Skip to content

Commit 6203264

Browse files
committed
views: Don't show chevron if user can't change sort order
We prevent users changing the column that sorting is done on when allowing users to change the order of patches in a bundle. However, we still show a chevron and clicking the link will appear to do something. This is confusing/misleading. Remove the chevron and the link in this situation. Signed-off-by: Stephen Finucane <[email protected]>
1 parent 45f47e9 commit 6203264

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

patchwork/templates/patchwork/partials/patch-list.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
{% endif %}
7070

7171
<th>
72+
{% if not order.editable %}
7273
{% if order.name == "name" %}
7374
<a class="colactive" href="{% listurl order=order.reversed_name %}">
7475
<span class="glyphicon glyphicon-chevron-{{ order.updown }}"></span>
@@ -77,11 +78,10 @@
7778
Patch
7879
</a>
7980
{% else %}
80-
{% if not order.editable %}
8181
<a class="colinactive" href="{% listurl order="name" %}">Patch</a>
82+
{% endif %}
8283
{% else %}
8384
<span class="colinactive">Patch</span>
84-
{% endif %}
8585
{% endif %}
8686
</th>
8787

@@ -98,6 +98,7 @@
9898
</th>
9999

100100
<th>
101+
{% if not order.editable %}
101102
{% if order.name == "date" %}
102103
<a class="colactive" href="{% listurl order=order.reversed_name %}">
103104
<span class="glyphicon glyphicon-chevron-{{ order.updown }}"></span>
@@ -106,15 +107,15 @@
106107
Date
107108
</a>
108109
{% else %}
109-
{% if not order.editable %}
110110
<a class="colinactive" href="{% listurl order="date" %}">Date</a>
111+
{% endif %}
111112
{% else %}
112113
<span class="colinactive">Date</span>
113-
{% endif %}
114114
{% endif %}
115115
</th>
116116

117117
<th>
118+
{% if not order.editable %}
118119
{% if order.name == "submitter" %}
119120
<a class="colactive" href="{% listurl order=order.reversed_name %}">
120121
<span class="glyphicon glyphicon-chevron-{{ order.updown }}"></span>
@@ -123,17 +124,17 @@
123124
Submitter
124125
</a>
125126
{% else %}
126-
{% if not order.editable %}
127127
<a class="colinactive" href="{% listurl order="submitter" %}">
128128
Submitter
129129
</a>
130+
{% endif %}
130131
{% else %}
131132
<span class="colinactive">Submitter</span>
132-
{% endif %}
133133
{% endif %}
134134
</th>
135135

136136
<th>
137+
{% if not order.editable %}
137138
{% if order.name == "delegate" %}
138139
<a class="colactive" href="{% listurl order=order.reversed_name %}">
139140
<span class="glyphicon glyphicon-chevron-{{ order.updown }}"></span>
@@ -142,15 +143,15 @@
142143
Delegate
143144
</a>
144145
{% else %}
145-
{% if not order.editable %}
146146
<a class="colinactive" href="{% listurl order="delegate" %}">Delegate</a>
147+
{% endif %}
147148
{% else %}
148149
<span class="colinactive">Delegate</span>
149-
{% endif %}
150150
{% endif %}
151151
</th>
152152

153153
<th>
154+
{% if not order.editable %}
154155
{% if order.name == "state" %}
155156
<a class="colactive" href="{% listurl order=order.reversed_name %}">
156157
<span class="glyphicon glyphicon-chevron-{{ order.updown }}"></span>
@@ -159,11 +160,10 @@
159160
State
160161
</a>
161162
{% else %}
162-
{% if not order.editable %}
163163
<a class="colinactive" href="{% listurl order="state" %}">State</a>
164+
{% endif %}
164165
{% else %}
165166
<span class="colinactive">State</span>
166-
{% endif %}
167167
{% endif %}
168168
</th>
169169

0 commit comments

Comments
 (0)