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.
 
 
 
 
 

160 lines
10 KiB

@model Teknik.Areas.Podcast.ViewModels.PodcastViewModel
<script>
// We need to define the action URLs for the script
var uploadURL = '@Url.SubRouteUrl("upload", "Upload.Upload")';
var getPodcastsURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "GetPodcasts" })';
var getPodcastEpisodeURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "GetPodcastEpisode" })';
var getPodcastTitleURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "GetPodcastTitle" })';
var getPodcastDescriptionURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "GetPodcastDescription" })';
var publishPodcastURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "PublishPodcast" })';
var addPodcastURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "CreatePodcast" })';
var editPodcastURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "EditPodcast" })';
var deletePodcastURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "DeletePodcast" })';
var getCommentsURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "GetComments" })';
var getCommentArticleURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "GetCommentArticle" })';
var addCommentURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "CreateComment" })';
var editCommentURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "EditComment" })';
var deleteCommentURL = '@Url.SubRouteUrl("podcast", "Podcast.Action", new { action = "DeleteComment" })';
</script>
@Styles.Render("~/Content/podcast")
@Scripts.Render("~/bundles/podcast")
<div class="container">
@if (!Model.Error)
{
if (User.IsInRole("Podcast"))
{
<div class="modal fade" id="editPodcast" tabindex="-1" role="dialog" aria-labelledby="editPodcastLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<form class="form" action="##" method="post" id="editPodcastForm">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Cancel</span></button>
<h4 class="modal-title" id="editPodcastLabel">Edit Your Post</h4>
</div>
<div class="modal-body">
<input name="edit_podcast_postid" id="edit_podcast_postid" type="hidden" />
<div class="row">
<div class="form-group col-sm-12">
<label for="edit_podcast_episode"><h4>Episode Number</h4></label>
<input class="form-control" name="edit_podcast_episode" id="edit_podcast_episode" placeholder="1" title="enter an episode number for the podcast" type="number" />
</div>
</div>
<div class="row">
<div class="form-group col-sm-12">
<label for="edit_podcast_title"><h4>Title</h4></label>
<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" />
</div>
</div>
<div class="row">
<div class="form-group col-sm-12">
<label for="edit_podcast_post"><h4>Podcast Description</h4></label>
<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>
</div>
</div>
<div class="row">
<div class="form-group col-sm-12">
<label for="edit_podcast_files"><h4>Add Podcast Files</h4></label>
<input id="edit_podcast_files" name="edit_podcast_files" type="file" placeholder="podcast.ogg" title="select the podcast file." multiple>
</div>
</div>
<div class="row">
<div class="form-group col-sm-12" id="edit_podcast_cur_files"></div>
<input name="edit_podcast_cur_file_list" id="edit_podcast_cur_file_list" type="hidden" />
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" id="edit_submit">Save</button>
</div>
</form>
</div>
</div>
</div>
}
<div class="podcast-main" id="@Model.PodcastId">
@Html.Partial("Podcast", Model)
</div>
if (User.Identity.IsAuthenticated)
{
<div class="row">
<div class="col-sm-10 col-sm-offset-1">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#newComment">Add Comment</button>
</div>
</div>
<br />
<div class="modal fade" id="newComment" tabindex="-1" role="dialog" aria-labelledby="newCommentLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<form class="form" action="##" method="post" id="publishComment">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Cancel</span></button>
<h4 class="modal-title" id="newCommentLabel">Add a New Comment</h4>
</div>
<div class="modal-body">
<input name="podcastId" id="podcastId" type="hidden" value="@Model.PodcastId" />
<div class="row">
<div class="form-group col-sm-12">
<label for="comment_post"><h4>Comment</h4></label>
<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>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" id="comment_submit">Publish</button>
</div>
</form>
</div>
</div>
</div>
<div class="modal fade" id="editComment" tabindex="-1" role="dialog" aria-labelledby="editCommentLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<form class="form" action="##" method="post" id="editCommentForm">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Cancel</span></button>
<h4 class="modal-title" id="editCommentLabel">Edit Your Comment</h4>
</div>
<div class="modal-body">
<input name="edit_comment_id" id="edit_comment_id" type="hidden" />
<div class="row">
<div class="form-group col-sm-12">
<label for="edit_comment_post"><h4>Comment</h4></label>
<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>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" id="edit_comment_submit">Save</button>
</div>
</form>
</div>
</div>
</div>
}
<a name="replies"></a>
<div class="post-comments" id="@Model.PodcastId"></div>
<script>
var comments = @Model.Config.PodcastConfig.CommentsToLoad;
var startComment = 0;
loadMoreComments(startComment, comments);
startComment = startComment + comments;
</script>
}
else
{
<div class="row">
<div class="col-sm-12 text-center">
<h2>@Model.ErrorMessage</h2>
</div>
</div>
}
</div>