mmsc_app/app/views/public/menu_items/_large_thumb.html.haml
Nicolas Bally a6aa1f6074 Initial
2020-05-25 11:40:11 +02:00

29 lines
1.2 KiB
Plaintext

-skip_desc = skip_desc || nil
-if menu_item
-menu_item_lang = menu_item.menu_item_langs.find_by_lang_site_id(@lang.id)
-if menu_item_lang.enabled == true and menu_item_lang.visible == true
-if menu_item.image_file
-img_url = menu_item.image_file.file.large.medium.url
-if menu_item.image_file and menu_item.image_file.photograph
-@page_images_credits << menu_item.image_file.photograph
-css_style = "background-image:url('#{img_url}');background-size:100%;background-size:cover;background-position:center center;display:block;min-height:50px;"
.large_thumb
=link_to @one_voice_host.to_s+menu_item_path(:url => menu_item_lang.url, :lang => @lang.slug) , :class => "with_ratio" do
.with_ratio{:style => css_style, :data => {:ratio => 0.62}}
.overlay
.desc{:style => ("padding-bottom:12px" if skip_desc)}
%h3{:style => ("margin-bottom:0px" if skip_desc)}
=menu_item.menu_item_langs.find_by_lang_site_id(@lang.id).name
-if !skip_desc
=simple_format menu_item.menu_content.lang_pages.find_by_lang_site_id(@lang.id).description