[CONTROLLER][Actor] Fix actor view route
This commit is contained in:
parent
8b5286c383
commit
af122df6e1
|
@ -45,6 +45,7 @@ class Actor extends ActorController
|
||||||
fn ($actor) => [
|
fn ($actor) => [
|
||||||
'_template' => 'actor/view.html.twig',
|
'_template' => 'actor/view.html.twig',
|
||||||
'actor' => $actor,
|
'actor' => $actor,
|
||||||
|
'nickname' => $actor->getNickname(),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -56,6 +57,7 @@ class Actor extends ActorController
|
||||||
fn ($actor) => [
|
fn ($actor) => [
|
||||||
'_template' => 'actor/view.html.twig',
|
'_template' => 'actor/view.html.twig',
|
||||||
'actor' => $actor,
|
'actor' => $actor,
|
||||||
|
'nickname' => $actor->getNickname(),
|
||||||
'notes' => \App\Entity\Note::getAllNotesByActor($actor),
|
'notes' => \App\Entity\Note::getAllNotesByActor($actor),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
|
@ -46,7 +46,7 @@ abstract class Actor
|
||||||
public static function load(RouteLoader $r): void
|
public static function load(RouteLoader $r): void
|
||||||
{
|
{
|
||||||
$r->connect(id: 'actor_view_id', uri_path: '/actor/{id<\d+>}', target: [C\Actor::class, 'actorViewId']);
|
$r->connect(id: 'actor_view_id', uri_path: '/actor/{id<\d+>}', target: [C\Actor::class, 'actorViewId']);
|
||||||
$r->connect(id: 'actor_view_nickname', uri_path: '/@{nickname<' . Nickname::DISPLAY_FMT . '>}', target: [C\Actor::class, 'actorViewId'], options: ['is_system_path' => false]);
|
$r->connect(id: 'actor_view_nickname', uri_path: '/@{nickname<' . Nickname::DISPLAY_FMT . '>}', target: [C\Actor::class, 'actorViewNickname'], options: ['is_system_path' => false]);
|
||||||
$r->connect(id: 'group_actor_view_id', uri_path: '/group/{id<\d+>}', target: [C\Actor::class, 'groupViewId']);
|
$r->connect(id: 'group_actor_view_id', uri_path: '/group/{id<\d+>}', target: [C\Actor::class, 'groupViewId']);
|
||||||
$r->connect(id: 'group_actor_view_nickname', uri_path: '/!{nickname<' . Nickname::DISPLAY_FMT . '>}', target: [C\Actor::class, 'groupViewNickname'], options: ['is_system_path' => false]);
|
$r->connect(id: 'group_actor_view_nickname', uri_path: '/!{nickname<' . Nickname::DISPLAY_FMT . '>}', target: [C\Actor::class, 'groupViewNickname'], options: ['is_system_path' => false]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
{% set nickname = nickname|escape %}
|
{% set nickname = nickname|escape %}
|
||||||
|
|
||||||
{% block title %}{% trans with {'%nick%': actor.getNickname()} %}%nick%'s profile{% endtrans %}{% endblock %}y
|
{% block title %}{% trans %}%nickname%'s profile{% endtrans %}{% endblock %}
|
||||||
|
|
||||||
{% block stylesheets %}
|
{% block stylesheets %}
|
||||||
{{ parent() }}
|
{{ parent() }}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user