[CARDS][Note] Notification targets are now used as target info, instead of previous reply dependant implementation [COMPONENTS][Group] Feed title is applied to GroupFeed view

This commit is contained in:
Eliseu Amaro 2022-02-24 20:15:55 +00:00 committed by Diogo Peralta Cordeiro
parent d5731e6351
commit 26a50618b0
No known key found for this signature in database
GPG Key ID: 18D2D35001FBFAB0
5 changed files with 31 additions and 22 deletions

View File

@ -26,18 +26,19 @@ namespace Component\Group\Controller;
use App\Core\Cache;
use App\Core\DB\DB;
use App\Core\Form;
use function App\Core\I18n\_m;
use App\Core\Router\Router;
use App\Entity as E;
use App\Entity\Actor;
use App\Entity as E;
use App\Util\Common;
use App\Util\Exception\ClientException;
use App\Util\Exception\ServerException;
use App\Util\HTML\Heading;
use Component\Collection\Util\Controller\FeedController;
use Component\Group\Entity\LocalGroup;
use Component\Subscription\Entity\ActorSubscription;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\HttpFoundation\Request;
use function App\Core\I18n\_m;
class GroupFeed extends FeedController
{
@ -82,11 +83,12 @@ class GroupFeed extends FeedController
EOF, ['id' => $group->getId()]);
return [
'_template' => 'group/view.html.twig',
'actor' => $group,
'nickname' => $group->getNickname(),
'notes' => $notes,
'subscribe_form' => $subscribe_form?->createView(),
'_template' => 'group/view.html.twig',
'actor' => $group,
'nickname' => $group->getNickname(),
'notes' => $notes,
'notes_feed_title' => (new Heading(1, [], $group->getNickname() . '\'s feed')),
'subscribe_form' => $subscribe_form?->createView(),
];
}

View File

@ -8,7 +8,7 @@
{% block profile_view %}
{% include 'cards/blocks/profile.html.twig' with { 'actor': actor } only %}
{% endblock profile_view %}
<hr>
{% if notes is defined %}
{{ parent() }}
{% endif %}

View File

@ -7,6 +7,7 @@
-o-mask-image: url(icons/add-actor.svg);
-webkit-mask-image: url(icons/add-actor.svg);
mask-image: url(icons/add-actor.svg);
opacity: initial !important;
}
.alert button {

View File

@ -30,12 +30,6 @@
<div class="note-replies-start"></div>
<div class="u-in-reply-to replies">
{% for conversation in replies %}
{% if extra.depth is defined %}
{% set depth_increment = {'depth': extra.depth + 1} %}
{% set parent = {'parent': block('note_author')} %}
{% set extra = extra|merge(depth_increment) %}
{% set extra = extra|merge(parent) %}
{% endif %}
<span class="note-replies-indicator" role="presentation"></span>
{% set args = { 'type': 'vanilla_full', 'note': conversation['note'], 'replies': conversation['replies'] | default, 'extra': extra } %}
{{ NoteFactory.constructor(args) }}

View File

@ -25,14 +25,26 @@
{{ block('note_info', 'cards/blocks/note.html.twig') }}
<section class="e-content entry-content note-content" title="{{ 'Note\'s main content' | trans }}">
{% if extra.parent is defined %}
<em
tabindex="0"
class="note-replies-parent"
title="{{'This is a reply with depth: ' | trans}} {{ extra.depth }}"
aria-flowto="note-anchor-">
{{'in reply to' | trans}} {{ extra.parent | raw }}
</em>
{% 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() }}">
{{'in reply to' | trans}}
<a href="{{ target.getUrl() }}">{{ mention(target) | raw }}</a>
</em>
{% endif %}
{% endfor %}
{% endif %}
{{ block('note_text', 'cards/blocks/note.html.twig') }}
{{ block('note_attachments', 'cards/blocks/note.html.twig') }}