[CONTROLLER][ROUTE] Favourites page initial query implementation and routing
This commit is contained in:
parent
651ec890d6
commit
492360ceeb
@ -120,4 +120,17 @@ END;
|
|||||||
),
|
),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function favourites(Request $request)
|
||||||
|
{
|
||||||
|
$actor_id = Common::ensureLoggedIn()->getActor()->getId();
|
||||||
|
|
||||||
|
return [
|
||||||
|
'_template' => 'network/public.html.twig',
|
||||||
|
'notes' => DB::dql('select f from App\Entity\Favourite f ' .
|
||||||
|
'where f.gsactor_id = ' . $actor_id .
|
||||||
|
'order by f.created DESC'
|
||||||
|
),
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,7 @@ abstract class Main
|
|||||||
$r->connect('main_all', '/main/all', [C\Network::class, 'network']);
|
$r->connect('main_all', '/main/all', [C\Network::class, 'network']);
|
||||||
$r->connect('home_all', '/{nickname<' . Nickname::DISPLAY_FMT . '>}/all', [C\Network::class, 'home']);
|
$r->connect('home_all', '/{nickname<' . Nickname::DISPLAY_FMT . '>}/all', [C\Network::class, 'home']);
|
||||||
$r->connect('replies', '/{nickname<' . Nickname::DISPLAY_FMT . '>}/replies', [C\Network::class, 'replies']);
|
$r->connect('replies', '/{nickname<' . Nickname::DISPLAY_FMT . '>}/replies', [C\Network::class, 'replies']);
|
||||||
|
$r->connect('favourites', '/{nickname<' . Nickname::DISPLAY_FMT . '>}/favourites', [C\Network::class, 'favourites']);
|
||||||
|
|
||||||
$r->connect('panel', '/panel', [C\AdminPanel::class, 'site']);
|
$r->connect('panel', '/panel', [C\AdminPanel::class, 'site']);
|
||||||
$r->connect('panel_site', '/panel/site', [C\AdminPanel::class, 'site']);
|
$r->connect('panel_site', '/panel/site', [C\AdminPanel::class, 'site']);
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<a href='#'>Messages</a>
|
<a href='#'>Messages</a>
|
||||||
<a href="{{ path("replies", {'nickname' : user_nickname}) }}" class='hover-effect {{ active("replies") }}'>Replies</a>
|
<a href="{{ path("replies", {'nickname' : user_nickname}) }}" class='hover-effect {{ active("replies") }}'>Replies</a>
|
||||||
<a href='#'>Favourites</a>
|
<a href="{{ path("favourites", {'nickname' : user_nickname}) }}" class='hover-effect {{ active("favourites") }}'>Favourites</a>
|
||||||
<a href='#'>Reverse Favs</a>
|
<a href='#'>Reverse Favs</a>
|
||||||
<a href="{{ path('settings_personal_info') }}" class='hover-effect {{ active('settings_') }}'>Settings</a>
|
<a href="{{ path('settings_personal_info') }}" class='hover-effect {{ active('settings_') }}'>Settings</a>
|
||||||
<a href='#'>Logout</a>
|
<a href='#'>Logout</a>
|
||||||
|
Loading…
Reference in New Issue
Block a user