Fixes the main menu for registrars

This commit is contained in:
Pinga 2023-12-12 18:47:05 +02:00
parent 66500a4939
commit 8dcbaed649
2 changed files with 10 additions and 7 deletions

View file

@ -112,6 +112,9 @@ $container->set('view', function ($container) use ($translations, $uiLang, $lang
} else { } else {
$view->getEnvironment()->addGlobal('screen_mode', 'light'); $view->getEnvironment()->addGlobal('screen_mode', 'light');
} }
if (isset($_SESSION['auth_roles'])) {
$view->getEnvironment()->addGlobal('roles', $_SESSION['auth_roles']);
}
$db = $container->get('db'); $db = $container->get('db');
$query = 'SELECT r.currency, ru.registrar_id $query = 'SELECT r.currency, ru.registrar_id

View file

@ -144,7 +144,7 @@
</a> </a>
</div> </div>
</li> </li>
<li {{ is_current_url('registrars') or is_current_url('listUsers') or is_current_url('registrarcreate') or 'registrar' in currentUri ? 'class="nav-item dropdown active"' : 'class="nav-item dropdown"' }}> {% if roles == 0 %}<li {{ is_current_url('registrars') or is_current_url('listUsers') or is_current_url('registrarcreate') or 'registrar' in currentUri ? 'class="nav-item dropdown active"' : 'class="nav-item dropdown"' }}>
<a class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown" data-bs-auto-close="outside" role="button" aria-expanded="false"> <a class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown" data-bs-auto-close="outside" role="button" aria-expanded="false">
<span class="nav-link-icon d-md-none d-lg-inline-block"><svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 13a3 3 0 1 0 0 -6a3 3 0 0 0 0 6z"></path><path d="M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z"></path><path d="M6 20.05v-.05a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v.05"></path></svg> <span class="nav-link-icon d-md-none d-lg-inline-block"><svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 13a3 3 0 1 0 0 -6a3 3 0 0 0 0 6z"></path><path d="M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z"></path><path d="M6 20.05v-.05a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v.05"></path></svg>
</span> </span>
@ -164,7 +164,7 @@
{{ __('List Users') }} {{ __('List Users') }}
</a> </a>
</div> </div>
</li> </li>{% endif %}
<li {{ is_current_url('deposit') or is_current_url('transactions') or is_current_url('overview') or is_current_url('invoices') or is_current_url('success') or 'invoice' in currentUri ? 'class="nav-item dropdown active"' : 'class="nav-item dropdown"' }}> <li {{ is_current_url('deposit') or is_current_url('transactions') or is_current_url('overview') or is_current_url('invoices') or is_current_url('success') or 'invoice' in currentUri ? 'class="nav-item dropdown active"' : 'class="nav-item dropdown"' }}>
<a class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown" data-bs-auto-close="outside" role="button" aria-expanded="false"> <a class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown" data-bs-auto-close="outside" role="button" aria-expanded="false">
<span class="nav-link-icon d-md-none d-lg-inline-block"><svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M7 9m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z"></path><path d="M14 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M17 9v-2a2 2 0 0 0 -2 -2h-10a2 2 0 0 0 -2 2v6a2 2 0 0 0 2 2h2"></path></svg> <span class="nav-link-icon d-md-none d-lg-inline-block"><svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M7 9m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z"></path><path d="M14 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M17 9v-2a2 2 0 0 0 -2 -2h-10a2 2 0 0 0 -2 2v6a2 2 0 0 0 2 2h2"></path></svg>
@ -198,7 +198,7 @@
</span> </span>
</a> </a>
<div class="dropdown-menu"> <div class="dropdown-menu">
<a class="dropdown-item" href="{{route('registry')}}"> {% if roles == 0 %}<a class="dropdown-item" href="{{route('registry')}}">
{{ __('Configuration') }} {{ __('Configuration') }}
</a> </a>
<a class="dropdown-item" href="{{route('listTlds')}}"> <a class="dropdown-item" href="{{route('listTlds')}}">
@ -207,16 +207,16 @@
<a class="dropdown-item" href="{{route('reports')}}"> <a class="dropdown-item" href="{{route('reports')}}">
{{ __('Reports') }} {{ __('Reports') }}
</a> </a>
<div class="dropdown-divider"></div> <div class="dropdown-divider"></div>{% endif %}
<a class="dropdown-item" href="{{route('poll')}}"> <a class="dropdown-item" href="{{route('poll')}}">
{{ __('Message Queue') }} {{ __('Message Queue') }}
</a> </a>
<a class="dropdown-item" href="{{route('epphistory')}}"> {% if roles == 0 %}<a class="dropdown-item" href="{{route('epphistory')}}">
{{ __('EPP History') }} {{ __('EPP History') }}
</a> </a>
<a class="dropdown-item" href="{{route('log')}}"> <a class="dropdown-item" href="{{route('log')}}">
{{ __('System Log') }} {{ __('System Log') }}
</a> </a>{% endif %}
</div> </div>
</li> </li>
<li {{ is_current_url('ticketview') or is_current_url('newticket') or is_current_url('docs') or is_current_url('mediakit') or 'ticket' in currentUri ? 'class="nav-item dropdown active"' : 'class="nav-item dropdown"' }}> <li {{ is_current_url('ticketview') or is_current_url('newticket') or is_current_url('docs') or is_current_url('mediakit') or 'ticket' in currentUri ? 'class="nav-item dropdown active"' : 'class="nav-item dropdown"' }}>