Merge branch 'design_team' into ldap

Conflicts:
	config/environments/development.rb
This commit is contained in:
Christophe Vilayphiou committed 2012-05-09 13:51:00 +08:00
commit d88d4e58dc
48 files changed
+916 -246

No files matched your search

+10 -1
View File
@@ -43,8 +43,8 @@ class Admin::PagePartsController < ApplicationController
def update
@part = PagePart.find(params[:id])
if @part.update_attributes(params[:page_part])
set_children_sub_menu(@part) if @part.public_r_tag && @part.public_r_tag.eql?('sub_menu')
flash.now[:notice] = t('admin.update_success_content')
@part.save
respond_to do |format|
format.html {
redirect_to admin_page_url( @part.page )
@@ -89,5 +89,14 @@ class Admin::PagePartsController < ApplicationController
format.js {}
end
end
protected
def set_children_sub_menu(part)
part.page.children.each do |child|
child_part = child.page_parts.detect{ |x| x.name.eql?(part.name) } rescue nil
child_part.update_attributes(:kind => part.kind, :public_r_tag => part.public_r_tag, :public_r_tag_object_id => part.public_r_tag_object_id) rescue nil
end
end
end