Refactors order_selector

Moves the information about the current order to the selector, not to
the container
This commit is contained in:
kikito
2015-09-12 16:48:31 +02:00
parent a2163c068a
commit d300bb6bcb
5 changed files with 33 additions and 17 deletions

View 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>