Skip to content

Commit

Permalink
🔀 Merge branch 'show-additional-drink-info' (PR #139)
Browse files Browse the repository at this point in the history
  • Loading branch information
YtvwlD committed Oct 21, 2023
2 parents 006d89b + 4149811 commit c4701a6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def get_revision

def show_amount(price)
return 'n/a' if price.blank?
sprintf('%.2f EUR', price)
sprintf('%.2f ', price)
end

def link_to_drink_if_exists(drink)
Expand Down
12 changes: 12 additions & 0 deletions app/views/drinks/_drink.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,15 @@
= image_tag drink.logo(:medium), alt: drink.name, class: drink.active? ? "" : "disabled", size: 100
.card-footer
= show_amount drink.price
%br
- if drink.bottle_size?
= drink.price / drink.bottle_size
€/L
- else

%br
- if drink.caffeine && !drink.caffeine.zero? && drink.bottle_size && !drink.bottle_size.zero?
= sprintf('%.2f', (drink.caffeine * (drink.bottle_size / 0.1) / drink.price))
mg caffeine/€
- else
no caffeine

0 comments on commit c4701a6

Please sign in to comment.