From b1e6d3dee9fa6519c65dd7564eac02b9e68bc3ce Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 7 Apr 2017 21:13:44 -0400 Subject: Developer blog --- Project-Unite/Views/Blog/Index.cshtml | 27 ++++++++++++ Project-Unite/Views/Blog/PostBlog.cshtml | 32 ++++++++++++++ Project-Unite/Views/Blog/ViewBlog.cshtml | 71 ++++++++++++++++++++++++++++++++ 3 files changed, 130 insertions(+) create mode 100644 Project-Unite/Views/Blog/Index.cshtml create mode 100644 Project-Unite/Views/Blog/PostBlog.cshtml create mode 100644 Project-Unite/Views/Blog/ViewBlog.cshtml (limited to 'Project-Unite/Views/Blog') diff --git a/Project-Unite/Views/Blog/Index.cshtml b/Project-Unite/Views/Blog/Index.cshtml new file mode 100644 index 0000000..56af4ef --- /dev/null +++ b/Project-Unite/Views/Blog/Index.cshtml @@ -0,0 +1,27 @@ +@model IEnumerable +@{ + ViewBag.Title = "Blog"; +} + +

Developer Blog

+ +

We ShiftOS devs have a lot going on. If you want to find out a bit more about what we do behind the scenes, this is the place for you. We'll post lots of things for you to read here.

+ +@if(ACL.Granted(User.Identity.Name, "CanBlog")) +{ + +} + +@foreach(var blog in Model) +{ +
+
+

@blog.Name

+

Posted by @Html.UserLink(blog.AuthorId) at @blog.PostedAt - @blog.Likes.Length likes, @blog.Dislikes.Length dislikes

+

@Html.Markdown(blog.Summary)

+ @Html.ActionLink("Read more", "ViewBlog", "Blog", new { id = blog.Id }, new { @class = "btn btn-default" }) +
+
+} \ No newline at end of file diff --git a/Project-Unite/Views/Blog/PostBlog.cshtml b/Project-Unite/Views/Blog/PostBlog.cshtml new file mode 100644 index 0000000..e3ad6f7 --- /dev/null +++ b/Project-Unite/Views/Blog/PostBlog.cshtml @@ -0,0 +1,32 @@ +@model Project_Unite.Models.PostBlogViewModel +@{ + ViewBag.Title = "Post blog"; +} + +

Post a blog

+ +

Just fill in the form and we'll get the post up onto the cloud.

+ +@using (Html.BeginForm()) +{ +
+
+ @Html.ValidationSummary() +
+
+ + + + + + + + + + + + + + +
Name:@Html.TextBoxFor(Model=>Model.Name, new{@class="form-control"})
Body:@Html.TextAreaFor(Model => Model.Contents, new { @class = "form-control", rows="10" })
+} \ No newline at end of file diff --git a/Project-Unite/Views/Blog/ViewBlog.cshtml b/Project-Unite/Views/Blog/ViewBlog.cshtml new file mode 100644 index 0000000..0511698 --- /dev/null +++ b/Project-Unite/Views/Blog/ViewBlog.cshtml @@ -0,0 +1,71 @@ +@model Project_Unite.Models.BlogPost +@{ + ViewBag.Title = Model.Name; +} + +

Developer Blog

+ +

@Model.Name

+ +@if (!string.IsNullOrWhiteSpace(ViewBag.Error)) +{ +
+
+

@ViewBag.Error

+
+
+} + +

Posted by @Html.UserLink(Model.AuthorId) at @Model.PostedAt

+ +
+
+ @Html.Markdown(Model.Contents) +
+
+ + + +
+ +

Comments

+ +@if (Request.IsAuthenticated) +{ +
+
+ @using (Html.BeginForm()) + { + + @Html.AntiForgeryToken() + + + + } +
+
+} + +@foreach(var comment in Model.Comments.OrderBy(x=>x.PostedAt)) +{ +
+
+

@Html.UserLink(comment.AuthorId) said on @comment.PostedAt:

+

@Html.Markdown(comment.Body)

+
+
+} \ No newline at end of file -- cgit v1.2.3