From d9d047cb3ae07da38714096e9dad12aedcc35f0a Mon Sep 17 00:00:00 2001 From: nati Date: Thu, 14 Dec 2023 12:09:47 +0200 Subject: [PATCH] Made login page mobile friendly and made every column in admin logins list sortable --- public/css/app.css | 5 ++ src/Admin/src/Form/LoginForm.php | 2 +- src/Admin/src/Service/AdminService.php | 2 +- .../templates/admin/list-logins.html.twig | 34 +++++----- src/Admin/templates/admin/login.html.twig | 64 ++++++++++--------- src/App/assets/scss/components/forms.scss | 6 ++ 6 files changed, 64 insertions(+), 49 deletions(-) diff --git a/public/css/app.css b/public/css/app.css index a79e818..0ab66bc 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -66783,6 +66783,11 @@ textarea.form-control-lg { background-color: #5cb85c; } +@media (max-width: 767px) { + .login-button { + width: 100%; + } +} #loader { transition: all 0.3s ease-in-out; opacity: 1; diff --git a/src/Admin/src/Form/LoginForm.php b/src/Admin/src/Form/LoginForm.php index 07825bb..6c8e0d9 100644 --- a/src/Admin/src/Form/LoginForm.php +++ b/src/Admin/src/Form/LoginForm.php @@ -62,7 +62,7 @@ public function init(): void 'attributes' => [ 'type' => 'submit', 'value' => 'Log in', - 'class' => 'btn btn-primary btn-block', + 'class' => 'btn btn-primary btn-block login-button', ], 'type' => Submit::class, ]); diff --git a/src/Admin/src/Service/AdminService.php b/src/Admin/src/Service/AdminService.php index 4e598fe..eda1cac 100644 --- a/src/Admin/src/Service/AdminService.php +++ b/src/Admin/src/Service/AdminService.php @@ -129,7 +129,7 @@ public function getAdminLogins( 'uuid' => $login->getUuid()->toString(), 'identity' => $login->getIdentity(), 'adminIp' => $login->getAdminIp(), - 'status' => $login->getLoginStatus(), + 'loginStatus' => $login->getLoginStatus(), 'country' => $login->getCountry(), 'continent' => $login->getContinent(), 'organization' => $login->getOrganization(), diff --git a/src/Admin/templates/admin/list-logins.html.twig b/src/Admin/templates/admin/list-logins.html.twig index 8a67d48..05ad022 100644 --- a/src/Admin/templates/admin/list-logins.html.twig +++ b/src/Admin/templates/admin/list-logins.html.twig @@ -18,23 +18,23 @@ - Identity - Ip - Status - Country - Continent - Organization - Device Type - Device Brand - Device Model - Is Mobile - Os Name - Os Version - Os Platform - Client Type - Client Name - Client Engine - Client Version + Identity + Ip + Status + Country + Continent + Organization + Device Type + Device Brand + Device Model + Is Mobile + Os Name + Os Version + Os Platform + Client Type + Client Name + Client Engine + Client Version Created diff --git a/src/Admin/templates/admin/login.html.twig b/src/Admin/templates/admin/login.html.twig index 580b625..6565291 100644 --- a/src/Admin/templates/admin/login.html.twig +++ b/src/Admin/templates/admin/login.html.twig @@ -54,40 +54,44 @@
-
-
-
- - - +
+
+
+
+
+ + + +
+
-
-
-
- {% set dummy = form.prepare() %} - {{ form().openTag(form) | raw }} -

Login

-
- {% set username = form.get('username') %} - {% set elementTranslatePlaceholder = username.getAttribute('placeholder')|trans|raw %} - {% set dummy = username.setAttribute('placeholder', elementTranslatePlaceholder) %} - {{ formElement(username) }} -
-
- {% set password = form.get('password') %} - {% set elementTranslatePlaceholder = password.getAttribute('placeholder')|trans|raw %} - {% set dummy = password.setAttribute('placeholder', elementTranslatePlaceholder) %} - {{ formElement(password) }} -
- {% set submit = form.get('submit') %} - {% set submitValue = submit.getValue|trans|raw %} - {% set dummy = submit.setAttribute('value', submitValue) %} +
+ {% set dummy = form.prepare() %} + {{ form().openTag(form) | raw }} +

Login

+
+ {% set username = form.get('username') %} + {% set elementTranslatePlaceholder = username.getAttribute('placeholder')|trans|raw %} + {% set dummy = username.setAttribute('placeholder', elementTranslatePlaceholder) %} + {{ formElement(username) }} +
+
+ {% set password = form.get('password') %} + {% set elementTranslatePlaceholder = password.getAttribute('placeholder')|trans|raw %} + {% set dummy = password.setAttribute('placeholder', elementTranslatePlaceholder) %} + {{ formElement(password) }} +
+ {% set submit = form.get('submit') %} + {% set submitValue = submit.getValue|trans|raw %} + {% set dummy = submit.setAttribute('value', submitValue) %} - {{ messagesPartial('partial::alerts', {}, null, 'user-login') }} + {{ messagesPartial('partial::alerts', {}, null, 'user-login') }} - {{ formSubmit(submit) }} + {{ formSubmit(submit) }} - {{ form().closeTag() | raw }} + {{ form().closeTag() | raw }} +
+
diff --git a/src/App/assets/scss/components/forms.scss b/src/App/assets/scss/components/forms.scss index 3b9f27a..608785c 100644 --- a/src/App/assets/scss/components/forms.scss +++ b/src/App/assets/scss/components/forms.scss @@ -255,3 +255,9 @@ .radio-success input[type="radio"]:checked + label::after { background-color: #5cb85c; } + +@media (max-width: 767px) { + .login-button { + width: 100%; + } +} \ No newline at end of file