|
| 1 | +@model ListModel |
| 2 | +@{ |
| 3 | + ViewData["bodyClass"] = "home"; |
| 4 | + var pgr = Model.Pager; |
| 5 | +} |
| 6 | +<!DOCTYPE html> |
| 7 | +<html lang="en"> |
| 8 | +<head> |
| 9 | + <partial name="~/Views/Themes/moments/_Shared/_Head.cshtml" /> |
| 10 | +</head> |
| 11 | +<body class="@ViewData["bodyClass"]"> |
| 12 | + |
| 13 | + <partial name="~/Views/Themes/moments/_Shared/_Header.cshtml" /> |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + <div class="page-cover" style="background-image: url('@Model.Blog.Cover')"> |
| 18 | + <h1 class="page-cover-title"> |
| 19 | + @if (Model.PostListType == PostListType.Search) |
| 20 | + { |
| 21 | + <a href="#"><i class="fa fa-search"></i> @Model.Blog.Title</a> |
| 22 | + } |
| 23 | + else if (Model.PostListType == PostListType.Author) |
| 24 | + { |
| 25 | + <a href="~/"> |
| 26 | + <img src="~/@Model.Author.Avatar" class="rounded-circle" style="width: 52px" /> @Model.Author.DisplayName |
| 27 | + </a> |
| 28 | + } |
| 29 | + else if (Model.PostListType == PostListType.Category) |
| 30 | + { |
| 31 | + <a href="#"><i class="fa fa-tag"></i> @ViewBag.Category</a> |
| 32 | + } |
| 33 | + else |
| 34 | + { |
| 35 | + <a href="~/">@Model.Blog.Title</a> |
| 36 | + } |
| 37 | + </h1> |
| 38 | + <p class="page-cover-desc">@Model.Blog.Description</p> |
| 39 | + </div> |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + <div class="page-content"> |
| 44 | + <div class="container"> |
| 45 | + @if (Model.Posts != null) |
| 46 | + { |
| 47 | + foreach (var item in Model.Posts) |
| 48 | + { |
| 49 | + var img = string.IsNullOrEmpty(item.Cover) ? Model.Blog.Cover : item.Cover; |
| 50 | + <article class="post"> |
| 51 | + <div class="post-cover"> |
| 52 | + <img src="~/@img" alt="@item.Title"> |
| 53 | + @if (item.Featured) |
| 54 | + { |
| 55 | + <span class="post-featrued-label"><i class="fa fa-star"></i> Featured</span> |
| 56 | + } |
| 57 | + </div> |
| 58 | + <h2 class="post-title"><a href="~/posts/@item.Slug">@item.Title</a></h2> |
| 59 | + <div class="post-meta"> |
| 60 | + <a class="post-meta-author" href="~/authors/@item.Author.AppUserName">@item.Author.DisplayName</a> |
| 61 | + <time class="post-meta-time">/ @item.Published.ToFriendlyDateString()</time> |
| 62 | + </div> |
| 63 | + <div class="post-description">@Html.Raw(Markdig.Markdown.ToHtml(item.Description))</div> |
| 64 | + <a class="post-more btn btn-rounded btn-dark" href="~/posts/@item.Slug">Read</a> |
| 65 | + </article> |
| 66 | + } |
| 67 | + } |
| 68 | + @if (pgr != null && (pgr.ShowOlder || pgr.ShowNewer)) |
| 69 | + { |
| 70 | + <ul class="pagination justify-content-center"> |
| 71 | + @if (pgr.ShowOlder) |
| 72 | + { |
| 73 | + <li class="item item-prev"> |
| 74 | + <a class="item-link" href="~/@pgr.LinkToOlder"> |
| 75 | + <i class="item-icon fa fa-angle-left"></i> |
| 76 | + </a> |
| 77 | + </li> |
| 78 | + } |
| 79 | + @if (pgr.ShowNewer) |
| 80 | + { |
| 81 | + <li class="item item-next"> |
| 82 | + <a class="item-link" href="~/@pgr.LinkToNewer"> |
| 83 | + <i class="item-icon fa fa-angle-right"></i> |
| 84 | + </a> |
| 85 | + </li> |
| 86 | + } |
| 87 | + </ul> |
| 88 | + } |
| 89 | + </div> |
| 90 | + </div> |
| 91 | + |
| 92 | + <partial name="~/Views/Themes/moments/_Shared/_Footer.cshtml" /> |
| 93 | +</body> |
| 94 | +</html> |
0 commit comments