Skip to content

Commit

Permalink
Include a tenancy table to user_move
Browse files Browse the repository at this point in the history
Fixes #555
  • Loading branch information
lukasjuhrich committed Dec 11, 2023
1 parent 8755c7b commit a05bcef
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
9 changes: 8 additions & 1 deletion web/blueprints/user/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,14 @@ def default_response(refill_form_data: bool = False) -> ResponseReturnValue:
if not form.is_submitted() or refill_form_data:
if user.room is not None:
refill_room_data(form, user.room)
return render_template('user/user_move.html', user_id=user_id, form=form)
return render_template(
"user/user_move.html",
user_id=user_id,
form=form,
tenancy_table=TenancyTable(
data_url=url_for(".tenancies_json", user_id=user.id)
),
)

if not form.validate_on_submit():
return default_response()
Expand Down
20 changes: 14 additions & 6 deletions web/templates/user/user_move.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,21 @@
{% import "macros/forms.html" as forms %}
{% import "macros/resources.html" as resources %}

{% block single_row_content %}
<div class="box box-info">
<strong>Hinweis:</strong>
Bei Umzügen muss ein Nachweis über den Umzugswunsch archiviert werden!
Beispiel: Verschieben eines Tickets in die Umzugsqueue oder Ausdrucken / unterschrieben Abheften des Antrags.
{% block content %}
<div class="row">
<div class="box box-info">
<strong>Hinweis:</strong>
Bei Umzügen muss ein Nachweis über den Umzugswunsch archiviert werden!
Beispiel: Verschieben eines Tickets in die Umzugsqueue oder Ausdrucken / unterschrieben Abheften des Antrags.
</div>
{{ forms.simple_form(form, '', url_for('.user_show', user_id=user_id) ) }}
</div>
{{ forms.simple_form(form, '', url_for('.user_show', user_id=user_id) ) }}
{% if tenancy_table %}
<div class="row">
<h3>{{ _("Mietverträge") }}</h3>
{{ tenancy_table.render("tenancy_table") }}
</div>
{% endif %}
{% endblock %}

{% block page_script %}
Expand Down

0 comments on commit a05bcef

Please sign in to comment.