mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Merge pull request #3561 from hennevogel/bugfix/3556
Drop word_pluralize helper
This commit is contained in:
commit
3e36235e55
2 changed files with 3 additions and 13 deletions
|
|
@ -114,16 +114,6 @@ module FormatHelper
|
|||
end
|
||||
end
|
||||
|
||||
def word_pluralize(count, singular, plural = nil)
|
||||
word = if (count == 1 || count =~ /^1(\.0+)?$/)
|
||||
singular
|
||||
else
|
||||
plural || singular.pluralize
|
||||
end
|
||||
|
||||
word
|
||||
end
|
||||
|
||||
# Returns black or white deppending on what of them contrast more with the
|
||||
# given color. Useful to print text in a coloured background.
|
||||
# hexcolor is a hex color of 7 characters, being the first one '#'.
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@
|
|||
%li
|
||||
= @total_quantity[ticket_id]
|
||||
= tickets.first.title
|
||||
= word_pluralize(@total_quantity[ticket_id], 'Ticket')
|
||||
= pluralize(@total_quantity[ticket_id], 'Ticket')
|
||||
for
|
||||
= tickets.first.price.symbol
|
||||
= humanized_money @total_price_per_ticket[ticket_id]
|
||||
|
|
@ -148,7 +148,7 @@
|
|||
%i.fa-solid.fa-user-group.fa-stack-1x
|
||||
= @conference.participants.count
|
||||
Registered
|
||||
= word_pluralize(@conference.participants.count, 'Attendee')
|
||||
= pluralize(@conference.participants.count, 'Attendee')
|
||||
- @conference.participants.each do |participant|
|
||||
= link_to image_tag(participant.gravatar_url(size: '25'), title: "#{participant.name}!", class: 'img-circle'), user_path(participant)
|
||||
.col-md-4.col-md-offset-2
|
||||
|
|
@ -159,6 +159,6 @@
|
|||
%i.fa-solid.fa-microphone.fa-stack-1x
|
||||
= @conference.program.speakers.confirmed.count
|
||||
Confirmed
|
||||
= word_pluralize(@conference.program.speakers.confirmed.count, 'Speaker')
|
||||
= pluralize(@conference.program.speakers.confirmed.count, 'Speaker')
|
||||
- @conference.program.speakers.confirmed.each do |speaker|
|
||||
= link_to image_tag(speaker.gravatar_url(size: '25'), title: "#{speaker.name}!", class: 'img-circle'), user_path(speaker)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue