factorize filter
This commit is contained in:
parent
21a6fb98dc
commit
afa911284c
@ -1,6 +1,6 @@
|
||||
<%= render 'layouts/initials' %>
|
||||
<%= will_paginate class: "center" %>
|
||||
<%= render'layouts/filter' %>
|
||||
|
||||
<%= will_paginate class: "center" %>
|
||||
<table class="table table-striped authors">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
@ -13,6 +13,4 @@
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<%= will_paginate class: "center" %>
|
||||
<%= render 'layouts/perpage' %>
|
||||
|
@ -1,15 +1,10 @@
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Filter</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<% isLatest = session[:sort] == "latest" %>
|
||||
<% content_for :latest_filter do
|
||||
isLatest = session[:sort] == "latest" %>
|
||||
<%= link_to "Latest", url_for(sort: (isLatest ? "alpha" : "latest")), class: "btn btn-default btn-sm " + (isLatest ? " active" : ""), remote: true %>
|
||||
<%= render'layouts/initials' %>
|
||||
</div>
|
||||
</div>
|
||||
<%= will_paginate class: "center" %>
|
||||
<% end %>
|
||||
<%= render'layouts/filter' %>
|
||||
|
||||
<%= will_paginate class: "center" %>
|
||||
<table class="table table-striped authors">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
@ -33,6 +28,4 @@
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<%= will_paginate class: "center" %>
|
||||
<%= render'layouts/perpage' %>
|
||||
|
12
app/views/layouts/_filter.html.erb
Normal file
12
app/views/layouts/_filter.html.erb
Normal file
@ -0,0 +1,12 @@
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<%= link_to "#filterContent", data: { toggle: "collapse" } do %>
|
||||
<h3 class="panel-title"> Filter </h3>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="panel-body collapse" id="filterContent">
|
||||
<%= yield(:latest_filter) %>
|
||||
<%= render'layouts/initials' %>
|
||||
<%= render'layouts/perpage' %>
|
||||
</div>
|
||||
</div>
|
@ -1,6 +1,6 @@
|
||||
<% initials = ['0'] + ('A'..'Z').to_a %>
|
||||
<div class="center">
|
||||
<ul class="pagination">
|
||||
<ul class="pagination btn-sm">
|
||||
<% initials.each do |i|
|
||||
is_cur = (i == session[:initial])
|
||||
%>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<%= render'layouts/initials' %>
|
||||
<%= will_paginate class: "center" %>
|
||||
<%= render'layouts/filter' %>
|
||||
|
||||
<%= will_paginate class: "center" %>
|
||||
<table class="table table-striped series">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
@ -30,6 +30,4 @@
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<%= will_paginate class: "center" %>
|
||||
<%= render'layouts/perpage' %>
|
||||
|
Loading…
Reference in New Issue
Block a user