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.

Podcast.cshtml 2.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. @model Teknik.Areas.Podcast.ViewModels.PodcastViewModel
  2. @using Teknik.Areas.Podcast.Models
  3. <script>
  4. var converter = new Markdown.getSanitizingConverter();
  5. var old_post = $("#podcast_@Model.PodcastId").text();
  6. var new_post = converter.makeHtml(old_post);
  7. $("#podcast_@Model.PodcastId").html(new_post);
  8. </script>
  9. <div class="row">
  10. <div class="col-sm-10 col-sm-offset-1">
  11. <div class="podcast-post">
  12. <h2 class="podcast-post-title text-center"><a href="@Url.SubRouteUrl("podcast", "Podcast.View", new { episode = Model.Episode })" id="title_@Model.PodcastId">Episode @Model.Episode - @Model.Title</a></h2>
  13. <p class="podcast-post-meta text-center text-muted">
  14. Posted on <time datetime="@Model.DatePosted.ToString("o")">@Model.DatePosted.ToString("MMMM dd, yyyy")</time>
  15. @if (User.IsInRole("Podcast"))
  16. {
  17. <br />
  18. <button type="button" class="btn btn-info edit_post" id="@Model.PodcastId" data-toggle="modal" data-target="#editPodcast">Edit</button>
  19. if (Model.Published)
  20. {
  21. <button type="button" class="btn btn-warning unpublish_podcast" id="@Model.PodcastId">Unpublish</button>
  22. }
  23. else
  24. {
  25. <button type="button" class="btn btn-success publish_podcast" id="@Model.PodcastId">Publish</button>
  26. }
  27. <button type="button" class="btn btn-danger delete_podcast" id="@Model.PodcastId">Delete</button>
  28. }
  29. </p>
  30. @if (Model.Files != null)
  31. {
  32. <div class="text-center">
  33. <audio preload="none" controls>
  34. @foreach (PodcastFile file in Model.Files)
  35. {
  36. <source src="@Url.SubRouteUrl("podcast", "Podcast.Download", new { episode = Model.Episode, fileName = file.FileName })" type="@file.ContentType" />
  37. }
  38. </audio>
  39. </div>
  40. }
  41. <br />
  42. <p id="podcast_@Model.PodcastId">@Model.Description</p>
  43. @if (Model.Files != null)
  44. {
  45. foreach (PodcastFile file in Model.Files)
  46. {
  47. <div class="row text-center">
  48. <a href="@Url.SubRouteUrl("podcast", "Podcast.Download", new { episode = Model.Episode, fileName = file.FileName })">Direct Download - @file.ContentType</a>
  49. </div>
  50. }
  51. }
  52. </div>
  53. </div>
  54. </div>