mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-03 11:25:29 -04:00
Display the entries and sub-titles count
This commit is contained in:
parent
ce88acb9e5
commit
45a81ad5f6
@ -108,8 +108,18 @@ class Title
|
|||||||
ary.reverse
|
ary.reverse
|
||||||
end
|
end
|
||||||
|
|
||||||
def size
|
# Returns a string the describes the content of the title
|
||||||
@entries.size + @title_ids.size
|
# e.g., - 3 titles and 1 entry
|
||||||
|
# - 4 entries
|
||||||
|
# - 1 title
|
||||||
|
def content_label
|
||||||
|
ary = [] of String
|
||||||
|
tsize = titles.size
|
||||||
|
esize = entries.size
|
||||||
|
|
||||||
|
ary << "#{tsize} #{tsize > 1 ? "titles" : "title"}" if tsize > 0
|
||||||
|
ary << "#{esize} #{esize > 1 ? "entries" : "entry"}" if esize > 0
|
||||||
|
ary.join " and "
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_entry(eid)
|
def get_entry(eid)
|
||||||
|
@ -76,7 +76,7 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
<% if item.is_a? Title %>
|
<% if item.is_a? Title %>
|
||||||
<% if grouped_count == 1 %>
|
<% if grouped_count == 1 %>
|
||||||
<p class="uk-text-meta"><%= item.size %> entries</p>
|
<p class="uk-text-meta"><%= item.content_label %></p>
|
||||||
<% else %>
|
<% else %>
|
||||||
<p class="uk-text-meta"><%= grouped_count %> new entries</p>
|
<p class="uk-text-meta"><%= grouped_count %> new entries</p>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
<%- end -%>
|
<%- end -%>
|
||||||
<li class="uk-disabled"><a><%= title.display_name %></a></li>
|
<li class="uk-disabled"><a><%= title.display_name %></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p class="uk-text-meta"><%= title.size %> entries found</p>
|
<p class="uk-text-meta"><%= title.content_label %> found</p>
|
||||||
<div class="uk-grid-small" uk-grid>
|
<div class="uk-grid-small" uk-grid>
|
||||||
<div class="uk-margin-bottom uk-width-3-4@s">
|
<div class="uk-margin-bottom uk-width-3-4@s">
|
||||||
<form class="uk-search uk-search-default">
|
<form class="uk-search uk-search-default">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user