* adds Revocation model to interventions/models.py * adds revocations to interventions detail view * fixes duplicated ids in html includes * refactors controls for detail view into included template files (controls.html) * reduces max length for payment transfer notes from 1000 to 200 * adds RevocationAdmin to intervention/admin.py * adds new form for adding a Revocation to an intervention's legal_data * only one revocation per intervention possible * removes add button in case of an existing revocation * adds revocation routes to intervention app * renames document field in Document model into file for more clarity * adds/updates translations
		
			
				
	
	
		
			71 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			71 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
{% load i18n l10n fontawesome_5 %}
 | 
						|
<div id="revocation" class="card">
 | 
						|
    <div class="card-header rlp-r">
 | 
						|
        <div class="row">
 | 
						|
            <div class="col-sm-6">
 | 
						|
                <h5>
 | 
						|
                    <span class="badge badge-light">{% if intervention.legal.revocation %}1{% else %}0{% endif %}</span>
 | 
						|
                    {% trans 'Revocation' %}
 | 
						|
                </h5>
 | 
						|
            </div>
 | 
						|
            <div class="col-sm-6">
 | 
						|
                <div class="d-flex justify-content-end">
 | 
						|
                    {% comment %}
 | 
						|
                        Only show add-button if no revocation exists, yet.
 | 
						|
                    {% endcomment %}
 | 
						|
                    {% if is_default_member and has_access and not intervention.legal.revocation %}
 | 
						|
                    <button class="btn btn-outline-default btn-modal" data-form-url="{% url 'intervention:revocation-new' intervention.id %}" title="{% trans 'Add revocation' %}">
 | 
						|
                        {% fa5_icon 'plus' %}
 | 
						|
                        {% fa5_icon 'ban' %}
 | 
						|
                    </button>
 | 
						|
                    {% endif %}
 | 
						|
                </div>
 | 
						|
            </div>
 | 
						|
        </div>
 | 
						|
    </div>
 | 
						|
    <div class="card-body scroll-300">
 | 
						|
        <table class="table table-hover">
 | 
						|
            <thead>
 | 
						|
            <tr>
 | 
						|
                <th scope="col">
 | 
						|
                    {% trans 'From' context 'Revocation' %}
 | 
						|
                </th>
 | 
						|
                <th scope="col">
 | 
						|
                    {% trans 'Comment' %}
 | 
						|
                </th>
 | 
						|
                <th scope="col">
 | 
						|
                    {% trans 'Document' %}
 | 
						|
                </th>
 | 
						|
                <th scope="col">
 | 
						|
                    {% trans 'Action' %}
 | 
						|
                </th>
 | 
						|
            </tr>
 | 
						|
            </thead>
 | 
						|
            <tbody>
 | 
						|
            {% if intervention.legal.revocation %}
 | 
						|
            {% with intervention.legal.revocation as rev %}
 | 
						|
            <tr>
 | 
						|
                <td class="align-middle">
 | 
						|
                    {{ rev.date }}
 | 
						|
                </td>
 | 
						|
                <td class="align-middle">{{ rev.comment }}</td>
 | 
						|
                <td class="align-middle">
 | 
						|
                    <a href="{% url 'doc-open' rev.document.id %}">
 | 
						|
                        {{ rev.document.file }}
 | 
						|
                    </a>
 | 
						|
                </td>
 | 
						|
                <td>
 | 
						|
                    {% if is_default_member and has_access  %}
 | 
						|
                    <button data-form-url="{% url 'intervention:revocation-remove' rev.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove revocation' %}">
 | 
						|
                        {% fa5_icon 'trash' %}
 | 
						|
                    </button>
 | 
						|
                    {% endif %}
 | 
						|
                </td>
 | 
						|
            </tr>
 | 
						|
            {% endwith %}
 | 
						|
            {% endif %}
 | 
						|
            </tbody>
 | 
						|
        </table>
 | 
						|
    </div>
 | 
						|
</div>
 |