Skip to content

Commit 027fe48

Browse files
committed
Updates to moments theme
1 parent 4111d4e commit 027fe48

File tree

4 files changed

+148
-186
lines changed

4 files changed

+148
-186
lines changed

docs/SendGrid.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ required is to update `appsettings.json`:
1717
}
1818
```
1919

20-
Currently, SendGrid only used by Newsletter widget. When guest subscribles to the blog via Newsletter,
21-
every time new post gets published, Blogifier goes over list of subscribers and sends notification
22-
about new publicatoin to every subscriber.
20+
Currently, SendGrid only used by Newsletter widget. When guest subscribes to the blog via Newsletter,
21+
every time new post gets published, Blogifier goes over list of subscribers and sends notification
22+
about new publication to every subscriber.
23+
2324

2425
### Why not SMTP?
2526
Plain SMTP client routes calls to actual SMTP email server, like Gmail or HotMail.

src/App/Views/Themes/moments/List.cshtml

Lines changed: 143 additions & 182 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
@model ListModel
2+
@inject Core.Services.IDataService _db
23
@{
34
ViewData["bodyClass"] = "home";
45
var pgr = Model.Pager;
6+
7+
var first3 = _db.BlogPosts.All().OrderByDescending(p => p.Published).Take(3).ToList();
58
}
69
<!DOCTYPE html>
710
<html lang="en">
@@ -12,216 +15,174 @@
1215

1316
<partial name="~/Views/Themes/moments/_Shared/_Header.cshtml" />
1417

15-
16-
17-
<div class="blog-featured">
18-
19-
<div class="container">
20-
<div class="blog-featured-container">
21-
<div id="carouselExampleIndicators" class="carousel slide " data-ride="carousel">
22-
<ol class="carousel-indicators">
23-
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"><img class="blog-featured-item-img d-block w-100" src="/data/admin/cover-blog.png" alt="[POSTTITLE]"></li>
24-
<li data-target="#carouselExampleIndicators" data-slide-to="1"><img class="blog-featured-item-img d-block w-100" src="/data/demo/demo-cover.jpg" alt="[POSTTITLE]"></li>
25-
<li data-target="#carouselExampleIndicators" data-slide-to="2"><img class="blog-featured-item-img d-block w-100" src="/data/admin/cover-globe.png" alt="[POSTTITLE]"></li>
26-
</ol>
27-
<div class="carousel-inner">
28-
<div class="carousel-item active">
29-
<img class="blog-featured-item-img d-block w-100" src="/data/admin/cover-blog.png" alt="[POSTTITLE]">
30-
<div class="blog-featured-item-inner">
31-
<span class="blog-featured-item-cat">Category</span>
32-
<h2 class="blog-featured-item-title">Here is going to be the title of the post</h2>
33-
<time class="blog-featured-item-time"><i class="fa fa-clock-o"></i> June 25, 2018</time>
34-
</div>
35-
</div>
36-
<div class="carousel-item">
37-
<img class="blog-featured-item-img d-block w-100" src="/data/demo/demo-cover.jpg" alt="[POSTTITLE]">
38-
<div class="blog-featured-item-inner">
39-
<span class="blog-featured-item-cat">Category</span>
40-
<h2 class="blog-featured-item-title">Here is going to be the title of the post</h2>
41-
<time class="blog-featured-item-time"><i class="fa fa-clock-o"></i> June 25, 2018</time>
42-
</div>
43-
</div>
44-
<div class="carousel-item">
45-
<img class="blog-featured-item-img d-block w-100" src="/data/admin/cover-globe.png" alt="[POSTTITLE]">
46-
<div class="blog-featured-item-inner">
47-
<span class="blog-featured-item-cat">Category</span>
48-
<h2 class="blog-featured-item-title">Here is going to be the title of the post</h2>
49-
<time class="blog-featured-item-time"><i class="fa fa-clock-o"></i> June 25, 2018</time>
50-
</div>
51-
</div>
52-
</div>
53-
</div>
54-
</div>
55-
</div>
56-
</div>
57-
58-
5918
@if (Model.PostListType == PostListType.Search)
6019
{
6120
<div class="page-cover" style="background-image: url('@Model.Blog.Cover')">
62-
<a href="#"><i class="fa fa-search"></i> @Model.Blog.Title</a>
21+
<a href="#"><i class="fa fa-search"></i> @Model.Blog.Title</a>
6322
</div>
6423
}
6524
else if (Model.PostListType == PostListType.Author)
6625
{
67-
<div class="page-cover" style="background-image: url('@Model.Blog.Cover')">
68-
<a href="~/">
69-
<img src="~/@Model.Author.Avatar" class="rounded-circle" style="width: 52px" />
70-
@Model.Author.DisplayName
71-
</a>
72-
</div>
26+
<div class="page-cover" style="background-image: url('@Model.Blog.Cover')">
27+
<a href="~/">
28+
<img src="~/@Model.Author.Avatar" class="rounded-circle" style="width: 52px" />
29+
@Model.Author.DisplayName
30+
</a>
31+
</div>
7332
}
7433
else if (Model.PostListType == PostListType.Category)
7534
{
76-
<div class="page-cover" style="background-image: url('@Model.Blog.Cover')">
77-
<a href="#"><i class="fa fa-tag"></i> @ViewBag.Category</a>
78-
</div>
79-
} else {
80-
<!-- <div class="page-cover" style="background-image: url('@Model.Blog.Cover')">
81-
Hello
82-
</div> -->
35+
<div class="page-cover" style="background-image: url('@Model.Blog.Cover')">
36+
<a href="#"><i class="fa fa-tag"></i> @ViewBag.Category</a>
37+
</div>
38+
}
39+
else
40+
{
41+
<div class="blog-featured">
42+
<div class="container">
43+
<div class="blog-featured-container">
44+
<div id="postCarousel" class="carousel slide " data-ride="carousel">
45+
<ol class="carousel-indicators">
46+
@for (int i = 0; i < first3.Count(); i++)
47+
{
48+
var cls = i == 0 ? "active" : "";
49+
<li data-target="#postCarousel" data-slide-to="@i" class="@cls">
50+
<img class="blog-featured-item-img d-block w-100" src="~/@first3[i].Cover" alt="@first3[i].Title">
51+
</li>
52+
}
53+
</ol>
54+
<div class="carousel-inner">
55+
@for (int i = 0; i < first3.Count(); i++)
56+
{
57+
var cls2 = i == 0 ? "active" : "";
58+
<div class="carousel-item @cls2">
59+
<img class="blog-featured-item-img d-block w-100" src="~/@first3[i].Cover" alt="@first3[i].Title">
60+
<div class="blog-featured-item-inner">
61+
@if (!string.IsNullOrEmpty(first3[i].Categories))
62+
{
63+
<span class="blog-featured-item-cat"><i class="fa fa-tag"></i> @first3[i].Categories</span>
64+
}
65+
<h2 class="blog-featured-item-title">@first3[i].Title</h2>
66+
<time class="blog-featured-item-time"><i class="fa fa-clock-o"></i> @first3[i].Published.ToFriendlyDateString()</time>
67+
</div>
68+
</div>
69+
}
70+
</div>
71+
</div>
72+
</div>
73+
</div>
74+
</div>
8375
}
84-
85-
8676

8777
<div class="page-content">
8878
<div class="container">
89-
<div class="row">
79+
<div class="row">
9080

91-
<div class="col-sm-8">
92-
@if (Model.Posts != null)
93-
{
94-
foreach (var item in Model.Posts)
95-
{
96-
var img = string.IsNullOrEmpty(item.Cover) ? Model.Blog.Cover : item.Cover;
97-
<article class="post">
98-
<div class="post-cover">
99-
<img src="~/@img" alt="@item.Title">
100-
@if (item.Featured)
101-
{
102-
<span class="post-featrued-label"><i class="fa fa-star"></i> Featured</span>
103-
}
104-
</div>
105-
<h2 class="post-title"><a href="~/posts/@item.Slug">@item.Title</a></h2>
106-
<div class="post-meta">
107-
<a class="post-meta-author" href="~/authors/@item.Author.AppUserName">@item.Author.DisplayName</a>
108-
<time class="post-meta-time">/ @item.Published.ToFriendlyDateString()</time>
109-
</div>
110-
<div class="post-description">@Html.Raw(Markdig.Markdown.ToHtml(item.Description))</div>
111-
<a class="post-more btn btn-rounded btn-dark" href="~/posts/@item.Slug">Read</a>
112-
</article>
113-
}
114-
}
115-
@if (pgr != null && (pgr.ShowOlder || pgr.ShowNewer))
116-
{
117-
<ul class="pagination justify-content-center">
118-
@if (pgr.ShowOlder)
81+
<div class="col-sm-8">
82+
@if (Model.Posts != null)
11983
{
120-
<li class="item item-prev">
121-
<a class="item-link" href="~/@pgr.LinkToOlder">
122-
<i class="item-icon fa fa-angle-left"></i>
123-
</a>
124-
</li>
84+
foreach (var item in Model.Posts)
85+
{
86+
var img = string.IsNullOrEmpty(item.Cover) ? Model.Blog.Cover : item.Cover;
87+
<article class="post">
88+
<div class="post-cover">
89+
<img src="~/@img" alt="@item.Title">
90+
@if (item.Featured)
91+
{
92+
<span class="post-featrued-label"><i class="fa fa-star"></i> Featured</span>
93+
}
94+
</div>
95+
<h2 class="post-title"><a href="~/posts/@item.Slug">@item.Title</a></h2>
96+
<div class="post-meta">
97+
<a class="post-meta-author" href="~/authors/@item.Author.AppUserName">@item.Author.DisplayName</a>
98+
<time class="post-meta-time">/ @item.Published.ToFriendlyDateString()</time>
99+
</div>
100+
<div class="post-description">@Html.Raw(Markdig.Markdown.ToHtml(item.Description))</div>
101+
<a class="post-more btn btn-rounded btn-dark" href="~/posts/@item.Slug">Read</a>
102+
</article>
103+
}
125104
}
126-
@if (pgr.ShowNewer)
105+
@if (pgr != null && (pgr.ShowOlder || pgr.ShowNewer))
127106
{
128-
<li class="item item-next">
129-
<a class="item-link" href="~/@pgr.LinkToNewer">
130-
<i class="item-icon fa fa-angle-right"></i>
131-
</a>
132-
</li>
107+
<ul class="pagination justify-content-center">
108+
@if (pgr.ShowOlder)
109+
{
110+
<li class="item item-prev">
111+
<a class="item-link" href="~/@pgr.LinkToOlder">
112+
<i class="item-icon fa fa-angle-left"></i>
113+
</a>
114+
</li>
115+
}
116+
@if (pgr.ShowNewer)
117+
{
118+
<li class="item item-next">
119+
<a class="item-link" href="~/@pgr.LinkToNewer">
120+
<i class="item-icon fa fa-angle-right"></i>
121+
</a>
122+
</li>
123+
}
124+
</ul>
133125
}
134-
</ul>
135-
}
136-
137-
138-
</div>
139-
140-
<aside class="col-sm-4">
141-
142-
<div class="widget widget-social">
143-
<h4 class="widget-title"><span>Follow Us</span></h4>
144-
<div class="widget-body">
145-
<ul>
146-
<!-- @await Component.InvokeAsync("HtmlBlock", new { theme = "moments", widget = "Social Buttons" }) -->
147-
<li><a class="widget-social-fb" target="_blank" href="#"><i class="fa fa-facebook-square"></i> <span>Like</span></a></li>
148-
<li><a class="widget-social-tw" target="_blank" href="#"><i class="fa fa-twitter"></i> <span>Follow</span></a></li>
149-
<li><a class="widget-social-yt" target="_blank" href="#"><i class="fa fa-youtube"></i> <span>Subscribe</span></a></li>
150-
<li><a class="widget-social-gp" target="_blank" href="#"><i class="fa fa-google-plus"></i> <span>Follow</span></a></li>
151-
</ul>
152-
</div>
153-
</div>
154-
155-
156-
<div class="widget widget-posts">
157-
<h4 class="widget-title"><span>Recent Posts</span></h4>
158-
<div class="widget-body">
159-
<ul class="widget-posts-list">
160-
<li class="widget-posts-item">
161-
<a href="#" class="widget-posts-link">
162-
<h5 class="widget-posts-title">Welcome to Blogifier!</h5>
163-
<span class="widget-posts-date">July 19, 2018</span>
164-
<span class="widget-posts-cat">News</span>
165-
<img class="widget-posts-img" src="~/data/admin/cover-blog.png" alt="[POSTTITLE]">
166-
<p class="widget-posts-desc">Blogifier is simple, beautiful, light-weight open source blog written in .NET Core. This cross-platform, highly extendable and customizable web application brings all the best blogging features in small, portable package.</p>
167-
</a>
168-
</li>
169-
<li class="widget-posts-item">
170-
<a href="#" class="widget-posts-link">
171-
<h5 class="widget-posts-title">Welcome to Blogifier!</h5>
172-
<span class="widget-posts-date">July 19, 2018</span>
173-
<span class="widget-posts-cat">News</span>
174-
<img class="widget-posts-img" src="~/data/admin/cover-blog.png" alt="[POSTTITLE]">
175-
<p class="widget-posts-desc">Blogifier is simple, beautiful, light-weight open source blog written in .NET Core. This cross-platform, highly extendable and customizable web application brings all the best blogging features in small, portable package.</p>
176-
</a>
177-
</li>
178-
</ul>
179-
</div>
180-
</div>
181-
182-
<div class="widget widget-categories">
183-
<h4 class="widget-title"><span>Categories</span></h4>
184-
<div class="widget-body">
185-
<ul>
186-
<li><a href="#">catname <span>(25)</span></a></li>
187-
<li><a href="#">catname <span>(25)</span></a></li>
188-
<li><a href="#">catname <span>(25)</span></a></li>
189-
</ul>
190-
</div>
191-
</div>
192-
193-
<div class="widget widget-tags">
194-
<h4 class="widget-title"><span>Tags</span></h4>
195-
<div class="widget-body">
196-
<ul class="clearfix">
197-
<li><a href="#">News</a></li>
198-
<li><a href="#">Technology</a></li>
199-
<li><a href="#">Microsoft</a></li>
200-
<li><a href="#">C#</a></li>
201-
<li><a href="#">Frameworks</a></li>
202-
<li><a href="#">Developers</a></li>
203-
<li><a href="#">Windows</a></li>
204-
<li><a href="#">Tablet</a></li>
205-
</ul>
206126
</div>
207-
</div>
208-
209127

128+
<aside class="col-sm-4">
210129

130+
<div class="widget widget-social">
131+
<h4 class="widget-title"><span>Follow Us</span></h4>
132+
<div class="widget-body">
133+
<ul>
134+
@await Component.InvokeAsync("HtmlBlock", new { theme = "moments", widget = "Social Buttons" })
135+
</ul>
136+
</div>
137+
</div>
138+
139+
<div class="widget widget-posts">
140+
<h4 class="widget-title"><span>Recent Posts</span></h4>
141+
<div class="widget-body">
142+
<ul class="widget-posts-list">
143+
@await Component.InvokeAsync("PostList", new { theme = "moments", widget = "Recent Posts" })
144+
</ul>
145+
</div>
146+
</div>
147+
148+
<div class="widget widget-categories">
149+
<h4 class="widget-title"><span>Categories</span></h4>
150+
<div class="widget-body">
151+
<ul>
152+
<li><a href="#">catname <span>(25)</span></a></li>
153+
<li><a href="#">catname <span>(25)</span></a></li>
154+
<li><a href="#">catname <span>(25)</span></a></li>
155+
</ul>
156+
</div>
157+
</div>
158+
159+
<div class="widget widget-tags">
160+
<h4 class="widget-title"><span>Tags</span></h4>
161+
<div class="widget-body">
162+
<ul class="clearfix">
163+
<li><a href="#">News</a></li>
164+
<li><a href="#">Technology</a></li>
165+
<li><a href="#">Microsoft</a></li>
166+
<li><a href="#">C#</a></li>
167+
<li><a href="#">Frameworks</a></li>
168+
<li><a href="#">Developers</a></li>
169+
<li><a href="#">Windows</a></li>
170+
<li><a href="#">Tablet</a></li>
171+
</ul>
172+
</div>
173+
</div>
211174

175+
</aside>
212176

213-
</aside>
214-
215-
216-
</div>
177+
</div>
217178
</div>
218179
</div>
219180

220181
<div class="widget-newsletter">
221-
<div class="container">
222-
<h3>Newsletter!</h3>
223-
@await Component.InvokeAsync("Newsletter", new { theme = "moments", widget = "Newsletter" })
224-
</div>
182+
<div class="container">
183+
<h3>Newsletter!</h3>
184+
@await Component.InvokeAsync("Newsletter", new { theme = "moments", widget = "Newsletter" })
185+
</div>
225186
</div>
226187
<partial name="~/Views/Themes/moments/_Shared/_Footer.cshtml" />
227188
</body>

src/App/Views/Themes/moments/Moments.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
},
66
{
77
"Widget": "PostList",
8-
"Title": "Post List"
8+
"Title": "Recent Posts"
99
},
1010
{
1111
"Widget": "Newsletter",

src/App/app.db

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)