The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ViewPodcast.cshtml 10.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. @model Teknik.Areas.Podcast.ViewModels.PodcastViewModel
  2. <script>
  3. // We need to define the action URLs for the script
  4. var uploadURL = '@Url.SubRouteUrl("upload", "Upload.Upload")';
  5. var getPodcastsURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "GetPodcasts" })';
  6. var getPodcastEpisodeURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "GetPodcastEpisode" })';
  7. var getPodcastTitleURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "GetPodcastTitle" })';
  8. var getPodcastDescriptionURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "GetPodcastDescription" })';
  9. var publishPodcastURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "PublishPodcast" })';
  10. var addPodcastURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "CreatePodcast" })';
  11. var editPodcastURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "EditPodcast" })';
  12. var deletePodcastURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "DeletePodcast" })';
  13. var getCommentsURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "GetComments" })';
  14. var getCommentArticleURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "GetCommentArticle" })';
  15. var addCommentURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "CreateComment" })';
  16. var editCommentURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "EditComment" })';
  17. var deleteCommentURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "DeleteComment" })';
  18. </script>
  19. @Styles.Render("~/Content/podcast")
  20. @Scripts.Render("~/bundles/podcast")
  21. <div class="container">
  22. @if (!Model.Error)
  23. {
  24. if (User.IsInRole("Podcast"))
  25. {
  26. <div class="modal fade" id="editPodcast" tabindex="-1" role="dialog" aria-labelledby="editPodcastLabel" aria-hidden="true">
  27. <div class="modal-dialog">
  28. <div class="modal-content">
  29. <form class="form" action="##" method="post" id="editPodcastForm">
  30. <div class="modal-header">
  31. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Cancel</span></button>
  32. <h4 class="modal-title" id="editPodcastLabel">Edit Your Post</h4>
  33. </div>
  34. <div class="modal-body">
  35. <input name="edit_podcast_postid" id="edit_podcast_postid" type="hidden" />
  36. <div class="row">
  37. <div class="form-group col-sm-12">
  38. <label for="edit_podcast_episode"><h4>Episode Number</h4></label>
  39. <input class="form-control" name="edit_podcast_episode" id="edit_podcast_episode" placeholder="1" title="enter an episode number for the podcast" type="number" />
  40. </div>
  41. </div>
  42. <div class="row">
  43. <div class="form-group col-sm-12">
  44. <label for="edit_podcast_title"><h4>Title</h4></label>
  45. <input class="form-control" name="edit_podcast_title" id="edit_podcast_title" placeholder="Awesome Podcast Title" title="enter a title for the podcast." type="text" />
  46. </div>
  47. </div>
  48. <div class="row">
  49. <div class="form-group col-sm-12">
  50. <label for="edit_podcast_post"><h4>Podcast Description</h4></label>
  51. <textarea class="form-control wmd-input" name="edit_podcast_post" id="edit_podcast_post" placeholder="We talked about awesome stuff." title="enter what the podcast was about." data-provide="markdown" rows="10"></textarea>
  52. </div>
  53. </div>
  54. <div class="row">
  55. <div class="form-group col-sm-12">
  56. <label for="edit_podcast_files"><h4>Add Podcasts</h4></label>
  57. <input id="edit_podcast_files" name="edit_podcast_files" type="file" placeholder="podcast.ogg" title="select the podcast file." multiple>
  58. </div>
  59. </div>
  60. <div class="row">
  61. <div class="form-group col-sm-12" id="edit_podcast_cur_files"></div>
  62. <input name="edit_podcast_cur_file_list" id="edit_podcast_cur_file_list" type="hidden" />
  63. </div>
  64. </div>
  65. <div class="modal-footer">
  66. <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  67. <button type="button" class="btn btn-primary" id="edit_submit">Save</button>
  68. </div>
  69. </form>
  70. </div>
  71. </div>
  72. </div>
  73. }
  74. <div class="podcast-main" id="@Model.PodcastId">
  75. @Html.Partial("Podcast", Model)
  76. </div>
  77. if (User.Identity.IsAuthenticated)
  78. {
  79. <div class="row">
  80. <div class="col-sm-10 col-sm-offset-1">
  81. <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#newComment">Add Comment</button>
  82. </div>
  83. </div>
  84. <br />
  85. <div class="modal fade" id="newComment" tabindex="-1" role="dialog" aria-labelledby="newCommentLabel" aria-hidden="true">
  86. <div class="modal-dialog">
  87. <div class="modal-content">
  88. <form class="form" action="##" method="post" id="publishComment">
  89. <div class="modal-header">
  90. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Cancel</span></button>
  91. <h4 class="modal-title" id="newCommentLabel">Add a New Comment</h4>
  92. </div>
  93. <div class="modal-body">
  94. <input name="podcastId" id="podcastId" type="hidden" value="@Model.PodcastId" />
  95. <div class="row">
  96. <div class="form-group col-sm-12">
  97. <label for="comment_post"><h4>Comment</h4></label>
  98. <textarea class="form-control wmd-input" name="comment_post" id="comment_post" placeholder="Nice post!" title="enter what you think about the post." data-provide="markdown" rows="10"></textarea>
  99. </div>
  100. </div>
  101. </div>
  102. <div class="modal-footer">
  103. <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  104. <button type="button" class="btn btn-primary" id="comment_submit">Publish</button>
  105. </div>
  106. </form>
  107. </div>
  108. </div>
  109. </div>
  110. <div class="modal fade" id="editComment" tabindex="-1" role="dialog" aria-labelledby="editCommentLabel" aria-hidden="true">
  111. <div class="modal-dialog">
  112. <div class="modal-content">
  113. <form class="form" action="##" method="post" id="editCommentForm">
  114. <div class="modal-header">
  115. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Cancel</span></button>
  116. <h4 class="modal-title" id="editCommentLabel">Edit Your Comment</h4>
  117. </div>
  118. <div class="modal-body">
  119. <input name="edit_comment_id" id="edit_comment_id" type="hidden" />
  120. <div class="row">
  121. <div class="form-group col-sm-12">
  122. <label for="edit_comment_post"><h4>Comment</h4></label>
  123. <textarea class="form-control" name="edit_comment_post" id="edit_comment_post" placeholder="What an interesting article!" title="enter what you thought about the article." data-provide="markdown" rows="10"></textarea>
  124. </div>
  125. </div>
  126. </div>
  127. <div class="modal-footer">
  128. <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  129. <button type="button" class="btn btn-primary" id="edit_comment_submit">Save</button>
  130. </div>
  131. </form>
  132. </div>
  133. </div>
  134. </div>
  135. }
  136. <a name="replies"></a>
  137. <div class="post-comments" id="@Model.PodcastId"></div>
  138. <script>
  139. var comments = @Model.Config.PodcastConfig.CommentsToLoad;
  140. var startComment = 0;
  141. loadMoreComments(startComment, comments);
  142. startComment = startComment + comments;
  143. </script>
  144. }
  145. else
  146. {
  147. <div class="row">
  148. <div class="col-sm-12 text-center">
  149. <h2>@Model.ErrorMessage</h2>
  150. </div>
  151. </div>
  152. }
  153. </div>