Compensation routes

* improves compensation routes
This commit is contained in:
mipel 2021-07-23 15:23:54 +02:00
parent b962e22c04
commit 13a15e4f56
5 changed files with 22 additions and 16 deletions

View File

@ -95,7 +95,7 @@ class EcoAccountTable(BaseTable):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
self.title = _("Eco Accounts") self.title = _("Eco Accounts")
self.add_new_url = reverse("compensation:account-new") self.add_new_url = reverse("compensation:acc-new")
def render_ac(self, value, record): def render_ac(self, value, record):
""" """

View File

@ -13,15 +13,21 @@ app_name = "compensation"
urlpatterns = [ urlpatterns = [
# Main compensation # Main compensation
path("", index_view, name="index"), path("", index_view, name="index"),
path('new/', new_view, name='new'), path('new', new_view, name='new'),
path('open/<id>', open_view, name='open'), path('<id>', open_view, name='open'),
path('edit/<id>', edit_view, name='edit'), path('<id>/edit', edit_view, name='edit'),
path('remove/<id>', remove_view, name='remove'), path('<id>/remove', remove_view, name='remove'),
# Payment
path('pay/new', new_view, name='pay-new'),
path('pay/<id>', open_view, name='pay-open'),
path('pay/<id>/edit', edit_view, name='pay-edit'),
path('pay/<id>/remove', remove_view, name='pay-remove'),
# Eco-account # Eco-account
path("account/", account_index_view, name="account-index"), path("acc/", account_index_view, name="acc-index"),
path('account/new/', account_new_view, name='account-new'), path('acc/new/', account_new_view, name='acc-new'),
path('account/open/<id>', account_open_view, name='account-open'), path('acc/<id>', account_open_view, name='acc-open'),
path('account/edit/<id>', account_edit_view, name='account-edit'), path('acc/<id>/edit', account_edit_view, name='acc-edit'),
path('account/remove/<id>', account_remove_view, name='account-remove'), path('acc/<id>/remove', account_remove_view, name='acc-remove'),
] ]

View File

@ -194,7 +194,7 @@
</div> </div>
<div class="col-sm-6"> <div class="col-sm-6">
<div class="d-flex justify-content-end"> <div class="d-flex justify-content-end">
<a href="{% url 'compensation:new' %}" title="{% trans 'Add new payment' %}"> <a href="{% url 'compensation:pay-new' %}" title="{% trans 'Add new payment' %}">
<button class="btn btn-outline-default"> <button class="btn btn-outline-default">
{% fa5_icon 'plus' %} {% fa5_icon 'plus' %}
{% fa5_icon 'money-bill-wave' %} {% fa5_icon 'money-bill-wave' %}
@ -218,7 +218,7 @@
</thead> </thead>
<tbody> <tbody>
{% for pay in intervention.payments.all %} {% for pay in intervention.payments.all %}
<a href="{% url 'payment:open' pay.id %}"> <a href="{% url 'compensation:pay-open' pay.id %}">
<tr> <tr>
<td>{{ pay.amount }}</td> <td>{{ pay.amount }}</td>
<td>{{ pay.comment }}</td> <td>{{ pay.comment }}</td>

View File

@ -88,7 +88,7 @@
{% trans 'Eco-account' %} {% trans 'Eco-account' %}
</h4> </h4>
<div class="row"> <div class="row">
<a href="{% url 'compensation:account-index' %}"> <a href="{% url 'compensation:acc-index' %}">
<div class="col-sm-5"> <div class="col-sm-5">
<div class="qs-box d-flex justify-content-center align-items-center"> <div class="qs-box d-flex justify-content-center align-items-center">
{% fa5_icon 'tree' %} {% fa5_icon 'tree' %}
@ -110,12 +110,12 @@
<div class="col-sm-12 col-lg"> <div class="col-sm-12 col-lg">
<div class="col-sm"> <div class="col-sm">
<div class="row my-1"> <div class="row my-1">
<a href="{% url 'compensation:account-new' %}"> <a href="{% url 'compensation:acc-new' %}">
<button class="btn btn-default">{% fa5_icon 'plus' %} {% trans 'Create' %}</button> <button class="btn btn-default">{% fa5_icon 'plus' %} {% trans 'Create' %}</button>
</a> </a>
</div> </div>
<div class="row my-1"> <div class="row my-1">
<a href="{% url 'compensation:account-index' %}"> <a href="{% url 'compensation:acc-index' %}">
<button class="btn btn-default">{% fa5_icon 'eye' %} {% trans 'Show' %}</button> <button class="btn btn-default">{% fa5_icon 'eye' %} {% trans 'Show' %}</button>
</a> </a>
</div> </div>

View File

@ -29,7 +29,7 @@
</a> </a>
</li> </li>
<li class=" menu-elem"> <li class=" menu-elem">
<a class="nav-btn nav-link" href="{% url 'compensation:account-index' %}"> <a class="nav-btn nav-link" href="{% url 'compensation:acc-index' %}">
{% fa5_icon 'tree' %} {% fa5_icon 'tree' %}
{% trans 'Eco-account' %} {% trans 'Eco-account' %}
</a> </a>