gnu-social/templates/cards/macros/note/types.html.twig

91 lines
3.6 KiB
Twig

{# args: { 'type': { 'vanilla_full' }, 'note': note, ?'replies': { note, ?replies }, ?'extra': { 'foo': bar } #}
{% macro vanilla_full(args) %}
{% set note = args.note %}
{% set actor = note.getActor() %}
{% set nickname = actor.getNickname() %}
{% set fullname = actor.getFullname() %}
{% set actor_uri = actor.getUri() %}
{% set actor_url = actor.getUrl() %}
{% set mention = mention(actor) %}
{% set note_language = note.getNoteLanguageShortDisplay() %}
{% set note_anchor = 'note-anchor-' ~ note.getId() %}
<article
tabindex="0"
title="{% trans %}A note by actor %nickname%{% endtrans %}"
id="{{ 'note-anchor-' ~ note.getId() }}"
class="h-entry hentry note"
lang="{{ note.getLanguageLocale() }}">
{{ block('note_sidebar', 'cards/blocks/note.html.twig') }}
<div class="note-wrapper">
{{ block('note_info', 'cards/blocks/note.html.twig') }}
<section class="e-content entry-content note-content" title="{% trans %}Note's main content{% endtrans %}">
{{ block('note_context', 'cards/blocks/note.html.twig') }}
{{ block('note_text', 'cards/blocks/note.html.twig') }}
{{ block('note_attachments', 'cards/blocks/note.html.twig') }}
{{ block('note_links', 'cards/blocks/note.html.twig') }}
</section>
</div>
{{ block('note_complementary', 'cards/blocks/note.html.twig') }}
</article>
{% set additional_blocks = handle_event('AppendNoteBlock', app.request, args) %}
{% for block in additional_blocks %}
{{ block | raw }}
{% endfor %}
{% endmacro vanilla_full %}
{# args: { 'type': { 'vanilla_compact' }, 'note': note, ?'extra': { 'foo': bar } } #}
{% macro vanilla_compact(args) %}
{% set note = args.note %}
{% if args.extra is defined %}{% set extra = args.extra %}{% else %}{% set extra = null %}{% endif %}
{% set actor = note.getActor() %}
{% set nickname = actor.getNickname() %}
{% set fullname = actor.getFullname() %}
{% set actor_uri = actor.getUri() %}
{% set actor_url = actor.getUrl() %}
{% set mention = mention(actor) %}
<article
tabindex="0"
title="{% trans %}A note by actor %nickname%{% endtrans %}"
id="{{ 'note-compact-anchor-' ~ note.getId() }}"
class="h-entry hentry note"
lang="{{ note.getLanguageLocale() }}">
<div class="note-wrapper">
<header class="note-info">
{{ block('note_sidebar', 'cards/blocks/note.html.twig') }}
{{ block('note_author', 'cards/blocks/note.html.twig') }}
</header>
<section class="e-content entry-content note-content-compact" title="{% trans %}Note's main content{% endtrans %}">
<small class="note-conversation-info">
<a href="{{ note.getConversationUrl() }}"
class="note-conversation-url">{% trans %}in conversation{% endtrans %}</a>
<a href="{{ note.getUrl() }}"
class="note-url">{{ note.getModified() | ago }}</a>
</small>
<hr>
{{ block('note_text', 'cards/blocks/note.html.twig') }}
</section>
</div>
</article>
{% endmacro vanilla_compact %}
{# args: { 'type': { 'page_full' }, 'note': note, ?'replies': { note, ?replies }, ?'extra': { 'foo': bar } #}
{% macro page_full(args) %}
TODO
{% endmacro page_full %}
{# args: { 'type': { 'page_compact' }, 'note': note, ?'extra': { 'foo': bar } } #}
{% macro page_compact(args) %}
TODO
{% endmacro page_compact %}