Payments add modal form

* adds help texts to add payment form
* adds removing button for payments
* refactors user fetching into BaseForm
* adds generic RemoveModalForm which is intended to be used for every modal form which shall remove something
* adds translations
* removes unused html
* prepares payment amount field to be able to process german inputs like '1.000,50' which is not the international default
This commit is contained in:
mipel
2021-07-26 11:29:05 +02:00
parent 4fb2ef26d0
commit a6c51aede6
12 changed files with 174 additions and 64 deletions

View File

@@ -1,5 +1,5 @@
{% extends 'base.html' %}
{% load i18n static fontawesome_5 %}
{% load i18n l10n static fontawesome_5 humanize %}
{% block head %}
@@ -129,7 +129,7 @@
<tr>
<th scope="row">{% trans 'Last modified' %}</th>
<td class="align-middle">
{{intervention.created_on|default_if_none:""}}
{{intervention.created_on|default_if_none:""|naturalday}}
<br>
{% trans 'by' %}
{{intervention.created_by|default_if_none:""}}
@@ -171,7 +171,7 @@
</div>
</div>
</div>
<div class="card-body">
<div class="card-body scroll-300">
<table class="table table-hover">
<thead>
<tr>
@@ -219,16 +219,22 @@
</div>
</div>
</div>
<div class="card-body">
<div class="card-body scroll-300">
<table class="table table-hover">
<thead>
<tr>
<th scope="col">
{% trans 'Amount' %}
</th>
<th scope="col">
{% trans 'Due on' %}
</th>
<th scope="col">
{% trans 'Transfer comment' %}
</th>
<th scope="col">
{% trans 'Action' %}
</th>
</tr>
</thead>
<tbody>
@@ -236,10 +242,16 @@
<tr>
<td class="align-middle">
<a href="{% url 'compensation:pay-open' pay.id %}">
{{ pay.amount }}
{{ pay.amount|floatformat:2 }}
</a>
</td>
<td class="align-middle">{{ pay.due_on }}</td>
<td class="align-middle">{{ pay.comment }}</td>
<td>
<button data-form-url="{% url 'compensation:pay-remove' pay.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove payment' %}">
{% fa5_icon 'trash' %}
</button>
</td>
</tr>
{% endfor %}
</tbody>
@@ -271,7 +283,7 @@
</div>
</div>
</div>
<div class="card-body">
<div class="card-body scroll-300">
<table class="table table-hover">
<thead>
<tr>