Enhance NormalCase functionality: prepopulate age fields on edit, update author handling in create case normal view, and refine template logic for editing permissions
This commit is contained in:
@@ -32,18 +32,18 @@
|
||||
{% for normal in page_obj.object_list %}
|
||||
<div class="list-group-item d-flex justify-content-between align-items-start">
|
||||
<a class="flex-grow-1 text-decoration-none text-reset" href="{% url 'atlas:case_detail' normal.case.pk %}">
|
||||
<div class="d-flex w-100 justify-content-between">
|
||||
<h5 class="mb-1">{{ normal.case.title }}</h5>
|
||||
<small class="text-muted">{{ normal.added_date|date:"Y-m-d" }}</small>
|
||||
</div>
|
||||
<p class="mb-1">
|
||||
Age: {{ normal.display_age }}
|
||||
{% if normal.examination %} • Exam: {{ normal.examination }}{% endif %}
|
||||
{% if normal.modality %} • Modality: {{ normal.modality }}{% endif %}
|
||||
</p>
|
||||
{% if normal.notes %}
|
||||
<p class="mb-0 text-muted">{{ normal.notes }}</p>
|
||||
{% endif %}
|
||||
<div class="d-flex w-100 justify-content-between">
|
||||
<h5 class="mb-1">{{ normal.case.title }}</h5>
|
||||
<small class="text-muted">{{ normal.added_date|date:"Y-m-d" }}</small>
|
||||
</div>
|
||||
<p class="mb-1">
|
||||
Age: {{ normal.display_age }}
|
||||
{% if normal.examination %} • Exam: {{ normal.examination }}{% endif %}
|
||||
{% if normal.modality %} • Modality: {{ normal.modality }}{% endif %}
|
||||
</p>
|
||||
{% if normal.notes %}
|
||||
<p class="mb-0 text-muted">{{ normal.notes }}</p>
|
||||
{% endif %}
|
||||
</a>
|
||||
<div class="ms-2">
|
||||
{% if request.user.is_superuser or request.user in normal.author.all %}
|
||||
|
||||
@@ -15,8 +15,7 @@
|
||||
</button>
|
||||
{% endif %}
|
||||
|
||||
{# Allow NormalCase authors (or atlas editors/superusers) to edit the Normal metadata #}
|
||||
{% if case.normal_case and (request.user.is_superuser or request.user in case.normal_case.author.all or can_edit) %}
|
||||
{% if request.user.is_superuser or can_edit or request.user in case.normal_case.author.all %}
|
||||
<button class="btn btn-sm btn-outline-secondary ms-2"
|
||||
hx-get="{% url 'atlas:case_normal_edit' case.normal_case.pk %}"
|
||||
hx-target="body"
|
||||
|
||||
Reference in New Issue
Block a user