Skip to content

Commit 919c856

Browse files
author
Farzin
committed
#281 Design - Refactoring Themes - 1
1 parent c8b9901 commit 919c856

59 files changed

Lines changed: 4327 additions & 96 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/Blogifier.Admin/Pages/Settings/ThemesView.razor

Lines changed: 31 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -10,50 +10,41 @@
1010
{
1111
<h1 class="section-title">@_localizer["themes"]</h1>
1212
<div class="section-content">
13-
<div class="row themes">
14-
<div class="col-md-6 col-lg-4">
15-
<div class="themes-item">
16-
<div class="themes-cover">
17-
<img src="@CurrentTheme.Cover" class="themes-img" alt="@CurrentTheme.Title">
18-
</div>
19-
<div class="themes-details">
20-
<div class="themes-title">@CurrentTheme.Title (@_localizer["current"])</div>
21-
<ul class="themes-info">
22-
<li class="themes-info-item">@_localizer["developer"] <a href="#">John Doe</a></li>
23-
<li class="themes-info-item">@_localizer["version"] 2.1</li>
24-
</ul>
25-
<a href="/admin/settings/customize/" class="btn btn-blogifier btn-block">@_localizer["customize"]</a>
26-
</div>
13+
<div class="themes">
14+
<div class="themes-item d-flex">
15+
<img src="@CurrentTheme.Cover" class="themes-thumbnail" alt="@CurrentTheme.Title">
16+
<!-- 4:5 -->
17+
<!-- 1024:1280 -->
18+
<!-- 1600:2000 -->
19+
<div class="themes-info">
20+
<h3 class="themes-title">@CurrentTheme.Title (@_localizer["current"])</h3>
21+
<ul class="themes-meta d-flex">
22+
<li class="themes-meta-item">@_localizer["version"] 2.1</li>
23+
<li class="themes-meta-item">@_localizer["by"] <a href="#">John Doe</a></li>
24+
</ul>
25+
<p class="themes-desc">This is the default theme that comes with the Blogifier 3.0 There are some customization you might enjoy.</p>
26+
<a class="btn btn-blogifier px-4" href="/admin/settings/customize/">@_localizer["customize"]</a>
2727
</div>
2828
</div>
2929
@foreach (var item in Themes)
3030
{
31-
<div class="col-md-6 col-lg-4">
32-
<div class="themes-item">
33-
<div class="themes-cover">
34-
<img src="@item.Cover" class="themes-img" alt="@item.Title">
35-
</div>
36-
<div class="themes-details">
37-
<div class="themes-title">@item.Title</div>
38-
<ul class="themes-info">
39-
<li class="themes-info-item">@_localizer["developer"] <a href="#">John Doe</a></li>
40-
<li class="themes-info-item">@_localizer["version"] 2.1</li>
41-
</ul>
42-
<div class="d-flex">
43-
<button type="button" class="btn btn-outline-default flex-grow-1 me-2" @onclick="()=> SelectTheme(item.Title)" @onclick:preventDefault>@_localizer["select"]</button>
44-
<button type="button" class="btn btn-outline-default me-2" title="@_localizer["delete"]">
45-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-trash" viewBox="0 0 16 16">
46-
<path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z" />
47-
<path fill-rule="evenodd" d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4L4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z" />
48-
</svg>
49-
</button>
50-
<button type="button" class="btn btn-outline-default" data-bs-toggle="modal" data-bs-target="#themeInfo" title="@_localizer["info"]">
51-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-info-circle" viewBox="0 0 16 16">
52-
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/>
53-
<path d="M8.93 6.588l-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"/>
54-
</svg>
55-
</button>
56-
</div>
31+
<div class="themes-item d-flex">
32+
<img src="@item.Cover" class="themes-thumbnail" alt="@item.Title">
33+
<div class="themes-info">
34+
<div class="themes-title">@item.Title</div>
35+
<ul class="themes-meta d-flex">
36+
<li class="themes-meta-item">@_localizer["version"] 2.1</li>
37+
<li class="themes-meta-item">@_localizer["by"] <a href="#">John Doe</a></li>
38+
</ul>
39+
<p class="themes-desc">This is the default theme that comes with the Blogifier 3.0 There are some customization you might enjoy.</p>
40+
<div class="d-flex">
41+
<button type="button" class="btn btn-default me-2" @onclick="()=> SelectTheme(item.Title)" @onclick:preventDefault>@_localizer["set-current-theme"]</button>
42+
<button type="button" class="btn btn-default me-2" title="@_localizer["delete"]">
43+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-trash" viewBox="0 0 16 16">
44+
<path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z" />
45+
<path fill-rule="evenodd" d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4L4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z" />
46+
</svg>
47+
</button>
5748
</div>
5849
</div>
5950
</div>

src/Blogifier.Admin/wwwroot/admin/css/app.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Blogifier.Admin/wwwroot/admin/css/app.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 21 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,40 @@
11
.themes {
2-
margin-top: 1.5rem;
3-
42
&-item {
5-
@include bf-shadow();
6-
overflow: hidden;
7-
margin-bottom: 2rem;
8-
}
9-
10-
&-cover {
11-
max-height: 15rem;
12-
overflow: hidden;
13-
border-bottom: 1px solid $gray-200;
3+
margin-bottom: 3rem;
144
}
15-
16-
&-img {
17-
min-width: 100%;
18-
max-width: 100%;
5+
&-thumbnail {
6+
border-radius: 0.325rem;
7+
display: block;
8+
// 4:5
9+
width: 12.5rem;
10+
height: 15.625rem;
11+
object-fit: cover;
12+
object-position: center;
1913
}
2014

21-
&-details {
22-
padding: 1.5rem;
15+
&-info {
16+
margin-left: 2rem;
17+
padding-top: 1rem;
2318
}
2419

2520
&-title {
26-
font-size: 0.875rem;
27-
font-weight: 500;
28-
margin-bottom: 0.875rem;
21+
margin-bottom: 1.5rem;
2922
}
3023

31-
&-info {
32-
font-size: 0.75rem;
24+
&-meta {
3325
list-style: none;
3426
padding: 0;
27+
margin: 0 0 1.5rem;
3528
color: $gray-600;
36-
margin-bottom: 1rem;
3729

38-
a {
39-
color: $gray-600;
40-
&:hover {
41-
color: $gray-900;
42-
}
30+
&-item {
31+
margin-right: 1.5rem;
4332
}
4433
}
4534

46-
&-modal {
47-
padding: 1rem;
48-
49-
&-title {
50-
font-size: 1.5rem;
51-
font-weight: 500;
52-
margin-bottom: 1rem;
53-
}
54-
&-desc {
55-
margin-bottom: 1rem;
56-
}
57-
58-
&-info {
59-
list-style: none;
60-
padding: 0;
61-
margin: 0 0 2rem;
62-
> li {
63-
margin-bottom: .5rem;
64-
}
65-
}
66-
67-
&-img {
68-
border-radius: 0.25rem;
69-
border: 1px solid $gray-200;
70-
width: 100%;
71-
}
35+
&-desc {
36+
margin-bottom: 1.5rem;
37+
width: 100%;
38+
max-width: 75%;
7239
}
7340
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
7+
<title>Error 404</title>
8+
<meta name="description" content="Error page">
9+
10+
<!-- TODO: These variables comes from customfiedls -->
11+
<style>
12+
:root {
13+
/* accent color */
14+
--bf-color: #622aff;
15+
/* header */
16+
--bf-header-title-size: 1.5rem;
17+
--bf-header-title-weight: 700;
18+
--bf-header-title-color: #000;
19+
--bf-header-title-hover: #622aff;
20+
/* logo */
21+
--bf-header-logo-width: auto;
22+
--bf-header-logo-height: 1.5rem;
23+
/* post */
24+
--bf-post-width: 43.75rem;
25+
/* radius */
26+
--bf-radius: .5rem;
27+
}
28+
</style>
29+
30+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl" crossorigin="anonymous">
31+
<link rel="stylesheet" href="~/themes/standard/css/styles.css" asp-append-version="true">
32+
</head>
33+
34+
35+
<body>
36+
<partial name="./components/header.cshtml" />
37+
<main class="container">
38+
<h1>Page Not Found</h1>
39+
</main>
40+
<partial name="./components/footer.cshtml" />
41+
42+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/js/bootstrap.bundle.min.js" integrity="sha384-b5kHyXgcpbZJO/tY9Ul7kGkf1S0CWuKcCD38l8YkeH8z8QjE0GmW1gYU5S9FOnJ0" crossorigin="anonymous"></script>
43+
<script src="~/themes/standard/js/highlight.js" asp-append-version="true"></script>
44+
<script src="~/themes/standard/js/scripts.js" asp-append-version="true"></script>
45+
<script src="~/themes/standard/js/newsletter.js" asp-append-version="true"></script>
46+
</body>
47+
48+
</html>
49+
50+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@{
2+
Layout = "layouts/_main.cshtml";
3+
}
4+
5+
<main class="container">
6+
<h1 class="h3 mb-5">CATEGORY_TITLE</h1>
7+
<partial name="post/view-list.cshtml" />
8+
</main>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@using Blogifier.Shared
2+
@{
3+
Layout = "layouts/_main.cshtml";
4+
}
5+
6+
<main class="container">
7+
<partial name="post/featured.cshtml" />
8+
@*
9+
TODO:
10+
Custom fields:
11+
- Post list style options:
12+
1. view-grid (default)
13+
2. view-list
14+
*@
15+
<partial name="post/view-grid.cshtml" />
16+
@* <partial name="post/view-list.cshtml" /> *@
17+
18+
<partial name="components/pagination.cshtml" />
19+
</main>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
@using Blogifier.Shared.Resources
2+
@using Blogifier.Shared
3+
@using Microsoft.Extensions.Localization
4+
@inject IStringLocalizer<Resource> _localizer
5+
@{
6+
Layout = "layouts/_main.cshtml";
7+
PostModel postModel = (PostModel)Model;
8+
var post = postModel.Post;
9+
string cover = $"{Url.Content("~/")}{postModel.Post.Cover}";
10+
}
11+
12+
<main class="post-detail">
13+
<article class="post">
14+
15+
<figure class="post-cover">
16+
<img class="post-cover-img" src="@cover" alt="@post.Title">
17+
</figure>
18+
19+
<header class="post-header post-container">
20+
21+
<h1 class="post-title">@post.Title</h1>
22+
23+
<div class="post-meta d-flex align-items-center">
24+
<div class="post-meta-item post-meta-date">
25+
<span class="post-meta-label">@_localizer["published"]</span>
26+
<time class="post-meta-date-time">@post.Published.ToFriendlyShortDateString()</time>
27+
</div>
28+
<button class="post-meta-btn ms-auto" type="button" data-bs-toggle="modal" data-bs-target="#shareModal">
29+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-share" viewBox="0 0 16 16">
30+
<path d="M13.5 1a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zM11 2.5a2.5 2.5 0 1 1 .603 1.628l-6.718 3.12a2.499 2.499 0 0 1 0 1.504l6.718 3.12a2.5 2.5 0 1 1-.488.876l-6.718-3.12a2.5 2.5 0 1 1 0-3.256l6.718-3.12A2.5 2.5 0 0 1 11 2.5zm-8.5 4a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zm11 5.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z"/>
31+
</svg>
32+
</button>
33+
@if (User.Identity.IsAuthenticated)
34+
{
35+
<a class="post-meta-btn ms-2" href="~/admin/pages/editor/@post.Slug">
36+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pencil" viewBox="0 0 16 16">
37+
<path d="M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5L13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175l-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325z"/>
38+
</svg>
39+
</a>
40+
}
41+
</div>
42+
</header>
43+
44+
<section class="post-content post-container">
45+
@Html.Raw(post.Content)
46+
</section>
47+
48+
</article>
49+
50+
<partial name="post/share.cshtml" />
51+
52+
</main>

0 commit comments

Comments
 (0)