Skip to content

Commit

Permalink
Merge pull request #206 from PopNatanael/4.0
Browse files Browse the repository at this point in the history
Made login page mobile friendly and made every column in admin logins…
  • Loading branch information
arhimede authored Dec 14, 2023
2 parents 353f3c6 + d9d047c commit a569d87
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 49 deletions.
5 changes: 5 additions & 0 deletions public/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Admin/src/Form/LoginForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
]);
Expand Down
2 changes: 1 addition & 1 deletion src/Admin/src/Service/AdminService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
34 changes: 17 additions & 17 deletions src/Admin/templates/admin/list-logins.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@
<thead>

<tr>
<th data-field="identity" data-sortable="false">Identity</th>
<th data-field="adminIp" data-sortable="false">Ip</th>
<th data-field="status" data-sortable="false">Status</th>
<th data-field="country" data-sortable="false">Country</th>
<th data-field="continent" data-sortable="false">Continent</th>
<th data-field="organization" data-sortable="false">Organization</th>
<th data-field="deviceType" data-sortable="false">Device Type</th>
<th data-field="deviceBrand" data-sortable="false">Device Brand</th>
<th data-field="deviceModel" data-sortable="false">Device Model</th>
<th data-field="isMobile" data-sortable="false">Is Mobile</th>
<th data-field="osName" data-sortable="false">Os Name</th>
<th data-field="osVersion" data-sortable="false">Os Version</th>
<th data-field="osPlatform" data-sortable="false">Os Platform</th>
<th data-field="clientType" data-sortable="false">Client Type</th>
<th data-field="clientName" data-sortable="false">Client Name</th>
<th data-field="clientEngine" data-sortable="false">Client Engine</th>
<th data-field="clientVersion" data-sortable="false">Client Version</th>
<th data-field="identity" data-sortable="true">Identity</th>
<th data-field="adminIp" data-sortable="true">Ip</th>
<th data-field="loginStatus" data-sortable="true">Status</th>
<th data-field="country" data-sortable="true">Country</th>
<th data-field="continent" data-sortable="true">Continent</th>
<th data-field="organization" data-sortable="true">Organization</th>
<th data-field="deviceType" data-sortable="true">Device Type</th>
<th data-field="deviceBrand" data-sortable="true">Device Brand</th>
<th data-field="deviceModel" data-sortable="true">Device Model</th>
<th data-field="isMobile" data-sortable="true">Is Mobile</th>
<th data-field="osName" data-sortable="true">Os Name</th>
<th data-field="osVersion" data-sortable="true">Os Version</th>
<th data-field="osPlatform" data-sortable="true">Os Platform</th>
<th data-field="clientType" data-sortable="true">Client Type</th>
<th data-field="clientName" data-sortable="true">Client Name</th>
<th data-field="clientEngine" data-sortable="true">Client Engine</th>
<th data-field="clientVersion" data-sortable="true">Client Version</th>
<th data-field="created" data-sortable="true">Created</th>
</tr>

Expand Down
64 changes: 34 additions & 30 deletions src/Admin/templates/admin/login.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -54,40 +54,44 @@
</head>
<body class="app">
<div class="peers ai-s fxw-nw h-100vh align-items-center">
<div class="col-6 col-md-6 peer pX-40 pY-80 h-100 bgc-white scrollable pos-r">
<div class="pos-a centerXY">
<div class="bgc-white bdrs-50p w-100">
<a href="{{ path('dashboard') }}">
<img class="pos-a centerXY logo-img" src="{{ asset('images/app/logo.svg') }}" alt="">
</a>
<div class="container">
<div class="row">
<div class="col-md-6 peer pX-40 pY-80 h-100 bgc-white scrollable pos-r">
<div class="pos-a centerXY">
<div class="bgc-white bdrs-50p w-100">
<a href="{{ path('dashboard') }}">
<img class="pos-a centerXY logo-img" src="{{ asset('images/app/logo.svg') }}" alt="">
</a>
</div>
</div>
</div>
</div>
</div>
<div class="col-2 col-md-2 mL-10">
{% set dummy = form.prepare() %}
{{ form().openTag(form) | raw }}
<h4 class="fw-300 c-grey-900 mB-20">Login</h4>
<div class="mb-3">
{% set username = form.get('username') %}
{% set elementTranslatePlaceholder = username.getAttribute('placeholder')|trans|raw %}
{% set dummy = username.setAttribute('placeholder', elementTranslatePlaceholder) %}
{{ formElement(username) }}
</div>
<div class="mb-3">
{% set password = form.get('password') %}
{% set elementTranslatePlaceholder = password.getAttribute('placeholder')|trans|raw %}
{% set dummy = password.setAttribute('placeholder', elementTranslatePlaceholder) %}
{{ formElement(password) }}
</div>
{% set submit = form.get('submit') %}
{% set submitValue = submit.getValue|trans|raw %}
{% set dummy = submit.setAttribute('value', submitValue) %}
<div class="col-md-4">
{% set dummy = form.prepare() %}
{{ form().openTag(form) | raw }}
<h4 class="fw-300 c-grey-900 mB-20">Login</h4>
<div class="mb-3">
{% set username = form.get('username') %}
{% set elementTranslatePlaceholder = username.getAttribute('placeholder')|trans|raw %}
{% set dummy = username.setAttribute('placeholder', elementTranslatePlaceholder) %}
{{ formElement(username) }}
</div>
<div class="mb-3">
{% set password = form.get('password') %}
{% set elementTranslatePlaceholder = password.getAttribute('placeholder')|trans|raw %}
{% set dummy = password.setAttribute('placeholder', elementTranslatePlaceholder) %}
{{ formElement(password) }}
</div>
{% 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 }}
</div>
</div>
</div>
</div>
</body>
Expand Down
6 changes: 6 additions & 0 deletions src/App/assets/scss/components/forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -255,3 +255,9 @@
.radio-success input[type="radio"]:checked + label::after {
background-color: #5cb85c;
}

@media (max-width: 767px) {
.login-button {
width: 100%;
}
}

0 comments on commit a569d87

Please sign in to comment.