Class: ChiliPepper::MenuDecorator
- Inherits:
-
Draper::Decorator
- Object
- Draper::Decorator
- ChiliPepper::MenuDecorator
- Defined in:
- app/decorators/chili_pepper/menu_decorator.rb
Instance Method Summary collapse
- #display_availability ⇒ Object
- #display_description ⇒ Object
- #display_price ⇒ Object
- #footnotes ⇒ Object
-
#pdf_link ⇒ Object
def header_img if menu_image? h.image_tag menu_image.url(), style: “margin-top: #menu_img_margin_top(menu_imagemenu_img_margin_top(menu_image.url)” end end.
Instance Method Details
#display_availability ⇒ Object
15 16 17 18 19 |
# File 'app/decorators/chili_pepper/menu_decorator.rb', line 15 def display_availability if availability? h.content_tag(:h2, h.markdown(availability), class: 'menu_availibilities') end end |
#display_description ⇒ Object
21 22 23 24 25 |
# File 'app/decorators/chili_pepper/menu_decorator.rb', line 21 def display_description if description? h.content_tag(:h3, h.markdown(description), class: 'menu_description') end end |
#display_price ⇒ Object
7 8 9 10 11 12 13 |
# File 'app/decorators/chili_pepper/menu_decorator.rb', line 7 def display_price if price? euro_sign = h.content_tag(:span, '€', class: euro_sign) price_to_display = h.number_to_currency(price, unit: '') price_content = h.content_tag(:div, euro_sign + price_to_display, id: 'big_price') end end |
#footnotes ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'app/decorators/chili_pepper/menu_decorator.rb', line 41 def footnotes return if == 'drinks' footnotes_class = "menu_footnotes" # if menu_annotations.present? # footnotes_class += ' with_supplements' # section_content = health_footnotes + supplementary_footnotes_columns # else # footnotes_class += ' no_supplements' section_content = health_footnotes # end h.content_tag(:section, section_content, class: footnotes_class) end |
#pdf_link ⇒ Object
def header_img
if
h.image_tag .url(), style: "margin-top: #{(.url)}"
end
end
33 34 35 36 37 38 39 |
# File 'app/decorators/chili_pepper/menu_decorator.rb', line 33 def pdf_link if downloadable_pdf? pdf_size = h.content_tag(:span, "(#{h.number_to_human_size(downloadable_pdf.size)})") link = h.link_to(h.raw("Download PDF #{pdf_size}"), downloadable_pdf.url, onclick: "javascript: _gaq.push(['_trackPageview', '/downloads/#{slug}']);") h.content_tag(:p, link, class: 'pdf_download') end end |