2021-10-28 04:39:34 +09:00
|
|
|
{% block note_actions %}
|
|
|
|
{% if app.user or note_actions_hide is defined %}
|
2022-02-08 10:26:25 +09:00
|
|
|
<menu class="note-actions">
|
2022-01-18 01:32:41 +09:00
|
|
|
<li class="note-actions-extra">
|
|
|
|
<details class="note-actions-extra-details">
|
|
|
|
<summary>
|
2022-01-27 09:54:27 +09:00
|
|
|
{{ icon('kebab', 'icon icon-note-actions-extra') | raw }}
|
2022-01-18 01:32:41 +09:00
|
|
|
</summary>
|
2022-01-27 09:54:27 +09:00
|
|
|
<menu>
|
2022-03-01 20:27:19 +09:00
|
|
|
<a href="{{ note.getUrl() }}">{% trans %}Permalink{% endtrans %}</a>
|
2022-01-18 01:32:41 +09:00
|
|
|
<hr>
|
|
|
|
{% for current_action in get_extra_note_actions(note) %}
|
2022-02-07 06:37:04 +09:00
|
|
|
<a class="{{ current_action["classes"] }}" href="{{ current_action["url"] }}">{{ current_action['title'] }}</a>
|
2022-01-18 01:32:41 +09:00
|
|
|
{% endfor %}
|
2022-01-27 09:54:27 +09:00
|
|
|
</menu>
|
2022-01-18 01:32:41 +09:00
|
|
|
</details>
|
|
|
|
</li>
|
|
|
|
{% for current_action in get_note_actions(note) %}
|
2022-01-27 09:54:27 +09:00
|
|
|
<li><a title="{{ current_action["title"] | trans }}" class="{{ current_action["classes"] }}" href="{{ current_action["url"] }}"></a></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_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"
|
2022-03-01 20:27:19 +09:00
|
|
|
title="{% trans %}Attachments for this note{% endtrans %}">
|
2021-10-28 04:39:34 +09:00
|
|
|
{% for attachment in note.getAttachments() %}
|
2022-02-07 06:37:04 +09:00
|
|
|
{% include 'cards/blocks/attachment.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 %}
|
2022-03-01 20:27:19 +09:00
|
|
|
<div class="note-links" title="{% trans %}Shared links{% endtrans %}">
|
2021-10-28 04:39:34 +09:00
|
|
|
{% 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"
|
2022-03-01 20:27:19 +09:00
|
|
|
title="{% trans %}Main note content{% endtrans %}">
|
2022-02-05 01:03:49 +09:00
|
|
|
{% set paragraph_array = note.getRenderedSplit() %}
|
2022-02-16 12:01:25 +09:00
|
|
|
{% for paragraph in paragraph_array %}
|
|
|
|
<p>{{ paragraph | raw }}</p>
|
|
|
|
{% endfor %}
|
2021-10-28 04:39:34 +09:00
|
|
|
</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" #}
|
2022-02-15 20:35:48 +09:00
|
|
|
<a href="{{ actor_url }}" class="note-author-url u-url"
|
2022-03-01 20:27:19 +09:00
|
|
|
title="{% trans %}%nickname's profile{% endtrans %}">
|
2022-02-10 03:49:34 +09:00
|
|
|
{% if fullname is not null %}{{ fullname }}{% else %}{{ nickname }}{% endif %}
|
2021-12-27 13:13:09 +09:00
|
|
|
</a>
|
2021-12-27 00:55:49 +09:00
|
|
|
|
2022-03-01 20:27:19 +09:00
|
|
|
<small class="note-author-uri" title="{% trans %}Author related permalinks{% endtrans %}">
|
|
|
|
<a href="{{ actor_uri }}" class="u-url" title="{% trans %}%nickname%'s permalink {% endtrans %}">{{ 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 %}
|
2022-03-01 20:27:19 +09:00
|
|
|
<aside class="note-sidebar" title="{% trans %}%nickname%'s avatar{% endtrans %}">
|
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() }}"
|
2022-03-01 20:27:19 +09:00
|
|
|
alt="{% trans %}%nickname%'s avatar{% endtrans %}"
|
2021-12-31 02:33:51 +09:00
|
|
|
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-03-01 20:27:19 +09:00
|
|
|
<header class="note-info" title="{% trans %}Information about note's author{% endtrans %}">
|
2022-01-17 11:51:20 +09:00
|
|
|
{{ block('note_author') }}
|
2022-03-01 20:27:19 +09:00
|
|
|
<small class="note-conversation-info" title="{% trans %}Conversation related permalinks{% endtrans %}">
|
2022-02-28 21:43:40 +09:00
|
|
|
<a href="{{ note.getConversationUrl() ~ '#' ~ note_anchor }}"
|
2022-03-01 20:27:19 +09:00
|
|
|
title="{% trans %}Conversation's permalink{% endtrans %}"
|
|
|
|
class="note-conversation-url">{% trans %}in conversation{% endtrans %}</a>
|
2022-01-17 11:51:20 +09:00
|
|
|
<a href="{{ note.getUrl() }}"
|
2022-03-01 20:27:19 +09:00
|
|
|
title="{% trans %}Note's permalink{% endtrans %}"
|
2022-01-17 11:51:20 +09:00
|
|
|
class="note-url">{{ note.getModified() | ago }}</a>
|
|
|
|
</small>
|
2022-02-10 03:49:34 +09:00
|
|
|
</header>
|
2021-12-09 07:46:00 +09:00
|
|
|
{% endblock note_info %}
|
|
|
|
|
2022-02-28 21:43:40 +09:00
|
|
|
{% block note_context %}
|
2022-03-14 03:23:19 +09:00
|
|
|
{% set attentions = note.getAttentionTargets() %}
|
|
|
|
{% if attentions is not empty %}
|
|
|
|
{% for target in attentions %}
|
2022-02-28 21:43:40 +09:00
|
|
|
{% if target.isGroup() %}
|
|
|
|
<em tabindex="0"
|
|
|
|
class="note-replies-parent"
|
2022-03-01 20:27:19 +09:00
|
|
|
title="{% trans %}The group in which this note was addressed to{% endtrans %}">
|
|
|
|
{% set mentionAnchor %}<a href="{{ target.getUrl() }}">{{ mention(target) | raw }}</a>{% endset %}
|
|
|
|
{% trans %}in %mentionAnchor%{% endtrans %}
|
2022-02-28 21:43:40 +09:00
|
|
|
</em>
|
|
|
|
{% else %}
|
|
|
|
<em tabindex="0"
|
|
|
|
class="note-replies-parent"
|
2022-03-14 03:23:19 +09:00
|
|
|
title="{% trans %}The recipient to whom this note was addressed to{% endtrans %}">
|
2022-03-01 20:27:19 +09:00
|
|
|
{% set mentionAnchor %}<a href="{{ target.getUrl() }}">{{ mention(target) | raw }}</a>{% endset %}
|
2022-03-14 03:23:19 +09:00
|
|
|
{% trans %}to %mentionAnchor%{% endtrans %}
|
2022-02-28 21:43:40 +09:00
|
|
|
</em>
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
2022-03-14 03:23:19 +09:00
|
|
|
{% set reply_to = note.getReplyTo() %}
|
|
|
|
{% if reply_to is not empty %}
|
|
|
|
<em tabindex="0"
|
|
|
|
class="note-replies-parent"
|
|
|
|
title="{% trans %}Whom this is a reply to{% endtrans %}"
|
|
|
|
aria-flowto="note-anchor-{{ reply_to }}">
|
|
|
|
{% set replyAnchor %}<a href="{{ note.getConversationUrl() ~ "#note-anchor-" ~ reply_to }}">{% endset %}
|
|
|
|
{% set target = note.getActor() %}
|
|
|
|
{% set mentionAnchor %}<a href="{{ target.getUrl() }}">{{ mention(target) | raw }}</a>{% endset %}
|
|
|
|
{% trans %}%replyAnchor% in reply to %mentionAnchor%{% endtrans %}
|
|
|
|
</em>
|
|
|
|
{% endif %}
|
2022-02-28 21:43:40 +09:00
|
|
|
{% endblock note_context %}
|
|
|
|
|
2022-02-09 01:13:46 +09:00
|
|
|
{% block note_complementary %}
|
2022-02-15 20:35:48 +09:00
|
|
|
{% set complementary_info_array = handle_event('AppendCardNote', { 'note': note, 'request': app.request }) %}
|
2022-02-25 04:04:14 +09:00
|
|
|
|
|
|
|
{% if app.user is not null or complementary_info_array is not empty %}
|
|
|
|
<aside
|
2022-03-01 20:27:19 +09:00
|
|
|
title="{% trans %}Additional note context information and actions{% endtrans %}"
|
|
|
|
class="note-complementary">
|
2022-02-25 04:04:14 +09:00
|
|
|
{% if complementary_info_array is not empty %}
|
|
|
|
<div class="note-complementary-info">
|
2022-03-01 22:13:55 +09:00
|
|
|
{% for complementary_info in complementary_info_array %}
|
|
|
|
{% set formatted = [] %}
|
2022-03-02 02:58:53 +09:00
|
|
|
{% for complementary_info_actor in complementary_info['actors'] %}
|
|
|
|
{% if complementary_info_actor is defined and (app.user is null or complementary_info_actor.getId() != app.user.getId()) %}
|
|
|
|
{% set tmp %}<a href="{{ complementary_info_actor.getUrl() }}">{{ complementary_info_actor.getNickname() }}</a>{% endset %}
|
|
|
|
{% set formatted = formatted|merge([tmp]) %}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
{% if formatted is not empty %}
|
2022-03-01 22:13:55 +09:00
|
|
|
<span>
|
|
|
|
{{ trans(
|
2022-03-02 02:58:53 +09:00
|
|
|
[
|
|
|
|
"{formatted} has {action} this note",
|
|
|
|
"{formatted} have {action} this note"
|
|
|
|
],
|
2022-03-01 22:13:55 +09:00
|
|
|
{
|
|
|
|
'count': formatted|length,
|
|
|
|
'formatted': trans_list(formatted),
|
|
|
|
'action': complementary_info['action']
|
|
|
|
}
|
|
|
|
) | raw }}
|
|
|
|
</span>
|
2022-02-09 00:19:33 +09:00
|
|
|
{% endif %}
|
2022-03-01 22:13:55 +09:00
|
|
|
{% endfor %}
|
2022-02-25 04:04:14 +09:00
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{{ block('note_actions', 'cards/blocks/note.html.twig') }}
|
|
|
|
</aside>
|
2022-02-15 20:35:48 +09:00
|
|
|
{% endif %}
|
2022-03-01 20:27:19 +09:00
|
|
|
{% endblock note_complementary %}
|