diff --git a/Project-Unite/Controllers/ForumController.cs b/Project-Unite/Controllers/ForumController.cs index 3eb3c83..888c41e 100644 --- a/Project-Unite/Controllers/ForumController.cs +++ b/Project-Unite/Controllers/ForumController.cs @@ -47,6 +47,7 @@ namespace Project_Unite.Controllers var model = new CreateTopicViewModel(); model.Category = id; + model.Subject = new ApplicationDbContext().ForumTopics.FirstOrDefault(x => x.Discriminator == id).Subject; return View(model); } diff --git a/Project-Unite/Models/ForumCategory.cs b/Project-Unite/Models/ForumCategory.cs index 52e184e..96c826e 100644 --- a/Project-Unite/Models/ForumCategory.cs +++ b/Project-Unite/Models/ForumCategory.cs @@ -50,6 +50,8 @@ namespace Project_Unite.Models public class ForumPost { public string Id { get; set; } + + public string Subject { get; set; } [Required] public string Parent { get; set; } diff --git a/Project-Unite/Views/Forum/PostReply.cshtml b/Project-Unite/Views/Forum/PostReply.cshtml index 2305204..6080a79 100644 --- a/Project-Unite/Views/Forum/PostReply.cshtml +++ b/Project-Unite/Views/Forum/PostReply.cshtml @@ -12,7 +12,11 @@
@Html.DisplayNameFor(Model => Model.Body) + | Subject: | +@Html.TextBoxFor(Model=>Model.Subject, new{@class="form-control"}) | +
@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" }) | diff --git a/Project-Unite/Views/Forum/ViewForum.cshtml b/Project-Unite/Views/Forum/ViewForum.cshtml index e4b528f..92fb802 100644 --- a/Project-Unite/Views/Forum/ViewForum.cshtml +++ b/Project-Unite/Views/Forum/ViewForum.cshtml @@ -37,6 +37,18 @@ } } +@{ + var db = new Project_Unite.Models.ApplicationDbContext(); + var globals = Model.Topics.Where(x => x.ShouldShow == true&&x.IsGlobal==true).OrderByDescending(x => x.StartedAt); + +} + +@if (globals.Count() > 0) +{ +