Merge pull request #3561 from hennevogel/bugfix/3556

Drop word_pluralize helper
This commit is contained in:
Henne Vogelsang 2025-01-30 16:42:43 +01:00 committed by GitHub
commit 3e36235e55
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 13 deletions

View file

@ -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 '#'.

View file

@ -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)