mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-05-05 20:51:49 +02:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
4ada44a606
5 changed files with 29 additions and 23 deletions
2
Makefile
2
Makefile
|
@ -38,7 +38,7 @@ update: remove-install-stamp install ## Update the dependencies
|
||||||
.PHONY: serve
|
.PHONY: serve
|
||||||
serve: install ## Run the ihatemoney server
|
serve: install ## Run the ihatemoney server
|
||||||
@echo 'Running ihatemoney on http://localhost:5000'
|
@echo 'Running ihatemoney on http://localhost:5000'
|
||||||
$(PYTHON) -m ihatemoney.manage run
|
FLASK_DEBUG=1 FLASK_ENV=development FLASK_APP=ihatemoney.wsgi $(VENV)/bin/flask run --host=0.0.0.0
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test: install-dev ## Run the tests
|
test: install-dev ## Run the tests
|
||||||
|
|
|
@ -456,17 +456,8 @@ tr.payer_line .balance-name {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.messages {
|
.flash {
|
||||||
display: flex;
|
z-index: 1031;
|
||||||
justify-content: center;
|
|
||||||
position: absolute;
|
|
||||||
top: 4.5rem;
|
|
||||||
width: 100%;
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.messages .alert {
|
|
||||||
pointer-events: auto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.light {
|
.light {
|
||||||
|
|
|
@ -1,4 +1,22 @@
|
||||||
{% import "forms.html" as forms %}
|
{% import "forms.html" as forms %}
|
||||||
|
|
||||||
|
{% macro flash_messages(classes='') %}
|
||||||
|
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||||
|
{% if messages %}
|
||||||
|
<div class="position-absolute d-flex flex-wrap mt-2 mr-1 {{ classes }}">
|
||||||
|
{% for category, message in messages %}
|
||||||
|
<div class="flash mr-2 text-center alert alert-{{ "success" if category == "message" else category }} alert-dismissible fade show">
|
||||||
|
{{ message }}
|
||||||
|
<button type="button" class="close h-100" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% endwith %}
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html class="h-100">
|
<html class="h-100">
|
||||||
<head>
|
<head>
|
||||||
|
@ -120,16 +138,9 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="messages">
|
{% if not messages_shown %}
|
||||||
{% for category, message in get_flashed_messages(with_categories=true) %}
|
{{ flash_messages(classes="w-100 justify-content-center") }}
|
||||||
<div class="flash alert alert-{{ "success" if category == "message" else category }} alert-dismissible fade show">
|
{% endif %}
|
||||||
{{ message }}
|
|
||||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% block footer %}
|
{% block footer %}
|
||||||
<footer class="footer mt-auto py-3">
|
<footer class="footer mt-auto py-3">
|
||||||
|
|
|
@ -53,8 +53,12 @@
|
||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
<main class="offset-md-3 col-xs-12 col-md-9 d-flex flex-column">
|
<main class="offset-md-3 col-xs-12 col-md-9 d-flex flex-column">
|
||||||
|
{{ flash_messages() }}
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
{# It must be set outside of the block definition #}
|
||||||
|
{% set messages_shown = True %}
|
|
@ -59,7 +59,7 @@ dev =
|
||||||
zest.releaser>=6.20.1
|
zest.releaser>=6.20.1
|
||||||
|
|
||||||
doc =
|
doc =
|
||||||
Sphinx==4.3.0
|
Sphinx==4.3.1
|
||||||
docutils==0.17.1
|
docutils==0.17.1
|
||||||
myst-parser
|
myst-parser
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue