1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-24 23:25:24 +00:00

reorganize otp_login and login pages

This commit is contained in:
catborise 2023-05-11 15:31:42 +03:00
parent c099cd06ef
commit 6e76eb2cd9
3 changed files with 38 additions and 37 deletions

View file

@ -1,30 +1,37 @@
{% extends 'base.html' %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% load static %} {% load static %}
{% load django_bootstrap5 %} {% load django_bootstrap5 %}
{% block title %}WebVirtCloud{% endblock title %} {% block title %}{% trans "WebVirtCloud" %} - {% trans "Sign In with OTP" %}{% endblock title %}
{% block page_heading %}WebVirtCloud{% endblock page_heading %} {% block style %}
<link href="{% static "css/signin.css" %}" rel="stylesheet">
{% endblock style %}
{% block content %} {% block content %}
<div class="row"> <div class="login-box">
<div class="col-6 offset-3" role="main"> <div class="page-header">
<div class="card"> <a href="/"><h1>WebVirtCloud</h1></a>
<div class="card-body"> </div>
{% if form.errors %} <hr>
{% bootstrap_form_errors form %} <div class="col-12" role="main">
{% endif %} {% if form.errors %}
<form class="form-signin" method="post" role="form" aria-label="Login form"> <div class="alert alert-danger" role="alert">
{% csrf_token %} {% bootstrap_form_errors form %}
{% bootstrap_field form.username layout='horizontal' %}
{% bootstrap_field form.password layout='horizontal' %}
{% bootstrap_field form.otp_token layout='horizontal' %}
<a href="{% url 'accounts:email_otp' %}" class="float-end mb-2">{% trans "I do not have/lost my OTP!" %}</a>
<button class="btn btn-lg btn-success btn-block" type="submit">{% trans "Sign In" %}</button>
</form>
</div> </div>
</div> {% endif %}
<form class="form-signin" method="post" role="form" aria-label="Login form">{% csrf_token %}
<h2 class="form-signin-heading">{% trans "Sign In" %}</h2>
{% bootstrap_field form.username layout='inline' %}
{% bootstrap_field form.password layout='inline' %}
{% bootstrap_field form.otp_token layout='inline'%}
<a href="{% url 'accounts:email_otp' %}" class="float-end">{% trans "I do not have/lost my OTP!" %}</a>
<br>
<div class="d-grid">
<button class="btn btn-lg btn-success" type="submit">{% trans "Sign In" %}</button>
</div>
</form>
</div> </div>
</div> </div>
{% endblock content %} {% endblock content %}

View file

@ -2,7 +2,8 @@
{% load i18n %} {% load i18n %}
{% load static %} {% load static %}
{% block title %}{% trans "WebVirtCloud" %} - {% trans "Sign In" %}{% endblock %}
{% block title %}{% trans "WebVirtCloud" %} - {% trans "Sign In" %}{% endblock title %}
{% block style %} {% block style %}
<link href="{% static "css/signin.css" %}" rel="stylesheet"> <link href="{% static "css/signin.css" %}" rel="stylesheet">
@ -11,19 +12,20 @@
{% block content %} {% block content %}
<div class="login-box"> <div class="login-box">
<div class="page-header"> <div class="page-header">
<a class="" href="/"><h1>WebVirtCloud</h1></a> <a href="/"><h1>WebVirtCloud</h1></a>
</div> </div>
<hr>
<div class="col-12" role="main"> <div class="col-12" role="main">
{% if form.errors %} {% if form.errors %}
<div class="alert alert-danger"> <div class="alert alert-danger" role="alert">
<button type="button" class="btn-close" data-dismiss="alert" aria-label="Close"></button> <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
{% trans "Incorrect username or password." %} {% trans "Incorrect username or password." %}
</div> </div>
{% endif %} {% endif %}
<form class="form-signin" method="post" role="form" aria-label="Login form">{% csrf_token %} <form class="form-signin" method="post" role="form" aria-label="Login form">{% csrf_token %}
<h2 class="form-signin-heading">{% trans "Sign In" %}</h2> <h2 class="form-signin-heading">{% trans "Sign In" %}</h2>
<input type="text" class="form-control" name="username" placeholder="{% trans "User" %}" autocapitalize="none" autocorrect="off" autofocus> <input type="text" class="form-control" name="username" placeholder="{% trans 'User' %}" autocapitalize="none" autocorrect="off" autofocus required>
<input type="password" class="form-control" name="password" placeholder="{% trans "Password" %}"> <input type="password" class="form-control" name="password" placeholder="{% trans 'Password' %}" required>
<input type="hidden" name="next" value="{{ next }}"> <input type="hidden" name="next" value="{{ next }}">
<div class="d-grid"> <div class="d-grid">
<button class="btn btn-lg btn-success" type="submit">{% trans "Sign In" %}</button> <button class="btn btn-lg btn-success" type="submit">{% trans "Sign In" %}</button>
@ -31,5 +33,4 @@
</form> </form>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View file

@ -6,11 +6,10 @@
display: block; display: block;
align-content: center; align-content: center;
align-items: center; align-items: center;
box-shadow: 0px 0px 30px black; box-shadow: 0px 0px 20px black;
border-radius: 20px; border-radius: 5px;
padding-top: 30px; padding-top: 5%;
padding-bottom: 20px; padding-bottom: 1%;
background: linear-gradient(0deg, rgba(203,203,203,1) 0%, rgba(255,255,255,1) 100%);
} }
h1 { h1 {
color:#212529; color:#212529;
@ -60,16 +59,10 @@ h2 {
} }
.btn-success { .btn-success {
background: linear-gradient(45deg, rgba(190,120,255,1) 0%, rgba(43,108,173,1) 34%, rgba(38,173,151,1) 68%, rgba(208,144,71,1) 100%);
transition-duration: 0.5s;
border-color: rgba(11, 12, 13, 0);
border-width: 2px; border-width: 2px;
border-style: solid; border-style: solid;
color:white;
} }
.btn-success:hover { .btn-success:hover {
transition-duration: 0.5s;
border-color: goldenrod;
border-width: 2px; border-width: 2px;
border-style: solid; border-style: solid;
} }