From c47f296f17cb16dbb3769c84a7d9895368b6d738 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 16 Oct 2018 10:59:35 +0100 Subject: [PATCH] Change location of switch user --- app/Providers/AppServiceProvider.php | 5 +++ public/css/app.css | 44 ++++++++++++++++++++++++--- public/mix-manifest.json | 6 ++-- resources/assets/sass/_app.scss | 32 ++++++++++++++++--- resources/views/layouts/app.blade.php | 14 +++++++-- 5 files changed, 88 insertions(+), 13 deletions(-) diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index fce89c09..8e9daf59 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -59,7 +59,12 @@ class AppServiceProvider extends ServiceProvider $lang = Setting::fetch('language'); \App::setLocale($lang); + $allusers = User::all(); + $current_user = User::currentUser(); + $view->with('alt_bg', $alt_bg ); + $view->with('allusers', $allusers ); + $view->with('current_user', $current_user ); }); diff --git a/public/css/app.css b/public/css/app.css index bbfd705f..814f08ff 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -234,14 +234,50 @@ body { } #switchuser { - background: rgba(0, 0, 0, 0.6); + background: rgba(0, 0, 0, 0.5); position: absolute; - padding: 5px; + padding: 10px; color: white; text-align: center; - top: 0; + bottom: 0; left: 0; - right: 0; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + border-top: 2px solid rgba(255, 255, 255, 0.15); + border-right: 2px solid rgba(255, 255, 255, 0.15); + -webkit-box-shadow: 0 0 10px 0px rgba(0, 0, 0, 0.4); + box-shadow: 0 0 10px 0px rgba(0, 0, 0, 0.4); + border-radius: 0 9px 0 0; + line-height: 1.5; + font-size: 14px; +} + +#switchuser img { + width: 50px; + margin-bottom: 5px; +} + +#switchuser .btn { + font-size: 13px; + color: white; + text-decoration: none; + margin-left: -10px; + margin-right: -12px; + margin-bottom: -10px; + margin-top: 8px; + border-radius: 0; + width: calc(100% + 22px); } #app { diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 4a6d1f2a..43aa0022 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,4 +1,4 @@ { - "/css/app.css": "/css/app.css?id=6bc80b2f799b708a8024", - "/js/app.js": "/js/app.js?id=32cbf6f4924b46ae7e05" -} \ No newline at end of file + "/css/app.css": "/css/app.css?id=1dc828711282cb6af1c7", + "/js/app.js": "/js/app.js?id=f18d23b8fc7a094a2c66" +} diff --git a/resources/assets/sass/_app.scss b/resources/assets/sass/_app.scss index f81a66a0..2ea16fd6 100644 --- a/resources/assets/sass/_app.scss +++ b/resources/assets/sass/_app.scss @@ -8,14 +8,38 @@ body { background: $body-bg; } #switchuser { - background: rgba(0,0,0,0.6); + background: rgba(0,0,0,0.5); position: absolute; - padding: 5px; + padding: 10px; color: white; text-align: center; - top:0; + bottom:0; left: 0; - right: 0; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + border-top: 2px solid rgba(255, 255, 255, 0.15); + border-right: 2px solid rgba(255, 255, 255, 0.15); + box-shadow: 0 0 10px 0px rgba(0, 0, 0, 0.4); + border-radius: 0 9px 0 0; + line-height: 1.5; + font-size: 14px; + img { + width: 50px; + margin-bottom: 5px; + } + .btn { + font-size: 13px; + color: white; + text-decoration: none; + margin-left: -10px; + margin-right: -12px; + margin-bottom: -10px; + margin-top: 8px; + border-radius: 0; + width: calc(100% + 22px); + } } #app { display: flex; diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 18dfe6a4..12509709 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -71,7 +71,17 @@ @endif - Switch User + @if($allusers->count() > 1) +
+ @if($current_user->avatar) + + @else + + @endif + {{ $current_user->name }} + Switch User +
+ @endif @yield('content')
@@ -81,7 +91,7 @@ @endif - @if(App\User::currentUser()->id === 1) + @if($current_user->id === 1) @endif