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

@@ -1,7 +1,7 @@
<section role="main">
<div class="wrap row">
<div id="debates" class="debates-list small-12 medium-9 column js-order-<%= @current_order.dasherize %>">
<div id="debates" class="debates-list small-12 medium-9 column">
<div class="filters">
<div class="small-12 medium-7 column">
<% if @search_terms %>
@@ -27,7 +27,7 @@
<%= t("debates.index.select_order_long") %>
</h2>
<% end %>
<%= render 'shared/order_select', i18n_namespace: "debates.index" %>
<%= render 'shared/order_selector', i18n_namespace: "debates.index" %>
</div>
<div class="show-for-small-only">
<%= link_to t("debates.index.start_debate"), new_debate_path, class: 'button radius expand' %>

View File

@@ -1,7 +1,7 @@
<section role="main">
<div class="wrap row">
<div id="proposals" class="Proposals-list small-12 medium-9 column js-order-<%= @current_order.dasherize %>">
<div id="proposals" class="Proposals-list small-12 medium-9 column">
<div class="filters">
<div class="small-12 medium-7 column">
<% if @search_terms %>
@@ -27,7 +27,7 @@
<%= t("proposals.index.select_order_long") %>
</h2>
<% end %>
<%= render 'shared/order_select', i18n_namespace: "proposals.index" %>
<%= render 'shared/order_selector', i18n_namespace: "proposals.index" %>
</div>
<div class="show-for-small-only">
<%= link_to t("proposals.index.start_proposal"), new_proposal_path, class: 'button radius expand' %>

View File

@@ -4,7 +4,7 @@
%>
<form class="inline-block">
<select class="js-location-changer" name="order-selector">
<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) %>'>