1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- {% macro post_template(type, post, information_icon, post_url, current_url, related_posts) %}
- {% if post %}
- <h2>{{ post.title }}</h2>
- <p>{{ post.content }}</p>
- <p>{{ post.createdAt |date('d/m/Y') }}</p>
- {% if post.private %}
- <p><span class="label label-warning">Private</span></p>
- {% endif %}
- <p>{{ post.insertUser.completeName }}</p>
- {% if post.tags %}
- {% for tag in post.tags %}
- {{ tag }}
- {% if not loop.last %}
- ,
- {% endif %}
- {% endfor %}
- {% endif %}
- {% set countElements = post.hasParent + post.children.count %}
- {% if countElements %}
- <a href="{{ post_url }}&post_id={{ post.id }}">
- {% if countElements > 1 %}
- {{ information_icon }} + {{ countElements }}
- {% else %}
- {{ information_icon }}
- {% endif %}
- </a>
- {% endif %}
- {% if type == 'all' %}
- {% 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 }}
- </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 %}
- {% import _self as template %}
- <div class="actions">
- {{ back_link }}
- </div>
- <h1>Care detail view</h1>
- {{ template.post_template('all', post, information_icon, post_url, current_url, related_posts) }}
|