mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-05-04 20:21:49 +02:00
Compare commits
4 commits
4e8857d2cd
...
1e3dd2b76f
Author | SHA1 | Date | |
---|---|---|---|
![]() |
1e3dd2b76f | ||
![]() |
cf77b4c346 | ||
![]() |
9b514ca7c7 | ||
![]() |
9433b7de92 |
41 changed files with 88 additions and 51 deletions
|
@ -759,7 +759,7 @@ msgstr ""
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Legal information"
|
msgid "Legal information"
|
||||||
|
|
|
@ -264,6 +264,12 @@ class Project(db.Model):
|
||||||
.order_by(Bill.id.desc())
|
.order_by(Bill.id.desc())
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def filter(query, start_date, end_date):
|
||||||
|
return (
|
||||||
|
query.filter(Bill.date >= start_date, Bill.date <= end_date)
|
||||||
|
)
|
||||||
|
|
||||||
def get_bill_weights(self):
|
def get_bill_weights(self):
|
||||||
"""
|
"""
|
||||||
Return all bills for this project, along with the sum of weight for each bill.
|
Return all bills for this project, along with the sum of weight for each bill.
|
||||||
|
@ -285,6 +291,9 @@ class Project(db.Model):
|
||||||
"""Ordered version of get_bill_weights"""
|
"""Ordered version of get_bill_weights"""
|
||||||
return self.order_bills(self.get_bill_weights())
|
return self.order_bills(self.get_bill_weights())
|
||||||
|
|
||||||
|
def get_filtered_bill_weights_ordered(self, start_date, end_date):
|
||||||
|
return self.filter(self.get_bill_weights_ordered(), start_date, end_date)
|
||||||
|
|
||||||
def get_member_bills(self, member_id):
|
def get_member_bills(self, member_id):
|
||||||
"""Return the list of bills related to a specific member"""
|
"""Return the list of bills related to a specific member"""
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -168,7 +168,7 @@
|
||||||
<i class="icon book">{{ static_include("images/book.svg") | safe }}</i>
|
<i class="icon book">{{ static_include("images/book.svg") | safe }}</i>
|
||||||
</a>
|
</a>
|
||||||
{% if g.show_admin_dashboard_link %}
|
{% if g.show_admin_dashboard_link %}
|
||||||
<a target="_blank" rel="noopener" data-toggle="tooltip" data-placement="top" title="{{ _('Administation Dashboard') }}" href="{{ url_for('main.dashboard') }}">
|
<a target="_blank" rel="noopener" data-toggle="tooltip" data-placement="top" title="{{ _('Administration Dashboard') }}" href="{{ url_for('main.dashboard') }}">
|
||||||
<i class="icon admin">{{ static_include("images/cog.svg") | safe }}</i>
|
<i class="icon admin">{{ static_include("images/cog.svg") | safe }}</i>
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -105,6 +105,16 @@
|
||||||
<li class="page-item {% if bills.page == bills.pages %}disabled{% endif %}"><a class="page-link" href="{{ url_for('main.list_bills', page=bills.next_num) }}">{{ _("Older bills") }} »</a></li>
|
<li class="page-item {% if bills.page == bills.pages %}disabled{% endif %}"><a class="page-link" href="{{ url_for('main.list_bills', page=bills.next_num) }}">{{ _("Older bills") }} »</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<form action="{{ url_for(".list_bills") }}" method="post">
|
||||||
|
{{ csrf_form.csrf_token }}
|
||||||
|
<label for="start_date">Start Date:</label>
|
||||||
|
<input type="date" id="start_date" name="start_date" value="{{ start_date if start_date else '' }}">
|
||||||
|
|
||||||
|
<label for="end_date">End Date:</label>
|
||||||
|
<input type="date" id="end_date" name="end_date" value="{{ end_date if end_date else '' }}">
|
||||||
|
|
||||||
|
<input type="submit" value="Filter">
|
||||||
|
</form>
|
||||||
<span id="new-bill" class="ml-auto pb-2" {% if not g.project.members %} data-toggle="tooltip" title="{{_('You should start by adding participants')}}" {% endif %}>
|
<span id="new-bill" class="ml-auto pb-2" {% if not g.project.members %} data-toggle="tooltip" title="{{_('You should start by adding participants')}}" {% endif %}>
|
||||||
<a href="{{ url_for('.add_bill') }}" class="btn btn-primary {% if not g.project.members %} disabled {% endif %}" data-toggle="modal" data-keyboard="true" data-target="#bill-form" autofocus>
|
<a href="{{ url_for('.add_bill') }}" class="btn btn-primary {% if not g.project.members %} disabled {% endif %}" data-toggle="modal" data-keyboard="true" data-target="#bill-form" autofocus>
|
||||||
<i class="icon icon-white before-text">{{ static_include("images/plus.svg") | safe }}</i>
|
<i class="icon icon-white before-text">{{ static_include("images/plus.svg") | safe }}</i>
|
||||||
|
|
|
@ -782,7 +782,7 @@ msgstr ""
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Legal information"
|
msgid "Legal information"
|
||||||
|
|
|
@ -785,7 +785,7 @@ msgstr ""
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Legal information"
|
msgid "Legal information"
|
||||||
|
|
|
@ -826,7 +826,7 @@ msgstr "Aplicació mòbil"
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr "Documentació"
|
msgstr "Documentació"
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr "Panell d'administració"
|
msgstr "Panell d'administració"
|
||||||
|
|
||||||
msgid "Legal information"
|
msgid "Legal information"
|
||||||
|
|
|
@ -800,7 +800,7 @@ msgstr "Mobilní aplikace"
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr "Dokumentace"
|
msgstr "Dokumentace"
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr "Správcovský panel"
|
msgstr "Správcovský panel"
|
||||||
|
|
||||||
msgid "Legal information"
|
msgid "Legal information"
|
||||||
|
|
|
@ -824,7 +824,7 @@ msgstr "Handy-Applikation"
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr "Dokumentation"
|
msgstr "Dokumentation"
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr "Dashboard Administration"
|
msgstr "Dashboard Administration"
|
||||||
|
|
||||||
msgid "Legal information"
|
msgid "Legal information"
|
||||||
|
|
|
@ -811,7 +811,7 @@ msgstr ""
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
|
|
|
@ -821,7 +821,7 @@ msgstr "Poŝaparata programo"
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr "Dokumentaro"
|
msgstr "Dokumentaro"
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr "Administra panelo"
|
msgstr "Administra panelo"
|
||||||
|
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
|
|
|
@ -818,7 +818,7 @@ msgstr "Aplicación móvil"
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr "Documentación"
|
msgstr "Documentación"
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr "Panel de administración"
|
msgstr "Panel de administración"
|
||||||
|
|
||||||
msgid "Legal information"
|
msgid "Legal information"
|
||||||
|
|
|
@ -815,7 +815,7 @@ msgstr "Aplicación móvil"
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr "Documentación"
|
msgstr "Documentación"
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr "Panel de administración"
|
msgstr "Panel de administración"
|
||||||
|
|
||||||
msgid "Legal information"
|
msgid "Legal information"
|
||||||
|
|
|
@ -782,7 +782,7 @@ msgstr ""
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Legal information"
|
msgid "Legal information"
|
||||||
|
|
|
@ -824,7 +824,7 @@ msgstr "Application mobile"
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr "Documentation"
|
msgstr "Documentation"
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr "Panneau d'administration"
|
msgstr "Panneau d'administration"
|
||||||
|
|
||||||
msgid "Legal information"
|
msgid "Legal information"
|
||||||
|
|
|
@ -788,7 +788,7 @@ msgstr "יישום לנייד"
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr "דוקומנטציה"
|
msgstr "דוקומנטציה"
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Legal information"
|
msgid "Legal information"
|
||||||
|
|
|
@ -829,7 +829,7 @@ msgstr "मोबाइल एप्लीकेशन"
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr "प्रलेखन"
|
msgstr "प्रलेखन"
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr "व्यवस्थापन डैशबोर्ड"
|
msgstr "व्यवस्थापन डैशबोर्ड"
|
||||||
|
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
|
|
|
@ -817,7 +817,7 @@ msgstr "Mobil alkalmazás"
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr "Dokumentáció"
|
msgstr "Dokumentáció"
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr "Adminisztrátori vezérlőpult"
|
msgstr "Adminisztrátori vezérlőpult"
|
||||||
|
|
||||||
msgid "Legal information"
|
msgid "Legal information"
|
||||||
|
|
|
@ -812,7 +812,7 @@ msgstr "Aplikasi Gawai"
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr "Dokumentasi"
|
msgstr "Dokumentasi"
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr "Dasbor Administrasi"
|
msgstr "Dasbor Administrasi"
|
||||||
|
|
||||||
msgid "Legal information"
|
msgid "Legal information"
|
||||||
|
|
|
@ -817,7 +817,7 @@ msgstr "Applicazione mobile"
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr "Documentazione"
|
msgstr "Documentazione"
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr "Cruscotto Amministrazione"
|
msgstr "Cruscotto Amministrazione"
|
||||||
|
|
||||||
msgid "Legal information"
|
msgid "Legal information"
|
||||||
|
|
|
@ -797,7 +797,7 @@ msgstr "携帯アプリ"
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr "書類"
|
msgstr "書類"
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr "管理ダッシュボード"
|
msgstr "管理ダッシュボード"
|
||||||
|
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
|
|
|
@ -793,7 +793,7 @@ msgstr ""
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Legal information"
|
msgid "Legal information"
|
||||||
|
|
|
@ -793,7 +793,7 @@ msgstr ""
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Legal information"
|
msgid "Legal information"
|
||||||
|
|
|
@ -855,7 +855,7 @@ msgstr "Mobilprogram"
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr "Dokumentasjon"
|
msgstr "Dokumentasjon"
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr "Administrasjonsoversiktspanel"
|
msgstr "Administrasjonsoversiktspanel"
|
||||||
|
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
|
|
|
@ -814,7 +814,7 @@ msgstr "Mobiele app"
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr "Documentatie"
|
msgstr "Documentatie"
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr "Administratie-overzicht"
|
msgstr "Administratie-overzicht"
|
||||||
|
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
|
|
|
@ -777,7 +777,7 @@ msgstr ""
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr "Documentacion"
|
msgstr "Documentacion"
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr "Panèl d’administracion"
|
msgstr "Panèl d’administracion"
|
||||||
|
|
||||||
msgid "Legal information"
|
msgid "Legal information"
|
||||||
|
|
|
@ -812,7 +812,7 @@ msgstr "Aplikacja mobilna"
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr "Dokumentacja"
|
msgstr "Dokumentacja"
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr "Kokpit administracyjny"
|
msgstr "Kokpit administracyjny"
|
||||||
|
|
||||||
msgid "Legal information"
|
msgid "Legal information"
|
||||||
|
|
|
@ -823,7 +823,7 @@ msgstr "Aplicação Mobile"
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr "Documentação"
|
msgstr "Documentação"
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr "Painel de Administração"
|
msgstr "Painel de Administração"
|
||||||
|
|
||||||
msgid "Legal information"
|
msgid "Legal information"
|
||||||
|
|
|
@ -809,7 +809,7 @@ msgstr "Aplicativo"
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr "Documentação"
|
msgstr "Documentação"
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr "Painel de Administração"
|
msgstr "Painel de Administração"
|
||||||
|
|
||||||
msgid "Legal information"
|
msgid "Legal information"
|
||||||
|
|
|
@ -816,7 +816,7 @@ msgstr "Мобильное приложение"
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr "Документация"
|
msgstr "Документация"
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr "Панель инструментов администратора"
|
msgstr "Панель инструментов администратора"
|
||||||
|
|
||||||
msgid "Legal information"
|
msgid "Legal information"
|
||||||
|
|
|
@ -783,7 +783,7 @@ msgstr "Mobilna Aplikacija"
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr "Dokumentacija"
|
msgstr "Dokumentacija"
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Legal information"
|
msgid "Legal information"
|
||||||
|
|
|
@ -818,7 +818,7 @@ msgstr "Mobilapplikation"
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr "Dokumentation"
|
msgstr "Dokumentation"
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr "Översiktspanel för administration"
|
msgstr "Översiktspanel för administration"
|
||||||
|
|
||||||
msgid "Legal information"
|
msgid "Legal information"
|
||||||
|
|
|
@ -809,7 +809,7 @@ msgstr ""
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Legal information"
|
msgid "Legal information"
|
||||||
|
|
|
@ -817,7 +817,7 @@ msgstr ""
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Legal information"
|
msgid "Legal information"
|
||||||
|
|
|
@ -778,7 +778,7 @@ msgstr ""
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Legal information"
|
msgid "Legal information"
|
||||||
|
|
|
@ -811,7 +811,7 @@ msgstr "Telefon Uygulaması"
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr "Belgelendirme"
|
msgstr "Belgelendirme"
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr "Yönetici Gösterge Paneli"
|
msgstr "Yönetici Gösterge Paneli"
|
||||||
|
|
||||||
msgid "Legal information"
|
msgid "Legal information"
|
||||||
|
|
|
@ -791,7 +791,7 @@ msgstr ""
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Legal information"
|
msgid "Legal information"
|
||||||
|
|
|
@ -776,7 +776,7 @@ msgstr ""
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Legal information"
|
msgid "Legal information"
|
||||||
|
|
|
@ -775,7 +775,7 @@ msgstr ""
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Legal information"
|
msgid "Legal information"
|
||||||
|
|
|
@ -779,7 +779,7 @@ msgstr "手机软件"
|
||||||
msgid "Documentation"
|
msgid "Documentation"
|
||||||
msgstr "文件"
|
msgstr "文件"
|
||||||
|
|
||||||
msgid "Administation Dashboard"
|
msgid "Administration Dashboard"
|
||||||
msgstr "管理面板"
|
msgstr "管理面板"
|
||||||
|
|
||||||
msgid "Legal information"
|
msgid "Legal information"
|
||||||
|
|
|
@ -642,7 +642,7 @@ def invite():
|
||||||
return render_template("send_invites.html", form=form, qrcode=qrcode_svg)
|
return render_template("send_invites.html", form=form, qrcode=qrcode_svg)
|
||||||
|
|
||||||
|
|
||||||
@main.route("/<project_id>/")
|
@main.route("/<project_id>/", methods=["GET", "POST"])
|
||||||
def list_bills():
|
def list_bills():
|
||||||
bill_form = get_billform_for(g.project)
|
bill_form = get_billform_for(g.project)
|
||||||
# Used for CSRF validation
|
# Used for CSRF validation
|
||||||
|
@ -666,19 +666,37 @@ def list_bills():
|
||||||
# Each item will be a (weight_sum, Bill) tuple.
|
# Each item will be a (weight_sum, Bill) tuple.
|
||||||
# TODO: improve this awkward result using column_property:
|
# TODO: improve this awkward result using column_property:
|
||||||
# https://docs.sqlalchemy.org/en/14/orm/mapped_sql_expr.html.
|
# https://docs.sqlalchemy.org/en/14/orm/mapped_sql_expr.html.
|
||||||
weighted_bills = g.project.get_bill_weights_ordered().paginate(
|
if request.method == "GET":
|
||||||
per_page=100, error_out=True
|
weighted_bills = g.project.get_bill_weights_ordered().paginate(
|
||||||
)
|
per_page=100, error_out=True
|
||||||
|
)
|
||||||
|
return render_template(
|
||||||
|
"list_bills.html",
|
||||||
|
bills=weighted_bills,
|
||||||
|
member_form=MemberForm(g.project),
|
||||||
|
bill_form=bill_form,
|
||||||
|
csrf_form=csrf_form,
|
||||||
|
add_bill=request.values.get("add_bill", False),
|
||||||
|
current_view="list_bills",
|
||||||
|
)
|
||||||
|
if request.method == "POST":
|
||||||
|
start_date = request.form['start_date']
|
||||||
|
end_date = request.form['end_date']
|
||||||
|
weighted_bills = g.project.get_filtered_bill_weights_ordered(start_date, end_date).paginate(
|
||||||
|
per_page=100, error_out=True
|
||||||
|
)
|
||||||
|
return render_template(
|
||||||
|
"list_bills.html",
|
||||||
|
bills=weighted_bills,
|
||||||
|
member_form=MemberForm(g.project),
|
||||||
|
bill_form=bill_form,
|
||||||
|
csrf_form=csrf_form,
|
||||||
|
add_bill=request.values.get("add_bill", False),
|
||||||
|
current_view="list_bills",
|
||||||
|
start_date=start_date,
|
||||||
|
end_date=end_date,
|
||||||
|
)
|
||||||
|
|
||||||
return render_template(
|
|
||||||
"list_bills.html",
|
|
||||||
bills=weighted_bills,
|
|
||||||
member_form=MemberForm(g.project),
|
|
||||||
bill_form=bill_form,
|
|
||||||
csrf_form=csrf_form,
|
|
||||||
add_bill=request.values.get("add_bill", False),
|
|
||||||
current_view="list_bills",
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@main.route("/<project_id>/members/add", methods=["GET", "POST"])
|
@main.route("/<project_id>/members/add", methods=["GET", "POST"])
|
||||||
|
|
Loading…
Reference in a new issue