From 5eea4787f1bdc384451c18d5a693e65a4ed38601 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 7 Apr 2017 10:47:11 -0400 Subject: add search system (downloads and topics) --- Project-Unite/Views/Home/Search.cshtml | 75 ++++++++++++++++++++++++++++++++++ Project-Unite/Views/Wiki/Index.cshtml | 2 +- 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 Project-Unite/Views/Home/Search.cshtml (limited to 'Project-Unite/Views') diff --git a/Project-Unite/Views/Home/Search.cshtml b/Project-Unite/Views/Home/Search.cshtml new file mode 100644 index 0000000..e786832 --- /dev/null +++ b/Project-Unite/Views/Home/Search.cshtml @@ -0,0 +1,75 @@ +@model Project_Unite.Models.SearchResult +@{ + ViewBag.Title = "Search"; +} + +

Search results

+ +

Here's what we found for that query.

+ + + + +
+
+

Forum Topics

+ + + + + + + @foreach (var topic in Model.ForumTopics.OrderByDescending(x=>x.StartedAt)) + { + + + + + + } +
TopicPopularityMost Recent Post
+ @Html.TopicLinkFor(topic.Id)
+

by @Html.UserLink(topic.AuthorId) at @topic.StartedAt

+
+ @topic.Likes.Length @topic.Dislikes.Length + + @{ + var mostrecent = topic.Posts.OrderByDescending(x => x.PostedAt).First(); + } +

By @Html.UserLink(mostrecent.AuthorId) at @mostrecent.PostedAt

+
+
+ +
+

Downloads

+ + + + + + @foreach (var download in Model.Downloads.OrderByDescending(x => x.PostDate)) + { + + + + + } +
DownloadActions
+

@download.Name
...released by @Html.UserLink(download.ReleasedBy), released at @download.PostDate

+
+ @if (!string.IsNullOrEmpty(download.DevUpdateId)) + { + Watch dev update + View details + Download + } +
+
+ +
\ No newline at end of file diff --git a/Project-Unite/Views/Wiki/Index.cshtml b/Project-Unite/Views/Wiki/Index.cshtml index 02c2845..3cebce7 100644 --- a/Project-Unite/Views/Wiki/Index.cshtml +++ b/Project-Unite/Views/Wiki/Index.cshtml @@ -83,7 +83,7 @@ if (Request.IsAuthenticated) { -