2017-09-29 16:19:31 +02:00
|
|
|
//- ******************************************************* -//
|
|
|
|
| {% macro render_blog_post(node) %}
|
|
|
|
| {% if node.picture %}
|
|
|
|
.blog_index-header
|
|
|
|
img(src="{{ node.picture.thumbnail('l', api=api) }}")
|
|
|
|
| {% endif %}
|
|
|
|
.blog_index-item
|
|
|
|
a.item-title(
|
|
|
|
href="{{ url_for_node(node=node) }}")
|
|
|
|
| {{node.name}}
|
|
|
|
|
|
|
|
.item-info.
|
|
|
|
<span title="{{node._created}}">{{node._created | pretty_date }}</span>
|
|
|
|
{% if node._created != node._updated %}
|
|
|
|
<span title="{{node._updated}}">(updated {{node._updated | pretty_date }})</span>
|
|
|
|
{% endif %}
|
|
|
|
{% if node.properties.category %}| {{node.properties.category}}{% endif %}
|
|
|
|
| by {{node.user.full_name}}
|
|
|
|
| <a href="{{ url_for_node(node=node) }}#comments">Leave a comment</a>
|
|
|
|
{% if node.properties.status != 'published' %} | {{ node.properties.status}} {% endif %}
|
|
|
|
|
|
|
|
.item-content
|
|
|
|
| {{node.properties.content}}
|
|
|
|
|
|
|
|
.item-meta
|
|
|
|
a(href="{{ url_for_node(node=node) }}#comments") Leave a comment
|
|
|
|
| {% endmacro %}
|
|
|
|
|
|
|
|
//- ******************************************************* -//
|
|
|
|
| {% macro render_blog_index(project, posts, can_create_blog_posts, api) %}
|
|
|
|
| {% if can_create_blog_posts %}
|
|
|
|
a.btn.btn-default.button-create(href="{{url_for('nodes.posts_create', project_id=project._id)}}")
|
|
|
|
i.pi-plus
|
|
|
|
| Create New Post
|
|
|
|
| {% endif %}
|
|
|
|
|
|
|
|
| {% if posts %}
|
2017-09-29 17:04:48 +02:00
|
|
|
| {{ render_blog_post(posts[0]) }}
|
2017-09-29 16:19:31 +02:00
|
|
|
|
2017-09-29 17:04:48 +02:00
|
|
|
| {% for node in posts[1:] %}
|
2017-09-29 16:19:31 +02:00
|
|
|
| {% if loop.first %}
|
|
|
|
h4.blog_index-title Blasts from the past
|
|
|
|
| {% endif %}
|
|
|
|
.blog_index-item.list
|
|
|
|
| {% if node.picture %}
|
|
|
|
.item-header
|
|
|
|
img.image(src="{{ node.picture.thumbnail('s', api=api) }}")
|
|
|
|
| {% else %}
|
|
|
|
.item-header.nothumb
|
|
|
|
i.pi-document-text
|
|
|
|
| {% endif %}
|
|
|
|
a.item-title(
|
|
|
|
href="{{ url_for_node(node=node) }}")
|
|
|
|
| {{node.name}}
|
|
|
|
|
|
|
|
.item-info.
|
|
|
|
<span title="{{node._created}}">{{node._created | pretty_date }}</span>
|
|
|
|
{% if node._created != node._updated %}
|
|
|
|
<span title="{{node._updated}}">(updated {{node._updated | pretty_date }})</span>
|
|
|
|
{% endif %}
|
|
|
|
{% if node.properties.category %}| {{node.properties.category}}{% endif %}
|
|
|
|
| by {{node.user.full_name}}
|
|
|
|
{% if node.properties.status != 'published' %} | {{ node.properties.status}} {% endif %}
|
|
|
|
| {% endfor %} {# posts #}
|
|
|
|
|
|
|
|
| {% else %}
|
|
|
|
|
|
|
|
.blog_index-item
|
|
|
|
.item-content No posts yet.
|
|
|
|
|
|
|
|
| {% endif %} {# posts #}
|
|
|
|
| {% endmacro %}
|