diff --git a/plugins/Directory/Controller/Directory.php b/plugins/Directory/Controller/Directory.php index 6ed92445be..065fc10ceb 100644 --- a/plugins/Directory/Controller/Directory.php +++ b/plugins/Directory/Controller/Directory.php @@ -24,6 +24,7 @@ declare(strict_types = 1); namespace Plugin\Directory\Controller; use App\Core\DB\DB; +use App\Entity\Actor; use Component\Feed\Util\FeedController; use Symfony\Component\HttpFoundation\Request; @@ -38,7 +39,7 @@ class Directory extends FeedController { return [ '_template' => 'directory/actors.html.twig', - 'actors' => DB::dql('select a from actor a order by a.nickname ASC'), + 'actors' => DB::findBy(Actor::class, ['type' => Actor::PERSON], order_by: ['created' => 'DESC', 'nickname' => 'ASC']), ]; } @@ -51,7 +52,7 @@ class Directory extends FeedController { return [ '_template' => 'directory/groups.html.twig', - 'groups' => DB::dql('select g from group g order by g.nickname ASC'), + 'groups' => DB::findBy(Actor::class, ['type' => Actor::GROUP], order_by: ['created' => 'DESC', 'nickname' => 'ASC']), ]; } } diff --git a/plugins/Directory/Directory.php b/plugins/Directory/Directory.php index 3e944f9e51..fbd38da55e 100644 --- a/plugins/Directory/Directory.php +++ b/plugins/Directory/Directory.php @@ -35,8 +35,8 @@ class Directory extends Plugin */ public function onAddRoute(RouteLoader $r) { - $r->connect('directory_actors', '/actors', [Controller\Directory::class, 'actors']); - $r->connect('directory_groups', '/groups', [Controller\Directory::class, 'groups']); + $r->connect('directory_actors', '/directory/actors', [Controller\Directory::class, 'actors']); + $r->connect('directory_groups', '/directory/groups', [Controller\Directory::class, 'groups']); return Event::next; } diff --git a/plugins/Directory/templates/directory/group.html.twig b/plugins/Directory/templates/directory/group.html.twig deleted file mode 100644 index d84b0537ae..0000000000 --- a/plugins/Directory/templates/directory/group.html.twig +++ /dev/null @@ -1,31 +0,0 @@ -{% extends 'stdgrid.html.twig' %} - -{% set nickname = group.getNickname() %} - -{% block title %}{{ nickname }}'s page{% endblock %} - -{% block body %} -
{{ group_description }}
- {% else %} -{{ '(No description)' | trans }}
- {% endif %} -