forked from Github-Mirrors/canaille
Improved flash messages display on the homepage
This commit is contained in:
parent
f89d45a3e7
commit
b0534896b5
4 changed files with 90 additions and 74 deletions
|
@ -1,7 +1,7 @@
|
|||
{% macro messages() %}
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% for category, message in messages %}
|
||||
<div class="ui attached message {{ category }}">
|
||||
<div class="ui message {{ category }}">
|
||||
{{ message }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
|
|
@ -1,45 +1,52 @@
|
|||
{% extends theme('base.html') %}
|
||||
{% import 'flask.j2' as flask %}
|
||||
{% import 'fomanticui.html' as sui %}
|
||||
|
||||
{% block content %}
|
||||
<div class="ui clearing segment">
|
||||
{% if logo_url %}
|
||||
<a href="{{ url_for('account.index') }}">
|
||||
<img class="ui tiny centered image" src="{{ logo_url }}" alt="{{ website_name }}">
|
||||
</a>
|
||||
{% else %}
|
||||
<i class="massive sign in icon image ui"></i>
|
||||
{% endif %}
|
||||
{% block container %}
|
||||
<div class="ui container">
|
||||
<div class="content">
|
||||
<div class="ui clearing segment">
|
||||
{% if logo_url %}
|
||||
<a href="{{ url_for('account.index') }}">
|
||||
<img class="ui tiny centered image" src="{{ logo_url }}" alt="{{ website_name }}">
|
||||
</a>
|
||||
{% else %}
|
||||
<i class="massive sign in icon image ui"></i>
|
||||
{% endif %}
|
||||
|
||||
<h2 class="ui center aligned header">
|
||||
<div class="content">
|
||||
{{ _("Sign in at %(website)s", website=website_name) }}
|
||||
</div>
|
||||
<div class="sub header">{% trans %}Log-in and manage your authorizations.{% endtrans %}</div>
|
||||
</h2>
|
||||
<h2 class="ui center aligned header">
|
||||
<div class="content">
|
||||
{{ _("Sign in at %(website)s", website=website_name) }}
|
||||
</div>
|
||||
<div class="sub header">{% trans %}Log-in and manage your authorizations.{% endtrans %}</div>
|
||||
</h2>
|
||||
|
||||
<form method="POST"
|
||||
id="{{ form.id or form.__class__.__name__|lower }}"
|
||||
action="{{ request.url }}"
|
||||
role="form"
|
||||
class="ui form"
|
||||
>
|
||||
{{ flask.messages() }}
|
||||
|
||||
{{ form.hidden_tag() if form.hidden_tag }}
|
||||
{% block login_field scoped %}{{ sui.render_field(form.login, icon="user", noindicator=true) }}{% endblock %}
|
||||
<form method="POST"
|
||||
id="{{ form.id or form.__class__.__name__|lower }}"
|
||||
action="{{ request.url }}"
|
||||
role="form"
|
||||
class="ui form"
|
||||
>
|
||||
|
||||
{% if "password" in form %}
|
||||
{% block password_field scoped %}{{ sui.render_field(form.password, icon="key", noindicator=true) }}{% endblock %}
|
||||
{% endif %}
|
||||
{{ form.hidden_tag() if form.hidden_tag }}
|
||||
{% block login_field scoped %}{{ sui.render_field(form.login, icon="user", noindicator=true) }}{% endblock %}
|
||||
|
||||
<div class="ui right aligned container">
|
||||
<div class="ui stackable buttons">
|
||||
{% if has_smtp and has_password_recovery %}
|
||||
<a type="button" class="ui right floated button" href="{{ url_for('account.forgotten') }}">{{ _("Forgotten password") }}</a>
|
||||
{% if "password" in form %}
|
||||
{% block password_field scoped %}{{ sui.render_field(form.password, icon="key", noindicator=true) }}{% endblock %}
|
||||
{% endif %}
|
||||
<button type="submit" class="ui right floated primary button">{{ _("Continue") }}</button>
|
||||
</div>
|
||||
|
||||
<div class="ui right aligned container">
|
||||
<div class="ui stackable buttons">
|
||||
{% if has_smtp and has_password_recovery %}
|
||||
<a type="button" class="ui right floated button" href="{{ url_for('account.forgotten') }}">{{ _("Forgotten password") }}</a>
|
||||
{% endif %}
|
||||
<button type="submit" class="ui right floated primary button">{{ _("Continue") }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,42 +1,49 @@
|
|||
{% extends theme('base.html') %}
|
||||
{% import 'flask.j2' as flask %}
|
||||
{% import 'fomanticui.html' as sui %}
|
||||
|
||||
{% block content %}
|
||||
<div class="ui clearing segment">
|
||||
{% if logo_url %}
|
||||
<a href="{{ url_for('account.index') }}">
|
||||
<img class="ui tiny centered image" src="{{ logo_url }}" alt="{{ website_name }}">
|
||||
</a>
|
||||
{% else %}
|
||||
<i class="massive sign in icon image ui"></i>
|
||||
{% endif %}
|
||||
{% block container %}
|
||||
<div class="ui container">
|
||||
<div class="content">
|
||||
<div class="ui clearing segment">
|
||||
{% if logo_url %}
|
||||
<a href="{{ url_for('account.index') }}">
|
||||
<img class="ui tiny centered image" src="{{ logo_url }}" alt="{{ website_name }}">
|
||||
</a>
|
||||
{% else %}
|
||||
<i class="massive sign in icon image ui"></i>
|
||||
{% endif %}
|
||||
|
||||
<h2 class="ui center aligned header">
|
||||
<div class="content">
|
||||
{{ _("Sign in as %(username)s", username=username) }}
|
||||
<h2 class="ui center aligned header">
|
||||
<div class="content">
|
||||
{{ _("Sign in as %(username)s", username=username) }}
|
||||
</div>
|
||||
<div class="sub header">{% trans %}Please enter your password for this account.{% endtrans %}</div>
|
||||
</h2>
|
||||
|
||||
{{ flask.messages() }}
|
||||
|
||||
<form method="POST"
|
||||
id="{{ form.id or form.__class__.__name__|lower }}"
|
||||
action="{{ request.url }}"
|
||||
role="form"
|
||||
class="ui form"
|
||||
>
|
||||
|
||||
{{ form.hidden_tag() if form.hidden_tag }}
|
||||
{{ sui.render_field(form.password, icon="key", noindicator=true) }}
|
||||
|
||||
<div class="ui right aligned container">
|
||||
<div class="ui stackable buttons">
|
||||
<a type="button" class="ui right floated button" href="{{ url_for('account.login') }}">{{ _("I am not %(username)s", username=username) }}</a>
|
||||
{% if has_smtp and has_password_recovery %}
|
||||
<a type="button" class="ui right floated button" href="{{ url_for('account.forgotten') }}">{{ _("Forgotten password") }}</a>
|
||||
{% endif %}
|
||||
<button type="submit" class="ui right floated primary button">{{ _("Sign in") }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="sub header">{% trans %}Please enter your password for this account.{% endtrans %}</div>
|
||||
</h2>
|
||||
|
||||
<form method="POST"
|
||||
id="{{ form.id or form.__class__.__name__|lower }}"
|
||||
action="{{ request.url }}"
|
||||
role="form"
|
||||
class="ui form"
|
||||
>
|
||||
|
||||
{{ form.hidden_tag() if form.hidden_tag }}
|
||||
{{ sui.render_field(form.password, icon="key", noindicator=true) }}
|
||||
|
||||
<div class="ui right aligned container">
|
||||
<div class="ui stackable buttons">
|
||||
<a type="button" class="ui right floated button" href="{{ url_for('account.login') }}">{{ _("I am not %(username)s", username=username) }}</a>
|
||||
{% if has_smtp and has_password_recovery %}
|
||||
<a type="button" class="ui right floated button" href="{{ url_for('account.forgotten') }}">{{ _("Forgotten password") }}</a>
|
||||
{% endif %}
|
||||
<button type="submit" class="ui right floated primary button">{{ _("Sign in") }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -93,12 +93,14 @@
|
|||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
<div class="ui container">
|
||||
<div class="content">
|
||||
{{ flask.messages() }}
|
||||
{% block content %}{% endblock %}
|
||||
{% block container %}
|
||||
<div class="ui container">
|
||||
<div class="content">
|
||||
{{ flask.messages() }}
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
<footer>
|
||||
<a href="{{ url_for('account.about') }}">{{ _("About canaille") }}</a>
|
||||
|
|
Loading…
Reference in a new issue