summaryrefslogtreecommitdiff
path: root/Project-Unite/Views
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-04-07 10:47:11 -0400
committerMichael <[email protected]>2017-04-07 10:47:11 -0400
commit5eea4787f1bdc384451c18d5a693e65a4ed38601 (patch)
tree2f4eead1093da297807494c1d489831b8e0e5122 /Project-Unite/Views
parent5860170c1fed2342232d7e35015b669e8b8ec471 (diff)
downloadproject-unite-5eea4787f1bdc384451c18d5a693e65a4ed38601.tar.gz
project-unite-5eea4787f1bdc384451c18d5a693e65a4ed38601.tar.bz2
project-unite-5eea4787f1bdc384451c18d5a693e65a4ed38601.zip
add search system (downloads and topics)
Diffstat (limited to 'Project-Unite/Views')
-rw-r--r--Project-Unite/Views/Home/Search.cshtml75
-rw-r--r--Project-Unite/Views/Wiki/Index.cshtml2
2 files changed, 76 insertions, 1 deletions
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";
+}
+
+<h2>Search results</h2>
+
+<p>Here's what we found for that query.</p>
+
+
+<ul id="tabs" data-tabs="tabs" class="nav nav-tabs" role="tablist">
+ <li class="active"><a data-toggle="tab" href="#t_topics"><span class="glyphicon glyphicon-list"></span> Forum Topics (@Model.ForumTopics.Count())</a></li>
+ <li><a data-toggle="tab" href="#t_downloads"><span class="glyphicon glyphicon-arrow-down"></span> Downloads (@Model.Downloads.Count())</a></li>
+ <li><a data-toggle="tab" href="#t_skins"><span class="glyphicon glyphicon-eye-open"></span> Skins (@Model.Skins.Count())</a></li>
+ <li><a data-toggle="tab" href="#t_users"><span class="glyphicon glyphicon-user"></span> Users (@Model.Users.Count())</a></li>
+ <li><a data-toggle="tab" href="#t_wiki"><span class="glyphicon glyphicon-book"></span> Wiki Pages (@Model.WikiPages.Count())</a></li>
+</ul>
+
+<div class="tab-content">
+ <div class="tab-pane fade in active" id="t_topics">
+ <h4>Forum Topics</h4>
+ <table class="table">
+ <tr>
+ <th style="width:45%">Topic</th>
+ <th style="width:20%">Popularity</th>
+ <th>Most Recent Post</th>
+ </tr>
+ @foreach (var topic in Model.ForumTopics.OrderByDescending(x=>x.StartedAt))
+ {
+ <tr>
+ <td>
+ @Html.TopicLinkFor(topic.Id) <br/>
+ <p>by @Html.UserLink(topic.AuthorId) at @topic.StartedAt</p>
+ </td>
+ <td>
+ <span class="glyphicon glyphicon-thumbs-up"></span> @topic.Likes.Length <span class="glyphicon glyphicon-thumbs-down"></span> @topic.Dislikes.Length
+ </td>
+ <td>
+ @{
+ var mostrecent = topic.Posts.OrderByDescending(x => x.PostedAt).First();
+ }
+ <p>By @Html.UserLink(mostrecent.AuthorId) at @mostrecent.PostedAt</p>
+ </td>
+ </tr>
+ }
+ </table>
+ </div>
+
+ <div class="tab-pane fade in active" id="t_downloads">
+ <h4>Downloads</h4>
+ <table class="table">
+ <tr>
+ <th style="width:65%">Download</th>
+ <th>Actions</th>
+ </tr>
+ @foreach (var download in Model.Downloads.OrderByDescending(x => x.PostDate))
+ {
+ <tr>
+ <td>
+ <p>@download.Name <br/> ...released by @Html.UserLink(download.ReleasedBy), released at @download.PostDate</p>
+ </td>
+ <td>
+ @if (!string.IsNullOrEmpty(download.DevUpdateId))
+ {
+ <a href="http://youtube.com/[email protected]" class="btn btn-default"><span class="glyphicon glyphicon-play"></span> Watch dev update</a>
+ <a href="@Url.Action("ViewRelease", "Download", new {id=download.Id})" class="btn btn-default"><span class="glyphicon glyphicon-eye-open"></span> View details</a>
+ <a href="@download.DownloadUrl" class="btn btn-default"><span class="glyphicon glyphicon-arrow-down"></span> Download</a>
+ }
+ </td>
+ </tr>
+ }
+ </table>
+ </div>
+
+</div> \ 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)
{
- <ul>
+ <ul class="nav nav-pills">
<li><a href="@Url.Action("EditPage", new { id = Model.Page.Id })"><span class="glyphicon glyphicon-pencil"></span> Edit this page</a></li>
</ul>
}