Drop word_pluralize helper

It makes no sense...
This commit is contained in:
Henne Vogelsang 2025-01-30 16:21:30 +01:00
parent 368e2ddd88
commit 1178cc7273
No known key found for this signature in database
GPG key ID: 97DDB66BDAF8D4D6
2 changed files with 3 additions and 13 deletions

View file

@ -114,16 +114,6 @@ module FormatHelper
end end
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 # Returns black or white deppending on what of them contrast more with the
# given color. Useful to print text in a coloured background. # given color. Useful to print text in a coloured background.
# hexcolor is a hex color of 7 characters, being the first one '#'. # hexcolor is a hex color of 7 characters, being the first one '#'.

View file

@ -94,7 +94,7 @@
%li %li
= @total_quantity[ticket_id] = @total_quantity[ticket_id]
= tickets.first.title = tickets.first.title
= word_pluralize(@total_quantity[ticket_id], 'Ticket') = pluralize(@total_quantity[ticket_id], 'Ticket')
for for
= tickets.first.price.symbol = tickets.first.price.symbol
= humanized_money @total_price_per_ticket[ticket_id] = humanized_money @total_price_per_ticket[ticket_id]
@ -148,7 +148,7 @@
%i.fa-solid.fa-user-group.fa-stack-1x %i.fa-solid.fa-user-group.fa-stack-1x
= @conference.participants.count = @conference.participants.count
Registered Registered
= word_pluralize(@conference.participants.count, 'Attendee') = pluralize(@conference.participants.count, 'Attendee')
- @conference.participants.each do |participant| - @conference.participants.each do |participant|
= link_to image_tag(participant.gravatar_url(size: '25'), title: "#{participant.name}!", class: 'img-circle'), user_path(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 .col-md-4.col-md-offset-2
@ -159,6 +159,6 @@
%i.fa-solid.fa-microphone.fa-stack-1x %i.fa-solid.fa-microphone.fa-stack-1x
= @conference.program.speakers.confirmed.count = @conference.program.speakers.confirmed.count
Confirmed Confirmed
= word_pluralize(@conference.program.speakers.confirmed.count, 'Speaker') = pluralize(@conference.program.speakers.confirmed.count, 'Speaker')
- @conference.program.speakers.confirmed.each do |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) = link_to image_tag(speaker.gravatar_url(size: '25'), title: "#{speaker.name}!", class: 'img-circle'), user_path(speaker)