Skip to content

Commit 34fd0ed

Browse files
authored
Merge pull request creativecommons#328 from creativecommons/update_author_post
Update author posts page
2 parents d711369 + c15ff27 commit 34fd0ed

File tree

3 files changed

+87
-23
lines changed

3 files changed

+87
-23
lines changed
Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,34 @@
11
{% extends "layout.html" %}
22

3-
{% from "macros/posts.html" import render_posts %}
3+
{% from "macros/author_posts.html" import render_author_posts %}
44
{% from "macros/author_name.html" import render_author_name %}
55

6-
{% block title %}{{ render_author_name(this) + ' - ' + this.parent.parent.children.get('entries').title }}{% endblock %}
7-
{% block header %}{{ this.parent.parent.children.get('entries').title }}{% endblock %}
86
{% block body %}
9-
<h2>{{ render_author_name(this) }}</h2>
10-
{% if this.about %}
11-
{% if this.md5_hashed_email %}
12-
<img src="https://secure.gravatar.com/avatar/{{ this.md5_hashed_email }}?size=200" alt="gravatar" style="float:right;" class="px-3 pb-3" />
13-
{% endif %}
14-
{{ this.about }}
15-
{% endif %}
16-
<h3>Posts</h3>
17-
{{ render_posts(this.children) }}
18-
<hr/>
19-
<p class="text-muted"><strong><a href="{{ this.parent|url }}">All Authors</a></strong></p>
7+
<div class="author-posts">
8+
<div class="title">
9+
<div class="container">
10+
<div class="columns">
11+
<div class="column is-2">
12+
{% if this.about %}
13+
{% if this.md5_hashed_email %}
14+
<figure class="image profile">
15+
<img class="profile" src="https://secure.gravatar.com/avatar/{{ this.md5_hashed_email }}?size=200">
16+
</figure>
17+
{% endif %}
18+
{% endif %}
19+
</div>
20+
<div class="column is-8">
21+
<h2>{{ render_author_name(this) }}</h2>
22+
{% if this.about %}
23+
<div class="about">{{ this.about }}</div>
24+
{% endif %}
25+
<a class="button small" href="{{ this.parent|url }}">See all authors</a>
26+
</div>
27+
</div>
28+
</div>
29+
</div>
30+
<div class="posts container">
31+
{{ render_author_posts(this.children) }}
32+
</div>
33+
</div>
2034
{% endblock %}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{% from "macros/author_name.html" import render_author_name %}
2+
3+
{% macro render_author_posts(posts) %}
4+
<div class="columns is-multiline">
5+
{% for post in posts %}
6+
{% set author = post.parent.parent.children.get('authors').children.get(post.author) %}
7+
<article class="card entry-post horizontal no-border blog-entry column is-one-third">
8+
<div class="blog-content">
9+
<h4 class="b-header"><a class="blog-title has-color-dark-slate-gray" href="{{ post|url }}">{{ post.title }}</a></h4>
10+
<span class="blog-author">by <a href="{{ author|url }}">{{ render_author_name(author) }}</a>
11+
on {{ post.pub_date|dateformat("YYYY-MM-dd") }}</span>
12+
<div class="excerpt">
13+
{{ post.body | excerpt | string | striptags() | truncate(100) }}
14+
</div>
15+
</div>
16+
</article>
17+
{% endfor %}
18+
</div>
19+
{% endmacro %}

webpack/sass/main.scss

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,14 @@ a {
1010
text-decoration: none;
1111
}
1212

13-
// Will be replaced by content class from Bulma
13+
code {
14+
@extend .has-color-dark-slate-gray;
15+
16+
background-color: $color-lighter-gray;
17+
border: 1px solid $color-lighter-gray;
18+
border-radius: 0.25rem;
19+
}
20+
1421
.markdown {
1522
@extend .body-big;
1623

@@ -30,14 +37,6 @@ a {
3037
ol,ul {
3138
@extend .padding-horizontal-big;
3239
}
33-
34-
code {
35-
@extend .has-color-dark-slate-gray;
36-
37-
background-color: $color-lighter-gray;
38-
border: 1px solid $color-lighter-gray;
39-
border-radius: 0.25rem;
40-
}
4140
}
4241

4342
.navbar-item {
@@ -346,6 +345,38 @@ a {
346345
}
347346
}
348347

348+
.author-posts {
349+
.title {
350+
background-color: $color-lighter-gray;
351+
352+
.container {
353+
@extend .padding-horizontal-big;
354+
@extend .padding-bottom-xl;
355+
356+
.image {
357+
width: 9.5rem;
358+
height: 9.5rem;
359+
}
360+
361+
.about {
362+
@extend .body-big;
363+
@extend .padding-top-big;
364+
365+
line-height: 1.8125;
366+
}
367+
368+
.button {
369+
@extend .margin-top-bigger;
370+
}
371+
}
372+
}
373+
374+
.posts {
375+
@extend .padding-top-xl;
376+
@extend .padding-bottom-xxl;
377+
}
378+
}
379+
349380
.all-series {
350381
.title {
351382
background-color: $color-lighter-gray;

0 commit comments

Comments
 (0)