|
|
|
|
@ -1,4 +1,4 @@ |
|
|
|
|
{% macro post_template(post, information_icon, post_url, current_url) %} |
|
|
|
|
{% macro post_template(type, post, information_icon, post_url, current_url, related_posts) %} |
|
|
|
|
{% if post %} |
|
|
|
|
<h2>{{ post.title }}</h2> |
|
|
|
|
<p>{{ post.content }}</p> |
|
|
|
|
@ -22,29 +22,45 @@ |
|
|
|
|
{% set countElements = post.hasParent + post.children.count %} |
|
|
|
|
|
|
|
|
|
{% if countElements %} |
|
|
|
|
{% if countElements > 1%} |
|
|
|
|
<p>{{ information_icon }} + {{ countElements }}</p> |
|
|
|
|
<a href="{{ post_url }}&post_id={{ post.id }}"> |
|
|
|
|
{% if countElements > 1 %} |
|
|
|
|
{{ information_icon }} + {{ countElements }} |
|
|
|
|
{% else %} |
|
|
|
|
<p>{{ information_icon }} </p> |
|
|
|
|
{{ information_icon }} |
|
|
|
|
{% endif %} |
|
|
|
|
{% endif %} |
|
|
|
|
|
|
|
|
|
{% if post.parent %} |
|
|
|
|
<h3>Parent</h3> |
|
|
|
|
<a href="{{ post_url }}&post_id={{ post.parent.id }}"> |
|
|
|
|
{{ post.parent.title }} |
|
|
|
|
</a> |
|
|
|
|
{% endif %} |
|
|
|
|
|
|
|
|
|
{% if post.children.count %} |
|
|
|
|
<h3>Children</h3> |
|
|
|
|
{% for child in post.children %} |
|
|
|
|
<p> |
|
|
|
|
<a href="{{ post_url }}&post_id={{ child.id }}"> |
|
|
|
|
{{ child.title }} |
|
|
|
|
|
|
|
|
|
{% if type == 'all' %} |
|
|
|
|
{% if post.parent %} |
|
|
|
|
<h3>Parent</h3> |
|
|
|
|
<a href="{{ post_url }}&post_id={{ post.parent.id }}"> |
|
|
|
|
{{ post.parent.title }} |
|
|
|
|
</a> |
|
|
|
|
</p> |
|
|
|
|
{% endfor %} |
|
|
|
|
{% endif %} |
|
|
|
|
|
|
|
|
|
{% if post.children.count %} |
|
|
|
|
<h3>Children</h3> |
|
|
|
|
{% for child in post.children %} |
|
|
|
|
<p> |
|
|
|
|
<a href="{{ post_url }}&post_id={{ child.id }}"> |
|
|
|
|
{{ child.title }} |
|
|
|
|
</a> |
|
|
|
|
</p> |
|
|
|
|
{% endfor %} |
|
|
|
|
{% endif %} |
|
|
|
|
|
|
|
|
|
{% if related_posts %} |
|
|
|
|
<h3>Related</h3> |
|
|
|
|
{% for post in related_posts %} |
|
|
|
|
<p> |
|
|
|
|
<a href="{{ post_url }}&post_id={{ post.id }}"> |
|
|
|
|
{{ post.title }} |
|
|
|
|
</a> |
|
|
|
|
</p> |
|
|
|
|
{% endfor %} |
|
|
|
|
{% endif %} |
|
|
|
|
{% endif %} |
|
|
|
|
{% endif %} |
|
|
|
|
{% endmacro %} |
|
|
|
|
@ -55,4 +71,4 @@ |
|
|
|
|
{{ back_link }} |
|
|
|
|
</div> |
|
|
|
|
<h1>Care detail view</h1> |
|
|
|
|
{{ template.post_template(post, information_icon, post_url, current_url) }} |
|
|
|
|
{{ template.post_template('all', post, information_icon, post_url, current_url, related_posts) }} |