feat: Add admin edit links for superusers in case history view
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -48,6 +48,21 @@
|
|||||||
href="{% url 'atlas:collection_case_view' pk=collection.id case_number=forloop.counter0 %}">
|
href="{% url 'atlas:collection_case_view' pk=collection.id case_number=forloop.counter0 %}">
|
||||||
Open Case
|
Open Case
|
||||||
</a>
|
</a>
|
||||||
|
{% if request.user.is_superuser and row.user_answer %}
|
||||||
|
{% if row.user_answer.user_id %}
|
||||||
|
<a class="btn btn-sm btn-outline-secondary"
|
||||||
|
href="{% url 'admin:atlas_userreportanswer_change' row.user_answer.pk %}"
|
||||||
|
target="_blank">
|
||||||
|
Edit in admin
|
||||||
|
</a>
|
||||||
|
{% else %}
|
||||||
|
<a class="btn btn-sm btn-outline-secondary"
|
||||||
|
href="{% url 'admin:atlas_cidreportanswer_change' row.user_answer.pk %}"
|
||||||
|
target="_blank">
|
||||||
|
Edit in admin
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
{% if row.self_reviews %}
|
{% if row.self_reviews %}
|
||||||
{% for review in row.self_reviews %}
|
{% for review in row.self_reviews %}
|
||||||
<a class="btn btn-sm btn-outline-info"
|
<a class="btn btn-sm btn-outline-info"
|
||||||
@@ -90,15 +105,6 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if request.user.is_superuser and row.user_answer %}
|
|
||||||
<div class="mt-2 small">
|
|
||||||
{% if row.user_answer.user_id %}
|
|
||||||
<a href="{% url 'admin:atlas_userreportanswer_change' row.user_answer.pk %}" target="_blank">Edit in admin</a>
|
|
||||||
{% else %}
|
|
||||||
<a href="{% url 'admin:atlas_cidreportanswer_change' row.user_answer.pk %}" target="_blank">Edit in admin</a>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
</details>
|
</details>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
Reference in New Issue
Block a user