2021-10-27 20:39:34 +01:00
|
|
|
{% block note_actions %}
|
|
|
|
{% if app.user or note_actions_hide is defined %}
|
2022-02-08 01:26:25 +00:00
|
|
|
<menu class="note-actions">
|
2022-01-17 16:32:41 +00:00
|
|
|
<li class="note-actions-extra">
|
|
|
|
<details class="note-actions-extra-details">
|
|
|
|
<summary>
|
2022-01-27 00:54:27 +00:00
|
|
|
{{ icon('kebab', 'icon icon-note-actions-extra') | raw }}
|
2022-01-17 16:32:41 +00:00
|
|
|
</summary>
|
2022-01-27 00:54:27 +00:00
|
|
|
<menu>
|
|
|
|
<a href="{{ note.getUrl() }}">{{ 'Permalink' | trans }}</a>
|
2022-01-17 16:32:41 +00:00
|
|
|
<hr>
|
|
|
|
{% for current_action in get_extra_note_actions(note) %}
|
2022-02-06 21:37:04 +00:00
|
|
|
<a class="{{ current_action["classes"] }}" href="{{ current_action["url"] }}">{{ current_action['title'] }}</a>
|
2022-01-17 16:32:41 +00:00
|
|
|
{% endfor %}
|
2022-01-27 00:54:27 +00:00
|
|
|
</menu>
|
2022-01-17 16:32:41 +00:00
|
|
|
</details>
|
|
|
|
</li>
|
|
|
|
{% for current_action in get_note_actions(note) %}
|
2022-01-27 00:54:27 +00:00
|
|
|
<li><a title="{{ current_action["title"] | trans }}" class="{{ current_action["classes"] }}" href="{{ current_action["url"] }}"></a></li>
|
2022-01-17 16:32:41 +00:00
|
|
|
{% endfor %}
|
|
|
|
</menu>
|
2021-10-27 20:39:34 +01:00
|
|
|
{% endif %}
|
|
|
|
{% endblock note_actions %}
|
2021-09-16 16:27:28 +01:00
|
|
|
|
2021-10-27 20:39:34 +01:00
|
|
|
{% block note_attachments %}
|
|
|
|
{% if hide_attachments is not defined %}
|
|
|
|
{% if note.getAttachments() is not empty %}
|
2021-12-30 17:33:51 +00:00
|
|
|
<section class="note-attachments" tabindex="0"
|
2022-02-09 18:49:34 +00:00
|
|
|
title="{{ 'Attachments for this note' | trans }}">
|
2021-10-27 20:39:34 +01:00
|
|
|
{% for attachment in note.getAttachments() %}
|
2022-02-06 21:37:04 +00:00
|
|
|
{% include 'cards/blocks/attachment.html.twig' with {'attachment': attachment, 'note': note, 'title': attachment.getBestTitle(note)} only %}
|
2021-10-27 20:39:34 +01:00
|
|
|
{% endfor %}
|
|
|
|
</section>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
{% endblock note_attachments %}
|
2021-09-17 01:36:07 +01:00
|
|
|
|
2021-10-27 20:39:34 +01: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 15:04:51 +01:00
|
|
|
</div>
|
2021-10-27 20:39:34 +01:00
|
|
|
{% endif %}
|
|
|
|
{% endblock note_links %}
|
2021-09-16 23:53:38 +01:00
|
|
|
|
2021-10-27 20:39:34 +01:00
|
|
|
{% block note_text %}
|
2021-12-30 17:33:51 +00:00
|
|
|
<div class="note-text" tabindex="0"
|
2022-02-09 18:49:34 +00:00
|
|
|
title="{{ 'Main note content' | trans }}">
|
2022-02-04 16:03:49 +00:00
|
|
|
{% set paragraph_array = note.getRenderedSplit() %}
|
2022-02-16 03:01:25 +00:00
|
|
|
{% for paragraph in paragraph_array %}
|
|
|
|
<p>{{ paragraph | raw }}</p>
|
|
|
|
{% endfor %}
|
2021-10-27 20:39:34 +01:00
|
|
|
</div>
|
|
|
|
{% endblock note_text %}
|
2021-08-11 02:49:23 +01:00
|
|
|
|
2021-10-27 20:39:34 +01:00
|
|
|
{% block note_author %}
|
|
|
|
{# Microformat's h-card properties indicates a face icon is a "u-logo" #}
|
2022-02-15 11:35:48 +00:00
|
|
|
<a href="{{ actor_url }}" class="note-author-url u-url"
|
|
|
|
title="{{ nickname }}{{ '\'s profile' | trans }}">
|
2022-02-09 18:49:34 +00:00
|
|
|
{% if fullname is not null %}{{ fullname }}{% else %}{{ nickname }}{% endif %}
|
2021-12-27 04:13:09 +00:00
|
|
|
</a>
|
2021-12-26 15:55:49 +00:00
|
|
|
|
2022-02-09 18:49:34 +00:00
|
|
|
<small class="note-author-uri" title="{{ 'Author related permalinks' | trans }}">
|
2022-02-13 22:31:04 +00:00
|
|
|
<a href="{{ actor_uri }}" class="u-url" title="{% trans %} %nickname%'s permalink {% endtrans %}">{{ mention }}</a>
|
2021-12-26 15:55:49 +00:00
|
|
|
</small>
|
2021-10-27 20:39:34 +01:00
|
|
|
{% endblock note_author %}
|
2021-09-17 01:08:24 +01:00
|
|
|
|
2021-10-27 20:39:34 +01:00
|
|
|
{% block note_sidebar %}
|
2022-02-09 18:49:34 +00:00
|
|
|
<aside class="note-sidebar" title="{{ nickname }} {{ 'avatar' | trans }}">
|
2021-12-26 23:56:50 +00:00
|
|
|
{% set actor_avatar_dimensions = actor.getAvatarDimensions() %}
|
2021-12-30 17:33:51 +00: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-27 20:39:34 +01:00
|
|
|
</aside>
|
|
|
|
{% endblock note_sidebar %}
|
2021-09-17 01:08:24 +01:00
|
|
|
|
2021-12-08 22:46:00 +00:00
|
|
|
{% block note_info %}
|
2022-02-09 18:49:34 +00:00
|
|
|
<header class="note-info" title="{{ 'Information about note\'s author' | trans }}">
|
2022-01-17 02:51:20 +00:00
|
|
|
{{ block('note_author') }}
|
2022-02-09 18:49:34 +00:00
|
|
|
<small class="note-conversation-info" title="{{ 'Conversation related permalinks' | trans }}">
|
2022-02-28 12:43:40 +00:00
|
|
|
<a href="{{ note.getConversationUrl() ~ '#' ~ note_anchor }}"
|
2022-02-09 18:49:34 +00:00
|
|
|
title="{{ 'Conversation\'s permalink' | trans }}"
|
2022-01-17 02:51:20 +00:00
|
|
|
class="note-conversation-url">{{ 'in conversation' | trans }}</a>
|
|
|
|
<a href="{{ note.getUrl() }}"
|
2022-02-09 18:49:34 +00:00
|
|
|
title="{{ 'Note\'s permalink' | trans }}"
|
2022-01-17 02:51:20 +00:00
|
|
|
class="note-url">{{ note.getModified() | ago }}</a>
|
|
|
|
</small>
|
2022-02-09 18:49:34 +00:00
|
|
|
</header>
|
2021-12-08 22:46:00 +00:00
|
|
|
{% endblock note_info %}
|
|
|
|
|
2022-02-28 12:43:40 +00:00
|
|
|
{% block note_context %}
|
|
|
|
{% set notification_targets = note.getNotificationTargets() %}
|
|
|
|
{% if notification_targets is not empty %}
|
|
|
|
{% for target in notification_targets %}
|
|
|
|
{% if target.isGroup() %}
|
|
|
|
<em tabindex="0"
|
|
|
|
class="note-replies-parent"
|
|
|
|
title="{{'The group in which this note was addressed to' | trans}}">
|
|
|
|
{{'in ' | trans}}
|
|
|
|
<a href="{{ target.getUrl() }}">{{ mention(target) | raw }}</a>
|
|
|
|
</em>
|
|
|
|
{% else %}
|
|
|
|
<em tabindex="0"
|
|
|
|
class="note-replies-parent"
|
|
|
|
title="{{'Whom this is a reply to' | trans}}"
|
|
|
|
aria-flowto="note-anchor-{{ note.getReplyTo() }}">
|
|
|
|
<a href="{{ note.getConversationUrl() ~ '#note-anchor-' ~ note.getReplyTo() }}">{{'in reply to' | trans}}</a>
|
|
|
|
<a href="{{ target.getUrl() }}">{{ mention(target) | raw }}</a>
|
|
|
|
</em>
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
{% endblock note_context %}
|
|
|
|
|
2022-02-08 16:13:46 +00:00
|
|
|
{% block note_complementary %}
|
2022-02-15 11:35:48 +00:00
|
|
|
{% set complementary_info_array = handle_event('AppendCardNote', { 'note': note, 'request': app.request }) %}
|
2022-02-24 19:04:14 +00:00
|
|
|
|
|
|
|
{% if app.user is not null or complementary_info_array is not empty %}
|
|
|
|
<aside
|
2022-02-09 18:49:34 +00:00
|
|
|
title="{{ 'Additional note context information and actions' | trans }}"
|
2022-02-15 11:35:48 +00:00
|
|
|
class="note-complementary">
|
2022-02-24 19:04:14 +00:00
|
|
|
{% if complementary_info_array is not empty %}
|
|
|
|
<div class="note-complementary-info">
|
|
|
|
{% for complementary_info in complementary_info_array %}
|
|
|
|
{% set actor_count = complementary_info['actors'] | length %}
|
|
|
|
{% set counter = 0 %}
|
|
|
|
<span>
|
|
|
|
{% for complementary_info_actor in complementary_info['actors'] %}
|
|
|
|
{% if app.user is not null %}
|
|
|
|
{% if complementary_info_actor is defined and complementary_info_actor.getNickname() != app.user.nickname %}
|
|
|
|
<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 %}
|
|
|
|
|
|
|
|
{% set counter = counter + 1 %}
|
|
|
|
{% endif %}
|
|
|
|
{% else %}
|
|
|
|
{% 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 %}
|
|
|
|
{% set counter = counter + 1 %}
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
{% if complementary_info['action'] is defined and not null and counter > 0 %}
|
|
|
|
{% if counter > 1 %}{{ ' have ' | trans }}
|
|
|
|
{% else %}{{ ' has ' | trans }}
|
|
|
|
{% endif %}{{ complementary_info['action'] ~ ' this note' | trans }}
|
2022-02-08 15:19:33 +00:00
|
|
|
{% endif %}
|
2022-02-24 19:04:14 +00:00
|
|
|
</span>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{{ block('note_actions', 'cards/blocks/note.html.twig') }}
|
|
|
|
</aside>
|
2022-02-15 11:35:48 +00:00
|
|
|
{% endif %}
|
2022-02-08 16:13:46 +00:00
|
|
|
{% endblock note_complementary %}
|