[Compensation] Conservation office #5

* keeps responsible data in compensation model for potential future purposes
* refactors registration_office and conservation_office to map onto KonovaCodes instead of own Organization model
* adds str_as_office property-method to KonovaCode to provide an easy way of rendering template data
* adds missing highlighting in case of missing information about registration office and conservation office
This commit is contained in:
mipel
2021-08-27 09:44:23 +02:00
parent b20ce0fdbc
commit e35dc6f2a5
5 changed files with 42 additions and 11 deletions

View File

@@ -38,17 +38,17 @@
<th scope="row">{% trans 'Law' %}</th>
<td class="align-middle">{{intervention.legal.law|default_if_none:""}}</td>
</tr>
<tr>
<tr {% if not intervention.responsible.registration_office %}class="alert alert-danger" title="{% trans 'Missing' %}" {% endif %}>
<th scope="row">{% trans 'Registration office' %}</th>
<td class="align-middle">{{intervention.responsible.registration_office|default_if_none:""}}</td>
<td class="align-middle">{{intervention.responsible.registration_office.str_as_office|default_if_none:""}}</td>
</tr>
<tr {% if not intervention.responsible.registration_file_number %}class="alert alert-danger" title="{% trans 'Missing' %}" {% endif %}>
<th scope="row">{% trans 'Registration office file number' %}</th>
<td class="align-middle">{{intervention.responsible.registration_file_number|default_if_none:""}}</td>
</tr>
<tr>
<tr {% if not intervention.responsible.conservation_office %}class="alert alert-danger" title="{% trans 'Missing' %}" {% endif %}>
<th scope="row">{% trans 'Conservation office' %}</th>
<td class="align-middle">{{intervention.responsible.conservation_office|default_if_none:""}}</td>
<td class="align-middle">{{intervention.responsible.conservation_office.str_as_office|default_if_none:""}}</td>
</tr>
<tr {% if not intervention.responsible.conservation_file_number %}class="alert alert-danger" title="{% trans 'Missing' %}" {% endif %}>
<th scope="row">{% trans 'Conversation office file number' %}</th>