Skip to content
Snippets Groups Projects
Commit f7f9bafc authored by Yassine Doghri's avatar Yassine Doghri
Browse files

feat(admin): add tooltip for not authorized routes

parent 0bd7ddea
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,7 @@ return [
'toggle_sidebar' => 'Toggle sidebar',
'go_to_website' => 'Go to website',
'go_to_admin' => 'Go to admin',
'not-authorized' => 'Not authorized',
'dashboard' => 'Dashboard',
'admin' => 'Home',
'podcasts' => 'Podcasts',
......
......@@ -38,13 +38,17 @@
}
?>
<li class="inline-flex">
<a class="relative w-full py-3 pl-14 pr-2 text-sm hover:opacity-100 before:absolute before:opacity-0 before:w-5 before:h-5 hover:bg-navigation-active focus:ring-inset focus:ring-accent<?= $isActive
<?php if ($isAllowed): ?>
<a class="relative w-full py-3 pl-14 pr-2 text-sm hover:opacity-100 before:content-chevronRightIcon before:absolute before:-ml-5 before:opacity-0 before:w-5 before:h-5 hover:bg-navigation-active focus:ring-inset focus:ring-accent<?= $isActive
? ' before:opacity-100 font-semibold inline-flex items-center'
: ' hover:before:opacity-60 focus:before:opacity-60' ?><?= $isAllowed
? ' before:content-chevronRightIcon before:-ml-5'
: ' before:content-prohibitedIcon before:-ml-6 before:opacity-60 pointer-events-none' ?>" href="<?= route_to($item, $podcastId ?? null, $episodeId ?? null) ?>"><?= lang(
: ' hover:before:opacity-60 focus:before:opacity-60' ?>" href="<?= route_to($item, $podcastId ?? null, $episodeId ?? null) ?>"><?= lang(
$langKey . '.' . $item,
) ?></a>
<?php else: ?>
<span data-tooltip="right" title="<?= lang('Navigation.not-authorized') ?>" class="relative w-full py-3 pr-2 text-sm cursor-not-allowed before:inset-y-0 before:my-auto pl-14 hover:opacity-100 before:absolute before:content-prohibitedIcon before:-ml-5 before:opacity-60 before:w-4 before:h-4 hover:bg-navigation-active focus:ring-inset focus:ring-accent"><?= lang(
$langKey . '.' . $item,
) ?></span>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment