]> BookStack Code Mirror - bookstack/blob - resources/views/common/header.blade.php
Locales: Removed a lot of existing locale handling
[bookstack] / resources / views / common / header.blade.php
1 <header id="header" component="header-mobile-toggle" class="primary-background">
2     <div class="grid mx-l">
3
4         <div>
5             <a href="{{ url('/') }}" data-shortcut="home_view" class="logo">
6                 @if(setting('app-logo', '') !== 'none')
7                     <img class="logo-image" src="{{ setting('app-logo', '') === '' ? url('/logo.png') : url(setting('app-logo', '')) }}" alt="Logo">
8                 @endif
9                 @if (setting('app-name-header'))
10                     <span class="logo-text">{{ setting('app-name') }}</span>
11                 @endif
12             </a>
13             <button type="button"
14                     refs="header-mobile-toggle@toggle"
15                     title="{{ trans('common.header_menu_expand') }}"
16                     aria-expanded="false"
17                     class="mobile-menu-toggle hide-over-l">@icon('more')</button>
18         </div>
19
20         <div class="flex-container-column items-center justify-center hide-under-l">
21             @if (user()->hasAppAccess())
22             <form component="global-search" action="{{ url('/search') }}" method="GET" class="search-box" role="search" tabindex="0">
23                 <button id="header-search-box-button"
24                         refs="global-search@button"
25                         type="submit"
26                         aria-label="{{ trans('common.search') }}"
27                         tabindex="-1">@icon('search')</button>
28                 <input id="header-search-box-input"
29                        refs="global-search@input"
30                        type="text"
31                        name="term"
32                        data-shortcut="global_search"
33                        autocomplete="off"
34                        aria-label="{{ trans('common.search') }}" placeholder="{{ trans('common.search') }}"
35                        value="{{ $searchTerm ?? '' }}">
36                 <div refs="global-search@suggestions" class="global-search-suggestions card">
37                     <div refs="global-search@loading" class="text-center px-m global-search-loading">@include('common.loading-icon')</div>
38                     <div refs="global-search@suggestion-results" class="px-m"></div>
39                     <button class="text-button card-footer-link" type="submit">{{ trans('common.view_all') }}</button>
40                 </div>
41             </form>
42             @endif
43         </div>
44
45         <nav refs="header-mobile-toggle@menu" class="header-links">
46             <div class="links text-center">
47                 @if (user()->hasAppAccess())
48                     <a class="hide-over-l" href="{{ url('/search') }}">@icon('search'){{ trans('common.search') }}</a>
49                     @if(userCanOnAny('view', \BookStack\Entities\Models\Bookshelf::class) || userCan('bookshelf-view-all') || userCan('bookshelf-view-own'))
50                         <a href="{{ url('/shelves') }}" data-shortcut="shelves_view">@icon('bookshelf'){{ trans('entities.shelves') }}</a>
51                     @endif
52                     <a href="{{ url('/books') }}" data-shortcut="books_view">@icon('books'){{ trans('entities.books') }}</a>
53                     @if(!user()->isGuest() && userCan('settings-manage'))
54                         <a href="{{ url('/settings') }}" data-shortcut="settings_view">@icon('settings'){{ trans('settings.settings') }}</a>
55                     @endif
56                     @if(!user()->isGuest() && userCan('users-manage') && !userCan('settings-manage'))
57                         <a href="{{ url('/settings/users') }}" data-shortcut="settings_view">@icon('users'){{ trans('settings.users') }}</a>
58                     @endif
59                 @endif
60
61                 @if(user()->isGuest())
62                     @if(setting('registration-enabled') && config('auth.method') === 'standard')
63                         <a href="{{ url('/register') }}">@icon('new-user'){{ trans('auth.sign_up') }}</a>
64                     @endif
65                     <a href="{{ url('/login')  }}">@icon('login'){{ trans('auth.log_in') }}</a>
66                 @endif
67             </div>
68             @if(!user()->isGuest())
69                 @include('common.header-user-menu', ['user' => user()])
70             @endif
71         </nav>
72
73     </div>
74 </header>