2021-10-28 04:39:34 +09:00
|
|
|
{% block note_actions %}
|
|
|
|
{% if app.user or note_actions_hide is defined %}
|
2022-01-18 01:32:41 +09:00
|
|
|
<menu class="note-actions note-info-end">
|
|
|
|
<li class="note-actions-extra">
|
|
|
|
<details class="note-actions-extra-details">
|
|
|
|
<summary>
|
|
|
|
{{ icon('kebab', 'icon icon-note-actions-extra') | raw }} {# button-container #}
|
|
|
|
</summary>
|
|
|
|
<ul>
|
|
|
|
<li>
|
|
|
|
<a href="{{ note.getUrl() }}">{{ 'Permalink' | trans }}</a>
|
|
|
|
</li>
|
|
|
|
<hr>
|
|
|
|
{% for current_action in get_extra_note_actions(note) %}
|
2021-12-27 02:37:35 +09:00
|
|
|
<li>
|
2022-01-18 01:32:41 +09:00
|
|
|
<a class="{{ current_action["classes"] }}"
|
|
|
|
href="{{ current_action["url"] }}">{{ current_action['title'] }}</a>
|
2021-12-27 02:37:35 +09:00
|
|
|
</li>
|
2022-01-18 01:32:41 +09:00
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
</details>
|
|
|
|
</li>
|
|
|
|
<span class="note-actions-separator"></span>
|
|
|
|
{% for current_action in get_note_actions(note) %}
|
|
|
|
<li>
|
|
|
|
<a title="{{ current_action["title"] | trans }}"
|
|
|
|
class="{{ current_action["classes"] }}"
|
|
|
|
href="{{ current_action["url"] }}"></a>
|
2021-12-07 05:35:44 +09:00
|
|
|
</li>
|
2022-01-18 01:32:41 +09:00
|
|
|
{% endfor %}
|
|
|
|
</menu>
|
2021-10-28 04:39:34 +09:00
|
|
|
{% endif %}
|
|
|
|
{% endblock note_actions %}
|
2021-09-17 00:27:28 +09:00
|
|
|
|
2021-10-28 04:39:34 +09:00
|
|
|
{% block note_replies %}
|
|
|
|
{% if replies is defined and replies is not empty %}
|
2022-01-01 02:02:18 +09:00
|
|
|
<div class="u-in-reply-to replies">
|
2022-01-18 01:32:41 +09:00
|
|
|
<span class="note-replies-start"
|
|
|
|
tabindex="0">{{ 'Replies to ' | trans }}{{ nickname }}{{ '\'s note' | trans }}</span>
|
2021-10-28 04:39:34 +09:00
|
|
|
{% 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 %}
|
2021-09-17 07:53:38 +09:00
|
|
|
|
2021-10-28 04:39:34 +09:00
|
|
|
{% block note_attachments %}
|
|
|
|
{% if hide_attachments is not defined %}
|
|
|
|
{% if note.getAttachments() is not empty %}
|
2021-12-31 02:33:51 +09:00
|
|
|
<section class="note-attachments" tabindex="0"
|
|
|
|
title="{{ 'Note attachments.' | trans }}">
|
2021-10-28 04:39:34 +09:00
|
|
|
{% for attachment in note.getAttachments() %}
|
2021-12-31 02:33:51 +09:00
|
|
|
{% include '/cards/attachments/view.html.twig' with {'attachment': attachment, 'note': note, 'title': attachment.getBestTitle(note)} only %}
|
2021-10-28 04:39:34 +09:00
|
|
|
{% endfor %}
|
|
|
|
</section>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
{% endblock note_attachments %}
|
2021-09-17 09:36:07 +09:00
|
|
|
|
2021-10-28 04:39:34 +09:00
|
|
|
{% 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 %}
|
2021-08-14 23:04:51 +09:00
|
|
|
</div>
|
2021-10-28 04:39:34 +09:00
|
|
|
{% endif %}
|
|
|
|
{% endblock note_links %}
|
2021-09-17 07:53:38 +09:00
|
|
|
|
2021-10-28 04:39:34 +09:00
|
|
|
{% block note_text %}
|
2021-12-31 02:33:51 +09:00
|
|
|
<div class="note-text" tabindex="0"
|
|
|
|
title="{{ 'Note text content.' | trans }}">
|
2021-10-28 04:39:34 +09:00
|
|
|
{{ note.getRendered() | raw }}
|
|
|
|
</div>
|
|
|
|
{% endblock note_text %}
|
2021-08-11 10:49:23 +09:00
|
|
|
|
2021-10-28 04:39:34 +09:00
|
|
|
{% block note_author %}
|
|
|
|
{# Microformat's h-card properties indicates a face icon is a "u-logo" #}
|
2021-12-27 13:13:09 +09:00
|
|
|
<a href="{{ actor_url }}">
|
2021-12-31 02:33:51 +09:00
|
|
|
<header class="note-author-fullname" tabindex="0"
|
|
|
|
title="{{ 'Begin a note by the user: ' | trans }} {{ nickname }}">
|
|
|
|
{% if fullname is not null %}
|
|
|
|
{{ fullname }}
|
|
|
|
{% else %}
|
|
|
|
{{ nickname }}
|
|
|
|
{% endif %}
|
|
|
|
</header>
|
2021-12-27 13:13:09 +09:00
|
|
|
</a>
|
2021-12-27 00:55:49 +09:00
|
|
|
|
|
|
|
<small class="note-author-nickname">
|
2021-12-31 02:33:51 +09:00
|
|
|
<a href="{{ actor_uri }}"
|
|
|
|
class="note-author-url u-url">{{ mention }}</a>
|
2021-12-27 00:55:49 +09:00
|
|
|
</small>
|
2021-10-28 04:39:34 +09:00
|
|
|
{% endblock note_author %}
|
2021-09-17 09:08:24 +09:00
|
|
|
|
2021-10-28 04:39:34 +09:00
|
|
|
{% block note_sidebar %}
|
|
|
|
<aside class="note-sidebar">
|
2021-12-27 08:56:50 +09:00
|
|
|
{% set actor_avatar_dimensions = actor.getAvatarDimensions() %}
|
2021-12-31 02:33:51 +09:00
|
|
|
<img class="u-logo avatar" src="{{ note.getActorAvatarUrl() }}"
|
|
|
|
alt="{{ nickname }}'s avatar"
|
|
|
|
width="{{ actor_avatar_dimensions['width'] }}"
|
|
|
|
height="{{ actor_avatar_dimensions['height'] }}">
|
2021-10-28 04:39:34 +09:00
|
|
|
</aside>
|
|
|
|
{% endblock note_sidebar %}
|
2021-09-17 09:08:24 +09:00
|
|
|
|
2021-12-09 07:46:00 +09:00
|
|
|
{% block note_info %}
|
2022-01-17 11:51:20 +09:00
|
|
|
<div class="note-info-start">
|
|
|
|
{{ block('note_author') }}
|
|
|
|
<small class="note-conversation-info">
|
|
|
|
<a href="{{ note.getConversationUrl() }}"
|
|
|
|
class="note-conversation-url">{{ 'in conversation' | trans }}</a>
|
|
|
|
<a href="{{ note.getUrl() }}"
|
|
|
|
class="note-url">{{ note.getModified() | ago }}</a>
|
|
|
|
</small>
|
2021-12-09 07:46:00 +09:00
|
|
|
</div>
|
|
|
|
{% endblock note_info %}
|
|
|
|
|
2021-12-31 02:33:51 +09:00
|
|
|
{% block note_complementary_info %}
|
|
|
|
{% for complementary_info in handle_event('AppendCardNote', {'note': note }) %}
|
|
|
|
<aside title="{{ 'Note\'s complementary information' | trans }}"
|
|
|
|
class="note-complementary">
|
|
|
|
{% set actor_count = complementary_info['actors'] | length %}
|
|
|
|
{% set counter = 0 %}
|
|
|
|
{% for complementary_info_actor in complementary_info['actors'] %}
|
|
|
|
{% if complementary_info_actor is defined %}
|
|
|
|
<a href="{{ complementary_info_actor.getUrl() }}">{{ complementary_info_actor.getNickname() }}{% if actor_count > 1 and counter < actor_count - 2 %}{{ ', ' | trans }}{% endif %}</a>
|
|
|
|
{% if counter == actor_count - 2 %}
|
|
|
|
{{ ' and ' | trans }}
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
{% set counter = counter + 1 %}
|
|
|
|
{% endfor %}
|
|
|
|
{% if complementary_info['action'] is defined and not null %}
|
|
|
|
{% if counter > 1 %}
|
|
|
|
{{ ' have ' | trans }}
|
|
|
|
{% else %}
|
|
|
|
{{ ' has ' | trans }}
|
|
|
|
{% endif %}
|
|
|
|
{{ complementary_info['action'] ~ ' this note' | trans }}
|
|
|
|
{% endif %}
|
|
|
|
</aside>
|
|
|
|
{% endfor %}
|
|
|
|
{% endblock note_complementary_info %}
|
|
|
|
|
2021-10-28 04:39:34 +09:00
|
|
|
{% macro macro_note(note, replies) %}
|
2021-11-07 10:32:06 +09:00
|
|
|
{% set actor = note.getActor() %}
|
2021-12-27 08:56:50 +09:00
|
|
|
{% set nickname = actor.getNickname() %}
|
|
|
|
{% set fullname = actor.getFullname() %}
|
2021-12-27 13:13:09 +09:00
|
|
|
{% set actor_uri = actor.getUri() %}
|
2021-11-07 10:32:06 +09:00
|
|
|
{% set actor_url = actor.getUrl() %}
|
2021-12-27 13:13:09 +09:00
|
|
|
{% set mention = mention(actor) %}
|
2021-12-03 00:05:23 +09:00
|
|
|
{% set note_language = note.getNoteLanguageShortDisplay() %}
|
2021-10-28 04:39:34 +09:00
|
|
|
|
2021-12-31 03:34:07 +09:00
|
|
|
<article id="{{ 'note-anchor-' ~ note.getId() }}"
|
|
|
|
class="h-entry hentry note" lang={{ note.getLanguageLocale() }}>
|
2021-10-28 04:39:34 +09:00
|
|
|
{{ block('note_sidebar') }}
|
|
|
|
<div class="note-wrapper">
|
2022-01-18 01:32:41 +09:00
|
|
|
<header class="note-info">
|
2022-01-17 11:51:20 +09:00
|
|
|
{{ block('note_info') }}
|
|
|
|
{{ block('note_actions') }}
|
2022-01-18 01:32:41 +09:00
|
|
|
</header>
|
2021-11-07 10:32:06 +09:00
|
|
|
|
2021-12-09 07:46:00 +09:00
|
|
|
<section role="dialog" class="e-content entry-content note-content">
|
2021-10-28 04:39:34 +09:00
|
|
|
{{ block('note_text') }}
|
|
|
|
{{ block('note_attachments') }}
|
|
|
|
{{ block('note_links') }}
|
|
|
|
</section>
|
2021-11-07 10:32:06 +09:00
|
|
|
|
2021-12-08 01:17:49 +09:00
|
|
|
{{ block('note_replies') }}
|
2021-12-31 02:33:51 +09:00
|
|
|
{{ block('note_complementary_info') }}
|
2021-10-28 04:39:34 +09:00
|
|
|
</div>
|
|
|
|
</article>
|
|
|
|
{% endmacro macro_note %}
|
2021-09-17 09:08:24 +09:00
|
|
|
|
2021-10-28 04:39:34 +09:00
|
|
|
{% macro macro_note_minimal(note) %}
|
2021-12-27 08:56:50 +09:00
|
|
|
{% set actor = note.getActor() %}
|
|
|
|
{% set nickname = actor.getNickname() %}
|
|
|
|
{% set fullname = actor.getFullname() %}
|
2021-12-27 13:13:09 +09:00
|
|
|
{% set actor_uri = actor.getUri() %}
|
2021-12-27 08:56:50 +09:00
|
|
|
{% set actor_url = actor.getUrl() %}
|
2021-12-27 13:13:09 +09:00
|
|
|
{% set mention = mention(actor) %}
|
2021-09-17 07:53:38 +09:00
|
|
|
|
2021-12-27 13:22:38 +09:00
|
|
|
<article class="h-entry hentry note" lang={{ note.getLanguageLocale() }}>
|
2021-10-28 04:39:34 +09:00
|
|
|
{{ block('note_sidebar') }}
|
|
|
|
<div class="note-wrapper">
|
2022-01-18 01:32:41 +09:00
|
|
|
<header class="note-info">
|
2022-01-17 11:51:20 +09:00
|
|
|
{{ block('note_info') }}
|
2022-01-18 01:32:41 +09:00
|
|
|
</header>
|
2021-12-27 13:22:38 +09:00
|
|
|
|
|
|
|
<section role="dialog" class="e-content entry-content note-content">
|
2021-10-28 04:39:34 +09:00
|
|
|
{{ block('note_text') }}
|
|
|
|
</section>
|
|
|
|
</div>
|
|
|
|
</article>
|
2021-11-26 20:59:11 +09:00
|
|
|
{% endmacro macro_note_minimal %}
|