在organization控制器的show方法添加layout

dev_wuhao
ouyangxuhua 9 years ago
parent b80bc98fcb
commit 2275b367f4

@ -29,17 +29,11 @@ class OrganizationsController < ApplicationController
helper :issues helper :issues
include UsersHelper include UsersHelper
before_filter :find_organization, :only => [:show, :members, :apply_subdomain, :select_org_layout] before_filter :find_organization, :only => [:show, :members, :apply_subdomain, :select_org_layout]
layout :select_org_layout layout 'base_org'
def index def index
end end
# 组织风格判定
# style:为0的时候为老式风格1 为新式风格
def select_org_layout
(@organization.show_mode == 1 && params[:action] == "show")? 'base_org_newstyle' : 'base_org'
end
def new def new
@organization = Organization.new @organization = Organization.new
render :layout => 'new_base' render :layout => 'new_base'
@ -81,6 +75,7 @@ class OrganizationsController < ApplicationController
@project_acts = get_project_activities_org @organization @project_acts = get_project_activities_org @organization
@course_acts_homework = get_course_homework_activities_org @organization @course_acts_homework = get_course_homework_activities_org @organization
@course_acts_message = get_course_message_activities_org @organization @course_acts_message = get_course_message_activities_org @organization
render :layout => 'base_org_newstyle'
else else
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization) if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)

Loading…
Cancel
Save