The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

ViewPodcast.cshtml 9.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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>Upload Podcast</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>
  61. <div class="modal-footer">
  62. <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  63. <button type="button" class="btn btn-primary" id="edit_submit">Save</button>
  64. </div>
  65. </form>
  66. </div>
  67. </div>
  68. </div>
  69. }
  70. <div class="podcast-main" id="@Model.PodcastId">
  71. @Html.Partial("Podcast", Model)
  72. </div>
  73. if (User.Identity.IsAuthenticated)
  74. {
  75. <div class="row">
  76. <div class="col-sm-10 col-sm-offset-1">
  77. <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#newComment">Add Comment</button>
  78. </div>
  79. </div>
  80. <br />
  81. <div class="modal fade" id="newComment" tabindex="-1" role="dialog" aria-labelledby="newCommentLabel" aria-hidden="true">
  82. <div class="modal-dialog">
  83. <div class="modal-content">
  84. <form class="form" action="##" method="post" id="publishComment">
  85. <div class="modal-header">
  86. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Cancel</span></button>
  87. <h4 class="modal-title" id="newCommentLabel">Add a New Comment</h4>
  88. </div>
  89. <div class="modal-body">
  90. <input name="podcastId" id="podcastId" type="hidden" value="@Model.PodcastId" />
  91. <div class="row">
  92. <div class="form-group col-sm-12">
  93. <label for="comment_post"><h4>Comment</h4></label>
  94. <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>
  95. </div>
  96. </div>
  97. </div>
  98. <div class="modal-footer">
  99. <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  100. <button type="button" class="btn btn-primary" id="comment_submit">Publish</button>
  101. </div>
  102. </form>
  103. </div>
  104. </div>
  105. </div>
  106. <div class="modal fade" id="editComment" tabindex="-1" role="dialog" aria-labelledby="editCommentLabel" aria-hidden="true">
  107. <div class="modal-dialog">
  108. <div class="modal-content">
  109. <form class="form" action="##" method="post" id="editCommentForm">
  110. <div class="modal-header">
  111. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Cancel</span></button>
  112. <h4 class="modal-title" id="editCommentLabel">Edit Your Comment</h4>
  113. </div>
  114. <div class="modal-body">
  115. <input name="edit_comment_id" id="edit_comment_id" type="hidden" />
  116. <div class="row">
  117. <div class="form-group col-sm-12">
  118. <label for="edit_comment_post"><h4>Comment</h4></label>
  119. <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>
  120. </div>
  121. </div>
  122. </div>
  123. <div class="modal-footer">
  124. <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  125. <button type="button" class="btn btn-primary" id="edit_comment_submit">Save</button>
  126. </div>
  127. </form>
  128. </div>
  129. </div>
  130. </div>
  131. }
  132. <a name="replies"></a>
  133. <div class="post-comments" id="@Model.PodcastId"></div>
  134. <script>
  135. var comments = @Model.Config.PodcastConfig.CommentsToLoad;
  136. var startComment = 0;
  137. loadMoreComments(startComment, comments);
  138. startComment = startComment + comments;
  139. </script>
  140. }
  141. else
  142. {
  143. <div class="row">
  144. <div class="col-sm-12 text-center">
  145. <h2>@Model.ErrorMessage</h2>
  146. </div>
  147. </div>
  148. }
  149. </div>