-
Notifications
You must be signed in to change notification settings - Fork 516
/
post.cshtml
88 lines (81 loc) · 3.41 KB
/
post.cshtml
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
@model PostModel
@inject IStringLocalizer<Resource> _localizer
@{
Layout = "layouts/_main.cshtml"; ;
}
<main class="post-detail">
<article class="post">
<figure class="post-cover">
<img class="post-cover-img" src="~/@Model.PostSlug.Post.Cover" alt="@Model.PostSlug.Post.Title" aria-hidden="true">
</figure>
<header class="post-header post-container">
<h1 class="post-title">@Model.PostSlug.Post.Title</h1>
<div class="post-meta d-flex align-items-center">
<div class="post-meta-item post-meta-author">
<img class="post-meta-author-img d-none d-md-block" width="32" height="32" src="@UserHelper.CheckGetAvatarUrl(Model.PostSlug.Post.User.Avatar)"
alt="@Model.PostSlug.Post.User.NickName" aria-hidden="true" />
<div class="post-meta-author-details">
<span class="post-meta-label">@_localizer["author"]</span>
<a class="post-meta-author-name" href="#">@Model.PostSlug.Post.User.NickName</a>
</div>
</div>
<div class="post-meta-item post-meta-date">
<span class="post-meta-label">@_localizer["published"]</span>
<time class="post-meta-date-time">@DateTimeHelper.ToFriendlyShortDateString(Model.PostSlug.Post.PublishedAt)</time>
</div>
@if (Model.PostSlug.Post.Categories != null && Model.PostSlug.Post.Categories.Count > 0)
{
<div class="post-meta-item post-meta-cats">
<span class="post-meta-label">@_localizer["categories"]</span>
<ul class="post-meta-cats-list d-flex">
@foreach (var cat in Model.PostSlug.Post.Categories)
{
<li class="post-meta-cats-item">
<a class="post-meta-cats-link" href="@Model.CategoriesUrl/@cat.Content">@cat.Content</a>
</li>
}
</ul>
</div>
}
<button class="post-meta-btn ms-auto" type="button" data-bs-toggle="modal" data-bs-target="#shareModal" aria-label="@_localizer["share"]">
<svg width="16" height="16" class="bi bi-share">
<use xlink:href="/_content/@ThemesStandardConstant.AssemblyName/img/icon-sprites.svg#bi-share"></use>
</svg>
</button>
@if (User.Identity != null && User.Identity.IsAuthenticated)
{
<a class="post-meta-btn ms-2" href="~/admin/blogs/editor/@Model.PostSlug.Post.Slug" role="button" aria-label="@_localizer["edit-post"]">
<svg width="16" height="16" class="bi bi-pencil">
<use xlink:href="/_content/@ThemesStandardConstant.AssemblyName/img/icon-sprites.svg#bi-pencil"></use>
</svg>
</a>
}
</div>
</header>
<section class="post-content post-container">
@Html.Raw(Model.PostSlug.Post.ContentHtml)
</section>
<footer class="post-footer post-container">
<!--
TODO:
Custom fields:
- post author on or off (default)
- post comments on or off (default)
-->
<partial name="post/author.cshtml" />
<partial name="post/comments.cshtml" />
</footer>
</article>
<div class="container">
<!--
TODO:
Custom fields:
- post nav on or off (default)
- post related on (default) or off
- post share on (default) or off
-->
<partial name="post/nav.cshtml" />
<partial name="post/related.cshtml" />
<partial name="post/share.cshtml" />
</div>
</main>