From cdc61eb4ea5309769ad4db84d92594e4dc3dff67 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 20 Mar 2017 16:45:17 -0400 Subject: Initial commit (azure deploy test) --- Project-Unite/Views/Forum/CreateTopic.cshtml | 86 ++++++++++++++ Project-Unite/Views/Forum/EditPost.cshtml | 37 ++++++ Project-Unite/Views/Forum/Index.cshtml | 39 +++++++ Project-Unite/Views/Forum/PostReply.cshtml | 27 +++++ Project-Unite/Views/Forum/ViewForum.cshtml | 166 +++++++++++++++++++++++++++ Project-Unite/Views/Forum/ViewTopic.cshtml | 69 +++++++++++ 6 files changed, 424 insertions(+) create mode 100644 Project-Unite/Views/Forum/CreateTopic.cshtml create mode 100644 Project-Unite/Views/Forum/EditPost.cshtml create mode 100644 Project-Unite/Views/Forum/Index.cshtml create mode 100644 Project-Unite/Views/Forum/PostReply.cshtml create mode 100644 Project-Unite/Views/Forum/ViewForum.cshtml create mode 100644 Project-Unite/Views/Forum/ViewTopic.cshtml (limited to 'Project-Unite/Views/Forum') diff --git a/Project-Unite/Views/Forum/CreateTopic.cshtml b/Project-Unite/Views/Forum/CreateTopic.cshtml new file mode 100644 index 0000000..cb080dd --- /dev/null +++ b/Project-Unite/Views/Forum/CreateTopic.cshtml @@ -0,0 +1,86 @@ +@model Project_Unite.Models.CreateTopicViewModel +@{ + ViewBag.Title = "Create topic"; +} + +

Create topic

+ +@using (Html.BeginForm()) +{ + @Html.AntiForgeryToken() + @Html.HiddenFor(Model => Model.Category) + + + + + + + + + + + + + + +
@Html.DisplayNameFor(Model => Model.Subject)@Html.TextBoxFor(Model => Model.Subject, new { @class = "form-control", style = "width:100%" })
@Html.DisplayNameFor(Model => Model.Body) +

This is the content of your topic. You can use Markdown formatting to style your post.

+
@Html.TextAreaFor(Model => Model.Body, new { @class = "form-control", style = "width:100%", rows = "10" })
+ +

Topic options

+ + + bool showGeneral = false; + if (ACL.Granted(User.Identity.Name, "CanStickyOwnTopics") || ACL.Granted(User.Identity.Name, "CanGlobalOwnTopics") || ACL.Granted(User.Identity.Name, "CanAnnounceOwnTopics")) + { + showGeneral = true; + } + string generalStyle = "tab-pane fade in"; + string pollStyle = "tab-pane fade in"; + if (showGeneral == true) { + generalStyle += " active"; + + } + else + { + pollStyle += " active"; + } + + + + +
+
+

Topic status

+ +

Below you can set the status of your topic.

+ + @if (ACL.Granted(User.Identity.Name, "CanStickyOwnTopics")) + { +

Sticky: @Html.CheckBoxFor(Model => Model.IsSticky, new { @class = "form-control" })

+ } + @if (ACL.Granted(User.Identity.Name, "CanAnnounceOwnTopics")) + { +

Announcement: @Html.CheckBoxFor(Model => Model.IsAnnounce, new { @class = "form-control" })

+ } + @if (ACL.Granted(User.Identity.Name, "CanGlobalOwnTopics")) + { +

Global announcement: @Html.CheckBoxFor(Model => Model.IsGlobal, new { @class = "form-control" })

+ } +
+
+

Polls

+

Not yet implemented.

+
+
+} \ No newline at end of file diff --git a/Project-Unite/Views/Forum/EditPost.cshtml b/Project-Unite/Views/Forum/EditPost.cshtml new file mode 100644 index 0000000..ea02f6f --- /dev/null +++ b/Project-Unite/Views/Forum/EditPost.cshtml @@ -0,0 +1,37 @@ +@model Project_Unite.Models.EditPostViewModel +@{ + ViewBag.Title = "Edit post"; +} + +

Edit post

+ +@using (Html.BeginForm()) +{ + @Html.AntiForgeryToken() + @Html.HiddenFor(Model=>Model.Id) + + + + + + + + + + + + + +
+

Body:

+

Make your edits to the post in this field. CommonMark-compliant Markdown is supported.

+
+ @Html.TextAreaFor(Model=>Model.Contents, new { rows = "10", @class="form-control" }) +
+

Edit reason:

+

Why did you edit the post? This reason is displayed in the Moderator Control Panel as well as at the bottom of the post.

+
+ @Html.TextBoxFor(Model => Model.EditReason, new { @class = "form-control" }) +
+} + diff --git a/Project-Unite/Views/Forum/Index.cshtml b/Project-Unite/Views/Forum/Index.cshtml new file mode 100644 index 0000000..8e26c24 --- /dev/null +++ b/Project-Unite/Views/Forum/Index.cshtml @@ -0,0 +1,39 @@ +@model IEnumerable + +@{ + ViewBag.Title = "Forums"; +} + +

Welcome to the forums.

+ +@foreach (var cat in Model) +{ + + + + + + + + @foreach (var subcat in cat.Children) + { + + + + + + + } +
@cat.NameTopicsPostsMost Recent Post
@Html.ActionLink(subcat.Name, "ViewForum", "Forum", new { id = subcat.Id }, null)
+

@subcat.Description

+ @if(subcat.Children.Length > 0) + { +

Subforums: + @foreach(var subfrm in subcat.Children) + { + @Html.ActionLink(subfrm.Name, "ViewForum", "Forum", new { id = subfrm.Id }, null)  + } +

+ } +
@subcat.Topics.Length
+} \ No newline at end of file diff --git a/Project-Unite/Views/Forum/PostReply.cshtml b/Project-Unite/Views/Forum/PostReply.cshtml new file mode 100644 index 0000000..2305204 --- /dev/null +++ b/Project-Unite/Views/Forum/PostReply.cshtml @@ -0,0 +1,27 @@ +@model Project_Unite.Models.CreateTopicViewModel +@{ + ViewBag.Title = "Post reply"; +} + +

Post reply

+ +@using (Html.BeginForm()) +{ + @Html.AntiForgeryToken() + @Html.HiddenFor(Model => Model.Category) + + + + + + + + + + +
@Html.DisplayNameFor(Model => Model.Body) +

This is the content of your topic. You can use Markdown formatting to style your post.

+
@Html.TextAreaFor(Model => Model.Body, new { @class = "form-control", style = "width:100%", rows = "10" })
+ + +} \ No newline at end of file diff --git a/Project-Unite/Views/Forum/ViewForum.cshtml b/Project-Unite/Views/Forum/ViewForum.cshtml new file mode 100644 index 0000000..01f1d01 --- /dev/null +++ b/Project-Unite/Views/Forum/ViewForum.cshtml @@ -0,0 +1,166 @@ +@model Project_Unite.Models.ForumCategory +@{ + ViewBag.Title = "View forum"; +} + +

@Model.Name

+ +@if (Model.Parent == "root") +{ + @Html.ActionLink("Back", "Index", "Forum", null, new { @class = "btn btn-default" }) + +} +else +{ + @Html.ActionLink("Back", "ViewForum", "Forum", new { id=Model.Parent}, new { @class = "btn btn-default" }) +} + +@if(ACL.CanPost(User.Identity.Name, Model.Id)) +{ + @Html.ActionLink("New topic", "CreateTopic", "Forum", new { id=Model.Id}, new { @class = "btn btn-default" }) +} + +

@Model.Description

+ +@if (Model.Children.Length > 0) +{ + + + + + + + + @foreach (var cat in Model.Children) + { + + + + + + + } +
SubforumsTopicsPostsMost Recent Post
@Html.ActionLink(cat.Name, "ViewForum", "Forum", new { id = cat.Id }, null) +

@cat.Description

+
+ @cat.Topics.Length +
+} + +
+ +@if (Model.Topics.Length > 0) +{ + + + + + + + @{ + var stickies = Model.Topics.Where(x => x.IsSticky == true); + var stickiesSorted = stickies.OrderByDescending(x => x.StartedAt); + var topicsSorted = Model.Topics.Where(x => x.IsSticky != true).OrderByDescending(x => x.StartedAt); + } + + @foreach (var topic in stickiesSorted) + { + bool showTopic = true; + if (topic.IsUnlisted == true) + { + if(!ACL.Granted(User.Identity.Name, "CanSeeUnlistedTopics")) + { + showTopic = false; + } + } + + if (showTopic == true) + { + + + + + + } + } + @foreach (var topic in topicsSorted) + { + + bool showTopic = true; + if (topic.IsUnlisted == true) + { + if (!ACL.Granted(User.Identity.Name, "CanSeeUnlistedTopics")) + { + showTopic = false; + } + } + + if (showTopic == true) + { + + + + + + } + } + + +
TopicsPostsMost recent post
  + @if(topic.IsUnlisted == true) + { + + } + @if (topic.IsLocked == true) + { + + } + + @Html.ActionLink(topic.Subject, "ViewTopic", "Forum", new { id = topic.Discriminator }, null) +

Started by @Html.UserLink(topic.AuthorId) on @topic.StartedAt

+
+ @topic.Posts.Length + + @if (topic.Posts.Length > 0) + { + var mostRecent = topic.Posts.OrderByDescending(x => x.PostedAt).First(); + Re: @topic.Subject + by @Html.UserLink(mostRecent.AuthorId) +

at @mostRecent.PostedAt

+ } + else + { + No posts. + } +
+ @if(topic.IsUnlisted == true) + { + + } + + @if (topic.IsLocked == true) + { + + } + @Html.ActionLink(topic.Subject, "ViewTopic", "Forum", new { id = topic.Discriminator }, null) +

Started by @Html.UserLink(topic.AuthorId) on @topic.StartedAt

+
+ @topic.Posts.Length + + @if (topic.Posts.Length > 0) + { + var mostRecent = topic.Posts.OrderByDescending(x => x.PostedAt).First(); + Re: @topic.Subject + by @Html.UserLink(mostRecent.AuthorId) +

at @mostRecent.PostedAt

+ } + else + { + No posts. + } +
+} +else +{ +

No topics exist in this category. Be the first to start one!

+} \ No newline at end of file diff --git a/Project-Unite/Views/Forum/ViewTopic.cshtml b/Project-Unite/Views/Forum/ViewTopic.cshtml new file mode 100644 index 0000000..4348518 --- /dev/null +++ b/Project-Unite/Views/Forum/ViewTopic.cshtml @@ -0,0 +1,69 @@ +@model Project_Unite.Models.ForumTopic +@using Microsoft.AspNet.Identity +@{ + ViewBag.Title = Model.Subject; +} + +@if(ViewBag.Error != null) +{ +
+
+

@ViewBag.Error

+
+
+} + +@if(Model.IsUnlisted == true) +{ +
+
+

This topic is unlisted. Only those with the topic link as well as moderators may see this topic. Please respect its privacy.

+
+
+} + +

@Model.Subject

+ +

Started by @Html.UserLink(Model.AuthorId) at @Model.StartedAt

+ +@{ + Html.RenderPartial("~/Views/Shared/_ModeratorBar.cshtml", Model); +} + +@foreach (var post in Model.Posts.OrderBy(x => x.PostedAt)) +{ +
+
+
+
+ @Html.UserLink(post.AuthorId)
+ @{ + var user = ACL.GetUserInfo(post.AuthorId); +

@user.Codepoints Codepoints

+

@user.HighestRole.Name

+

+ @if (ACL.Granted(User.Identity.Name, "CanAccessModCP")) + { + if (ACL.Granted(User.Identity.Name, "CanViewUserInfo")) + { + @Html.ActionLink("User info", "UserDetails", "Moderator", new { id = ACL.UserNameRaw(post.AuthorId) }, new { @class = "btn btn-default" }) + } + } +

+ } +
+
+

@Model.Subject

+

@Html.UserLink(post.AuthorId) at @post.PostedAt

+

@Html.Markdown(post.Body)

+ @{ + Html.RenderPartial("~/Views/Shared/_PostModerationBar.cshtml", post); + } +
+
+
+} + +@{ + Html.RenderPartial("~/Views/Shared/_ModeratorBar.cshtml", Model); +} -- cgit v1.2.3