Add client open mode preference (same tab / new window) to user settings

This commit is contained in:
root
2026-06-26 19:53:32 +02:00
parent 6add7cdfb1
commit 9c92cd297a
8 changed files with 200 additions and 37 deletions
@@ -22,30 +22,31 @@
</div>
<div class="flex flex-col gap-y-2 md:flex-row md:gap-x-4">
<a data-turbolinks="false" href="{{ route('nitro-client') }}">
<button
class="font-bold py-3 px-6 rounded-xl shadow-xl border-2 transition-all duration-300 hover:scale-110 hover:shadow-2xl text-base tracking-wide"
style="background-color: var(--button-color); color: var(--button-text-color); border-color: rgba(255,255,255,0.3);">
<span class="flex items-center gap-2">
<i class="fa-solid fa-gamepad"></i>
<span class="-md">{{ __('Nitro client') }}</span>
</span>
</button>
</a>
@php $clientOpenMode = auth()->user()->preferences['client_open_mode'] ?? 'same'; @endphp
<a data-turbolinks="false" href="{{ route('nitro-client') }}" @if($clientOpenMode === 'new_window') target="_blank" rel="noopener" @endif>
<button
class="font-bold py-3 px-6 rounded-xl shadow-xl border-2 transition-all duration-300 hover:scale-110 hover:shadow-2xl text-base tracking-wide"
style="background-color: var(--button-color); color: var(--button-text-color); border-color: rgba(255,255,255,0.3);">
<span class="flex items-center gap-2">
<i class="fa-solid fa-gamepad"></i>
<span class="-md">{{ __('Nitro client') }}</span>
</span>
</button>
</a>
@if (config('habbo.client.flash_enabled'))
<a data-turbolinks="false" href="{{ route('flash-client') }}">
<button
class="font-bold py-3 px-6 rounded-xl shadow-xl border-2 transition-all duration-300 hover:scale-110 hover:shadow-2xl text-base tracking-wide"
style="background-color: var(--button-color); color: var(--button-text-color); border-color: rgba(255,255,255,0.3);">
<span class="flex items-center gap-2">
<i class="fa-solid fa-bolt"></i>
<span class="-md">{{ __('Flash client') }}</span>
</span>
</button>
</a>
@endif
</div>
@if (config('habbo.client.flash_enabled'))
<a data-turbolinks="false" href="{{ route('flash-client') }}" @if($clientOpenMode === 'new_window') target="_blank" rel="noopener" @endif>
<button
class="font-bold py-3 px-6 rounded-xl shadow-xl border-2 transition-all duration-300 hover:scale-110 hover:shadow-2xl text-base tracking-wide"
style="background-color: var(--button-color); color: var(--button-text-color); border-color: rgba(255,255,255,0.3);">
<span class="flex items-center gap-2">
<i class="fa-solid fa-bolt"></i>
<span class="-md">{{ __('Flash client') }}</span>
</span>
</button>
</a>
@endif
</div>
</div>
@endauth
@@ -13,11 +13,12 @@
</a>
</div>
<a data-turbolinks="false" href="{{ route('nitro-client') }}">
<button
class="font-bold py-2 px-4 rounded-lg shadow-lg transition-all duration-300 hover:scale-105 hover:opacity-90"
style="background-color: var(--button-color); color: var(--button-text-color);">
{{ __('Go to :hotel', ['hotel' => setting('hotel_name')]) }}
</button>
</a>
@php $clientOpenMode = auth()->user()->preferences['client_open_mode'] ?? 'same'; @endphp
<a data-turbolinks="false" href="{{ route('nitro-client') }}" @if($clientOpenMode === 'new_window') target="_blank" rel="noopener" @endif>
<button
class="font-bold py-2 px-4 rounded-lg shadow-lg transition-all duration-300 hover:scale-105 hover:opacity-90"
style="background-color: var(--button-color); color: var(--button-text-color);">
{{ __('Go to :hotel', ['hotel' => setting('hotel_name')]) }}
</button>
</a>
</div>