2021-04-19 16:41:13 -04:00
|
|
|
<header id="header" component="header-mobile-toggle" class="primary-background">
|
2019-04-07 04:57:48 -04:00
|
|
|
<div class="grid mx-l">
|
2019-02-03 12:34:15 -05:00
|
|
|
|
2018-10-16 13:49:16 -04:00
|
|
|
<div>
|
2019-08-04 09:26:39 -04:00
|
|
|
<a href="{{ url('/') }}" class="logo">
|
2018-10-16 13:49:16 -04:00
|
|
|
@if(setting('app-logo', '') !== 'none')
|
2019-08-04 09:26:39 -04:00
|
|
|
<img class="logo-image" src="{{ setting('app-logo', '') === '' ? url('/logo.png') : url(setting('app-logo', '')) }}" alt="Logo">
|
2018-10-16 13:49:16 -04:00
|
|
|
@endif
|
|
|
|
@if (setting('app-name-header'))
|
|
|
|
<span class="logo-text">{{ setting('app-name') }}</span>
|
|
|
|
@endif
|
|
|
|
</a>
|
2021-04-19 16:41:13 -04:00
|
|
|
<button type="button"
|
|
|
|
refs="header-mobile-toggle@toggle"
|
|
|
|
title="{{ trans('common.header_menu_expand') }}"
|
|
|
|
aria-expanded="false"
|
|
|
|
class="mobile-menu-toggle hide-over-l">@icon('more')</button>
|
2018-10-16 13:49:16 -04:00
|
|
|
</div>
|
2019-02-03 12:34:15 -05:00
|
|
|
|
2021-02-04 18:11:55 -05:00
|
|
|
<div class="flex-container-row justify-center hide-under-l">
|
2019-02-03 12:34:15 -05:00
|
|
|
@if (hasAppAccess())
|
2019-08-25 10:44:51 -04:00
|
|
|
<form action="{{ url('/search') }}" method="GET" class="search-box" role="search">
|
2019-08-24 13:26:28 -04:00
|
|
|
<button id="header-search-box-button" type="submit" aria-label="{{ trans('common.search') }}" tabindex="-1">@icon('search') </button>
|
|
|
|
<input id="header-search-box-input" type="text" name="term"
|
2019-08-18 14:17:43 -04:00
|
|
|
aria-label="{{ trans('common.search') }}" placeholder="{{ trans('common.search') }}"
|
|
|
|
value="{{ isset($searchTerm) ? $searchTerm : '' }}">
|
2018-10-16 13:49:16 -04:00
|
|
|
</form>
|
2019-02-03 12:34:15 -05:00
|
|
|
@endif
|
2018-10-16 13:49:16 -04:00
|
|
|
</div>
|
2019-02-03 12:34:15 -05:00
|
|
|
|
2018-10-16 13:49:16 -04:00
|
|
|
<div class="text-right">
|
2021-04-19 16:41:13 -04:00
|
|
|
<nav refs="header-mobile-toggle@menu" class="header-links">
|
2018-10-16 13:49:16 -04:00
|
|
|
<div class="links text-center">
|
2019-02-03 12:34:15 -05:00
|
|
|
@if (hasAppAccess())
|
2019-08-04 09:26:39 -04:00
|
|
|
<a class="hide-over-l" href="{{ url('/search') }}">@icon('search'){{ trans('common.search') }}</a>
|
2020-11-21 19:17:45 -05:00
|
|
|
@if(userCanOnAny('view', \BookStack\Entities\Models\Bookshelf::class) || userCan('bookshelf-view-all') || userCan('bookshelf-view-own'))
|
2019-08-04 09:26:39 -04:00
|
|
|
<a href="{{ url('/shelves') }}">@icon('bookshelf'){{ trans('entities.shelves') }}</a>
|
2019-02-03 12:34:15 -05:00
|
|
|
@endif
|
2019-08-04 09:26:39 -04:00
|
|
|
<a href="{{ url('/books') }}">@icon('books'){{ trans('entities.books') }}</a>
|
2019-02-03 12:34:15 -05:00
|
|
|
@if(signedInUser() && userCan('settings-manage'))
|
2019-08-04 09:26:39 -04:00
|
|
|
<a href="{{ url('/settings') }}">@icon('settings'){{ trans('settings.settings') }}</a>
|
2019-02-03 12:34:15 -05:00
|
|
|
@endif
|
|
|
|
@if(signedInUser() && userCan('users-manage') && !userCan('settings-manage'))
|
2019-08-04 09:26:39 -04:00
|
|
|
<a href="{{ url('/settings/users') }}">@icon('users'){{ trans('settings.users') }}</a>
|
2019-02-03 12:34:15 -05:00
|
|
|
@endif
|
2019-01-13 09:10:27 -05:00
|
|
|
@endif
|
2019-02-03 12:34:15 -05:00
|
|
|
|
2018-10-16 13:49:16 -04:00
|
|
|
@if(!signedInUser())
|
2020-02-02 05:59:03 -05:00
|
|
|
@if(setting('registration-enabled') && config('auth.method') === 'standard')
|
2020-03-07 04:43:42 -05:00
|
|
|
<a href="{{ url('/register') }}">@icon('new-user'){{ trans('auth.sign_up') }}</a>
|
2019-01-13 09:10:27 -05:00
|
|
|
@endif
|
2020-03-14 14:29:31 -04:00
|
|
|
<a href="{{ url('/login') }}">@icon('login'){{ trans('auth.log_in') }}</a>
|
2018-10-16 13:49:16 -04:00
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
@if(signedInUser())
|
|
|
|
<?php $currentUser = user(); ?>
|
2021-04-19 16:41:13 -04:00
|
|
|
<div class="dropdown-container" component="dropdown" option:dropdown:bubble-escapes="true">
|
2020-06-24 15:38:08 -04:00
|
|
|
<span class="user-name py-s hide-under-l" refs="dropdown@toggle"
|
2019-08-24 13:26:28 -04:00
|
|
|
aria-haspopup="true" aria-expanded="false" aria-label="{{ trans('common.profile_menu') }}" tabindex="0">
|
2018-10-16 13:49:16 -04:00
|
|
|
<img class="avatar" src="{{$currentUser->getAvatar(30)}}" alt="{{ $currentUser->name }}">
|
|
|
|
<span class="name">{{ $currentUser->getShortName(9) }}</span> @icon('caret-down')
|
|
|
|
</span>
|
2020-06-24 15:38:08 -04:00
|
|
|
<ul refs="dropdown@menu" class="dropdown-menu" role="menu">
|
2021-05-23 08:34:08 -04:00
|
|
|
<li>
|
2022-04-20 09:03:47 -04:00
|
|
|
<a href="{{ url('/favourites') }}" class="icon-item">
|
|
|
|
@icon('star')
|
|
|
|
<div>{{ trans('entities.my_favourites') }}</div>
|
|
|
|
</a>
|
2021-05-23 08:34:08 -04:00
|
|
|
</li>
|
2018-10-16 13:49:16 -04:00
|
|
|
<li>
|
2022-04-20 09:03:47 -04:00
|
|
|
<a href="{{ $currentUser->getProfileUrl() }}" class="icon-item">
|
|
|
|
@icon('user')
|
|
|
|
<div>{{ trans('common.view_profile') }}</div>
|
|
|
|
</a>
|
2018-10-16 13:49:16 -04:00
|
|
|
</li>
|
|
|
|
<li>
|
2022-04-20 09:03:47 -04:00
|
|
|
<a href="{{ $currentUser->getEditUrl() }}" class="icon-item">
|
|
|
|
@icon('edit')
|
|
|
|
<div>{{ trans('common.edit_profile') }}</div>
|
|
|
|
</a>
|
2018-10-16 13:49:16 -04:00
|
|
|
</li>
|
|
|
|
<li>
|
2021-11-14 16:13:24 -05:00
|
|
|
<form action="{{ url(config('auth.method') === 'saml2' ? '/saml2/logout' : '/logout') }}"
|
|
|
|
method="post">
|
|
|
|
{{ csrf_field() }}
|
2022-04-20 09:03:47 -04:00
|
|
|
<button class="icon-item">
|
|
|
|
@icon('logout')
|
|
|
|
<div>{{ trans('auth.logout') }}</div>
|
2021-11-14 16:13:24 -05:00
|
|
|
</button>
|
|
|
|
</form>
|
2018-10-16 13:49:16 -04:00
|
|
|
</li>
|
2020-04-11 15:37:51 -04:00
|
|
|
<li><hr></li>
|
|
|
|
<li>
|
2022-04-20 09:03:47 -04:00
|
|
|
@include('common.dark-mode-toggle', ['classes' => 'icon-item'])
|
2020-04-11 15:37:51 -04:00
|
|
|
</li>
|
2018-10-16 13:49:16 -04:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
@endif
|
2019-08-25 10:44:51 -04:00
|
|
|
</nav>
|
2018-10-16 13:49:16 -04:00
|
|
|
</div>
|
2019-02-03 12:34:15 -05:00
|
|
|
|
2018-10-16 13:49:16 -04:00
|
|
|
</div>
|
2020-03-07 04:43:42 -05:00
|
|
|
</header>
|