diff --git a/app/helpers/menu_items_helper.rb b/app/helpers/menu_items_helper.rb new file mode 100644 index 0000000..04e863f --- /dev/null +++ b/app/helpers/menu_items_helper.rb @@ -0,0 +1,7 @@ +# -*- encoding : utf-8 -*- +module MenuItemsHelper +def menu_item_link(menu_item) + link_to menu_item.name, menu_item_path(:url => menu_item.url), :class => ("active" if @menu_item and (@menu_item == menu_item or @menu_item.ancestors.include?(menu_item))) +end + +end diff --git a/app/views/public/menu_items/show.html.haml b/app/views/public/menu_items/show.html.haml index 5c50dea..9c3f344 100644 --- a/app/views/public/menu_items/show.html.haml +++ b/app/views/public/menu_items/show.html.haml @@ -1 +1,38 @@ -=render :partial => "public/blocks/block", :locals => {:block => @menu_item.menu_content.blocks[0]} +-content_for :sidebar do + + -if @menu_item.parent_id + -if @menu_item.ancestors.reverse[0] + -first_level_menu = @menu_item.ancestors.reverse[0] + + -else + + -first_level_menu = @menu_item + + -if first_level_menu.children.size > 0 + .square + %h2=menu_item_link(first_level_menu) + %ul + -first_level_menu.children.where(:enabled => true, :visible => true).order(:position).each do |menu_item| + + %li + =menu_item_link(menu_item) + -if menu_item.children.where(:enabled => true, :visible => true).size > 0 + %ul + -menu_item.children.where(:enabled => true, :visible => true).order(:position).each do |menu_item| + %li=menu_item_link(menu_item) + -if first_level_menu.slug == "livres-eft" + %li=link_to "Ebook Maigrir Durablement avec l'EFT", "http://www.maigrir-durablement-avec-eft.com/", :target => "_blank" + %li=link_to "Ebook ArrĂȘter de Fumer avec l'EFT", "http://www.arreter-de-fumer-avec-eft.com/", :target => "_blank" + +.breadcrumb + -if @menu_item.ancestors + =link_to i(:home), "/" + > + -for menu_item in @menu_item.ancestors.reverse + =menu_item_link(menu_item) + > + + =@menu_item.name + + +=render :partial => "public/blocks/block", :locals => {:block => @menu_item.menu_content.blocks[0]} \ No newline at end of file diff --git a/config/environments/production.rb b/config/environments/production.rb index 1709628..1793b39 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,5 +1,5 @@ # -*- encoding : utf-8 -*- -HOSTNAME = 'http://new.lepicvert.org' +HOSTNAME = 'http://lepicvert.org' Survey::Application.configure do # Settings specified here will take precedence over those in config/application.rb. @@ -91,7 +91,7 @@ Survey::Application.configure do - config.action_mailer.default_url_options = { :host => "new.lepicvert.org" } + config.action_mailer.default_url_options = { :host => "lepicvert.org" } config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = {