-
Notifications
You must be signed in to change notification settings - Fork 983
Show changeset element counts using badges #4872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show changeset element counts using badges #4872
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks and works great, thanks for it! Requires updating with the latest changes of _paging_nav.html.erb / en.yml.
4b59d74
to
30d7f92
Compare
rebased |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks and works perfectly now, thank you very much!
30d7f92
to
ad5fa6f
Compare
ad5fa6f
to
31f9307
Compare
<% if pages.page_count == 1 %> | ||
<h4 class="fs-5"> | ||
<%= t ".#{type.pluralize}_title" %> | ||
<span class="badge count-number"> | ||
<%= pages.item_count %> | ||
</span> | ||
</h4> | ||
<% elsif pages.page_count > 1 %> | ||
<h4 class="fs-5"> | ||
<%= t ".#{type.pluralize}_title" %> | ||
<span class="badge count-number"> | ||
<%= t ".range", :x => pages.current_page.first_item, | ||
:y => pages.current_page.last_item, | ||
:count => pages.item_count %> | ||
</span> | ||
</h4> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd find a duplicated if easier to read than a duplicated h4.
<% if pages.page_count == 1 %> | |
<h4 class="fs-5"> | |
<%= t ".#{type.pluralize}_title" %> | |
<span class="badge count-number"> | |
<%= pages.item_count %> | |
</span> | |
</h4> | |
<% elsif pages.page_count > 1 %> | |
<h4 class="fs-5"> | |
<%= t ".#{type.pluralize}_title" %> | |
<span class="badge count-number"> | |
<%= t ".range", :x => pages.current_page.first_item, | |
:y => pages.current_page.last_item, | |
:count => pages.item_count %> | |
</span> | |
</h4> | |
<h4 class="fs-5"> | |
<%= t ".#{type.pluralize}_title" %> | |
<span class="badge count-number"> | |
<%= if pages.page_count == 1 | |
pages.item_count | |
elsif pages.page_count > 1 | |
t(".range", x: pages.current_page.first_item, | |
y: pages.current_page.last_item, | |
count: pages.item_count) | |
end %> | |
</span> | |
</h4> | |
<% if pages.page_count > 1 %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is reproducing what I removed from browse_helper.rb
, except as a code block inside the template.
Looks good to me, thanks. |
We use counter badges in other places. We can use them on changeset pages in element headings instead of numbers in ().
Before/after:
