ai_upgrade_assistant-0.2.0-alpha2/templates/ai-upgrade-assistant-forum-topic.html.twig
templates/ai-upgrade-assistant-forum-topic.html.twig
{#
/**
* @file
* Default theme implementation for a forum topic page.
*
* Available variables:
* - topic: The forum topic object.
* - replies: Array of replies to the topic.
*
* @ingroup themeable
*/
#}
<div class="ai-upgrade-assistant-forum-topic">
<div class="topic-header">
<h2 class="topic-title">{{ topic.title }}</h2>
<div class="topic-meta">
<span class="topic-author">{{ 'By'|t }} {{ topic.author }}</span>
<span class="topic-date">{{ topic.created|date('Y-m-d H:i') }}</span>
{% if topic.tags %}
<div class="topic-tags">
{% for tag in topic.tags|json_decode %}
<span class="tag">{{ tag }}</span>
{% endfor %}
</div>
{% endif %}
</div>
</div>
<div class="topic-content">
{{ topic.content|raw }}
{% if topic.attachments %}
<div class="topic-attachments">
<h4>{{ 'Attachments'|t }}</h4>
<ul>
{% for attachment in topic.attachments|json_decode %}
<li>
<a href="{{ file_url(attachment.uri) }}">
{{ attachment.filename }}
<span class="file-size">({{ attachment.filesize|format_size }})</span>
</a>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
</div>
{% if replies %}
<div class="topic-replies">
<h3>{{ 'Replies'|t }}</h3>
{% for reply in replies %}
<div class="reply" id="reply-{{ reply.id }}">
<div class="reply-meta">
<span class="reply-author">{{ reply.author }}</span>
<span class="reply-date">{{ reply.created|date('Y-m-d H:i') }}</span>
{% if is_granted('edit ai_upgrade_assistant forum replies') and reply.uid == user.id %}
<div class="reply-actions">
<a href="{{ path('ai_upgrade_assistant.forum.reply.edit', {'reply_id': reply.id}) }}" class="button">{{ 'Edit'|t }}</a>
<a href="{{ path('ai_upgrade_assistant.forum.reply.delete', {'reply_id': reply.id}) }}" class="button button--danger">{{ 'Delete'|t }}</a>
</div>
{% endif %}
</div>
<div class="reply-content">
{{ reply.content|raw }}
{% if reply.attachments %}
<div class="reply-attachments">
<h4>{{ 'Attachments'|t }}</h4>
<ul>
{% for attachment in reply.attachments|json_decode %}
<li>
<a href="{{ file_url(attachment.uri) }}">
{{ attachment.filename }}
<span class="file-size">({{ attachment.filesize|format_size }})</span>
</a>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
</div>
</div>
{% endfor %}
</div>
{% endif %}
{% if is_granted('reply to ai_upgrade_assistant forum topics') %}
<div class="reply-form">
{{ reply_form }}
</div>
{% endif %}
</div>
