summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-03-23 19:16:46 -0400
committerMichael <[email protected]>2017-03-23 19:16:46 -0400
commit966ad0c588d6de48de444a1488530159a55c39e1 (patch)
tree5380df388af225e2e0f71b29cc62e17e37ef06c7
parent2dcb12403b1f9b6d5a2625e604c78caac8c17dbf (diff)
downloadproject-unite-966ad0c588d6de48de444a1488530159a55c39e1.tar.gz
project-unite-966ad0c588d6de48de444a1488530159a55c39e1.tar.bz2
project-unite-966ad0c588d6de48de444a1488530159a55c39e1.zip
User posting front-end
-rw-r--r--Project-Unite/Project-Unite.csproj1
-rw-r--r--Project-Unite/Views/Profile/_NewPost.cshtml14
-rw-r--r--Project-Unite/Views/Profiles/ViewProfile.cshtml28
3 files changed, 43 insertions, 0 deletions
diff --git a/Project-Unite/Project-Unite.csproj b/Project-Unite/Project-Unite.csproj
index 9c09bdb..8cdd931 100644
--- a/Project-Unite/Project-Unite.csproj
+++ b/Project-Unite/Project-Unite.csproj
@@ -508,6 +508,7 @@
<Content Include="Views\Legal\TOS.cshtml" />
<Content Include="Views\Profiles\ViewProfile.cshtml" />
<Content Include="Views\Profile\ViewProfile.cshtml" />
+ <Content Include="Views\Profile\_NewPost.cshtml" />
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />
diff --git a/Project-Unite/Views/Profile/_NewPost.cshtml b/Project-Unite/Views/Profile/_NewPost.cshtml
new file mode 100644
index 0000000..d1ff6be
--- /dev/null
+++ b/Project-Unite/Views/Profile/_NewPost.cshtml
@@ -0,0 +1,14 @@
+@model Project_Unite.Models.UserPost
+
+<div class="panel">
+ @using (Html.BeginForm("PostContent", "Profiles"))
+ {
+ @Html.AntiForgeryToken()
+ @Html.ValidationSummary();
+ @Html.TextAreaFor(Model=>Model.PostContents, new {@class="form-control", rows="5"})
+ <input type="submit" class="btn btn-default" value="Post" />
+ }
+</div>
+
+
+
diff --git a/Project-Unite/Views/Profiles/ViewProfile.cshtml b/Project-Unite/Views/Profiles/ViewProfile.cshtml
index 94ca858..80c8e7a 100644
--- a/Project-Unite/Views/Profiles/ViewProfile.cshtml
+++ b/Project-Unite/Views/Profiles/ViewProfile.cshtml
@@ -24,4 +24,32 @@
<li><strong>Topics: </strong>@Model.TopicCount</li>
</ul>
</div>
+ <div class="col-xs-4">
+ @if(Model.UserName == User.Identity.Name)
+ {
+ Html.RenderPartial("~/Profiles/_NewPost.cshtml", new Project_Unite.Models.UserPost());
+ }
+ @foreach(var post in Model.Posts.OrderByDescending(x => x.PostedAt))
+ {
+
+ <div class="panel">
+ <p><strong>Posted on @post.PostedAt</strong>:</p>
+ <p>@Html.Markdown(post.PostContents</p>
+ <ul class="nav nav-pills">
+ @{
+ string likeLink = "#";
+ string dislikeLink = "";
+ if(Model.UserName != User.Identity.Name)
+ {
+ likeLink = "/Profiles/LikePost/" + post.Id;
+ dislikeLink = likeLink.Replace("Like", "Dislike");
+ }
+ }
+ <li><a href="@likeLink"><span class="glyphicon-thumbs-up"></span> @post.Likes.Length</a></li>
+ <li><a href="@dislikeLink"><span class="glyphicon-thumbs-down"></span> @post.Dislikes.Length</a></li>
+
+ </ul>
+ </div>
+ }
+ </div>
</div> \ No newline at end of file