30 lines
1.6 KiB
Plaintext
30 lines
1.6 KiB
Plaintext
-force_open = force_open || false
|
|
%ul
|
|
-#if MenuItem.find(50) and (first_level_menu.id == 34 or first_level_menu.id == 44)
|
|
-#first_level_menu = MenuItem.find(50)
|
|
|
|
|
|
-first_level_menu.children.order(:position).each do |menu_item|
|
|
-active = true if force_open or (@menu_item and (@menu_item == menu_item or @menu_item.ancestors.include?(menu_item) or ( @menu_item != @side_first_level_menu and menu_item.ancestors.include?(@menu_item) ) or (menu_item.ancestors.reverse[2] and menu_item.ancestors.reverse[2] == @menu_item.ancestors.reverse[2]))) or ( @original_menu_item)
|
|
|
|
-this_active = true if (@menu_item and @menu_item == menu_item or (@menu_item.id == 50 and (menu_item.id == 50 or menu_item.id == 34 or menu_item.id == 44)))
|
|
%li{:class => ("ul_active" if active).to_s+(" li_active" if this_active).to_s+(" header_active" if menu_item.ancestors.size == 3 and (this_active || @menu_item.ancestors.include?(menu_item))).to_s+(" experimented_li" if menu_item.id == 50 or menu_item.id == 34 or menu_item.id == 44).to_s}
|
|
|
|
|
|
-if menu_item.title_image
|
|
-img_url = menu_item.image_file.file.large.medium.small.url if menu_item.image_file
|
|
|
|
|
|
.link_overlay{:style => "background:center center no-repeat;background-image:url('#{img_url}');background-size:cover;", :class => ("active" if this_active)}
|
|
-link = menu_item_link(menu_item)
|
|
|
|
=raw link
|
|
|
|
|
|
|
|
|
|
-if menu_item.children.size > 0 and active
|
|
|
|
=render :partial => "public/menu_items/sub_menu", :locals =>{:first_level_menu => menu_item, :force_open => true}
|
|
|
|
|