From 6cf518e2e4aafe2081aafde2d4e35d620a9df4bd Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Thu, 10 Mar 2016 14:38:33 +0800 Subject: [PATCH] =?UTF-8?q?1.=E7=BB=84=E7=BB=87=E7=9A=84=E9=9D=9E=E6=88=90?= =?UTF-8?q?=E5=91=98=E7=94=A8=E6=88=B7=EF=BC=8C=E9=9A=90=E8=97=8F=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E8=B5=84=E6=BA=90/=E5=AF=BC=E5=85=A5=E8=B5=84?= =?UTF-8?q?=E6=BA=90=EF=BC=9B2.=E7=94=B3=E8=AF=B7=E7=9A=84=E5=AD=90?= =?UTF-8?q?=E5=9F=9F=E5=90=8D=EF=BC=8C=E4=B8=80=E5=BE=8B=E6=94=B9=E6=88=90?= =?UTF-8?q?=E5=B0=8F=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organizations_controller.rb | 2 +- app/views/files/_subfield_files.html.erb | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index f225e7f50..9fd5e51ee 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -315,7 +315,7 @@ class OrganizationsController < ApplicationController @organization = Organization.find(params[:id]) admins = User.where("admin=1") admins.each do |admin| - OrgMessage.create(:user_id => admin.id, :organization_id => @organization.id, :message_type => 'ApplySubdomain', :message_id => @organization.id, :sender_id => User.current.id, :viewed => 0, :content => params[:domain]) + OrgMessage.create(:user_id => admin.id, :organization_id => @organization.id, :message_type => 'ApplySubdomain', :message_id => @organization.id, :sender_id => User.current.id, :viewed => 0, :content => params[:domain].downcase) end end diff --git a/app/views/files/_subfield_files.html.erb b/app/views/files/_subfield_files.html.erb index 7fb9e2e0a..9e0dd41d0 100644 --- a/app/views/files/_subfield_files.html.erb +++ b/app/views/files/_subfield_files.html.erb @@ -41,9 +41,10 @@ <%= text_field_tag 'name', params[:name], name: "name", :class => 'researchBox fl',:style=>"padding: 0px"%> <%= submit_tag "栏目内搜索", :class => "blueBtn mr5 fl",:style => 'width:72px;',:name => "inorg_subfield",:id => "inorg_subfield", :onmouseover => "presscss('inorg_subfield')",:onmouseout =>"buttoncss()" %> <%#= submit_tag "全站搜索", :class => "blueBtn mr5 fl",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %> - - <%= link_to("导入资源", import_resources_user_path(User.current, :type => 6, :subfield_file_id => @org_subfield.id), :class => "blue-btn fr mr5", :remote => true) %> - <%#= link_to "上传资源",subfield_upload_file_org_subfield_files_path(@org_subfield.id, :in_org => 1),:method => "post",:class=>"blueBtn fr mr5",:remote => true %> + <% if User.current.member_of_org?(org_subfield.organization) %> + + <%= link_to("导入资源", import_resources_user_path(User.current, :type => 6, :subfield_file_id => @org_subfield.id), :class => "blue-btn fr mr5", :remote => true) %> + <% end %> <% end %>