Show sum of entries and titles count when displaying the number of entries

This commit is contained in:
Alex Ling 2020-03-15 02:08:20 +00:00
parent 5a500364fc
commit e65d701e0a
3 changed files with 7 additions and 3 deletions

View File

@ -154,6 +154,10 @@ class Title
ary
end
def size
@entries.size + @title_ids.size
end
# When downloading from MangaDex, the zip/cbz file would not be valid
# before the download is completed. If we scan the zip file,
# Entry.new would throw, so we use this method to check before

View File

@ -33,7 +33,7 @@
<div class="uk-card-body">
<div class="uk-card-badge uk-label"><%= (percentage[i] * 100).round(1) %>%</div>
<h3 class="uk-card-title"><%= t.title %></h3>
<p><%= t.entries.size %> entries</p>
<p><%= t.size %> entries</p>
</div>
</div>
</a>

View File

@ -6,7 +6,7 @@
<%- end -%>
<li class="uk-disabled"><a><%= title.title %></a></li>
</ul>
<p class="uk-text-meta"><%= title.entries.size %> entries found</p>
<p class="uk-text-meta"><%= title.size %> entries found</p>
<div class="uk-grid-small" uk-grid>
<div class="uk-margin-bottom uk-width-3-4@s">
<form class="uk-search uk-search-default">
@ -42,7 +42,7 @@
<div class="uk-card-body">
<div class="uk-card-badge uk-label"><%= (titles_percentage[i] * 100).round(1) %>%</div>
<h3 class="uk-card-title"><%= t.title %></h3>
<p><%= t.entries.size %> entries</p>
<p><%= t.size %> entries</p>
</div>
</div>
</a>