Migration complete
This commit is contained in:
@@ -4,49 +4,121 @@
|
||||
<i data-lucide="menu"></i>
|
||||
</button>
|
||||
|
||||
<form class="search-bar" action="{{ route('entries.index') }}">
|
||||
<input type="text" name="s" placeholder="Search" />
|
||||
<button type="submit" class="search-button">
|
||||
<i data-lucide="search" size="18" color="var(--text2)"></i>
|
||||
</button>
|
||||
</form>
|
||||
<form id="topbar-search-form" class="search-bar" method="GET">
|
||||
|
||||
<select id="search-scope" class="search-scope-select" name="search_scope">
|
||||
<option value="entries" selected>Entries</option>
|
||||
<option value="news">News</option>
|
||||
<option value="forum">Forum</option>
|
||||
</select>
|
||||
|
||||
<input type="text" id="search-input" placeholder="Search" autocomplete="off">
|
||||
|
||||
<button type="submit" class="search-button">
|
||||
<i data-lucide="search" size="18" color="var(--text2)"></i>
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
(function () {
|
||||
const form = document.getElementById('topbar-search-form');
|
||||
const select = document.getElementById('search-scope');
|
||||
const input = document.getElementById('search-input');
|
||||
|
||||
const scopes = {
|
||||
entries: { action: '{{ route('entries.index') }}', param: 's' },
|
||||
news: { action: '{{ route('news.index') }}', param: 's' },
|
||||
forum: {
|
||||
action: '{{ xfRoute('search/2147483647/') }}',
|
||||
param: 'q',
|
||||
extra: { o: 'relevance' },
|
||||
},
|
||||
};
|
||||
|
||||
form.addEventListener('submit', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
const term = input.value.trim();
|
||||
if (!term) return;
|
||||
|
||||
const cfg = scopes[select.value];
|
||||
const params = new URLSearchParams({ [cfg.param]: term, ...(cfg.extra || {}) });
|
||||
|
||||
window.location = cfg.action + '?' + params.toString();
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
<div class="topbar-actions">
|
||||
|
||||
@can('is-admin')
|
||||
@php $topbarAdminSeparator = true; @endphp
|
||||
<a href="{{ config('app.forum_url') . '/admin.php' }}" class="btn">
|
||||
<a href="{{ config('app.forum_url') . '/admin.php' }}" class="btn topbar-admin-btn" title="Admin">
|
||||
<i data-lucide="landmark" size="18"></i>
|
||||
</a>
|
||||
<a href="{{ config('app.url') . '/manage' }}" class="btn">
|
||||
<a href="{{ config('app.url') . '/manage' }}" class="btn topbar-admin-btn" title="Manage">
|
||||
<i data-lucide="shield-cog" size="18"></i>
|
||||
</a>
|
||||
@endcan
|
||||
|
||||
@if( $topbarAdminSeparator )
|
||||
<div class="vertical-separator"></div>
|
||||
<div class="vertical-separator topbar-admin-btn"></div>
|
||||
@endif
|
||||
|
||||
@can('is-mod')
|
||||
@php $topbarModSeparator = true; @endphp
|
||||
<a href="{{ route('modcp.index') }}" class="btn">
|
||||
<a href="{{ route('modcp.index') }}" class="btn topbar-mod-btn" title="Moderation">
|
||||
<i data-lucide="siren" size="18"></i>
|
||||
</a>
|
||||
<a href="{{ xfRoute('approval-queue') }}" class="btn">
|
||||
<a href="{{ xfRoute('approval-queue') }}" class="btn topbar-mod-btn" title="Approvals">
|
||||
<i data-lucide="message-circle-check" size="18"></i>
|
||||
</a>
|
||||
<a href="{{ xfRoute('reports') }}" class="btn">
|
||||
<a href="{{ xfRoute('reports') }}" class="btn topbar-mod-btn" title="Reports">
|
||||
<i data-lucide="triangle-alert" size="18"></i>
|
||||
</a>
|
||||
@endcan
|
||||
|
||||
@if( $topbarModSeparator )
|
||||
<div class="vertical-separator"></div>
|
||||
<div class="vertical-separator topbar-mod-btn"></div>
|
||||
@endif
|
||||
|
||||
{{-- Users --}}
|
||||
<div x-data="{ open: false }" class="topbar-more-container" style="position: relative;">
|
||||
@canany(['is-admin','is-mod'])
|
||||
<button @click="open = !open" @click.outside="open = false" class="btn topbar-btn-more" title="More actions">
|
||||
<i data-lucide="more-vertical" size="18"></i>
|
||||
</button>
|
||||
<div x-show="open" class="topbar-more-menu">
|
||||
@can('is-admin')
|
||||
<a href="{{ config('app.forum_url') . '/admin.php' }}" class="topbar-more-item" title="Admin">
|
||||
<i data-lucide="landmark" size="16"></i>
|
||||
<span>Admin</span>
|
||||
</a>
|
||||
<a href="{{ config('app.url') . '/manage' }}" class="topbar-more-item" title="Manage">
|
||||
<i data-lucide="shield-cog" size="16"></i>
|
||||
<span>Manage</span>
|
||||
</a>
|
||||
@endcan
|
||||
|
||||
@can('is-mod')
|
||||
<a href="{{ route('modcp.index') }}" class="topbar-more-item" title="Moderation">
|
||||
<i data-lucide="siren" size="16"></i>
|
||||
<span>Mod CP</span>
|
||||
</a>
|
||||
<a href="{{ xfRoute('approval-queue') }}" class="topbar-more-item" title="Approvals">
|
||||
<i data-lucide="message-circle-check" size="16"></i>
|
||||
<span>Approval Queue</span>
|
||||
</a>
|
||||
<a href="{{ xfRoute('reports') }}" class="topbar-more-item" title="Reports">
|
||||
<i data-lucide="triangle-alert" size="16"></i>
|
||||
<span>Reports</span>
|
||||
</a>
|
||||
@endcan
|
||||
</div>
|
||||
@endcanany
|
||||
</div>
|
||||
|
||||
@can('create','\App\Models\Entry')
|
||||
<a href="{{ route('submit.index') }}" class="btn">
|
||||
<a href="{{ route('submit.index') }}" class="btn" title="Submit">
|
||||
<i data-lucide="hard-drive-upload" size="18"></i>
|
||||
</a>
|
||||
@endcan
|
||||
|
||||
Reference in New Issue
Block a user