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.

Main.cshtml 9.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. @model Teknik.Areas.Podcast.ViewModels.MainViewModel
  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 getPodcastFilesURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "GetPodcastFiles" })';
  10. var publishPodcastURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "PublishPodcast" })';
  11. var addPodcastURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "CreatePodcast" })';
  12. var editPodcastURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "EditPodcast" })';
  13. var deletePodcastURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "DeletePodcast" })';
  14. var getCommentsURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "GetComments" })';
  15. var getCommentArticleURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "GetCommentArticle" })';
  16. var addCommentURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "CreateComment" })';
  17. var editCommentURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "EditComment" })';
  18. var deleteCommentURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "DeleteComment" })';
  19. </script>
  20. @Styles.Render("~/Content/podcast")
  21. @Scripts.Render("~/bundles/podcast")
  22. <div class="container">
  23. <div class="row">
  24. <div class="col-sm-12 podcast-heading">
  25. <h1 class="podcast-title text-center">@Model.Title</h1>
  26. <p class="lead podcast-description text-center text-muted">@Model.Description</p>
  27. </div>
  28. </div>
  29. <div class="row">
  30. <div class="col-sm-12 text-center">
  31. <p>
  32. <a href="@Url.SubRouteUrl("rss", "RSS.Podcast")"><i class="fa fa-rss fa-2x fa-border"></i></a>
  33. </p>
  34. </div>
  35. </div>
  36. @if (User.IsInRole("Podcast"))
  37. {
  38. <div class="row">
  39. <div class="col-sm-12 text-center">
  40. <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#newPodcast">Create Podcast</button>
  41. </div>
  42. </div>
  43. <div class="modal fade" id="newPodcast" tabindex="-1" role="dialog" aria-labelledby="newPodcastLabel" aria-hidden="true">
  44. <div class="modal-dialog">
  45. <div class="modal-content">
  46. <form class="form" action="##" method="post" id="publishPodcast" enctype="multipart/form-data">
  47. <div class="modal-header">
  48. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Cancel</span></button>
  49. <h4 class="modal-title" id="newPodcastLabel">Create a New Podcast</h4>
  50. </div>
  51. <div class="modal-body">
  52. <div class="row">
  53. <div class="form-group col-sm-12">
  54. <label for="podcast_episode"><h4>Episode Number</h4></label>
  55. <input class="form-control" name="podcast_episode" id="podcast_episode" placeholder="1" title="enter an episode number for the podcast" type="number" />
  56. </div>
  57. </div>
  58. <div class="row">
  59. <div class="form-group col-sm-12">
  60. <label for="podcast_title"><h4>Title</h4></label>
  61. <input class="form-control" name="podcast_title" id="podcast_title" placeholder="Awesome Podcast Title" title="enter a title for the podcast." type="text" />
  62. </div>
  63. </div>
  64. <div class="row">
  65. <div class="form-group col-sm-12">
  66. <label for="podcast_description"><h4>Podcast Description</h4></label>
  67. <textarea class="form-control wmd-input" name="podcast_description" id="podcast_description" placeholder="We talked about awesome stuff." title="enter what the podcast was about." data-provide="markdown" rows="10"></textarea>
  68. </div>
  69. </div>
  70. <div class="row">
  71. <div class="form-group col-sm-12">
  72. <label for="podcast_files"><h4>Add Podcasts</h4></label>
  73. <input id="podcast_files" name="podcast_files" type="file" placeholder="podcast.ogg" title="select the podcast file." multiple>
  74. </div>
  75. </div>
  76. <div class="row">
  77. <div class="form-group col-sm-12" id="uploadedPodcasts"></div>
  78. <input name="podcast_file" id="podcast_file" type="hidden" />
  79. </div>
  80. </div>
  81. <div class="modal-footer">
  82. <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  83. <button type="button" class="btn btn-primary" id="podcast_submit">Create</button>
  84. </div>
  85. </form>
  86. </div>
  87. </div>
  88. </div>
  89. <div class="modal fade" id="editPodcast" tabindex="-1" role="dialog" aria-labelledby="editPodcastLabel" aria-hidden="true">
  90. <div class="modal-dialog">
  91. <div class="modal-content">
  92. <form class="form" action="##" method="post" id="editPodcastForm">
  93. <div class="modal-header">
  94. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Cancel</span></button>
  95. <h4 class="modal-title" id="editPodcastLabel">Edit The Podcast</h4>
  96. </div>
  97. <div class="modal-body">
  98. <input name="edit_podcast_podcastId" id="edit_podcast_podcastId" type="hidden" />
  99. <div class="row">
  100. <div class="form-group col-sm-12">
  101. <label for="edit_podcast_episode"><h4>Episode Number</h4></label>
  102. <input class="form-control" name="edit_podcast_episode" id="edit_podcast_episode" placeholder="1" title="enter an episode number for the podcast" type="number" />
  103. </div>
  104. </div>
  105. <div class="row">
  106. <div class="form-group col-sm-12">
  107. <label for="edit_podcast_title"><h4>Title</h4></label>
  108. <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" />
  109. </div>
  110. </div>
  111. <div class="row">
  112. <div class="form-group col-sm-12">
  113. <label for="edit_podcast_description"><h4>Podcast Description</h4></label>
  114. <textarea class="form-control wmd-input" name="edit_podcast_description" id="edit_podcast_description" placeholder="We talked about awesome stuff." title="enter what the podcast was about." data-provide="markdown" rows="10"></textarea>
  115. </div>
  116. </div>
  117. <div class="row">
  118. <div class="form-group col-sm-12">
  119. <label for="edit_podcast_files"><h4>Add Podcasts</h4></label>
  120. <input id="edit_podcast_files" name="edit_podcast_files" type="file" placeholder="podcast.ogg" title="select the podcast file." multiple>
  121. </div>
  122. </div>
  123. <div class="row">
  124. <div class="form-group col-sm-12" id="edit_podcast_cur_files"></div>
  125. <input name="edit_podcast_cur_file_list" id="edit_podcast_cur_file_list" type="hidden" />
  126. </div>
  127. </div>
  128. <div class="modal-footer">
  129. <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  130. <button type="button" class="btn btn-primary" id="edit_submit">Save</button>
  131. </div>
  132. </form>
  133. </div>
  134. </div>
  135. </div>
  136. }
  137. @if (!Model.Error)
  138. {
  139. <div class="podcast-main"></div>
  140. <script>
  141. var podcasts = @Model.Config.PodcastConfig.PodcastsToLoad;
  142. var startPodcast = 0;
  143. loadMorePodcasts(startPodcast, podcasts);
  144. startPodcast = startPodcast + podcasts;
  145. </script>
  146. }
  147. else
  148. {
  149. <div class="row">
  150. <div class="col-sm-12 text-center">
  151. <h2>@Model.ErrorMessage</h2>
  152. </div>
  153. </div>
  154. }
  155. </div>