1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-10-31 19:44:16 +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 static %}
{% 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 %}
<div class="row">
<div class="col-6 offset-3" role="main">
<div class="card">
<div class="card-body">
{% if form.errors %}
{% bootstrap_form_errors form %}
{% endif %}
<form class="form-signin" method="post" role="form" aria-label="Login form">
{% csrf_token %}
{% 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 class="login-box">
<div class="page-header">
<a href="/"><h1>WebVirtCloud</h1></a>
</div>
<hr>
<div class="col-12" role="main">
{% if form.errors %}
<div class="alert alert-danger" role="alert">
{% bootstrap_form_errors form %}
</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>
{% endblock content %}

View file

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

View file

@ -6,11 +6,10 @@
display: block;
align-content: center;
align-items: center;
box-shadow: 0px 0px 30px black;
border-radius: 20px;
padding-top: 30px;
padding-bottom: 20px;
background: linear-gradient(0deg, rgba(203,203,203,1) 0%, rgba(255,255,255,1) 100%);
box-shadow: 0px 0px 20px black;
border-radius: 5px;
padding-top: 5%;
padding-bottom: 1%;
}
h1 {
color:#212529;
@ -60,16 +59,10 @@ h2 {
}
.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-style: solid;
color:white;
}
.btn-success:hover {
transition-duration: 0.5s;
border-color: goldenrod;
border-width: 2px;
border-style: solid;
}