mirror of
https://github.com/hkalexling/Mango.git
synced 2026-04-03 00:03:14 -04:00
Use component templates
This commit is contained in:
35
src/views/components/card.ecr
Normal file
35
src/views/components/card.ecr
Normal file
@@ -0,0 +1,35 @@
|
||||
<div class="item" data-mtime="<%= item.mtime.to_unix %>" data-progress="<%= progress || 0.0 %>"
|
||||
<% if item.is_a? Entry %>
|
||||
id="<%= item.id %>"
|
||||
<% end %>>
|
||||
|
||||
<a class="acard"
|
||||
<% unless item.is_a? Entry %>
|
||||
href="<%= base_url %>book/<%= item.id %>"
|
||||
<% end %>>
|
||||
|
||||
<div class="uk-card uk-card-default"
|
||||
<% if item.is_a? Entry %>
|
||||
onclick="showModal("<%= item.encoded_path %>", '<%= item.pages %>', <%= (progress.not_nil! * 100).round(1) %>, "<%= item.book.encoded_display_name %>", "<%= item.encoded_display_name %>", '<%= item.title_id %>', '<%= item.id %>')"
|
||||
<% end %>>
|
||||
|
||||
<div class="uk-card-media-top">
|
||||
<img data-src="<%= item.cover_url %>" data-width data-height alt="" uk-img>
|
||||
</div>
|
||||
|
||||
<div class="uk-card-body">
|
||||
<% unless (item.is_a? Title && item.entries.size == 0) || progress.nil? %>
|
||||
<div class="uk-card-badge uk-label"><%= (progress * 100).round(1) %>%</div>
|
||||
<% end %>
|
||||
|
||||
<h3 class="uk-card-title break-word" data-title="<%= item.display_name.gsub("\"", """) %>"><%= item.display_name %></h3>
|
||||
<% if item.is_a? Entry %>
|
||||
<p><%= item.pages %> pages</p>
|
||||
<% end %>
|
||||
<% if item.is_a? Title %>
|
||||
<p><%= item.size %> entries</p>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
8
src/views/components/sort-form.ecr
Normal file
8
src/views/components/sort-form.ecr
Normal file
@@ -0,0 +1,8 @@
|
||||
<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>
|
||||
<% end %>
|
||||
</select>
|
||||
</div>
|
||||
Reference in New Issue
Block a user