From 0459856a2c18414a53b87735d4da0c246752aa8f Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 1 Apr 2016 21:30:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E7=BA=BFlogo=E6=9B=B4=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 2 +- app/controllers/organizations_controller.rb | 4 ++++ app/views/layouts/base_org_newstyle.html.erb | 9 ++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 9853b4dc1..c1f9cf750 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -608,7 +608,7 @@ private @attachment.container.board.course) @course = @attachment.container.board.course else - unless @attachment.container_type == 'Bid' || @attachment.container_type == 'HomeworkAttach' || @attachment.container_type == 'Memo' || @attachment.container_type == 'Softapplication' || @attachment.container_type == 'PhoneAppVersion' || @attachment.container_type == 'StudentWorksScore'|| @attachment.container_type == 'StudentWork' + unless @attachment.container_type == 'Bid' || @attachment.container_type == 'Organization' || @attachment.container_type == 'HomeworkAttach' || @attachment.container_type == 'Memo' || @attachment.container_type == 'Softapplication' || @attachment.container_type == 'PhoneAppVersion' || @attachment.container_type == 'StudentWorksScore'|| @attachment.container_type == 'StudentWork' @project = @attachment.project end end diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index dd86d6ccd..ab97b5b1b 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -78,6 +78,10 @@ class OrganizationsController < ApplicationController # 组织新类型 show_mode:判断标准 1为新类型,0为旧 if @organization.show_mode == 1 && params[:org_subfield_id].nil? && params[:list] .nil? if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization) + # REDO:时间紧,暂时先这样 + @org_logo_attchment = Attachment.where("container_id =? and container_type =? and attachtype =?", @organization, "Organization", 0).order("created_on desc").first + @org_banner_attchment = Attachment.where("container_id =? and container_type =? and attachtype =?", @organization, "Organization", 1).order("created_on desc").first + @subfield_content = @organization.org_subfields.order("priority") @organization = Organization.find(params[:id]) # 统计访问量 diff --git a/app/views/layouts/base_org_newstyle.html.erb b/app/views/layouts/base_org_newstyle.html.erb index d670acaa5..f2426d9f1 100644 --- a/app/views/layouts/base_org_newstyle.html.erb +++ b/app/views/layouts/base_org_newstyle.html.erb @@ -77,7 +77,14 @@
- + <%# 登录 %> <%= render :partial => 'organizations/org_logined_header' %>