- {% endfor %} - {% else %} -
diff --git a/src/Controller/Actor.php b/src/Controller/Actor.php
index 8cd278e8e9..2bc0c658ff 100644
--- a/src/Controller/Actor.php
+++ b/src/Controller/Actor.php
@@ -71,6 +71,6 @@ class Actor extends Controller
}
public function ActorShowNickname(Request $request, string $nickname)
{
- return $this->ActorByNickname($nickname, fn ($actor) => ['_template' => 'actor/view.html.twig', 'actor' => $actor]);
+ return $this->ActorByNickname($nickname, fn ($actor) => ['_template' => 'actor/view.html.twig', 'actor' => $actor, 'notes' => \App\Entity\Note::getAllNotesByActor($actor)]);
}
}
diff --git a/src/Entity/Note.php b/src/Entity/Note.php
index e26493cd71..62efafb69b 100644
--- a/src/Entity/Note.php
+++ b/src/Entity/Note.php
@@ -217,6 +217,18 @@ class Note extends Entity
return Avatar::getAvatarUrl($this->getActorId(), $size);
}
+ public static function getAllNotesByActor(Actor $actor): array
+ {
+ return DB::sql(
+ <<<'EOF'
+ select {select} from note n
+ where (n.actor_id & :actor_id) <> 0
+ order by n.created DESC
+ EOF,
+ ['actor_id' => $actor],
+ );
+ }
+
public static function getAllNotes(int $note_scope): array
{
return DB::sql(
diff --git a/templates/actor/view.html.twig b/templates/actor/view.html.twig
index bb5d32778d..27f5a671d4 100644
--- a/templates/actor/view.html.twig
+++ b/templates/actor/view.html.twig
@@ -1,20 +1,30 @@
{% extends 'stdgrid.html.twig' %}
+{% import '/cards/note/view.html.twig' as noteView %}
-{% block title %}{{ actor.getNickname() }}'s profile{% endblock %}
+{% block title %}{{ actor.getNickname() ~ '\'s profile' | trans }}{% endblock %}
+
+{% block stylesheets %}
+ {{ parent() }}
+
+{% endblock stylesheets %}
{% block body %}
-{% block profile_view %}{% include 'cards/profile/view.html.twig' %}{% endblock profile_view %}
+ {% block profile_view %}
+ {% include 'cards/profile/view.html.twig' %}
+ {% endblock profile_view %}
-
- {% endfor %}
- {% else %}
- {% trans %}No notes here.{% endtrans %}
+ {% endblock current_note %}
+ {% endfor %}
+ {% else %}
+ {% trans %}No notes here.{% endtrans %}