clrghouz/resources/views/layouts/partials/topmenu.blade.php

182 lines
6.1 KiB
PHP
Raw Normal View History

2021-06-12 15:14:34 +00:00
<div id="nav-menu">
<h1>{{ $title ?? config('app.name') }}</h1>
2021-05-03 12:53:40 +00:00
2021-06-12 15:14:34 +00:00
<ul id="navlist-desktop">
2023-04-15 05:09:32 +00:00
<li><a href="{{ url($user ? 'dashboard' : '/') }}" class="@if(preg_match('#^([dashboard]?[/]?)+$#',request()->path()))thispage disabled @endif"><span>Home</span></a></li>
<li><a href="{{ url('about') }}" class="@if(preg_match('#^about#',request()->path()))thispage disabled @endif"><span>About</span></a></li>
2024-04-14 10:26:28 +00:00
<li>
<a class="@if(preg_match('#[domain|system]/list#',request()->path()))thispage @endif" type="button" data-bs-toggle="collapse" data-bs-target="#dropdown-list" aria-controls="dropdown-list" aria-expanded="false" aria-label="Toggle Lists">
<span>Lists</span>
</a>
<div class="collapse navbar-collapse" id="dropdown-list">
<ul class="dropdown-menu dropdown-menu-dark">
<li><a class="dropdown-item @if(preg_match('#^system/list#',request()->path()))thispage disabled @endif" href="{{ url('system/list') }}">BBS List</a></li>
<li><a class="dropdown-item @if(preg_match('#^domain/list#',request()->path()))thispage disabled @endif" href="{{ url('domain/list') }}">FTN List</a></li>
</ul>
</div>
</li>
@if(preg_match('#^domain/#',request()->path()) && $o->can_accept_app)
<li><a href="{{ url('join') }}" id="join_top" class="@if(preg_match('#^join#',request()->path()))thispage @endif"><span>Join</span></a></li>
@else
<li><a href="{{ url('status') }}" class="@if(preg_match('#^status#',request()->path()))thispage disabled @endif"><span>Status</span></a></li>
2021-06-12 15:14:34 +00:00
@endif
</ul>
2021-05-03 12:53:40 +00:00
<ul class="float-end">
2021-06-12 15:14:34 +00:00
@auth
<li>
2024-04-14 10:26:28 +00:00
<a class="{{ $user->switched ? 'switched' : '' }}" type="button" data-bs-toggle="collapse" data-bs-target="#user-menu-list" aria-controls="navbarNavDarkDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span>{{ $user->name }}</span>
</a>
2024-04-14 10:26:28 +00:00
<div class="collapse navbar-collapse" id="user-menu-list">
<ul class="dropdown-menu dropdown-menu-dark">
2024-04-25 05:27:45 +00:00
<li><a class="dropdown-item" href="{{ url('user/addedit',$user->id) }}">Account Settings</a></li>
<li><a class="dropdown-item" href="{{ url('user/system/register') }}">Register/Link System</a></li>
2024-04-14 10:26:28 +00:00
@can('admin')
<li><a class="dropdown-item @if(preg_match('#^setup#',request()->path()))thispage @endif" href="{{ url('setup') }}">Setup</a></li>
@endcan
@if($user->switched)
<li><a class="dropdown-item" href="{{ url('admin/switch/stop') }}">Switch Back</a></li>
@else
<li><a class="dropdown-item" href="{{ url('logout') }}">Logout</a></li>
@endif
</ul>
</div>
</li>
2021-06-12 15:14:34 +00:00
@endauth
@guest
<li><a href="{{ url('login') }}"><span>Login</span></a></li>
@endguest
</ul>
2021-05-03 12:53:40 +00:00
2021-06-26 14:34:15 +00:00
@auth
<ul class="float-end" id="searchbar">
<li><input type="text" class="ps-2" id="q" name="search" placeholder="Search..."><i class="bi bi-search"></i><div id="search_results"></div></li>
2021-06-26 14:34:15 +00:00
</ul>
@endauth
2021-06-12 15:14:34 +00:00
{{--
<div id="fontwidget">
<span id="row1">
Text mode font:
</span>
<span id="row2">
<a id="togglefonts" class="on" href="#-" onclick="toggleFonts();">[]</a>
<a id="selectfont1" class="on" href="#-" onclick="switchFont(1);">1</a>
<a id="selectfont2" href="#-" onclick="switchFont(2);" class="on">2</a>
<a id="selectfont3" href="#-" onclick="switchFont(3);" class="on">3</a>
<a id="selectfont4" href="#-" onclick="switchFont(4);" class="on">4</a>
<a id="selectfont5" href="#-" onclick="switchFont(5);" class="on">5</a>
<a id="selectfont6" href="#-" onclick="switchFont(6);" class="on">6</a>
</span>
<span id="currentfont">
IBM VGA 8x16
</span>
</div>
--}}
{{--
@todo Get rid of the CSS values if they arenot used, then delete this
<noscript>
<div id="fontwidget-no-js">
<div class="grn">Enable JavaScript for full functionality of all site features.</div>
2021-05-03 12:53:40 +00:00
</div>
2021-06-12 15:14:34 +00:00
</noscript>
--}}
2021-05-03 12:53:40 +00:00
2021-06-12 15:14:34 +00:00
{{--
@todo Is this required?
<div id="mobile-nav-content">
<ul>
<li>Oldschool PC Fonts:</li>
<li class="nobullet"><a href="../"><span>Home</span></a></li>
<li><a class="thispage"><span>Fonts</span></a></li>
<li><a href="../readme/"><span>Readme</span></a></li>
<li><a href="../showcase/"><span>Showcase</span></a></li>
<li><a href="../download/"><span>Download</span></a></li>
</ul>
<div class="mobile-button" id="mobile-button-burger" onclick="toggleSidebar();"> </div>
<div class="mobile-button" id="mobile-button-fontwidget" onclick="toggleFontWidget();">Aa</div>
</div>
--}}
<div id="sidebar">
2021-06-17 09:34:39 +00:00
@include('layouts.partials.sidebar')
2021-06-12 15:14:34 +00:00
</div>
</div>
2021-06-26 14:34:15 +00:00
@section('page-scripts')
<style>
/* Solid border */
div.typeahead.dropdown-menu > .dropdown-header {
color: #000000;
text-align: left;
}
</style>
<script type="text/javascript">
$(document).ready(function() {
$("input[id=q]").typeahead({
autoSelect: false,
scrollHeight: 10,
theme: 'bootstrap5',
delay: 500,
minLength: 2,
items: {{ $search_limit ?? 100 }},
fitToElement: false,
selectOnBlur: false,
appendTo: "#search_results",
source: function (query,process) {
search('{{ url('search') }}',query,process);
},
matcher: function () { return true; },
// Disable sorting and just return the items (items should by the ajax method)
sorter: function(items) {
return items;
},
updater: function (item) {
window.parent.location.href = item.value;
},
})
.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',
async : true,
cache : false,
beforeSend : function() {
2023-06-27 07:39:11 +00:00
if (c++ === 0) {
2021-06-26 14:34:15 +00:00
$('i.bi-search').addClass('spinner-grow spinner-grow-sm');
}
},
success : function(data) {
// if json is null, means no match, won't do again.
if(data==null || (data.length===0)) return;
process(data);
},
complete : function() {
2023-06-27 07:39:11 +00:00
if (--c === 0) {
2021-06-26 14:34:15 +00:00
$('i.bi-search').removeClass('spinner-grow spinner-grow-sm');
}
}
})
}, 500);
</script>
@append