]> BookStack Code Mirror - bookstack/blobdiff - resources/views/common/header.blade.php
Update maintenance.php
[bookstack] / resources / views / common / header.blade.php
index 7f309e21f81b24b67a861ef1215393b2225b1681..734789899b1e804f65efc8ea2fecbbbc040fbef4 100644 (file)
@@ -1,5 +1,6 @@
-<header id="header" header-mobile-toggle>
-    <div class="grid break-l mx-l">
+<header id="header" header-mobile-toggle class="primary-background">
+    <div class="grid mx-l">
+
         <div>
             <a href="{{ baseUrl('/') }}" class="logo">
                 @if(setting('app-logo', '') !== 'none')
             </a>
             <div class="mobile-menu-toggle hide-over-l">@icon('more')</div>
         </div>
+
         <div class="header-search hide-under-l">
+            @if (hasAppAccess())
             <form action="{{ baseUrl('/search') }}" method="GET" class="search-box">
                 <button id="header-search-box-button" type="submit">@icon('search') </button>
                 <input id="header-search-box-input" type="text" name="term" tabindex="2" placeholder="{{ trans('common.search') }}" value="{{ isset($searchTerm) ? $searchTerm : '' }}">
             </form>
+            @endif
         </div>
+
         <div class="text-right">
             <div class="header-links">
                 <div class="links text-center">
-                    <a class="hide-over-l" href="{{ baseUrl('/search') }}">@icon('search'){{ trans('common.search') }}</a>
-                    @if(userCan('bookshelf-view-all') || userCan('bookshelf-view-own'))
-                        <a href="{{ baseUrl('/shelves') }}">@icon('bookshelf'){{ trans('entities.shelves') }}</a>
-                    @endif
-                    <a href="{{ baseUrl('/books') }}">@icon('book'){{ trans('entities.books') }}</a>
-                    @if(signedInUser() && userCan('settings-manage'))
-                        <a href="{{ baseUrl('/settings') }}">@icon('settings'){{ trans('settings.settings') }}</a>
+                    @if (hasAppAccess())
+                        <a class="hide-over-l" href="{{ baseUrl('/search') }}">@icon('search'){{ trans('common.search') }}</a>
+                        @if(userCanOnAny('view', \BookStack\Entities\Bookshelf::class) || userCan('bookshelf-view-all') || userCan('bookshelf-view-own'))
+                            <a href="{{ baseUrl('/shelves') }}">@icon('bookshelf'){{ trans('entities.shelves') }}</a>
+                        @endif
+                        <a href="{{ baseUrl('/books') }}">@icon('books'){{ trans('entities.books') }}</a>
+                        @if(signedInUser() && userCan('settings-manage'))
+                            <a href="{{ baseUrl('/settings') }}">@icon('settings'){{ trans('settings.settings') }}</a>
+                        @endif
+                        @if(signedInUser() && userCan('users-manage') && !userCan('settings-manage'))
+                            <a href="{{ baseUrl('/settings/users') }}">@icon('users'){{ trans('settings.users') }}</a>
+                        @endif
                     @endif
+
                     @if(!signedInUser())
-                        <a href="{{ baseUrl('/login') }}">@icon('login'){{ trans('auth.log_in') }}</a>
+                        @if(setting('registration-enabled', false))
+                            <a href="{{ baseUrl('/register') }}">@icon('new-user') {{ trans('auth.sign_up') }}</a>
+                        @endif
+                        <a href="{{ baseUrl('/login') }}">@icon('login') {{ trans('auth.log_in') }}</a>
                     @endif
                 </div>
                 @if(signedInUser())
                             <img class="avatar" src="{{$currentUser->getAvatar(30)}}" alt="{{ $currentUser->name }}">
                             <span class="name">{{ $currentUser->getShortName(9) }}</span> @icon('caret-down')
                         </span>
-                        <ul>
+                        <ul class="dropdown-menu">
                             <li>
-                                <a href="{{ baseUrl("/user/{$currentUser->id}") }}" class="text-primary">@icon('user'){{ trans('common.view_profile') }}</a>
+                                <a href="{{ baseUrl("/user/{$currentUser->id}") }}">@icon('user'){{ trans('common.view_profile') }}</a>
                             </li>
                             <li>
-                                <a href="{{ baseUrl("/settings/users/{$currentUser->id}") }}" class="text-primary">@icon('edit'){{ trans('common.edit_profile') }}</a>
+                                <a href="{{ baseUrl("/settings/users/{$currentUser->id}") }}">@icon('edit'){{ trans('common.edit_profile') }}</a>
                             </li>
                             <li>
-                                <a href="{{ baseUrl('/logout') }}" class="text-neg">@icon('logout'){{ trans('auth.logout') }}</a>
+                                <a href="{{ baseUrl('/logout') }}">@icon('logout'){{ trans('auth.logout') }}</a>
                             </li>
                         </ul>
                     </div>
                 @endif
             </div>
         </div>
+
     </div>
 </header>
\ No newline at end of file