2018-04-23 07:45:21 +00:00
|
|
|
<!-- Main Header -->
|
2019-02-08 12:42:58 +00:00
|
|
|
<!-- Navbar -->
|
|
|
|
<nav class="main-header navbar navbar-expand bg-white navbar-light border-bottom">
|
|
|
|
<!-- Left navbar links -->
|
|
|
|
<ul class="navbar-nav">
|
|
|
|
<li class="nav-item">
|
2020-05-06 06:30:16 +00:00
|
|
|
<a class="nav-link" data-widget="pushmenu" href="#"><i class="fas fa-bars"></i></a>
|
2019-02-08 12:42:58 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<!-- SEARCH FORM -->
|
|
|
|
<form class="form-inline ml-3">
|
|
|
|
<div class="input-group input-group-sm">
|
2019-11-25 22:58:45 +00:00
|
|
|
<input class="form-control form-control-navbar" name="q" type="search" placeholder="Search" aria-label="Search" autocomplete="off">
|
2019-02-08 12:42:58 +00:00
|
|
|
<div class="input-group-append">
|
2021-04-23 06:03:39 +00:00
|
|
|
<span class="input-group-text"><i class="fas fa-search"></i></span>
|
|
|
|
<span class="p-1 d-none" name="searching"><i class="fas fa-spinner fa-spin" style="margin-top: .33em; width: 1em; height: 1em;"></i></span>
|
2019-02-08 12:42:58 +00:00
|
|
|
</div>
|
2019-02-18 09:44:17 +00:00
|
|
|
<div id="search_results"></div>
|
2018-04-23 07:45:21 +00:00
|
|
|
</div>
|
2019-02-08 12:42:58 +00:00
|
|
|
</form>
|
|
|
|
|
|
|
|
<!-- Right navbar links -->
|
|
|
|
<ul class="navbar-nav ml-auto">
|
|
|
|
@include('adminlte::layouts.partials.topmenu')
|
|
|
|
|
|
|
|
@if(Auth::check())
|
|
|
|
<!-- Profile Settings -->
|
|
|
|
<li class="nav-item dropdown">
|
|
|
|
<a class="nav-link" data-toggle="dropdown" href="#">
|
2020-05-06 06:30:16 +00:00
|
|
|
<i class="fas fa-cog"></i>
|
2019-02-08 12:42:58 +00:00
|
|
|
</a>
|
|
|
|
<div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
|
2019-06-17 01:44:56 +00:00
|
|
|
<span class="dropdown-item dropdown-header @if($user->switched) bg-danger @endif">
|
|
|
|
@if($user->switched)
|
|
|
|
SUDO (<small>{{ $user->name ?: 'User Name' }}</small>)
|
|
|
|
@else
|
|
|
|
{{ $user->name ?: 'User Name' }}
|
|
|
|
@endif
|
|
|
|
</span>
|
2019-02-08 12:42:58 +00:00
|
|
|
|
|
|
|
<div class="dropdown-divider"></div>
|
|
|
|
<a href="{{ url('settings') }}" class="dropdown-item">
|
2020-05-06 06:30:16 +00:00
|
|
|
<i class="fas fa-user mr-2"></i> Settings
|
2019-02-08 12:42:58 +00:00
|
|
|
</a>
|
|
|
|
|
|
|
|
<div class="dropdown-divider"></div>
|
2019-06-17 01:44:56 +00:00
|
|
|
@if ($user->switched)
|
2021-10-18 01:55:17 +00:00
|
|
|
<a href="{{ url('/admin/switch/stop') }}" class="dropdown-item">
|
2020-05-06 06:30:16 +00:00
|
|
|
<i class="fas fa-sign-out-alt mr-2"></i> {{ trans('adminlte_lang::message.switchoff') }}
|
2019-06-17 01:44:56 +00:00
|
|
|
</a>
|
|
|
|
@else
|
|
|
|
<a href="{{ url('logout') }}" class="dropdown-item">
|
2020-05-06 06:30:16 +00:00
|
|
|
<i class="fas fa-sign-out-alt mr-2"></i> Log Out
|
2019-06-17 01:44:56 +00:00
|
|
|
</a>
|
|
|
|
@endif
|
2019-02-08 12:42:58 +00:00
|
|
|
</div>
|
|
|
|
</li>
|
2019-04-11 12:30:03 +00:00
|
|
|
@else
|
2020-05-06 06:30:16 +00:00
|
|
|
<a href="{{ url()->current().'?login=1' }}" class="text-muted pr-2"><i class="fas fa-lock"></i></a>
|
2019-02-08 12:42:58 +00:00
|
|
|
@endif
|
|
|
|
|
|
|
|
<!-- Control Side Bar -->
|
|
|
|
@isset($controlsidebar)
|
|
|
|
<li class="nav-item">
|
|
|
|
<a class="nav-link" data-widget="control-sidebar" data-slide="true" href="#">
|
2020-05-06 06:30:16 +00:00
|
|
|
<i class="fas fa-th"></i>
|
2019-02-08 12:42:58 +00:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
@endisset
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
|
|
|
|
@section('page-scripts')
|
2020-05-26 01:12:54 +00:00
|
|
|
<style>
|
|
|
|
/* Solid border */
|
|
|
|
div.typeahead.dropdown-menu > .dropdown-header {
|
|
|
|
color: #000000;
|
|
|
|
text-align: left;
|
|
|
|
}
|
|
|
|
</style>
|
2019-02-08 12:42:58 +00:00
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function() {
|
2022-08-03 06:32:38 +00:00
|
|
|
$('input[name=q]').typeahead({
|
2020-05-26 01:12:54 +00:00
|
|
|
autoSelect: false,
|
|
|
|
scrollHeight: 10,
|
|
|
|
theme: 'bootstrap4',
|
2019-03-22 10:52:44 +00:00
|
|
|
delay: 500,
|
2019-02-08 12:42:58 +00:00
|
|
|
minLength: 2,
|
2020-05-26 01:12:54 +00:00
|
|
|
items: {{ isset($search_limit) ? $search_limit : 100 }},
|
2019-02-08 12:42:58 +00:00
|
|
|
fitToElement: false,
|
2020-05-26 01:12:54 +00:00
|
|
|
selectOnBlur: false,
|
2019-02-08 12:42:58 +00:00
|
|
|
appendTo: "#search_results",
|
|
|
|
source: function (query,process) {
|
|
|
|
search('{{ url("search",['date'=>isset($ido) ? $ido->id : NULL]) }}',query,process);
|
|
|
|
},
|
|
|
|
|
|
|
|
matcher: function () { return true; },
|
|
|
|
|
2020-06-11 06:18:39 +00:00
|
|
|
// Disable sorting and just return the items (items should by the ajax method)
|
|
|
|
sorter: function(items) {
|
|
|
|
return items;
|
|
|
|
},
|
|
|
|
|
2019-02-08 12:42:58 +00:00
|
|
|
updater: function (item) {
|
2020-05-26 01:12:54 +00:00
|
|
|
window.parent.location.href = item.value;
|
2019-02-08 12:42:58 +00:00
|
|
|
},
|
|
|
|
})
|
|
|
|
.on('keyup keypress', function(event) {
|
|
|
|
var key = event.keyCode || event.which;
|
|
|
|
if (key === 13) {
|
|
|
|
event.preventDefault();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
var c=0;
|
|
|
|
var search = _.debounce(function(url,query,process,icon){
|
|
|
|
$.ajax({
|
|
|
|
url : url,
|
|
|
|
type : 'GET',
|
|
|
|
data : 'term=' + query,
|
|
|
|
dataType : 'JSON',
|
2019-02-18 09:44:17 +00:00
|
|
|
async : true,
|
2019-02-08 12:42:58 +00:00
|
|
|
cache : false,
|
|
|
|
beforeSend : function() {
|
|
|
|
if (c++ == 0) {
|
|
|
|
if (icon)
|
|
|
|
$('i[name='+icon+']').addClass("fa-spin");
|
2019-02-18 09:44:17 +00:00
|
|
|
else {
|
|
|
|
$('span[name=searching]').removeClass("d-none");
|
|
|
|
}
|
2019-02-08 12:42:58 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
success : function(data) {
|
|
|
|
// if json is null, means no match, won't do again.
|
|
|
|
if(data==null || (data.length===0)) return;
|
|
|
|
|
2020-05-26 01:12:54 +00:00
|
|
|
process(data);
|
2019-02-08 12:42:58 +00:00
|
|
|
},
|
|
|
|
complete : function() {
|
|
|
|
if (--c == 0) {
|
|
|
|
if (icon)
|
|
|
|
$('i[name='+icon+']').removeClass("fa-spin");
|
2019-02-18 09:44:17 +00:00
|
|
|
else {
|
|
|
|
$('span[name=searching]').addClass("d-none");
|
|
|
|
}
|
2019-02-08 12:42:58 +00:00
|
|
|
}
|
2022-08-03 06:32:38 +00:00
|
|
|
},
|
|
|
|
statusCode: {
|
|
|
|
401: function() {
|
|
|
|
window.parent.location.href = '{{ route('login') }}';
|
|
|
|
}
|
2019-02-08 12:42:58 +00:00
|
|
|
}
|
|
|
|
})
|
|
|
|
}, 500);
|
|
|
|
</script>
|
|
|
|
@append
|