mirror of
https://github.com/hkalexling/Mango.git
synced 2026-04-04 00:00:51 -04:00
Use component template on home page
This commit is contained in:
@@ -1,3 +1,13 @@
|
||||
<% if item.is_a? NamedTuple(entry: Entry, percentage: Float64, grouped_count: Int32) %>
|
||||
<% grouped_count = item[:grouped_count] %>
|
||||
<% if grouped_count == 1 %>
|
||||
<% item = item[:entry] %>
|
||||
<% else %>
|
||||
<% item = item[:entry].book %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% grouped_count = 1 %>
|
||||
<% end %>
|
||||
<div class="item" data-mtime="<%= item.mtime.to_unix %>" data-progress="<%= progress || 0.0 %>"
|
||||
<% if item.is_a? Entry %>
|
||||
id="<%= item.id %>"
|
||||
@@ -27,7 +37,11 @@
|
||||
<p><%= item.pages %> pages</p>
|
||||
<% end %>
|
||||
<% if item.is_a? Title %>
|
||||
<% if grouped_count == 1 %>
|
||||
<p><%= item.size %> entries</p>
|
||||
<% else %>
|
||||
<p><%= grouped_count %> new entries</p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user