mirror of
https://github.com/Llloooggg/Dyxless.git
synced 2026-03-06 10:46:24 +03:00
Окна логина и регистрации отцентрированы
This commit is contained in:
@@ -30,6 +30,10 @@ mail.init_app(app)
|
||||
|
||||
login_manager = LoginManager()
|
||||
login_manager.login_view = "auth.login"
|
||||
login_manager.login_message = (
|
||||
"Вам необходимой войти, чтобы увидеть эту страницу"
|
||||
)
|
||||
login_manager.login_message_category = "is-warning"
|
||||
login_manager.init_app(app)
|
||||
|
||||
from .models import User
|
||||
|
||||
@@ -76,7 +76,7 @@ def signup():
|
||||
login_url = url_for("auth.login")
|
||||
flash(
|
||||
Markup(
|
||||
f"Указанная почта уже используется. <a href='{login_url}'>Перейти к странице входа</a>"
|
||||
f"Указанная почта уже используется.<br><a href='{login_url}'>Перейти к странице входа</a>"
|
||||
),
|
||||
"is-danger",
|
||||
)
|
||||
|
||||
@@ -33,14 +33,18 @@
|
||||
<div id="navbarMain" class="navbar-menu">
|
||||
<div class="navbar-end">
|
||||
{% if not current_user.is_authenticated %}
|
||||
{% if url_for(request.endpoint) != url_for('auth.login') %}
|
||||
<a href="{{ url_for('auth.login') }}" class="navbar-item">
|
||||
Войти
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if url_for(request.endpoint) != url_for('auth.signup') %}
|
||||
<span class="navbar-item">
|
||||
<a href="{{ url_for('auth.signup') }}" class="button is-success is-outlined">
|
||||
<strong>Зарегистрироваться</strong>
|
||||
</a>
|
||||
</span>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<div class="navbar-item has-dropdown is-hoverable">
|
||||
<a href="{{ url_for('main.profile') }}" class="navbar-link">
|
||||
@@ -66,10 +70,12 @@
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% if messages %}
|
||||
{% for category, text in messages%}
|
||||
<div class="notification {{ category }}">
|
||||
<div class='column is-3 is-offset-9'>
|
||||
<div class="notification is-light {{ category }}">
|
||||
<button class="delete"></button>
|
||||
{{ text }}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="column is-4 is-offset-4 is-centered">
|
||||
<form class="box" action="/login" method="POST">
|
||||
<section class="hero is-medium">
|
||||
<div class="hero-body">
|
||||
<div class="column is-4 is-offset-4">
|
||||
<form class="box" method="POST" action="/login" >
|
||||
<h3 class="title">Вход</h3>
|
||||
<div class="field">
|
||||
<label class="label">Email</label>
|
||||
@@ -36,5 +38,7 @@
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{% endblock %}
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container has-text-centered">
|
||||
|
||||
<section class="hero is-medium">
|
||||
<div class="hero-body">
|
||||
<p class="title">
|
||||
@@ -12,5 +12,5 @@
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -2,15 +2,15 @@
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="column is-4 is-offset-4">
|
||||
<h3 class="title">Регистрация</h3>
|
||||
<div class="container">
|
||||
<section class="hero is-medium">
|
||||
<div class="hero-body">
|
||||
<div class="column is-4 is-offset-4">
|
||||
<form class="box" method="POST" action="/signup">
|
||||
<h3 class="title">Регистрация</h3>
|
||||
<div class="field">
|
||||
<label class="label">Email</label>
|
||||
<p class="control has-icons-left">
|
||||
<input class="input" type="email" name="email" placeholder="yourmail@example.com" required>
|
||||
<input class="input" type="email" name="email" placeholder="you@mail.com" required>
|
||||
<span class="icon is-small is-left">
|
||||
<i class="fas fa-envelope"></i>
|
||||
</span>
|
||||
@@ -19,7 +19,7 @@
|
||||
<div class="field">
|
||||
<label class="label">Никнейм</label>
|
||||
<p class="control has-icons-left">
|
||||
<input class="input" type="username" name="username" placeholder="YourUsername" required>
|
||||
<input class="input" type="username" name="username" placeholder="Username" required>
|
||||
<span class="icon is-small is-left">
|
||||
<i class="fas fa-user"></i>
|
||||
</span>
|
||||
@@ -36,8 +36,8 @@
|
||||
</div>
|
||||
<button class="button is-success is-outlined is-fullwidth">Зарегистрироваться</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user