[Directory] Fixup directory plugin

This commit is contained in:
Hugo Sales 2021-04-15 16:57:39 +00:00
parent cc9f2d6ff2
commit 483ac38888
Signed by untrusted user: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
2 changed files with 10 additions and 15 deletions

View File

@ -32,8 +32,9 @@ class Directory extends Module
*/
public function onAddRoute(RouteLoader $r)
{
$r->connect('actors', '/actors', [Controller\Directory::class, 'actors']);
$r->connect('groups', '/groups', [Controller\Directory::class, 'groups']);
$r->connect('directory_actors', '/actors', [Controller\Directory::class, 'actors']);
$r->connect('directory_groups', '/groups', [Controller\Directory::class, 'groups']);
return Event::next;
}
@ -46,16 +47,8 @@ class Directory extends Module
*/
public function onStartTwigPopulateVars(array &$vars): bool
{
$vars['main_nav_tabs'] = [
[
'title' => 'Actors',
'route' => 'actors',
],
[
'title' => 'Groups',
'route' => 'groups',
],
];
$vars['main_nav_tabs'][] = ['title' => 'Actors', 'route' => 'directory_actors'];
$vars['main_nav_tabs'][] = ['title' => 'Groups', 'route' => 'directory_groups'];
return Event::next;
}

View File

@ -91,11 +91,13 @@
<li>
<a href="{{ path('main_all') }}" class='hover-effect {{ active('main_all') }}'>Network</a>
</li>
{% for tab in main_nav_tabs %}
{% if main_nav_tabs is defined %}
{% for tab in main_nav_tabs %}
<li>
<a href="{{ path(tab['route']) }}" class='hover-effect {{ active(tab['route']) }}' >{{ tab['title'] }}</a>
<a href="{{ path(tab['route']) }}" class='hover-effect {{ active(tab['route']) }}' >{{ tab['title'] }}</a>
</li>
{% endfor %}
{% endfor %}
{% endif %}
</ul>
</nav>
<div class="timeline">