mirror of
https://github.com/hkalexling/Mango.git
synced 2026-03-20 00:00:48 -04:00
Handle library/title sorting on backend (#86)
This commit is contained in:
@@ -1,8 +1,14 @@
|
||||
<div class="uk-form-horizontal">
|
||||
<select class="uk-select" id="sort-select">
|
||||
<% hash.each do |k, v| %>
|
||||
<option id="<%= k %>-up">▲ <%= v %></option>
|
||||
<option id="<%= k %>-down">▼ <%= v %></option>
|
||||
<option id="<%= k %>-up"
|
||||
<% if sort_opt && k == sort_opt.method.to_s.underscore && sort_opt.ascend %>
|
||||
<%= "selected" %>
|
||||
<% end %>>▲ <%= v %></option>
|
||||
<option id="<%= k %>-down"
|
||||
<% if sort_opt && k == sort_opt.method.to_s.underscore && !sort_opt.ascend %>
|
||||
<%= "selected" %>
|
||||
<% end %>>▼ <%= v %></option>
|
||||
<% end %>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
</div>
|
||||
<div class="uk-margin-bottom uk-width-1-4@s">
|
||||
<% hash = {
|
||||
"name" => "Name",
|
||||
"date" => "Date Modified",
|
||||
"auto" => "Auto",
|
||||
"time_modified" => "Date Modified",
|
||||
"progress" => "Progress"
|
||||
} %>
|
||||
<%= render_component "sort-form" %>
|
||||
|
||||
@@ -25,8 +25,9 @@
|
||||
<div class="uk-margin-bottom uk-width-1-4@s">
|
||||
<% hash = {
|
||||
"auto" => "Auto",
|
||||
"name" => "Name",
|
||||
"date" => "Date Modified",
|
||||
"title" => "Name",
|
||||
"time_modified" => "Date Modified",
|
||||
"time_added" => "Date Added",
|
||||
"progress" => "Progress"
|
||||
} %>
|
||||
<%= render_component "sort-form" %>
|
||||
@@ -37,7 +38,7 @@
|
||||
<% progress = title_percentage[i] %>
|
||||
<%= render_component "card" %>
|
||||
<% end %>
|
||||
<% title.entries.each_with_index do |item, i| %>
|
||||
<% entries.each_with_index do |item, i| %>
|
||||
<% progress = percentage[i] %>
|
||||
<%= render_component "card" %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user