Use order links in print proposals management

A `<select>` tag here might make more sense than in other similar places
since there are 5 options to choose among, and using links might take
too much screen space.

However, as mentioned in the previous commits, `<select>` tags which
automatically submit a form have many accessibility and usability
issues.

An alternative would be to create a dropdown menu with a button and a
list of links (similar to what Foundation does). I'm keeping the links
for simplicity and because the interface looks a bit more consistent
with the rest of the sections. Before these changes, we had a heading,
then a `<select>` field to choose the filter, and then a button to print
the page. We never use a similar interface, and some people might think
the "Print" button is related to the same form as the `<select>` field.

Now that we don't use the `order_selector` partial anywhere anymore, we
can remove it.
This commit is contained in:
Javi Martín
2021-06-27 20:28:07 +02:00
parent 227a5868b8
commit 14d8bef0d8
6 changed files with 6 additions and 23 deletions

View File

@@ -14,7 +14,9 @@
<span class="not-print"><%= t("proposals.index.select_order_long") %></span>
<span class="for-print-only"><%= t("management.print.proposals_title") %></span>
</h2>
<%= render "shared/order_selector", i18n_namespace: "proposals.index" %>
<div class="not-print">
<%= render "shared/order_links", i18n_namespace: "proposals.index" %>
</div>
</div>
<%= render @proposals %>

View File

@@ -1,16 +0,0 @@
<% if @valid_orders.present? && @valid_orders.count > 1 %>
<form class="inline-block">
<label for="order-selector-participation" class="show-for-sr"><%= t("#{i18n_namespace}.select_order") %></label>
<select class="js-location-changer js-order-selector select-order"
data-order="<%= @current_order %>"
name="order-selector"
id="order-selector-participation">
<% @valid_orders.each do |order| %>
<option <%= "selected" if order == @current_order %>
value="<%= current_path_with_query_params(order: order, page: 1) %>">
<%= t("#{i18n_namespace}.orders.#{order}") %>
</option>
<% end %>
</select>
</form>
<% end %>