|
| 1 | +@model ListModel |
| 2 | +@inject Core.Services.IDataService _db |
| 3 | +@{ |
| 4 | + ViewData["bodyClass"] = "home"; |
| 5 | + var pgr = Model.Pager; |
| 6 | + |
| 7 | + var first3 = _db.BlogPosts.All().OrderByDescending(p => p.Published).Take(3).ToList(); |
| 8 | + |
| 9 | + var returnUrl = Url.Action("Index", "Admin"); |
| 10 | + |
| 11 | +} |
| 12 | +<!DOCTYPE html> |
| 13 | +<html lang="en"> |
| 14 | +<head> |
| 15 | + <partial name="~/Views/Themes/vision/_Shared/_Head.cshtml" /> |
| 16 | +</head> |
| 17 | +<body class="@ViewData["bodyClass"]"> |
| 18 | + |
| 19 | + <partial name="~/Views/Themes/vision/_Shared/_Header.cshtml" /> |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + <div class="page-content"> |
| 24 | + <div class="container"> |
| 25 | + <div class="row"> |
| 26 | + <aside class="col-sm-3"> |
| 27 | + |
| 28 | + <div class="widget widget-posts"> |
| 29 | + <h4 class="widget-title"><i class="widget-icon fa fa-file-text-o"></i> <span>Recent Posts</span></h4> |
| 30 | + <div class="widget-body"> |
| 31 | + <ul class="widget-posts-list"> |
| 32 | + @await Component.InvokeAsync("PostList", new { theme = "vision", widget = "Recent Posts" }) |
| 33 | + </ul> |
| 34 | + </div> |
| 35 | + </div> |
| 36 | + <div class="widget widget-categories"> |
| 37 | + <h4 class="widget-title"><i class="widget-icon fa fa-folder"></i> <span>Categories</span></h4> |
| 38 | + <div class="widget-body"> |
| 39 | + <ul> |
| 40 | + @await Component.InvokeAsync("Categories", new { theme = "vision", widget = "Categories" }) |
| 41 | + </ul> |
| 42 | + </div> |
| 43 | + </div> |
| 44 | + <div class="widget widget-tags"> |
| 45 | + <h4 class="widget-title"><i class="widget-icon fa fa-tags"></i> <span>Tags</span></h4> |
| 46 | + <div class="widget-body"> |
| 47 | + <ul class="clearfix"> |
| 48 | + @await Component.InvokeAsync("Categories", new { theme = "vision", widget = "Tags" }) |
| 49 | + </ul> |
| 50 | + </div> |
| 51 | + </div> |
| 52 | + </aside> |
| 53 | + <div class="col-sm-6 pl-5 pr-5"> |
| 54 | + |
| 55 | + @if (Model.PostListType == PostListType.Search) |
| 56 | + { |
| 57 | + <h2 class="page-search-title"><i class="fa fa-search"></i> @Model.Blog.Title</h2> |
| 58 | + <hr class="my-5" /> |
| 59 | + } |
| 60 | + else if (Model.PostListType == PostListType.Author) |
| 61 | + { |
| 62 | + <h2 class="page-author-title"> |
| 63 | + <img src="~/@Model.Author.Avatar" class="page-author-avatar" /> |
| 64 | + <span class="page-author-name">@Model.Author.DisplayName</span> |
| 65 | + </h2> |
| 66 | + <hr class="my-5" /> |
| 67 | + } |
| 68 | + else if (Model.PostListType == PostListType.Category) |
| 69 | + { |
| 70 | + <h2 class="page-category-title"><i class="fa fa-tag"></i> @ViewBag.Category</h2> |
| 71 | + <hr class="my-5" /> |
| 72 | + } |
| 73 | + else |
| 74 | + { |
| 75 | + |
| 76 | + } |
| 77 | + |
| 78 | + @if (Model.Posts != null) |
| 79 | + { |
| 80 | + foreach (var item in Model.Posts) |
| 81 | + { |
| 82 | + var img = string.IsNullOrEmpty(item.Cover) ? Model.Blog.Cover : item.Cover; |
| 83 | + <article class="post"> |
| 84 | + <div class="post-cover"> |
| 85 | + |
| 86 | + <ul class="post-categories"> |
| 87 | + <li><a href="#">Technology</a></li> |
| 88 | + <li><a href="#">Microsoft</a></li> |
| 89 | + </ul> |
| 90 | + |
| 91 | + <a href="~/posts/@item.Slug"> |
| 92 | + <img src="~/@img" alt="@item.Title"> |
| 93 | + </a> |
| 94 | + @if (item.Featured) |
| 95 | + { |
| 96 | + <span class="post-featrued-label"><i class="fa fa-star"></i> Featured</span> |
| 97 | + } |
| 98 | + </div> |
| 99 | + <h2 class="post-title"><a href="~/posts/@item.Slug">@item.Title</a></h2> |
| 100 | + <div class="post-meta"> |
| 101 | + @*<a class="post-meta-author" href="~/authors/@item.Author.AppUserName">@item.Author.DisplayName</a>*@ |
| 102 | + <time class="post-meta-time">@item.Published.ToFriendlyDateString()</time> |
| 103 | + </div> |
| 104 | + </article> |
| 105 | + } |
| 106 | + } |
| 107 | + |
| 108 | + @if (pgr != null && (pgr.ShowOlder || pgr.ShowNewer)) |
| 109 | + { |
| 110 | + <ul class="pagination justify-content-between"> |
| 111 | + @if (pgr.ShowOlder) |
| 112 | + { |
| 113 | + <li class="item item-prev"> |
| 114 | + <a class="item-link" href="~/@pgr.LinkToOlder"> |
| 115 | + Previous Page |
| 116 | + </a> |
| 117 | + </li> |
| 118 | + } |
| 119 | + @if (pgr.ShowNewer) |
| 120 | + { |
| 121 | + <li class="item item-next"> |
| 122 | + <a class="item-link" href="~/@pgr.LinkToNewer"> |
| 123 | + Next Page |
| 124 | + </a> |
| 125 | + </li> |
| 126 | + } |
| 127 | + </ul> |
| 128 | + } |
| 129 | + </div> |
| 130 | + |
| 131 | + <aside class="col-sm-3"> |
| 132 | + |
| 133 | + <div class="widget widget-newsletter"> |
| 134 | + <h4 class="widget-title"><i class="widget-icon fa fa-telegram"></i><span>Newsletter</span></h4> |
| 135 | + <div class="widget-body"> |
| 136 | + @await Component.InvokeAsync("Newsletter", new { theme = "vision", widget = "Newsletter" }) |
| 137 | + </div> |
| 138 | + </div> |
| 139 | + <div class="widget widget-social"> |
| 140 | + <h4 class="widget-title"><i class="widget-icon fa fa-share-alt"></i><span>Follow Us</span></h4> |
| 141 | + <div class="widget-body"> |
| 142 | + @*@await Component.InvokeAsync("HtmlBlock", new { theme = "vision", widget = "Social Buttons" })*@ |
| 143 | + <a class="widget-social-fb" target="_blank" href="https://facebook.com/blogifierdotnet"><i class="fa fa-facebook"></i> <span>Facebook</span></a> |
| 144 | + <a class="widget-social-tw" target="_blank" href="https://twitter.com/blogifierdotnet"><i class="fa fa-twitter"></i> <span>Twitter</span></a> |
| 145 | + <a class="widget-social-in" target="_blank" href="https://instagram.com/blogifierdotnet"><i class="fa fa-instagram"></i> <span>Instagram</span></a> |
| 146 | + <a class="widget-social-rss" target="_blank" href="/feed/rss"><i class="fa fa-rss"></i> <span>Subscribe</span></a> |
| 147 | + </div> |
| 148 | + </div> |
| 149 | + |
| 150 | + |
| 151 | + |
| 152 | + |
| 153 | + <a href="~/" class="blog-logo"><img src="~/themes/vision/img/logo.png" width="200" alt="@Model.Blog.Title" /></a> |
| 154 | + <p class="my-4">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy.</p> |
| 155 | + <p class="blog-copyright">Copyright © @DateTime.Now.Year. Powered by <a href="https://github.com/blogifierdotnet/Blogifier" data-toggle="tooltip" target="_blank" title="Version - @AppSettings.Version">Blogifier</a>. Designed by <a href="https://francis.bio/" target="_blank" rel="nofollow">Francis</a>.</p> |
| 156 | + |
| 157 | + |
| 158 | + |
| 159 | + |
| 160 | + </aside> |
| 161 | + </div> |
| 162 | + </div> |
| 163 | + </div> |
| 164 | + |
| 165 | + |
| 166 | + <partial name="~/Views/Themes/vision/_Shared/_Footer.cshtml" /> |
| 167 | + |
| 168 | + <div class="blog-admin"> |
| 169 | + @if (User.Identity.IsAuthenticated) |
| 170 | + { |
| 171 | + <a href="~/admin"><i class="fa fa-user"></i></a> |
| 172 | + } |
| 173 | + else |
| 174 | + { |
| 175 | + <a href="~/account/login?ReturnUrl=@returnUrl"><i class="fa fa-login"></i></a> |
| 176 | + } |
| 177 | + </div> |
| 178 | +</body> |
| 179 | +</html> |
0 commit comments