Documents

* add get document route
* add missing attributes to intervention detail view
This commit is contained in:
mipel
2021-07-23 15:35:05 +02:00
parent 37f3799894
commit 6cbf88fb1d
4 changed files with 133 additions and 4 deletions

View File

@@ -57,6 +57,14 @@
<th class="w-25" scope="row">{% trans 'Title' %}</th>
<td class="align-middle">{{intervention.title}}</td>
</tr>
<tr>
<th scope="row">{% trans 'Process type' %}</th>
<td class="align-middle">{{intervention.process_type|default_if_none:""}}</td>
</tr>
<tr>
<th scope="row">{% trans 'Law' %}</th>
<td class="align-middle">{{intervention.law|default_if_none:""}}</td>
</tr>
<tr>
<th scope="row">{% trans 'Registration office' %}</th>
<td class="align-middle">{{intervention.registration_office|default_if_none:""}}</td>
@@ -73,6 +81,10 @@
<th scope="row">{% trans 'Conversation office file number' %}</th>
<td class="align-middle">{{intervention.conservation_file_number|default_if_none:""}}</td>
</tr>
<tr>
<th scope="row">{% trans 'Handler' %}</th>
<td class="align-middle">{{intervention.handler|default_if_none:""}}</td>
</tr>
<tr>
<th scope="row">{% trans 'Checked' %}</th>
<td class="align-middle">
@@ -131,7 +143,7 @@
</div>
<hr>
<div id="related-objects" class="row mb-5">
<div id="related-objects" class="row">
<div class="col-sm-12 col-md-12 col-lg-6">
<div id="related-compensations" class="card">
<div class="card-header rlp-r">
@@ -231,5 +243,105 @@
</div>
</div>
</div>
<div id="related-documents" class="row">
<div class="col-sm-12 col-md-12 col-lg-6">
<div class="card">
<div class="card-header rlp-r">
<div class="row">
<div class="col-sm-6">
<h5>
<span class="badge badge-light">{{intervention.documents.count}}</span>
{% trans 'Documents' %}
</h5>
</div>
<div class="col-sm-6">
<div class="d-flex justify-content-end">
<a href="{% url 'compensation:new' %}" title="{% trans 'Add new compensation' %}">
<button class="btn btn-outline-default">
{% fa5_icon 'plus' %}
{% fa5_icon 'file' %}
</button>
</a>
</div>
</div>
</div>
</div>
<div class="card-body">
<table class="table table-hover">
<thead>
<tr>
<th scope="col">
{% trans 'Title' %}
</th>
<th scope="col">
{% trans 'Comment' %}
</th>
</tr>
</thead>
<tbody>
{% for doc in intervention.documents.all %}
<tr>
<td>
<a href="{% url 'compensation:open' doc.id %}">
{{ doc.title }}
</a>
</td>
<td>{{ doc.comment }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
<div class="col-sm-12 col-md-12 col-lg-6">
<div id="related-payments" class="card">
<div class="card-header rlp-r">
<div class="row">
<div class="col-sm-6">
<h5>
<span class="badge badge-light">{{intervention.payments.count}}</span>
{% trans 'Payments' %}
</h5>
</div>
<div class="col-sm-6">
<div class="d-flex justify-content-end">
<a href="{% url 'compensation:pay-new' %}" title="{% trans 'Add new payment' %}">
<button class="btn btn-outline-default">
{% fa5_icon 'plus' %}
{% fa5_icon 'money-bill-wave' %}
</button>
</a>
</div>
</div>
</div>
</div>
<div class="card-body">
<table class="table table-hover">
<thead>
<tr>
<th scope="col">
{% trans 'Amount' %}
</th>
<th scope="col">
{% trans 'Transfer comment' %}
</th>
</tr>
</thead>
<tbody>
{% for pay in intervention.payments.all %}
<a href="{% url 'compensation:pay-open' pay.id %}">
<tr>
<td>{{ pay.amount }}</td>
<td>{{ pay.comment }}</td>
</tr>
</a>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
{% endblock %}