Skip to content

Commit ae9381d

Browse files
committed
feature #441 Display blog post metadata (javiereguiluz)
This PR was squashed before being merged into the master branch (closes #441). Discussion ---------- Display blog post metadata ### Index view | Before | After | --- | --- | ![before_blog_index](https://cloud.githubusercontent.com/assets/73419/22027650/cac567a0-dcd4-11e6-8fb4-8ece36939306.png) | ![after_blog_index](https://cloud.githubusercontent.com/assets/73419/22027652/cb786850-dcd4-11e6-893c-7864945fabcf.png) ### Show view | Before | After | --- | --- | ![before-blog-show](https://cloud.githubusercontent.com/assets/73419/22027654/ce77fa34-dcd4-11e6-8132-1a591d187744.png) | ![after-blog-show](https://cloud.githubusercontent.com/assets/73419/22027655/cfaa5438-dcd4-11e6-9b7d-fa9781587b0e.png) Commits ------- 6cf7a0e Display blog post metadata
2 parents 6964e23 + 6cf7a0e commit ae9381d

File tree

4 files changed

+28
-2
lines changed

4 files changed

+28
-2
lines changed

app/Resources/views/admin/blog/show.html.twig

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
{% block main %}
66
<h1>{{ post.title }}</h1>
77
<p class="post-metadata">
8-
<i class="fa fa-calendar"></i> {{ post.publishedAt|localizeddate('long', 'medium', null, 'UTC') }}
9-
<i class="fa fa-user"></i> {{ post.author.email }}
8+
<span class="metadata"><i class="fa fa-calendar"></i> {{ post.publishedAt|localizeddate('long', 'medium', null, 'UTC') }}</span>
9+
<span class="metadata"><i class="fa fa-user"></i> {{ post.author.email }}</span>
1010
</p>
1111

1212
<div class="well">

app/Resources/views/blog/index.html.twig

+5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
</a>
1212
</h2>
1313

14+
<p class="post-metadata">
15+
<span class="metadata"><i class="fa fa-calendar"></i> {{ post.publishedAt|localizeddate('long', 'medium', null, 'UTC') }}</span>
16+
<span class="metadata"><i class="fa fa-user"></i> {{ post.author.email }}</span>
17+
</p>
18+
1419
{{ post.summary|md2html }}
1520
</article>
1621
{% else %}

app/Resources/views/blog/post_show.html.twig

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
{% block main %}
66
<h1>{{ post.title }}</h1>
77

8+
<p class="post-metadata">
9+
<span class="metadata"><i class="fa fa-calendar"></i> {{ post.publishedAt|localizeddate('long', 'medium', null, 'UTC') }}</span>
10+
<span class="metadata"><i class="fa fa-user"></i> {{ post.author.email }}</span>
11+
</p>
12+
813
{{ post.content|md2html }}
914

1015
<div id="post-add-comment" class="well">

web/css/main.css

+16
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,17 @@ body#login #login-users-help p .console {
207207
padding: 10px
208208
}
209209

210+
/* Common Blog page elements
211+
------------------------------------------------------------------------- */
212+
.post-metadata {
213+
color: #b4bcc2;
214+
font-size: 19px;
215+
margin-bottom: 16px;
216+
}
217+
.post-metadata .metadata {
218+
margin-right: 1.5em;
219+
}
220+
210221
/* Page: 'Blog index'
211222
------------------------------------------------------------------------- */
212223
body#blog_index h1 {
@@ -217,6 +228,11 @@ body#blog_index article.post {
217228
margin-bottom: 3em
218229
}
219230

231+
body#blog_index .post-metadata {
232+
font-size: 16px;
233+
margin-bottom: 8px;
234+
}
235+
220236
/* Page: 'Blog post show'
221237
------------------------------------------------------------------------- */
222238
body#blog_post_show h3 {

0 commit comments

Comments
 (0)