Refactors order_selector
Moves the information about the current order to the selector, not to the container
This commit is contained in:
15
app/views/shared/_order_selector.html.erb
Normal file
15
app/views/shared/_order_selector.html.erb
Normal file
@@ -0,0 +1,15 @@
|
||||
<% # Params:
|
||||
#
|
||||
# i18n_namespace: for example "moderation.debates.index"
|
||||
%>
|
||||
|
||||
<form class="inline-block">
|
||||
<select class="js-location-changer js-order-selector" data-order="<%= @current_order %>" name="order-selector">
|
||||
<% @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>
|
||||
Reference in New Issue
Block a user