diff --git a/atlas/templates/atlas/case_displayset_modal.html b/atlas/templates/atlas/case_displayset_modal.html index 963fe34e..9cc299f0 100644 --- a/atlas/templates/atlas/case_displayset_modal.html +++ b/atlas/templates/atlas/case_displayset_modal.html @@ -1,6 +1,9 @@
{{ ds.name }}
+ {% if can_edit %} + Edit display set + {% endif %} {% if ds.description %}
{{ ds.description }}
{% endif %} @@ -8,7 +11,7 @@ {# Viewer area for the modal - mounted by rad/static/dv3d bundle #}
- +
{% if ds.viewerstate and ds.annotations %} diff --git a/atlas/views.py b/atlas/views.py index a2c67b2c..5ba5c696 100755 --- a/atlas/views.py +++ b/atlas/views.py @@ -545,7 +545,12 @@ def case_displaysets_detail(request, pk): def case_displaysets_modal(request, pk): """Return HTML fragment for a CaseDisplaySet to be shown inside a modal.""" displayset = get_object_or_404(CaseDisplaySet, pk=pk) - return render(request, 'atlas/case_displayset_modal.html', {'ds': displayset}) + can_edit = False + try: + can_edit = displayset.case.check_user_can_edit(request.user) + except Exception: + can_edit = False + return render(request, 'atlas/case_displayset_modal.html', {'ds': displayset, 'can_edit': can_edit}) def case_displaysets_delete(request, pk): try: