Add filters to specify order of debates#index

This commit is contained in:
Marko Lovic
2015-08-26 00:06:05 +02:00
parent 9ab13abf20
commit ccaca54816
5 changed files with 83 additions and 13 deletions

View File

@@ -0,0 +1,7 @@
<% options = @valid_filters.map { |f| [t("debates.index.filter_#{f}"), f] } %>
<%= form_tag('/debates', method: 'get', class: 'inline-block') do %>
<%= select_tag 'filter', options_for_select(options, @filter), onchange: "this.form.submit()" %>
<% end %>

View File

@@ -4,18 +4,7 @@
<div class="filters row">
<div class="small-12 column">
<h2><%= t("debates.index.showing") %></h2>
<select class="inline-block">
<option value="filter_news">
<%= t("debates.index.filter_news") %>
</option>
<option value="filter_votes">
<%= t("debates.index.filter_votes") %>
</option>
<option value="filter_rated">
<%= t("debates.index.filter_rated") %>
</option>
</select>
<%= render 'filter_selector' %>
</div>
</div>
<!-- /. Filters -->