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 %}">
|
||||
Open Case
|
||||
</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 %}
|
||||
{% for review in row.self_reviews %}
|
||||
<a class="btn btn-sm btn-outline-info"
|
||||
@@ -90,15 +105,6 @@
|
||||
{% endfor %}
|
||||
{% 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>
|
||||
</details>
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user