From b8463fcca5f6ff1f60f52c187ca74bbe71822d46 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 28 Mar 2016 16:51:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=97=E6=96=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organizations_controller.rb | 5 +-- app/helpers/organizations_helper.rb | 8 +++++ app/views/layouts/base_org_newstyle.html.erb | 35 ++++++++++++++------ db/schema.rb | 3 +- 4 files changed, 37 insertions(+), 14 deletions(-) diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 6c587645c..858952f0d 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -29,7 +29,7 @@ class OrganizationsController < ApplicationController helper :issues include UsersHelper before_filter :find_organization, :only => [:show, :members, :apply_subdomain, :select_org_layout] - layout 'base_org_newstyle' + layout :select_org_layout def index end @@ -37,7 +37,7 @@ class OrganizationsController < ApplicationController # 组织风格判定 # style:为0的时候为老式风格,1 为新式风格 def select_org_layout - @org.style == 0 ? 'base_org' : 'base_org_newstyle' + (@organization.show_mode == 1 && params[:action] == "show")? 'base_org_newstyle' : 'base_org' end def new @@ -75,6 +75,7 @@ class OrganizationsController < ApplicationController end def show + @subfield_content = @organization.org_subfields.order("priority") if @organization.show_mode == 1 if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization) @organization = Organization.find(params[:id]) # 统计访问量 diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index 69c355313..db7d6f576 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -28,4 +28,12 @@ module OrganizationsHelper end end + def get_project_activities_org org + + end + + def get_course_activity_org org + + end + end diff --git a/app/views/layouts/base_org_newstyle.html.erb b/app/views/layouts/base_org_newstyle.html.erb index bdfec084f..e52238503 100644 --- a/app/views/layouts/base_org_newstyle.html.erb +++ b/app/views/layouts/base_org_newstyle.html.erb @@ -119,11 +119,24 @@