This repository was archived by the owner on Jul 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathQuestions.cshtml
More file actions
64 lines (57 loc) · 2.76 KB
/
Questions.cshtml
File metadata and controls
64 lines (57 loc) · 2.76 KB
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
@page "/{category}/questions"
@inject IStringLocalizer<QuestionsModel> localizer
@model QuestionsModel
@using Codidact.Core.Application.Questions.Queries
@{
ViewData["Title"] = localizer["Questions_page_title"];
var query = Model.Query;
}
<partial name="_ValidationSummary" />
<div class="grid has-margin-4">
<div class="grid--cell is-flexible">
<h1 class="has-margin-0">@Model.Result.Category.DisplayName @localizer["Questions_title"]</h1>
<h3>@Model.Result.Category.ShortExplanation</h3>
</div>
</div>
<div class="button-list is-gutterless has-margin-top-4 has-float-right">
<a asp-page="questions" asp-route-sort="@QuestionsQuerySortType.Best" class="button is-muted is-outlined @(query.Sort == QuestionsQuerySortType.Best ? "is-active" : "")">@localizer["Best_sort"]</a>
<a asp-page="questions" asp-route-sort="@QuestionsQuerySortType.Oldest" class="button is-muted is-outlined @(query.Sort == QuestionsQuerySortType.Oldest ? "is-active" : "")">@localizer["Oldest_sort"]</a>
<a asp-page="questions" asp-route-sort="@QuestionsQuerySortType.Newest" class="button is-muted is-outlined @(query.Sort == QuestionsQuerySortType.Newest ? "is-active" : "")">@localizer["Active_sort"]</a>
</div>
<div class="has-clear-clear"></div>
<div class="item-list">
@foreach (var post in Model.Result.Items)
{
<div class="item-list--item">
<div class="item-list--number-value">
<div class="item-list--number">
@post.Answers
</div>
<div class="item-list--number-label">@localizer["Answers_span"]</div>
</div>
<div class="item-list--number-value">
<div class="item-list--number">
@post.Votes
</div>
<div class="item-list--number-label">@localizer["Votes_span"]</div>
</div>
<div class="item-list--text-value is-primary">
<div>
<a asp-page="question" asp-route-id="@post.Id" class="has-font-size-larger"> @post.Title</a>
</div>
<div class="has-padding-top-2">
@foreach (var tag in post.Tags)
{
<a asp-page="tag" asp-route-id="@tag.Id" class="badge is-tag">@tag.Name</a>
}
</div>
</div>
<div class="item-list--number-value">
<div class="item-list--number-label">@localizer["Question_date"]</div>
<div class="item-list--number live-date" data-date="@((post.LastModifiedAt ?? post.CreatedAt).ToString("u"))">
@((post.LastModifiedAt ?? post.CreatedAt).ToString("u"))
</div>
</div>
</div>
}
</div>