38 lines
2.1 KiB
Plaintext
38 lines
2.1 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 ((menu_item.id == 50 or menu_item.id == 34 or menu_item.id == 44) and @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)
|
|
-if @ancestor_1 and @ancestor_1.id == 19 #peuple sauvage
|
|
|
|
=raw link.to_s.gsub(/compagnons\-animaux\/experimentes/, 'peuples-sauvages/experimentes')
|
|
|
|
-elsif @ancestor_1 and @ancestor_1.id == 20 #animaux domestiques
|
|
|
|
=raw link.to_s.gsub(/compagnons\-animaux\/experimentes/, 'animaux-domestiques/experimentes')
|
|
|
|
-else
|
|
=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}
|
|
|
|
|