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

120 lines
4.5 KiB
Twig
Raw Normal View History

{% block note_actions %}
{% if app.user or note_actions_hide is defined %}
<div class="note-actions">
{% for current_action in get_note_actions(note) %}
<a class="{{ current_action["classes"] }}" href="{{ current_action["url"] }}"></a>
{% endfor %}
</div>
{% endif %}
{% endblock note_actions %}
{% block note_reply_to %}
{% set reply_to = note.getReplyToNickname()%}
{% if reply_to is not null %}
{% trans with {'%name%': reply_to} %} in reply to %name% {% endtrans %}
{% endif %}
{% endblock note_reply_to %}
{% block note_replies %}
{% if replies is defined and replies is not empty %}
<div class="u-in-reply-to replies" tabindex="0" title="{{ 'Begin replies to ' | trans }} {{ nickname }}'s note!">
{% for conversation in replies %}
{{ _self.macro_note(conversation['note'], conversation['replies']) }}
<hr tabindex="0" title="{{ 'End of reply' | trans }}">
{% endfor %}
</div>
{% endif %}
{% endblock note_replies %}
{% block note_attachments %}
{% if hide_attachments is not defined %}
{% if note.getAttachments() is not empty %}
<section class="note-attachments" tabindex="0" title="{{ 'Note attachments.' | trans }}">
{% for attachment in note.getAttachments() %}
{% include '/cards/attachments/view.html.twig' with {'attachment': attachment, 'note': note} only%}
{% endfor %}
</section>
{% endif %}
{% endif %}
{% endblock note_attachments %}
{% block note_links %}
{% if note.getLinks() is not empty %}
<div class="note-links" title="{{ 'Shared links.' | trans }}">
{% for link in note.getLinks() %}
{% for block in handle_event('ViewLink', {'link': link, 'note': note}) %}
{{ block | raw }}
{% endfor %}
{% endfor %}
</div>
{% endif %}
{% endblock note_links %}
{% block note_text %}
<div class="note-text" tabindex="0" title="{{ 'Note text content.' | trans }}">
{{ note.getRendered() | raw }}
</div>
{% endblock note_text %}
{% block note_author %}
{# Microformat's h-card properties indicates a face icon is a "u-logo" #}
<a href="{{ actor_url }}" class="note-author u-url">
<strong class="note-author-fullname">
{% if fullname is defined %}
{{ fullname }}
{% else %}
{{ nickname }}
{% endif %}
</strong>
<em class="note-author-nickname">{{ nickname }}</em>
</a>
{% endblock note_author %}
{% block note_sidebar %}
<aside class="note-sidebar">
<img class="u-logo avatar" src="{{ note.getActorAvatarUrl() }}" alt="{{ nickname }}'s avatar" width="32px" height="32px">
</aside>
{% endblock note_sidebar %}
{% macro macro_note(note, replies) %}
{% set nickname = note.getActorNickname() %}
{% set fullname = note.getActorFullname() %}
{% set actor_url = note.getActor().getUrl() %}
<article class="h-entry hentry note">
{{ block('note_sidebar') }}
<div class="note-wrapper">
<div tabindex="0" title="{{ 'Begin a note by the user: ' | trans }} {{ nickname }}." class="note-info">
{{ block('note_author') }}
{{ block('note_reply_to') }}
{{ block('note_actions') }}
</div>
<section tabindex="0" role="dialog" class="e-content entry-content note-content">
{{ block('note_text') }}
{{ block('note_attachments') }}
{{ block('note_links') }}
</section>
{{ block('note_replies') }}
</div>
</article>
{% endmacro macro_note %}
{% macro macro_note_minimal(note) %}
{% set nickname = note.getActorNickname() %}
{% set fullname = note.getActorFullname() %}
{% set actor_url = note.getActor().getUrl() %}
<article class="h-entry hentry note">
{{ block('note_sidebar') }}
<div class="note-wrapper">
<div tabindex="0" title="{{ 'Begin a note by the user: ' | trans }} {{ nickname }}." class="note-info">
{{ block('note_author') }}
</div>
<section tabindex="0" role="dialog" class="e-content entry-content note-content">
{{ block('note_text') }}
{{ block('note_attachments') }}
{{ block('note_links') }}
</section>
</div>
</article>
{% endmacro macro_note_minimal %}