Skip to content

Commit f567b0c

Browse files
larseggertrjsparks
andauthored
fix: Don't show reorder UI fixtures unless user can reorder (ietf-tools#4785)
Fixes ietf-tools#4773 Co-authored-by: Robert Sparks <rjsparks@nostrum.com>
1 parent baaa8f1 commit f567b0c

2 files changed

Lines changed: 24 additions & 19 deletions

File tree

ietf/templates/meeting/session_details.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
{% load origin ietf_filters static %}
44
{% block title %}{{ meeting }} : {{ acronym }}{% endblock %}
55
{% block morecss %}
6-
.slides tr {
7-
cursor:pointer;
6+
.draggable {
7+
cursor: pointer;
88
}
99
{% endblock %}
1010
{% block content %}

ietf/templates/meeting/session_details_panel.html

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,20 @@ <h3 class="mt-4">Agenda, Minutes, and Bluesheets</h3>
6666
<td>
6767
<a href="{{ pres.document.get_href }}">{{ pres.document.title }}</a>
6868
<a href="{{ url }}">({{ pres.document.name }})</a>
69-
</td>
70-
<td class="text-end">
7169
{% if user|has_role:"Secretariat" or can_manage_materials %}
70+
{% if pres.document.type.slug != 'bluesheets' or user|has_role:"Secretariat" or meeting.type.slug == 'interim' and can_manage_materials %}
71+
{% if pres.document.type.slug == 'minutes' %}
72+
<a class="btn btn-primary btn-sm float-end ms-1" href="{% url 'ietf.meeting.views.import_session_minutes' num=session.meeting.number session_id=session.pk %}">Import from notes.ietf.org</a>
73+
{% endif %}
74+
<a class="btn btn-primary btn-sm float-end ms-1" href="{{ upload_url }}">Upload revision</a>
75+
{% endif %}
7276
{% if pres.document.type.slug == 'minutes' %}
7377
{% url 'ietf.meeting.views.upload_session_minutes' session_id=session.pk num=session.meeting.number as upload_url %}
7478
{% elif pres.document.type.slug == 'agenda' %}
7579
{% url 'ietf.meeting.views.upload_session_agenda' session_id=session.pk num=session.meeting.number as upload_url %}
7680
{% else %}
7781
{% url 'ietf.meeting.views.upload_session_bluesheets' session_id=session.pk num=session.meeting.number as upload_url %}
7882
{% endif %}
79-
{% if pres.document.type.slug != 'bluesheets' or user|has_role:"Secretariat" or meeting.type.slug == 'interim' and can_manage_materials %}
80-
{% if pres.document.type.slug == 'minutes' %}
81-
<a class="btn btn-primary btn-sm" href="{% url 'ietf.meeting.views.import_session_minutes' num=session.meeting.number session_id=session.pk %}">Import from notes.ietf.org</a>
82-
{% endif %}
83-
<a class="btn btn-primary btn-sm" href="{{ upload_url }}">Upload revision</a>
84-
{% endif %}
8583
{% endif %}
8684
</td>
8785
</tr>
@@ -136,24 +134,31 @@ <h3 class="mt-4">Slides</h3>
136134
data-remove-from-session="{% url 'ietf.meeting.views.ajax_remove_slides_from_session' session_id=session.pk num=session.meeting.number %}"
137135
data-reorder-in-session="{% url 'ietf.meeting.views.ajax_reorder_slides_in_session' session_id=session.pk num=session.meeting.number %}">
138136
{% for pres in session.filtered_slides %}
139-
<tr data-name="{{ pres.document.name }}" title="Drag to reorder.">
137+
<tr data-name="{{ pres.document.name }}"
138+
{% if can_manage_materials %}
139+
class="draggable"
140+
title="Drag to reorder."
141+
{% endif %}
142+
>
140143
{% url 'ietf.doc.views_doc.document_main' name=pres.document.name as url %}
141-
<td><i class="bi bi-grip-vertical"></i></td>
144+
{% if can_manage_materials %}
145+
<td>
146+
<i class="bi bi-grip-vertical"></i>
147+
</td>
148+
{% endif %}
142149
<td>
143-
<a href="{{ pres.document.get_href }}">{{ pres.document.title }}</a>
144-
<a href="{{ url }}">({{ pres.document.name }})</a>
145-
</td>
146-
<td class="text-end">
147150
{% if can_manage_materials %}
148-
<a class="btn btn-primary btn-sm"
151+
<a class="btn btn-primary btn-sm float-end ms-1"
149152
href="{% url 'ietf.meeting.views.upload_session_slides' session_id=session.pk num=session.meeting.number name=pres.document.name %}">
150153
Upload revision
151154
</a>
152-
<a class="btn btn-danger btn-sm"
155+
<a class="btn btn-danger btn-sm float-end ms-1"
153156
href="{% url 'ietf.meeting.views.remove_sessionpresentation' session_id=session.pk num=session.meeting.number name=pres.document.name %}">
154157
Remove
155158
</a>
156159
{% endif %}
160+
<a href="{{ pres.document.get_href }}">{{ pres.document.title }}</a>
161+
<a href="{{ url }}">({{ pres.document.name }})</a>
157162
</td>
158163
</tr>
159164
{% endfor %}
@@ -206,4 +211,4 @@ <h3 class="mt-4">Drafts</h3>
206211
</a>
207212
{% endif %}
208213
{% endwith %}
209-
{% endfor %}
214+
{% endfor %}

0 commit comments

Comments
 (0)