]> BookStack Code Mirror - bookstack/blob - resources/views/common/header.blade.php
Merge branch 'create-content-meta-tags' of https://github.com/james-geiger/BookStack...
[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('/') }}" 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-row justify-center hide-under-l">
21             @if (hasAppAccess())
22             <form action="{{ url('/search') }}" method="GET" class="search-box" role="search">
23                 <button id="header-search-box-button" type="submit" aria-label="{{ trans('common.search') }}" tabindex="-1">@icon('search') </button>
24                 <input id="header-search-box-input" type="text" name="term"
25                        aria-label="{{ trans('common.search') }}" placeholder="{{ trans('common.search') }}"
26                        value="{{ isset($searchTerm) ? $searchTerm : '' }}">
27             </form>
28             @endif
29         </div>
30
31         <div class="text-right">
32             <nav refs="header-mobile-toggle@menu" class="header-links">
33                 <div class="links text-center">
34                     @if (hasAppAccess())
35                         <a class="hide-over-l" href="{{ url('/search') }}">@icon('search'){{ trans('common.search') }}</a>
36                         @if(userCanOnAny('view', \BookStack\Entities\Models\Bookshelf::class) || userCan('bookshelf-view-all') || userCan('bookshelf-view-own'))
37                             <a href="{{ url('/shelves') }}">@icon('bookshelf'){{ trans('entities.shelves') }}</a>
38                         @endif
39                         <a href="{{ url('/books') }}">@icon('books'){{ trans('entities.books') }}</a>
40                         @if(signedInUser() && userCan('settings-manage'))
41                             <a href="{{ url('/settings') }}">@icon('settings'){{ trans('settings.settings') }}</a>
42                         @endif
43                         @if(signedInUser() && userCan('users-manage') && !userCan('settings-manage'))
44                             <a href="{{ url('/settings/users') }}">@icon('users'){{ trans('settings.users') }}</a>
45                         @endif
46                     @endif
47
48                     @if(!signedInUser())
49                         @if(setting('registration-enabled') && config('auth.method') === 'standard')
50                             <a href="{{ url('/register') }}">@icon('new-user'){{ trans('auth.sign_up') }}</a>
51                         @endif
52                         <a href="{{ url('/login')  }}">@icon('login'){{ trans('auth.log_in') }}</a>
53                     @endif
54                 </div>
55                 @if(signedInUser())
56                     <?php $currentUser = user(); ?>
57                     <div class="dropdown-container" component="dropdown" option:dropdown:bubble-escapes="true">
58                         <span class="user-name py-s hide-under-l" refs="dropdown@toggle"
59                               aria-haspopup="true" aria-expanded="false" aria-label="{{ trans('common.profile_menu') }}" tabindex="0">
60                             <img class="avatar" src="{{$currentUser->getAvatar(30)}}" alt="{{ $currentUser->name }}">
61                             <span class="name">{{ $currentUser->getShortName(9) }}</span> @icon('caret-down')
62                         </span>
63                         <ul refs="dropdown@menu" class="dropdown-menu" role="menu">
64                             <li>
65                                 <a href="{{ url('/favourites') }}">@icon('star'){{ trans('entities.my_favourites') }}</a>
66                             </li>
67                             <li>
68                                 <a href="{{ $currentUser->getProfileUrl() }}">@icon('user'){{ trans('common.view_profile') }}</a>
69                             </li>
70                             <li>
71                                 <a href="{{ $currentUser->getEditUrl() }}">@icon('edit'){{ trans('common.edit_profile') }}</a>
72                             </li>
73                             <li>
74                                 @if(config('auth.method') === 'saml2')
75                                     <a href="{{ url('/saml2/logout') }}">@icon('logout'){{ trans('auth.logout') }}</a>
76                                 @else
77                                     <a href="{{ url('/logout') }}">@icon('logout'){{ trans('auth.logout') }}</a>
78                                 @endif
79                             </li>
80                             <li><hr></li>
81                             <li>
82                                 @include('partials.dark-mode-toggle')
83                             </li>
84                         </ul>
85                     </div>
86                 @endif
87             </nav>
88         </div>
89
90     </div>
91 </header>