diff --git a/ckanext/odsh/assets/odsh_header.css b/ckanext/odsh/assets/odsh_header.css index b55dfb3b4daaa8e929025f2fb05466dea28d400e..ee07f28aa8fd61f5b52ab6ab6419c834e81e178f 100644 --- a/ckanext/odsh/assets/odsh_header.css +++ b/ckanext/odsh/assets/odsh_header.css @@ -62,7 +62,7 @@ /* dirty fix to make it the same height as schleswig-holstein.de */ } -.language-switch.sign-language { +.navbar-right { margin-left: auto !important; } @@ -280,6 +280,10 @@ background-color: #003064 !important; } +.nav-pills li:hover .user-icon, .nav-pills li:active .user-icon { + fill: white; +} + @media (min-width: 768px) { .navbar.masthead .navigation .nav-pills li:not(:nth-child(2)) { margin-left: 22px; @@ -386,10 +390,6 @@ vertical-align: middle; } -.navbar.masthead .navigation .nav-pills li.dropdown { - float: right; -} - .navbar.masthead .navigation .nav-pills li.dropdown>.dropdown-toggle { padding-bottom: 13px; padding-top: 15px; diff --git a/ckanext/odsh/templates/header.html b/ckanext/odsh/templates/header.html index b6593b332b28ddf7479dd7e0ad52f382a0e7bfb3..c3bf96bc82f0aed61da556b5c5c0147f1afd977a 100644 --- a/ckanext/odsh/templates/header.html +++ b/ckanext/odsh/templates/header.html @@ -51,28 +51,40 @@ {% link_for _('Upload'), named_route='dataset.new', class_='text' %} </li> {% endif %} + {% block header_account_container_content %} {% if c.userobj %} <li class="dropdown navbar-right {{clazz}}"> {% set name = c.userobj.fullname if c.userobj.fullname else c.userobj.email%} - <a class="dropdown-toggle" data-toggle="dropdown" href="#"> + <a href="#" class="dropdown-toggle" data-bs-toggle="dropdown" id="accountMenuButton" aria-expanded="false"> <svg class='user-icon' viewBox="0 0 54 54"> <circle class='user-icon' cx="27" cy="17" r="7.5" /> <path class='user-icon' d="M42.5,44.5h-31v-6.4c0-4.7,3.9-8.6,8.6-8.6h13.9c4.7,0,8.6,3.9,8.6,8.6V44.5z" /> </svg> {{name}}</a> - <ul class="dropdown-menu" role="menu"> + <ul class="dropdown-menu" role="menu" aria-labelledby="accountMenuButton"> + {% block header_account_logged %} {% if c.userobj.sysadmin %} + <li> + <a href="{{ h.url_for('admin.index') }}" title="{{ _('Sysadmin settings') }}"> + <i class="fa fa-gavel" aria-hidden="true"></i> + <span class="text">{{ _('Admin') }}</span> + </a> + </li> + {% endif %} + {% block header_account_profile %} <li> <svg class='user-icon-small' viewBox="0 0 54 54"> <circle cx="27" cy="17" r="7.5" /> <path d="M42.5,44.5h-31v-6.4c0-4.7,3.9-8.6,8.6-8.6h13.9c4.7,0,8.6,3.9,8.6,8.6V44.5z" /> </svg> - <a href="{{ h.url_for('user.read', id=c.userobj.name) }}" aria-label="{{ _('View profile') }}" title="{{ _('View profile') }}" role="menuitem"> + <a href="{{ h.url_for('user.read', id=c.userobj.display_name) }}" aria-label="{{ _('View profile') }}" title="{{ _('View profile') }}" role="menuitem"> <span class="text"> {{ _('View profile') }} </span> </a> </li> + {% endblock %} + {% block header_account_settings_link %} <li> <a href="{{ h.url_for('user.edit', id=c.userobj.name) }}" aria-label="{{ _('Edit profile') }}" title="{{ _('Edit profile') }}" role="menuitem"> <i class='fa fa-edit'></i> @@ -81,12 +93,15 @@ </span> </a> </li> + {% endblock %} + {% block header_account_log_out_link %} <li> <a href="{{ h.url_for('user.logout') }}" aria-label="{{ _('Logout') }}" title="{{ _('Logout') }}" role="menuitem"> <i class='fa fa-sign-out'></i> <span class="text">{{ _('Logout') }}</span> </a> </li> + {% endblock %} {% endblock %} </ul> </a> </li> @@ -96,7 +111,7 @@ <span class="text">{{ _('Login') }}</span> </a> </li> - {% endif %} + {% endif %} {% endblock %} <li class="language-switch sign-language"> <a href="/gebaerdensprache" aria-label="{{ _('Sign language') }}" title="{{ _('Sign language') }}" class="navGebaerdensprache"></a> </li>