style filter
This commit is contained in:
parent
f50f520672
commit
76771541e9
@ -13,3 +13,9 @@
|
|||||||
*= require_tree .
|
*= require_tree .
|
||||||
*= require_self
|
*= require_self
|
||||||
*/
|
*/
|
||||||
|
a .filterToggle:before {
|
||||||
|
content: "\e113";
|
||||||
|
}
|
||||||
|
a.collapsed .filterToggle:before {
|
||||||
|
content: "\e114";
|
||||||
|
}
|
||||||
|
@ -1,6 +1,16 @@
|
|||||||
<% content_for :latest_filter do
|
<% opts = { data: { url: url_for, remote: true, method: :get } }
|
||||||
isLatest = session[:sort] == "latest" %>
|
content_for :latest_filter do %>
|
||||||
<%= link_to "Latest", url_for(sort: (isLatest ? "alpha" : "latest")), class: "btn btn-default btn-sm " + (isLatest ? " active" : ""), remote: true %>
|
<div class="form-group">
|
||||||
|
<%= label_tag "sort", "Sort by" %>
|
||||||
|
<label class="radio-inline">
|
||||||
|
<%= radio_button_tag "sort", "latest", @preference.sort == "latest",opts %>
|
||||||
|
Date
|
||||||
|
</label>
|
||||||
|
<label class="radio-inline">
|
||||||
|
<%= radio_button_tag "sort", "alpha", @preference.sort == "alpha", opts %>
|
||||||
|
Name
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= render'layouts/filter' %>
|
<%= render'layouts/filter' %>
|
||||||
|
|
||||||
|
@ -1,20 +1,23 @@
|
|||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<%= link_to "#filterContent", data: { toggle: "collapse" } do %>
|
<%= link_to "#filterContent", { class: "collapsed", data: { toggle: "collapse" } } do %>
|
||||||
<h3 class="panel-title"> Filter </h3>
|
<h3 class="panel-title">
|
||||||
|
<span class="glyphicon filterToggle" aria-hidden="true"/>
|
||||||
|
Filter
|
||||||
|
</h3>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body collapse" id="filterContent">
|
<div class="panel-body collapse" id="filterContent">
|
||||||
<%= render'layouts/initials' %>
|
<%= render'layouts/initials' %>
|
||||||
<%= render'layouts/perpage' %>
|
|
||||||
<%= yield(:latest_filter) %>
|
<%= yield(:latest_filter) %>
|
||||||
<%= form_tag({}, {method: :get, remote: true}) do %>
|
<%= form_tag({}, {method: :get, remote: true}) do %>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<span class="input-group-btn">
|
<span class="input-group-btn">
|
||||||
<%= button_tag "Seach", class: "btn btn-default" %>
|
<%= button_tag "Search", class: "btn btn-default" %>
|
||||||
</span>
|
</span>
|
||||||
<%= search_field_tag(:term, @preference.term, placeholder: "Search for...", class: "form-control") %>
|
<%= search_field_tag(:term, @preference.term, placeholder: "Search for...", class: "form-control") %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<%= render'layouts/perpage' %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<% initials = ['0'] + ('A'..'Z').to_a %>
|
<% initials = ['0'] + ('A'..'Z').to_a %>
|
||||||
<div class="center">
|
<div class="center">
|
||||||
<ul class="pagination btn-sm">
|
<ul class="pagination pagination-sm" title="Initial letter">
|
||||||
<% initials.each do |i|
|
<% initials.each do |i|
|
||||||
is_cur = (i == @preference.initial)
|
is_cur = (i == @preference.initial)
|
||||||
%>
|
%>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<div class="center">
|
<div class="center">
|
||||||
<ul class="pagination">
|
<ul class="pagination pagination-sm" title="Items per page">
|
||||||
<% [10,20,50,100].each do |p| %>
|
<% [10,20,50,100].each do |p| %>
|
||||||
<%= content_tag :li, class: (p == @preference.per_page ? "active": nil) do %>
|
<%= content_tag :li, class: (p == @preference.per_page ? "active": nil) do %>
|
||||||
<%= link_to p, url_for(per_page: p), remote: true %>
|
<%= link_to p, url_for(per_page: p), remote: true %>
|
||||||
|
Loading…
Reference in New Issue
Block a user