Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/adminlte.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@

'usermenu_enabled' => true,
'usermenu_header' => false,
'usermenu_header_class' => 'bg-primary',
'usermenu_header_class' => 'text-bg-primary',
'usermenu_image' => false,
'usermenu_desc' => false,
'usermenu_profile_url' => false,
Expand Down
2 changes: 1 addition & 1 deletion docs/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ wired into Breeze/Fortify. To customize them, publish with
| `adminlte::auth.register` | `auth/register.blade.php` |
| `adminlte::auth.login-v2` | `auth/login-v2.blade.php` |
| `adminlte::auth.register-v2` | `auth/register-v2.blade.php` |
| `adminlte::auth.lockscreen` | `auth/lockscreen.blade.php` |
| `adminlte::auth.lockscreen-v2` | `auth/lockscreen-v2.blade.php` |
| `adminlte::auth.passwords.email` | `auth/passwords/email.blade.php` |
| `adminlte::auth.passwords.reset` | `auth/passwords/reset.blade.php` |

Expand Down
2 changes: 1 addition & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ block in the published `resources/css/adminlte.css`.
| `usermenu_header_class` | `'bg-primary'` | Background class for the user dropdown header. |
| `usermenu_image` | `false` | Show the user's avatar in the dropdown. |
| `usermenu_desc` | `false` | Show a description/subtitle under the user's name. |
| `usermenu_profile_url` | `false` | URL for the dropdown's "Profile" link (false to hide). |
| `usermenu_profile_url` | `false` | URL for the dropdown's "Profile" link (false to hide, true to 'admin/profile'). |

---

Expand Down
83 changes: 83 additions & 0 deletions resources/views/auth/lockscreen-v2.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
@php
$title = trim($title ?? config('adminlte.title', 'AdminLTE 4'));

$user = auth()->user();
$name = $user->name;
$avatar = !empty($user?->profile_photo_url)
? $user->profile_photo_url
: asset('vendor/adminlte/img/user2-160x160.jpg');
@endphp
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">

<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
<meta content="{{ csrf_token() }}" name="csrf-token">
<title>{{ $title }}</title>
{{-- Bootstrap Icons ship via the Vite bundle (imported in resources/css/adminlte.css) --}}
@vite(['resources/css/adminlte.css', 'resources/js/adminlte.js'])
@stack('css')
</head>

<body class="lockscreen bg-body-secondary app-loaded">
<main class="lockscreen-wrapper" id="main" tabindex="-1">
<h1 class="lockscreen-logo">
<a href="../index2.html">
@if (config('adminlte.auth_logo.enabled', false))
<img @if (config('adminlte.auth_logo.img.class', null)) class="{{ config('adminlte.auth_logo.img.class') }}" @endif
@if (config('adminlte.auth_logo.img.width', null)) width="{{ config('adminlte.auth_logo.img.width') }}" @endif
@if (config('adminlte.auth_logo.img.height', null)) height="{{ config('adminlte.auth_logo.img.height') }}" @endif
alt="{{ config('adminlte.auth_logo.img.alt') }}"
src="{{ asset(config('adminlte.auth_logo.img.path')) }}">
@else
<img alt="{{ config('adminlte.logo_img_alt') }}" height="50"
src="{{ asset(config('adminlte.logo_img')) }}">
@endif
{!! config('adminlte.logo') !!}
</a>
</h1>

<div class="lockscreen-name">{{ $name }}</div>

<div class="lockscreen-item">
<div class="lockscreen-image">
<img alt="John Doe" src="{{ $avatar }}">
</div>

<form action="{{ route('password.confirm') }}" class="lockscreen-credentials" method="post">
@csrf
<label class="visually-hidden" for="lockscreenPassword">{{ __('adminlte.password') }}</label>

<div class="input-group">
<input class="form-control @error('password') is-invalid @enderror" id="lockscreenPassword"
inputmode="numeric" name="password" placeholder="{{ __('adminlte.password') }}" required
type="password">

<div class="input-group-text border-0 bg-transparent px-1">
<button aria-label="{{ __('adminlte.sign_in') }}" class="btn shadow-none" type="submit">
<i class="bi bi-box-arrow-right text-body-secondary"></i>
</button>
</div>

@error('password')
<div class="invalid-feedback d-block">{{ __($message) }}</div>
@enderror
</div>
</form>
</div>

<div class="help-block text-center">{{ __('adminlte.confirm_password_message') }}</div>
<div class="text-center">
<a class="text-decoration-none"
href="{{ route('login') }}">{{ __('adminlte.sign_in_as_different_user') }}</a>
</div>
<div class="lockscreen-footer text-center">
{!! config('adminlte.footer_left') !!}
</div>
</main>

@stack('js')
</body>

</html>
40 changes: 28 additions & 12 deletions resources/views/partials/usermenu.blade.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
@php
$user = auth()->user();
$name = $user->name ?? ($user->email ?? 'Guest');
$avatar = (config('adminlte.usermenu_image') && ! empty($user?->profile_photo_url))
$avatar = !empty($user?->profile_photo_url)
? $user->profile_photo_url
: asset('vendor/adminlte/img/user2-160x160.jpg');
$memberSince = $user?->created_at ? $user->created_at->format('M. Y') : null;
$profileUrl = config('adminlte.usermenu_profile_url', false) === true
? 'admin/profile'
: config('adminlte.usermenu_profile_url');
@endphp
<li class="nav-item dropdown user-menu">
<a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown">
Expand All @@ -13,13 +16,23 @@
</a>
<ul class="dropdown-menu dropdown-menu-lg dropdown-menu-end">
{{-- Header --}}
<li class="user-header text-bg-primary">
<img src="{{ $avatar }}" class="rounded-circle shadow" alt="{{ $name }}" width="90" height="90">
<p>
{{ $name }}
@if ($memberSince)<small>{{ __('adminlte.member_since') }} {{ $memberSince }}</small>@endif
</p>
</li>

@if(config('adminlte.usermenu_header'))
<li class="user-header {{ config('adminlte.usermenu_header_class', 'text-bg-primary') }}
@if(!config('adminlte.usermenu_image')) h-auto @endif" style="min-height: 0px;">

@if(config('adminlte.usermenu_image'))
<img src="{{ $avatar }}" class="rounded-circle shadow" alt="{{ $name }}" width="90" height="90">
@endif
<p>
{{ $name }}
@if(config('adminlte.usermenu_desc'))
@if ($memberSince)<small>{{ __('adminlte.member_since') }} {{ $memberSince }}</small>@endif
@endif
</p>
</li>
@endif

{{-- Body --}}
<li class="user-body">
<div class="row">
Expand All @@ -30,10 +43,13 @@
</li>
{{-- Footer --}}
<li class="user-footer">
<a href="{{ url(config('adminlte.usermenu_profile_url') ?: 'admin/profile') }}" class="btn btn-outline-secondary">
{{ __('adminlte.profile') }}
</a>
<a href="#" class="btn btn-outline-danger float-end"
@if (config('adminlte.usermenu_profile_url'))
<a href="{{ $profileUrl }}" class="btn btn-outline-secondary">
{{ __('adminlte.profile') }}
</a>
@endif

<a href="#" class="btn btn-outline-danger float-end @if(!config('adminlte.usermenu_profile_url')) w-100 @endif"
onclick="event.preventDefault(); document.getElementById('adminlte-logout-form').submit();">
{{ __('adminlte.sign_out') }}
</a>
Expand Down