Use order links in legislation proposals admin

As mentioned in the previous commits, a `<select>` field which submits
its form on change causes many accessibility and usability issues, so
we're replacing it with the order links we use everywhere else.

Since the links "Id" and "Title" by themselves don't have enough
information to let users know they're used to sort by ID or title, we
have to update them somehow. We could add a "Sort by:" prefix before the
list of links (and associate it with the `aria-labelledby` attribute);
however, we don't do this anywhere else and might look weird depending
on the screen size.

So we're simply adding "Sort by" before each link.

Now that we don't use the `wide_order_selector` partial anymore, we can
remove it alongside the styles for the `select-order` class.
This commit is contained in:
Javi Martín
2021-06-27 23:40:04 +02:00
parent d672a4294a
commit bc0f040758
9 changed files with 10 additions and 75 deletions

View File

@@ -1,7 +1,7 @@
<% if proposals.any? %>
<h3><%= page_entries_info proposals %></h3>
<%= render "shared/wide_order_selector", i18n_namespace: "admin.legislation.processes.proposals" %>
<%= render "shared/order_links", i18n_namespace: "admin.legislation.processes.proposals" %>
<table class="stack" id="legislation_proposals_list">
<thead>