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

82 lines
3.8 KiB
Twig

<article class="h-entry hentry note">
<div class="note-info" role="complementary">
{% set nickname = note.getActorNickname() %}
{# TODO: this should link to the note's user profile? #}
<header class="note-author u-url" href="#" >
{# Microformat's h-card properties indicates a face icon is a "u-logo" #}
<img class="u-logo avatar" src="{{ note.getAvatarUrl() }}" alt="{{ nickname }}'s avatar" aria-hidden="true">
<label aria-roledescription={{ 'This note author nickname.' | trans }}>
{{ nickname }}
</label>
</header>
{% 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 %}
{% if app.user %}
<div class="note-actions" aria-roledescription="{{ 'Favourite, reply and recycle this note.' | trans }}">
{% if have_user %}
{% for current_action in get_note_actions(note) %}
{{ form_start(current_action) }}
{% if current_action.submit_favourite is defined %}
<span title="Favourite this note." class="button-container favourite-button-container">
{{ form_widget(current_action.submit_favourite) }}
</span>
{% endif %}
{% if current_action.submit_repeat is defined %}
<span title="Repeat this note." class="button-container repeat-button-container">
{{ form_widget(current_action.submit_repeat) }}
</span>
{% endif %}
{% if current_action.reply is defined %}
<span title="Reply to this note." class="button-container reply-button-container">
{{ form_widget(current_action.reply) }}
</span>
{% endif %}
{{ form_end(current_action) }}
{% endfor %}
{% endif %}
</div>
{% endif %}
</div>
<div class="e-content entry-content note-content" aria-roledescription="{{ 'The note content.' | trans }}">
{% 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> #}
{% if hide_attachments is not defined %}
<div class="note-attachments">
{% for attachment in note.getAttachments() %}
{% include '/attachments/view.html.twig' with {'attachment': attachment, 'note': note} only%}
{% endfor %}
</div>
{% endif %}
<div class="note-links">
{% for link in note.getLinks() %}
{% for block in handle_event('ViewLink', {'link': link, 'note': note}) %}
{{ block | raw }}
{% endfor %}
{% endfor %}
</div>
</div>
{% if replies is defined and replies is not empty %}
<div class="u-in-reply-to 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 %}
{% if reply_to is not empty %}
<hr>
{% endif %}
</article>