# Variable refactoring
* renames variable `has_access` into `is_entry_shared` for better understanding in various places (mostly html related)
This commit is contained in:
		
							parent
							
								
									b622f986b1
								
							
						
					
					
						commit
						4e56f47b47
					
				@ -11,7 +11,7 @@
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="col-sm-6">
 | 
			
		||||
                <div class="d-flex justify-content-end">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button class="btn btn-outline-default btn-modal" data-form-url="{% url 'compensation:new-action' obj.id %}" title="{% trans 'Add new action' %}">
 | 
			
		||||
                        {% fa5_icon 'plus' %}
 | 
			
		||||
                        {% fa5_icon 'seedling' %}
 | 
			
		||||
@ -34,7 +34,7 @@
 | 
			
		||||
                <th scope="col">
 | 
			
		||||
                    {% trans 'Comment' %}
 | 
			
		||||
                </th>
 | 
			
		||||
                {% if is_default_member and has_access %}
 | 
			
		||||
                {% if is_default_member and is_entry_shared %}
 | 
			
		||||
                <th class="w-10" scope="col">
 | 
			
		||||
                    <span class="float-right">
 | 
			
		||||
                        {% trans 'Action' %}
 | 
			
		||||
@ -64,7 +64,7 @@
 | 
			
		||||
                    </div>
 | 
			
		||||
                </td>
 | 
			
		||||
                <td class="align-middle float-right">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button data-form-url="{% url 'compensation:action-edit' obj.id action.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit action' %}">
 | 
			
		||||
                        {% fa5_icon 'edit' %}
 | 
			
		||||
                    </button>
 | 
			
		||||
 | 
			
		||||
@ -11,7 +11,7 @@
 | 
			
		||||
            {% fa5_icon 'file-alt' %}
 | 
			
		||||
        </button>
 | 
			
		||||
    </a>
 | 
			
		||||
    {% if has_access %}
 | 
			
		||||
    {% if is_entry_shared %}
 | 
			
		||||
        <button class="btn btn-default btn-modal mr-2" title="{% trans 'Resubmission' %}" data-form-url="{% url 'compensation:resubmission-create' obj.id %}">
 | 
			
		||||
            {% fa5_icon 'bell' %}
 | 
			
		||||
        </button>
 | 
			
		||||
 | 
			
		||||
@ -10,7 +10,7 @@
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="col-sm-6">
 | 
			
		||||
                <div class="d-flex justify-content-end">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button class="btn btn-outline-default btn-modal" data-form-url="{% url 'compensation:new-deadline' obj.id %}" title="{% trans 'Add new deadline' %}">
 | 
			
		||||
                        {% fa5_icon 'plus' %}
 | 
			
		||||
                        {% fa5_icon 'calendar-check' %}
 | 
			
		||||
@ -38,7 +38,7 @@
 | 
			
		||||
                <th scope="col">
 | 
			
		||||
                    {% trans 'Comment' %}
 | 
			
		||||
                </th>
 | 
			
		||||
                {% if is_default_member and has_access %}
 | 
			
		||||
                {% if is_default_member and is_entry_shared %}
 | 
			
		||||
                    <th class="w-10" scope="col">
 | 
			
		||||
                        <span class="float-right">
 | 
			
		||||
                            {% trans 'Action' %}
 | 
			
		||||
@ -60,7 +60,7 @@
 | 
			
		||||
                    </div>
 | 
			
		||||
                </td>
 | 
			
		||||
                <td class="align-middle float-right">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button data-form-url="{% url 'compensation:deadline-edit' obj.id deadline.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit deadline' %}">
 | 
			
		||||
                        {% fa5_icon 'edit' %}
 | 
			
		||||
                    </button>
 | 
			
		||||
 | 
			
		||||
@ -10,7 +10,7 @@
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="col-sm-6">
 | 
			
		||||
                <div class="d-flex justify-content-end">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button class="btn btn-outline-default btn-modal" data-form-url="{% url 'compensation:new-doc' obj.id %}" title="{% trans 'Add new document' %}">
 | 
			
		||||
                        {% fa5_icon 'plus' %}
 | 
			
		||||
                        {% fa5_icon 'file' %}
 | 
			
		||||
@ -33,7 +33,7 @@
 | 
			
		||||
                <th scope="col">
 | 
			
		||||
                    {% trans 'Comment' %}
 | 
			
		||||
                </th>
 | 
			
		||||
                {% if is_default_member and has_access %}
 | 
			
		||||
                {% if is_default_member and is_entry_shared %}
 | 
			
		||||
                    <th class="w-10" scope="col">
 | 
			
		||||
                        <span class="float-right">
 | 
			
		||||
                            {% trans 'Action' %}
 | 
			
		||||
@ -59,7 +59,7 @@
 | 
			
		||||
                    </div>
 | 
			
		||||
                </td>
 | 
			
		||||
                <td class="align-middle float-right">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button data-form-url="{% url 'compensation:edit-doc' obj.id doc.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit document' %}">
 | 
			
		||||
                        {% fa5_icon 'edit' %}
 | 
			
		||||
                    </button>
 | 
			
		||||
 | 
			
		||||
@ -10,7 +10,7 @@
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="col-sm-6">
 | 
			
		||||
                <div class="d-flex justify-content-end">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button class="btn btn-outline-default btn-modal" data-form-url="{% url 'compensation:new-state' obj.id %}" title="{% trans 'Add new state after' %}">
 | 
			
		||||
                        {% fa5_icon 'plus' %}
 | 
			
		||||
                        {% fa5_icon 'layer-group' %}
 | 
			
		||||
@ -35,7 +35,7 @@
 | 
			
		||||
                <th scope="col">
 | 
			
		||||
                    {% trans 'Surface' %}
 | 
			
		||||
                </th>
 | 
			
		||||
                {% if is_default_member and has_access %}
 | 
			
		||||
                {% if is_default_member and is_entry_shared %}
 | 
			
		||||
                <th class="w-10" scope="col">
 | 
			
		||||
                    <span class="float-right">
 | 
			
		||||
                        {% trans 'Action' %}
 | 
			
		||||
@ -58,7 +58,7 @@
 | 
			
		||||
                </td>
 | 
			
		||||
                <td>{{ state.surface|floatformat:2 }} m²</td>
 | 
			
		||||
                <td class="align-middle float-right">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button data-form-url="{% url 'compensation:state-edit' obj.id state.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit state' %}">
 | 
			
		||||
                        {% fa5_icon 'edit' %}
 | 
			
		||||
                    </button>
 | 
			
		||||
 | 
			
		||||
@ -10,7 +10,7 @@
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="col-sm-6">
 | 
			
		||||
                <div class="d-flex justify-content-end">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button class="btn btn-outline-default btn-modal" data-form-url="{% url 'compensation:new-state' obj.id %}?before=true" title="{% trans 'Add new state before' %}">
 | 
			
		||||
                        {% fa5_icon 'plus' %}
 | 
			
		||||
                        {% fa5_icon 'layer-group' %}
 | 
			
		||||
@ -35,7 +35,7 @@
 | 
			
		||||
                <th scope="col">
 | 
			
		||||
                    {% trans 'Surface' %}
 | 
			
		||||
                </th>
 | 
			
		||||
                {% if is_default_member and has_access %}
 | 
			
		||||
                {% if is_default_member and is_entry_shared %}
 | 
			
		||||
                <th class="w-10" scope="col">
 | 
			
		||||
                    <span class="float-right">
 | 
			
		||||
                        {% trans 'Action' %}
 | 
			
		||||
@ -58,7 +58,7 @@
 | 
			
		||||
                </td>
 | 
			
		||||
                <td>{{ state.surface|floatformat:2 }} m²</td>
 | 
			
		||||
                <td class="align-middle float-right">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button data-form-url="{% url 'compensation:state-edit' obj.id state.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit state' %}">
 | 
			
		||||
                        {% fa5_icon 'edit' %}
 | 
			
		||||
                    </button>
 | 
			
		||||
 | 
			
		||||
@ -123,7 +123,7 @@
 | 
			
		||||
                                {% include 'user/includes/team_data_modal_button.html' %}
 | 
			
		||||
                            {% endfor %}
 | 
			
		||||
                            <hr>
 | 
			
		||||
                            {% if has_access %}
 | 
			
		||||
                            {% if is_entry_shared %}
 | 
			
		||||
                                {% for user in obj.intervention.shared_users %}
 | 
			
		||||
                                    {% include 'user/includes/contact_modal_button.html' %}
 | 
			
		||||
                                {% endfor %}
 | 
			
		||||
 | 
			
		||||
@ -10,7 +10,7 @@
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="col-sm-6">
 | 
			
		||||
                <div class="d-flex justify-content-end">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button class="btn btn-outline-default btn-modal" data-form-url="{% url 'compensation:acc:new-action' obj.id %}" title="{% trans 'Add new action' %}">
 | 
			
		||||
                        {% fa5_icon 'plus' %}
 | 
			
		||||
                        {% fa5_icon 'seedling' %}
 | 
			
		||||
@ -33,7 +33,7 @@
 | 
			
		||||
                <th scope="col">
 | 
			
		||||
                    {% trans 'Comment' %}
 | 
			
		||||
                </th>
 | 
			
		||||
                {% if is_default_member and has_access %}
 | 
			
		||||
                {% if is_default_member and is_entry_shared %}
 | 
			
		||||
                    <th class="w-10" scope="col">
 | 
			
		||||
                        <span class="float-right">
 | 
			
		||||
                            {% trans 'Action' %}
 | 
			
		||||
@ -63,7 +63,7 @@
 | 
			
		||||
                    </div>
 | 
			
		||||
                </td>
 | 
			
		||||
                <td class="align-middle float-right">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button data-form-url="{% url 'compensation:acc:action-edit' obj.id action.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit action' %}">
 | 
			
		||||
                        {% fa5_icon 'edit' %}
 | 
			
		||||
                    </button>
 | 
			
		||||
 | 
			
		||||
@ -11,7 +11,7 @@
 | 
			
		||||
            {% fa5_icon 'file-alt' %}
 | 
			
		||||
        </button>
 | 
			
		||||
    </a>
 | 
			
		||||
    {% if has_access %}
 | 
			
		||||
    {% if is_entry_shared %}
 | 
			
		||||
        <button class="btn btn-default btn-modal mr-2" title="{% trans 'Resubmission' %}" data-form-url="{% url 'compensation:acc:resubmission-create' obj.id %}">
 | 
			
		||||
            {% fa5_icon 'bell' %}
 | 
			
		||||
        </button>
 | 
			
		||||
 | 
			
		||||
@ -10,7 +10,7 @@
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="col-sm-6">
 | 
			
		||||
                <div class="d-flex justify-content-end">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button class="btn btn-outline-default btn-modal" data-form-url="{% url 'compensation:acc:new-deadline' obj.id %}" title="{% trans 'Add new deadline' %}">
 | 
			
		||||
                        {% fa5_icon 'plus' %}
 | 
			
		||||
                        {% fa5_icon 'calendar-check' %}
 | 
			
		||||
@ -58,7 +58,7 @@
 | 
			
		||||
                    </div>
 | 
			
		||||
                </td>
 | 
			
		||||
                <td class="align-middle float-right">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button data-form-url="{% url 'compensation:acc:deadline-edit' obj.id deadline.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit deadline' %}">
 | 
			
		||||
                        {% fa5_icon 'edit' %}
 | 
			
		||||
                    </button>
 | 
			
		||||
 | 
			
		||||
@ -61,7 +61,7 @@
 | 
			
		||||
                <td class="align-middle">{{ deduction.surface|floatformat:2|intcomma }} m²</td>
 | 
			
		||||
                <td class="align-middle">{{ deduction.created.timestamp|default_if_none:""|naturalday}}</td>
 | 
			
		||||
                <td class="align-middle float-right">
 | 
			
		||||
                    {% if is_default_member and has_access or is_default_member and user in deduction.intervention.shared_users  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared or is_default_member and user in deduction.intervention.shared_users  %}
 | 
			
		||||
                    <button data-form-url="{% url 'compensation:acc:edit-deduction' deduction.account.id deduction.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit Deduction' %}">
 | 
			
		||||
                        {% fa5_icon 'edit' %}
 | 
			
		||||
                    </button>
 | 
			
		||||
 | 
			
		||||
@ -10,7 +10,7 @@
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="col-sm-6">
 | 
			
		||||
                <div class="d-flex justify-content-end">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button class="btn btn-outline-default btn-modal" data-form-url="{% url 'compensation:acc:new-doc' obj.id %}" title="{% trans 'Add new document' %}">
 | 
			
		||||
                        {% fa5_icon 'plus' %}
 | 
			
		||||
                        {% fa5_icon 'file' %}
 | 
			
		||||
@ -57,7 +57,7 @@
 | 
			
		||||
                    </div>
 | 
			
		||||
                </td>
 | 
			
		||||
                <td class="align-middle float-right">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button data-form-url="{% url 'compensation:acc:edit-doc' obj.id doc.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit document' %}">
 | 
			
		||||
                        {% fa5_icon 'edit' %}
 | 
			
		||||
                    </button>
 | 
			
		||||
 | 
			
		||||
@ -10,7 +10,7 @@
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="col-sm-6">
 | 
			
		||||
                <div class="d-flex justify-content-end">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button class="btn btn-outline-default btn-modal" data-form-url="{% url 'compensation:acc:new-state' obj.id %}" title="{% trans 'Add new state after' %}">
 | 
			
		||||
                        {% fa5_icon 'plus' %}
 | 
			
		||||
                        {% fa5_icon 'layer-group' %}
 | 
			
		||||
@ -35,7 +35,7 @@
 | 
			
		||||
                <th scope="col">
 | 
			
		||||
                    {% trans 'Surface' %}
 | 
			
		||||
                </th>
 | 
			
		||||
                {% if is_default_member and has_access %}
 | 
			
		||||
                {% if is_default_member and is_entry_shared %}
 | 
			
		||||
                <th class="w-10" scope="col">
 | 
			
		||||
                    <span class="float-right">
 | 
			
		||||
                        {% trans 'Action' %}
 | 
			
		||||
@ -58,7 +58,7 @@
 | 
			
		||||
                </td>
 | 
			
		||||
                <td>{{ state.surface|floatformat:2 }} m²</td>
 | 
			
		||||
                <td class="align-middle float-right">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button data-form-url="{% url 'compensation:acc:state-edit' obj.id state.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit state' %}">
 | 
			
		||||
                        {% fa5_icon 'edit' %}
 | 
			
		||||
                    </button>
 | 
			
		||||
 | 
			
		||||
@ -10,7 +10,7 @@
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="col-sm-6">
 | 
			
		||||
                <div class="d-flex justify-content-end">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button class="btn btn-outline-default btn-modal" data-form-url="{% url 'compensation:acc:new-state' obj.id %}?before=true" title="{% trans 'Add new state before' %}">
 | 
			
		||||
                        {% fa5_icon 'plus' %}
 | 
			
		||||
                        {% fa5_icon 'layer-group' %}
 | 
			
		||||
@ -35,7 +35,7 @@
 | 
			
		||||
                <th scope="col">
 | 
			
		||||
                    {% trans 'Surface' %}
 | 
			
		||||
                </th>
 | 
			
		||||
                {% if is_default_member and has_access %}
 | 
			
		||||
                {% if is_default_member and is_entry_shared %}
 | 
			
		||||
                <th class="w-10" scope="col">
 | 
			
		||||
                    <span class="float-right">
 | 
			
		||||
                        {% trans 'Action' %}
 | 
			
		||||
@ -58,7 +58,7 @@
 | 
			
		||||
                </td>
 | 
			
		||||
                <td>{{ state.surface|floatformat:2 }} m²</td>
 | 
			
		||||
                <td class="align-middle float-right">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button data-form-url="{% url 'compensation:acc:state-edit' obj.id state.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit state' %}">
 | 
			
		||||
                        {% fa5_icon 'edit' %}
 | 
			
		||||
                    </button>
 | 
			
		||||
 | 
			
		||||
@ -101,7 +101,7 @@
 | 
			
		||||
                                {% include 'user/includes/team_data_modal_button.html' %}
 | 
			
		||||
                            {% endfor %}
 | 
			
		||||
                            <hr>
 | 
			
		||||
                            {% if has_access %}
 | 
			
		||||
                            {% if is_entry_shared %}
 | 
			
		||||
                                {% for user in obj.users.all %}
 | 
			
		||||
                                    {% include 'user/includes/contact_modal_button.html' %}
 | 
			
		||||
                                {% endfor %}
 | 
			
		||||
 | 
			
		||||
@ -259,7 +259,7 @@ def detail_view(request: HttpRequest, id: str):
 | 
			
		||||
        "last_checked_tooltip": last_checked_tooltip,
 | 
			
		||||
        "geom_form": geom_form,
 | 
			
		||||
        "parcels": parcels,
 | 
			
		||||
        "has_access": is_data_shared,
 | 
			
		||||
        "is_entry_shared": is_data_shared,
 | 
			
		||||
        "actions": actions,
 | 
			
		||||
        "before_states": before_states,
 | 
			
		||||
        "after_states": after_states,
 | 
			
		||||
 | 
			
		||||
@ -67,7 +67,7 @@ def report_view(request: HttpRequest, id: str):
 | 
			
		||||
            "img": qrcode_img_lanis,
 | 
			
		||||
            "url": qrcode_lanis_url,
 | 
			
		||||
        },
 | 
			
		||||
        "has_access": False,  # disables action buttons during rendering
 | 
			
		||||
        "is_entry_shared": False,  # disables action buttons during rendering
 | 
			
		||||
        "before_states": before_states,
 | 
			
		||||
        "after_states": after_states,
 | 
			
		||||
        "geom_form": geom_form,
 | 
			
		||||
 | 
			
		||||
@ -237,7 +237,7 @@ def detail_view(request: HttpRequest, id: str):
 | 
			
		||||
        "obj": acc,
 | 
			
		||||
        "geom_form": geom_form,
 | 
			
		||||
        "parcels": parcels,
 | 
			
		||||
        "has_access": is_data_shared,
 | 
			
		||||
        "is_entry_shared": is_data_shared,
 | 
			
		||||
        "before_states": before_states,
 | 
			
		||||
        "after_states": after_states,
 | 
			
		||||
        "sum_before_states": sum_before_states,
 | 
			
		||||
 | 
			
		||||
@ -73,7 +73,7 @@ def report_view(request: HttpRequest, id: str):
 | 
			
		||||
            "img": qrcode_img_lanis,
 | 
			
		||||
            "url": qrcode_lanis_url,
 | 
			
		||||
        },
 | 
			
		||||
        "has_access": False,  # disables action buttons during rendering
 | 
			
		||||
        "is_entry_shared": False,  # disables action buttons during rendering
 | 
			
		||||
        "before_states": before_states,
 | 
			
		||||
        "after_states": after_states,
 | 
			
		||||
        "geom_form": geom_form,
 | 
			
		||||
 | 
			
		||||
@ -10,7 +10,7 @@
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="col-sm-6">
 | 
			
		||||
                <div class="d-flex justify-content-end">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button class="btn btn-outline-default btn-modal" data-form-url="{% url 'ema:new-action' obj.id %}" title="{% trans 'Add new action' %}">
 | 
			
		||||
                        {% fa5_icon 'plus' %}
 | 
			
		||||
                        {% fa5_icon 'seedling' %}
 | 
			
		||||
@ -61,7 +61,7 @@
 | 
			
		||||
                    </div>
 | 
			
		||||
                </td>
 | 
			
		||||
                <td class="align-middle float-right">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button data-form-url="{% url 'ema:action-edit' obj.id action.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit action' %}">
 | 
			
		||||
                        {% fa5_icon 'edit' %}
 | 
			
		||||
                    </button>
 | 
			
		||||
 | 
			
		||||
@ -11,7 +11,7 @@
 | 
			
		||||
            {% fa5_icon 'file-alt' %}
 | 
			
		||||
        </button>
 | 
			
		||||
    </a>
 | 
			
		||||
    {% if has_access %}
 | 
			
		||||
    {% if is_entry_shared %}
 | 
			
		||||
        <button class="btn btn-default btn-modal mr-2" title="{% trans 'Resubmission' %}" data-form-url="{% url 'ema:resubmission-create' obj.id %}">
 | 
			
		||||
            {% fa5_icon 'bell' %}
 | 
			
		||||
        </button>
 | 
			
		||||
 | 
			
		||||
@ -10,7 +10,7 @@
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="col-sm-6">
 | 
			
		||||
                <div class="d-flex justify-content-end">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button class="btn btn-outline-default btn-modal" data-form-url="{% url 'ema:new-deadline' obj.id %}" title="{% trans 'Add new deadline' %}">
 | 
			
		||||
                        {% fa5_icon 'plus' %}
 | 
			
		||||
                        {% fa5_icon 'calendar-check' %}
 | 
			
		||||
@ -58,7 +58,7 @@
 | 
			
		||||
                    </div>
 | 
			
		||||
                </td>
 | 
			
		||||
                <td class="align-middle float-right">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button data-form-url="{% url 'ema:deadline-edit' obj.id deadline.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit deadline' %}">
 | 
			
		||||
                        {% fa5_icon 'edit' %}
 | 
			
		||||
                    </button>
 | 
			
		||||
 | 
			
		||||
@ -10,7 +10,7 @@
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="col-sm-6">
 | 
			
		||||
                <div class="d-flex justify-content-end">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button class="btn btn-outline-default btn-modal" data-form-url="{% url 'ema:new-doc' obj.id %}" title="{% trans 'Add new document' %}">
 | 
			
		||||
                        {% fa5_icon 'plus' %}
 | 
			
		||||
                        {% fa5_icon 'file' %}
 | 
			
		||||
@ -57,7 +57,7 @@
 | 
			
		||||
                    </div>
 | 
			
		||||
                </td>
 | 
			
		||||
                <td class="align-middle float-right">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button data-form-url="{% url 'ema:edit-doc' obj.id doc.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit document' %}">
 | 
			
		||||
                        {% fa5_icon 'edit' %}
 | 
			
		||||
                    </button>
 | 
			
		||||
 | 
			
		||||
@ -10,7 +10,7 @@
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="col-sm-6">
 | 
			
		||||
                <div class="d-flex justify-content-end">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button class="btn btn-outline-default btn-modal" data-form-url="{% url 'ema:new-state' obj.id %}" title="{% trans 'Add new state after' %}">
 | 
			
		||||
                        {% fa5_icon 'plus' %}
 | 
			
		||||
                        {% fa5_icon 'layer-group' %}
 | 
			
		||||
@ -56,7 +56,7 @@
 | 
			
		||||
                </td>
 | 
			
		||||
                <td>{{ state.surface|floatformat:2 }} m²</td>
 | 
			
		||||
                <td class="align-middle float-right">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button data-form-url="{% url 'ema:state-edit' obj.id state.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit state' %}">
 | 
			
		||||
                        {% fa5_icon 'edit' %}
 | 
			
		||||
                    </button>
 | 
			
		||||
 | 
			
		||||
@ -10,7 +10,7 @@
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="col-sm-6">
 | 
			
		||||
                <div class="d-flex justify-content-end">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button class="btn btn-outline-default btn-modal" data-form-url="{% url 'ema:new-state' obj.id %}?before=true" title="{% trans 'Add new state before' %}">
 | 
			
		||||
                        {% fa5_icon 'plus' %}
 | 
			
		||||
                        {% fa5_icon 'layer-group' %}
 | 
			
		||||
@ -56,7 +56,7 @@
 | 
			
		||||
                </td>
 | 
			
		||||
                <td>{{ state.surface|floatformat:2 }} m²</td>
 | 
			
		||||
                <td class="align-middle float-right">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button data-form-url="{% url 'ema:state-edit' obj.id state.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit state' %}">
 | 
			
		||||
                        {% fa5_icon 'edit' %}
 | 
			
		||||
                    </button>
 | 
			
		||||
 | 
			
		||||
@ -87,7 +87,7 @@
 | 
			
		||||
                                {% include 'user/includes/team_data_modal_button.html' %}
 | 
			
		||||
                            {% endfor %}
 | 
			
		||||
                            <hr>
 | 
			
		||||
                            {% if has_access %}
 | 
			
		||||
                            {% if is_entry_shared %}
 | 
			
		||||
                                {% for user in obj.users.all %}
 | 
			
		||||
                                    {% include 'user/includes/contact_modal_button.html' %}
 | 
			
		||||
                                {% endfor %}
 | 
			
		||||
 | 
			
		||||
@ -142,7 +142,7 @@ def detail_view(request: HttpRequest, id: str):
 | 
			
		||||
    geom_form = SimpleGeomForm(instance=ema)
 | 
			
		||||
    parcels = ema.get_underlying_parcels()
 | 
			
		||||
    _user = request.user
 | 
			
		||||
    is_data_shared = ema.is_shared_with(_user)
 | 
			
		||||
    is_entry_shared = ema.is_shared_with(_user)
 | 
			
		||||
 | 
			
		||||
    # Order states according to surface
 | 
			
		||||
    before_states = ema.before_states.all().order_by("-surface")
 | 
			
		||||
@ -167,7 +167,7 @@ def detail_view(request: HttpRequest, id: str):
 | 
			
		||||
        "obj": ema,
 | 
			
		||||
        "geom_form": geom_form,
 | 
			
		||||
        "parcels": parcels,
 | 
			
		||||
        "has_access": is_data_shared,
 | 
			
		||||
        "is_entry_shared": is_entry_shared,
 | 
			
		||||
        "before_states": before_states,
 | 
			
		||||
        "after_states": after_states,
 | 
			
		||||
        "sum_before_states": sum_before_states,
 | 
			
		||||
 | 
			
		||||
@ -67,7 +67,7 @@ def report_view(request:HttpRequest, id: str):
 | 
			
		||||
            "img": qrcode_img_lanis,
 | 
			
		||||
            "url": qrcode_lanis_url
 | 
			
		||||
        },
 | 
			
		||||
        "has_access": False,  # disables action buttons during rendering
 | 
			
		||||
        "is_entry_shared": False,  # disables action buttons during rendering
 | 
			
		||||
        "before_states": before_states,
 | 
			
		||||
        "after_states": after_states,
 | 
			
		||||
        "geom_form": geom_form,
 | 
			
		||||
 | 
			
		||||
@ -10,7 +10,7 @@
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="col-sm-6">
 | 
			
		||||
                <div class="d-flex justify-content-end">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <a href="{% url 'compensation:new' obj.id %}" title="{% trans 'Add new compensation' %}">
 | 
			
		||||
                        <button class="btn btn-outline-default">
 | 
			
		||||
                            {% fa5_icon 'plus' %}
 | 
			
		||||
@ -32,7 +32,7 @@
 | 
			
		||||
                <th scope="col">
 | 
			
		||||
                    {% trans 'Title' %}
 | 
			
		||||
                </th>
 | 
			
		||||
                {% if is_default_member and has_access %}
 | 
			
		||||
                {% if is_default_member and is_entry_shared %}
 | 
			
		||||
                    <th class="w-10" scope="col">
 | 
			
		||||
                        <span class="float-right">
 | 
			
		||||
                            {% trans 'Action' %}
 | 
			
		||||
@ -51,7 +51,7 @@
 | 
			
		||||
                </td>
 | 
			
		||||
                <td class="align-middle">{{ comp.title }}</td>
 | 
			
		||||
                <td>
 | 
			
		||||
                {% if is_default_member and has_access %}
 | 
			
		||||
                {% if is_default_member and is_entry_shared %}
 | 
			
		||||
                    <button data-form-url="{% url 'intervention:remove-compensation' obj.id comp.id %}" class="btn btn-default btn-modal float-right" title="{% trans 'Remove compensation' %}">
 | 
			
		||||
                        {% fa5_icon 'trash' %}
 | 
			
		||||
                    </button>
 | 
			
		||||
 | 
			
		||||
@ -11,7 +11,7 @@
 | 
			
		||||
            {% fa5_icon 'file-alt' %}
 | 
			
		||||
        </button>
 | 
			
		||||
    </a>
 | 
			
		||||
    {% if has_access %}
 | 
			
		||||
    {% if is_entry_shared %}
 | 
			
		||||
        <button class="btn btn-default btn-modal mr-2" title="{% trans 'Resubmission' %}" data-form-url="{% url 'intervention:resubmission-create' obj.id %}">
 | 
			
		||||
            {% fa5_icon 'bell' %}
 | 
			
		||||
        </button>
 | 
			
		||||
 | 
			
		||||
@ -10,7 +10,7 @@
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="col-sm-6">
 | 
			
		||||
                <div class="d-flex justify-content-end">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button class="btn btn-outline-default btn-modal" data-form-url="{% url 'intervention:new-deduction' obj.id %}" title="{% trans 'Add new deduction' %}">
 | 
			
		||||
                        {% fa5_icon 'plus' %}
 | 
			
		||||
                        {% fa5_icon 'tree' %}
 | 
			
		||||
@ -33,7 +33,7 @@
 | 
			
		||||
                <th scope="col">
 | 
			
		||||
                    {% trans 'Created' %}
 | 
			
		||||
                </th>
 | 
			
		||||
                {% if is_default_member and has_access %}
 | 
			
		||||
                {% if is_default_member and is_entry_shared %}
 | 
			
		||||
                    <th class="w-10" scope="col">
 | 
			
		||||
                        <span class="float-right">
 | 
			
		||||
                            {% trans 'Action' %}
 | 
			
		||||
@ -56,7 +56,7 @@
 | 
			
		||||
                <td class="align-middle">{{ deduction.surface|floatformat:2|intcomma }} m²</td>
 | 
			
		||||
                <td class="align-middle">{{ deduction.created.timestamp|default_if_none:""|naturalday}}</td>
 | 
			
		||||
                <td class="align-middle float-right">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button data-form-url="{% url 'intervention:edit-deduction' obj.id deduction.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit Deduction' %}">
 | 
			
		||||
                        {% fa5_icon 'edit' %}
 | 
			
		||||
                    </button>
 | 
			
		||||
 | 
			
		||||
@ -10,7 +10,7 @@
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="col-sm-6">
 | 
			
		||||
                <div class="d-flex justify-content-end">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button class="btn btn-outline-default btn-modal" data-form-url="{% url 'intervention:new-doc' obj.id %}" title="{% trans 'Add new document' %}">
 | 
			
		||||
                        {% fa5_icon 'plus' %}
 | 
			
		||||
                        {% fa5_icon 'file' %}
 | 
			
		||||
@ -38,7 +38,7 @@
 | 
			
		||||
                <th scope="col">
 | 
			
		||||
                    {% trans 'Comment' %}
 | 
			
		||||
                </th>
 | 
			
		||||
                {% if is_default_member and has_access %}
 | 
			
		||||
                {% if is_default_member and is_entry_shared %}
 | 
			
		||||
                    <th class="w-10" scope="col">
 | 
			
		||||
                        <span class="float-right">
 | 
			
		||||
                            {% trans 'Action' %}
 | 
			
		||||
@ -66,7 +66,7 @@
 | 
			
		||||
                    </div>
 | 
			
		||||
                </td>
 | 
			
		||||
                <td class="align-middle float-right">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button data-form-url="{% url 'intervention:edit-doc' obj.id doc.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit document' %}">
 | 
			
		||||
                        {% fa5_icon 'edit' %}
 | 
			
		||||
                    </button>
 | 
			
		||||
 | 
			
		||||
@ -10,7 +10,7 @@
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="col-sm-6">
 | 
			
		||||
                <div class="d-flex justify-content-end">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button class="btn btn-outline-default btn-modal" data-form-url="{% url 'compensation:pay:new' obj.id %}" title="{% trans 'Add new payment' %}">
 | 
			
		||||
                        {% fa5_icon 'plus' %}
 | 
			
		||||
                        {% fa5_icon 'money-bill-wave' %}
 | 
			
		||||
@ -33,7 +33,7 @@
 | 
			
		||||
                <th class="w-50" scope="col">
 | 
			
		||||
                    {% trans 'Comment' %}
 | 
			
		||||
                </th>
 | 
			
		||||
                {% if is_default_member and has_access %}
 | 
			
		||||
                {% if is_default_member and is_entry_shared %}
 | 
			
		||||
                    <th class="w-10" scope="col">
 | 
			
		||||
                        <span class="float-right">
 | 
			
		||||
                            {% trans 'Action' %}
 | 
			
		||||
@ -46,7 +46,7 @@
 | 
			
		||||
            {% for pay in obj.payments.all %}
 | 
			
		||||
            <tr>
 | 
			
		||||
                <td class="align-middle">
 | 
			
		||||
                    {% if has_access %}
 | 
			
		||||
                    {% if is_entry_shared %}
 | 
			
		||||
                        {{ pay.amount|floatformat:2 }} €
 | 
			
		||||
                    {% else %}
 | 
			
		||||
                        ***
 | 
			
		||||
@ -55,7 +55,7 @@
 | 
			
		||||
                <td class="align-middle">{{ pay.due_on|default_if_none:"---" }}</td>
 | 
			
		||||
                <td class="align-middle">
 | 
			
		||||
                    <div class="scroll-150">
 | 
			
		||||
                        {% if has_access %}
 | 
			
		||||
                        {% if is_entry_shared %}
 | 
			
		||||
                            {{ pay.comment }}
 | 
			
		||||
                        {% else %}
 | 
			
		||||
                            {% trans 'This data is not shared with you' %}
 | 
			
		||||
@ -63,7 +63,7 @@
 | 
			
		||||
                    </div>
 | 
			
		||||
                </td>
 | 
			
		||||
                <td class="align-middle float-right">
 | 
			
		||||
                    {% if is_default_member and has_access  %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                    <button data-form-url="{% url 'compensation:pay:edit' obj.id pay.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit payment' %}">
 | 
			
		||||
                        {% fa5_icon 'edit' %}
 | 
			
		||||
                    </button>
 | 
			
		||||
 | 
			
		||||
@ -13,7 +13,7 @@
 | 
			
		||||
                    {% comment %}
 | 
			
		||||
                        Only show add-button if no revocation exists, yet.
 | 
			
		||||
                    {% endcomment %}
 | 
			
		||||
                    {% if is_default_member and has_access and not obj.legal.revocation %}
 | 
			
		||||
                    {% if is_default_member and is_entry_shared and not obj.legal.revocation %}
 | 
			
		||||
                    <button class="btn btn-outline-default btn-modal" data-form-url="{% url 'intervention:new-revocation' obj.id %}" title="{% trans 'Add revocation' %}">
 | 
			
		||||
                        {% fa5_icon 'plus' %}
 | 
			
		||||
                        {% fa5_icon 'ban' %}
 | 
			
		||||
@ -36,7 +36,7 @@
 | 
			
		||||
                <th scope="col">
 | 
			
		||||
                    {% trans 'Comment' %}
 | 
			
		||||
                </th>
 | 
			
		||||
                {% if is_default_member and has_access %}
 | 
			
		||||
                {% if is_default_member and is_entry_shared %}
 | 
			
		||||
                    <th class="w-10" scope="col">
 | 
			
		||||
                        <span class="float-right">
 | 
			
		||||
                            {% trans 'Action' %}
 | 
			
		||||
@ -64,7 +64,7 @@
 | 
			
		||||
                        </div>
 | 
			
		||||
                    </td>
 | 
			
		||||
                    <td class="align-middle float-right">
 | 
			
		||||
                        {% if is_default_member and has_access  %}
 | 
			
		||||
                        {% if is_default_member and is_entry_shared  %}
 | 
			
		||||
                        <button data-form-url="{% url 'intervention:edit-revocation' obj.id rev.id %}" class="btn btn-default btn-modal" title="{% trans 'Edit revocation' %}">
 | 
			
		||||
                            {% fa5_icon 'edit' %}
 | 
			
		||||
                        </button>
 | 
			
		||||
 | 
			
		||||
@ -129,7 +129,7 @@
 | 
			
		||||
                                {% include 'user/includes/team_data_modal_button.html' %}
 | 
			
		||||
                            {% endfor %}
 | 
			
		||||
                            <hr>
 | 
			
		||||
                            {% if has_access %}
 | 
			
		||||
                            {% if is_entry_shared %}
 | 
			
		||||
                                {% for user in obj.users.all %}
 | 
			
		||||
                                    {% include 'user/includes/contact_modal_button.html' %}
 | 
			
		||||
                                {% endfor %}
 | 
			
		||||
 | 
			
		||||
@ -185,7 +185,7 @@ def detail_view(request: HttpRequest, id: str):
 | 
			
		||||
        "last_checked": last_checked,
 | 
			
		||||
        "last_checked_tooltip": last_checked_tooltip,
 | 
			
		||||
        "compensations": compensations,
 | 
			
		||||
        "has_access": is_data_shared,
 | 
			
		||||
        "is_entry_shared": is_data_shared,
 | 
			
		||||
        "geom_form": geom_form,
 | 
			
		||||
        "is_default_member": _user.in_group(DEFAULT_GROUP),
 | 
			
		||||
        "is_zb_member": _user.in_group(ZB_GROUP),
 | 
			
		||||
 | 
			
		||||
@ -216,11 +216,11 @@ class TableRenderMixin:
 | 
			
		||||
 | 
			
		||||
        """
 | 
			
		||||
        html = ""
 | 
			
		||||
        has_access = record.is_shared_with(self.user)
 | 
			
		||||
        is_entry_shared = record.is_shared_with(self.user)
 | 
			
		||||
 | 
			
		||||
        html += self.render_icn(
 | 
			
		||||
            tooltip=_("Full access granted") if has_access else _("Access not granted"),
 | 
			
		||||
            icn_class="fas fa-edit rlp-r-inv" if has_access else "far fa-edit",
 | 
			
		||||
            tooltip=_("Full access granted") if is_entry_shared else _("Access not granted"),
 | 
			
		||||
            icn_class="fas fa-edit rlp-r-inv" if is_entry_shared else "far fa-edit",
 | 
			
		||||
        )
 | 
			
		||||
        return format_html(html)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user