Add filters to specify order of debates#index
This commit is contained in:
7
app/views/debates/_filter_selector.erb
Normal file
7
app/views/debates/_filter_selector.erb
Normal 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 %>
|
||||
@@ -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 -->
|
||||
|
||||
Reference in New Issue
Block a user