forked from GNUsocial/gnu-social
[UI][TWIG] Small UI cleanup and change twig 'active' function to check for starts with, rather than equals
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
|
||||
namespace App\Twig;
|
||||
|
||||
use App\Util\Formatting;
|
||||
use Functional as F;
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
@@ -52,7 +53,7 @@ class Runtime implements RuntimeExtensionInterface, EventSubscriberInterface
|
||||
public function isCurrentRoute(string $class, string ...$routes): string
|
||||
{
|
||||
$current_route = $this->request->attributes->get('_route');
|
||||
return F\some($routes, F\equal($current_route)) ? $class : '';
|
||||
return F\some($routes, F\partial_left([Formatting::class, 'startsWith'], $current_route)) ? $class : '';
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user