gnu-social/templates/note/view.html.twig

69 lines
2.8 KiB
Twig
Raw Normal View History

<div class="note">
<div class="note-info">
2020-09-07 06:34:36 +09:00
{% set nickname = note.getActorNickname() %}
<a href="{{ path('settings_avatar') }}">
2021-04-19 19:50:33 +09:00
<img class="avatar" src="{{ note.getAvatarUrl() }}" alt="{{ nickname }}'s avatar">
</a>
2020-09-07 06:34:36 +09:00
<b>{{ nickname }}</b>
{% set reply_to = note.getReplyToNickname() %}
{% if reply_to is not null and not skip_reply_to is defined %}
{% trans with {'%name%': reply_to}%} in reply to %name% {% endtrans %}
{% endif %}
</div>
<div class="note-content">
{% block markdown %}
{% apply markdown_to_html %}
{{ note.getContent() }}
{% endapply %}
{% endblock %}
<div class="note-other-content">
{% for other in get_note_other_content(note) %}
{% include '/'~ other.name ~ '/view.html.twig' with {'vars': other.vars} only %}
{% endfor %}
</div>
<div class="note-attachments">
{% for attachment in note.getAttachments() %}
2021-04-19 20:20:10 +09:00
{% set thumbnail_parameters = {'id': attachment.getId(), 'w': config('thumbnail','width'), 'h': config('thumbnail','height')} %}
{% if attachment.mimetype starts with 'image/' %}
<div>
<figure>
2021-04-19 20:20:10 +09:00
<img src="{{ path('attachment_thumbnail', thumbnail_parameters) }}" alt="{{ attachment.getTitle() }}">
<figcaption> <a href="{{ path('attachment_show', {'id': attachment.getId()}) }}">{{ attachment.getTitle() }}</a> </figcaption>
</figure>
</div>
{% elseif attachment.mimetype starts with 'video/' %}
<div>
2021-04-19 20:20:10 +09:00
<video src="{{ path('attachment_view', {'id': attachment.getId()}) }}" controls poster="{{ path('attachment_thumbnail') }}, thumbnail_parameters">
<i> <a href="{{ path('attachment_show', {'id': attachment.getId()}) }}">{{ attachment.getTitle() }}</a> </i>
</video>
</div>
{% else %}
{% for show in handle_event('ShowAttachment', attachment) %}
<div>
{{ show | raw }}
</div>
{% else %}
<div>
<i> <a href="{{ path('attachment_show', {'id': attachment.getId()}) }}">{{ attachment.getTitle() }}</a> </i>
</div>
{% endfor %}
{% endif %}
{% endfor %}
</div>
</div>
<div class="note-actions">
{% if have_user %}
{#{% for act in get_note_actions(note) %}#}
{#{{ form(act) }}#}
{#{% endfor %}#}
{% endif %}
</div>
{% if replies is defined %}
<div class="replies">
{% for conversation in replies %}
{% include '/note/view.html.twig' with {'note': conversation['note'], 'skip_reply_to': true, 'have_user': have_user, 'replies': conversation['replies']} only %}
{% endfor %}
</div>
{% endif %}
</div>