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 8.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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 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. <div class="row">
  23. <div class="col-sm-12 podcast-heading">
  24. <h1 class="podcast-title text-center">@Model.Title</h1>
  25. <p class="lead podcast-description text-center text-muted">@Model.Description</p>
  26. </div>
  27. </div>
  28. <div class="row">
  29. <div class="col-sm-12 text-center">
  30. <p>
  31. <a href="@Url.SubRouteUrl("rss", "RSS.Podcast")"><i class="fa fa-rss fa-2x fa-border"></i></a>
  32. </p>
  33. </div>
  34. </div>
  35. @if (User.IsInRole("Podcast"))
  36. {
  37. <div class="row">
  38. <div class="col-sm-12 text-center">
  39. <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#newPodcast">Create Podcast</button>
  40. </div>
  41. </div>
  42. <div class="modal fade" id="newPodcast" tabindex="-1" role="dialog" aria-labelledby="newPodcastLabel" aria-hidden="true">
  43. <div class="modal-dialog">
  44. <div class="modal-content">
  45. <form class="form" action="##" method="post" id="publishPodcast" enctype="multipart/form-data">
  46. <div class="modal-header">
  47. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Cancel</span></button>
  48. <h4 class="modal-title" id="newPodcastLabel">Create a New Podcast</h4>
  49. </div>
  50. <div class="modal-body">
  51. <div class="row">
  52. <div class="form-group col-sm-12">
  53. <label for="podcast_episode"><h4>Episode Number</h4></label>
  54. <input class="form-control" name="podcast_episode" id="podcast_episode" placeholder="1" title="enter an episode number for the podcast" type="number" />
  55. </div>
  56. </div>
  57. <div class="row">
  58. <div class="form-group col-sm-12">
  59. <label for="podcast_title"><h4>Title</h4></label>
  60. <input class="form-control" name="podcast_title" id="podcast_title" placeholder="Awesome Podcast Title" title="enter a title for the podcast." type="text" />
  61. </div>
  62. </div>
  63. <div class="row">
  64. <div class="form-group col-sm-12">
  65. <label for="podcast_description"><h4>Podcast Description</h4></label>
  66. <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>
  67. </div>
  68. </div>
  69. <div class="row">
  70. <div class="form-group col-sm-12">
  71. <label for="files"><h4>Upload Podcast</h4></label>
  72. <input id="podcast_files" name="podcast_files" type="file" placeholder="podcast.ogg" title="select the podcast file." multiple>
  73. </div>
  74. </div>
  75. <div class="row">
  76. <div class="form-group col-sm-12" id="uploadedPodcasts"></div>
  77. <input name="podcast_file" id="podcast_file" type="hidden" />
  78. </div>
  79. </div>
  80. <div class="modal-footer">
  81. <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  82. <button type="button" class="btn btn-primary" id="podcast_submit">Create</button>
  83. </div>
  84. </form>
  85. </div>
  86. </div>
  87. </div>
  88. <div class="modal fade" id="editPodcast" tabindex="-1" role="dialog" aria-labelledby="editPodcastLabel" aria-hidden="true">
  89. <div class="modal-dialog">
  90. <div class="modal-content">
  91. <form class="form" action="##" method="post" id="editPodcastForm">
  92. <div class="modal-header">
  93. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Cancel</span></button>
  94. <h4 class="modal-title" id="editPodcastLabel">Edit The Podcast</h4>
  95. </div>
  96. <div class="modal-body">
  97. <input name="edit_podcast_podcastId" id="edit_podcast_podcastId" type="hidden" />
  98. <div class="row">
  99. <div class="form-group col-sm-12">
  100. <label for="edit_podcast_episode"><h4>Episode Number</h4></label>
  101. <input class="form-control" name="edit_podcast_episode" id="edit_podcast_episode" placeholder="1" title="enter an episode number for the podcast" type="number" />
  102. </div>
  103. </div>
  104. <div class="row">
  105. <div class="form-group col-sm-12">
  106. <label for="edit_podcast_title"><h4>Title</h4></label>
  107. <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" />
  108. </div>
  109. </div>
  110. <div class="row">
  111. <div class="form-group col-sm-12">
  112. <label for="edit_podcast_description"><h4>Podcast Description</h4></label>
  113. <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>
  114. </div>
  115. </div>
  116. </div>
  117. <div class="modal-footer">
  118. <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  119. <button type="button" class="btn btn-primary" id="edit_submit">Save</button>
  120. </div>
  121. </form>
  122. </div>
  123. </div>
  124. </div>
  125. }
  126. @if (!Model.Error)
  127. {
  128. <div class="podcast-main"></div>
  129. <script>
  130. var podcasts = @Model.Config.PodcastConfig.PodcastsToLoad;
  131. var startPodcast = 0;
  132. loadMorePodcasts(startPodcast, podcasts);
  133. startPodcast = startPodcast + podcasts;
  134. </script>
  135. }
  136. else
  137. {
  138. <div class="row">
  139. <div class="col-sm-12 text-center">
  140. <h2>@Model.ErrorMessage</h2>
  141. </div>
  142. </div>
  143. }
  144. </div>