summaryrefslogtreecommitdiff
path: root/Project-Unite/Views/Home/Search.cshtml
blob: 2dca6c8cd965805ef1ae9a325d4b8cc934423c3a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
@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_users">
        <h4>Users</h4>
        <table class="table">
            <tr>
                <th style="width:65%">User</th>
                <th>Stats</th>
            </tr>
            @foreach (var user in Model.Users.OrderByDescending(x => x.JoinedAt))
            {
                <tr>
                    <td>
                        <p><img src="@user.AvatarUrl" width="128" height="128" /> @Html.UserLink(user.Id)</p>
                    </td>
                    <td>
                        <ul>
                            <li><strong>@user.Codepoints</strong> Codepoints</li>
                            <li><strong>@user.Followers.Length</strong> followers, <strong>@user.Followed.Length</strong> followed.</li>
                            <li><strong>@user.TopicCount</strong> topics</li>
                            <li><strong>@user.Posts.Length</strong> posts</li>
                            <li><strong>Joined at</strong> @user.JoinedAt</li>
                        </ul>
                    </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 class="tab-pane fade in active" id="t_skins">
        <h4>Skins</h4>
        <table class="table">
            <tr>
                <th style="width:45%">Skin</th>
                <th style="width:20%">Popularity</th>
                <th>Actions</th>
            </tr>
            @foreach (var download in Model.Skins.OrderByDescending(x => x.PostedAt))
            {
                <tr>
                    <td>
                        <p>@download.Name <br /> ...made by @Html.UserLink(download.UserId), released at @download.PostedAt</p>
                    </td>
                    <td>
                        <span class="glyphicon glyphicon-thumbs-up"></span> @download.Likes.Length <span class="glyphicon glyphicon-thumbs-down"></span> @download.Dislikes.Length
                    </td>
                    <td>
                            <a href="@Url.Action("ViewSkin", "Skins", 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>