diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 63e823063..19e85bdc4 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -660,8 +660,10 @@ class AttachmentsController < ApplicationController end def has_login - unless @attachment && @attachment.container_type == "PhoneAppVersion" - render_403 if !User.current.logged? && !(@attachment.container_type == 'OrgSubfield' && @attachment.container.organization.allow_guest_download) && !(@attachment.container_type == 'OrgDocumentComment' && @attachment.container.organization.allow_guest_download) + unless @attachment.container_type == "Organization" + unless @attachment && @attachment.container_type == "PhoneAppVersion" + render_403 if !User.current.logged? && !(@attachment.container_type == 'OrgSubfield' && @attachment.container.organization.allow_guest_download) && !(@attachment.container_type == 'OrgDocumentComment' && @attachment.container.organization.allow_guest_download) + end end end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1d443610f..828123675 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2104,6 +2104,8 @@ module ApplicationHelper attachment.container.board.course course = attachment.container.board.course candown= User.current.member_of_course?(course) || (course.is_public==1 && attachment.is_public == 1) + elsif attachment.container.class.to_s=="Organization" + candown = true elsif attachment.container.class.to_s=="HomeworkAttach" candown = true elsif attachment.container.class.to_s=="StudentWorksScore" diff --git a/app/views/files/_upload_org_new_files_banner.html.erb b/app/views/files/_upload_org_new_files_banner.html.erb new file mode 100644 index 000000000..cf044e089 --- /dev/null +++ b/app/views/files/_upload_org_new_files_banner.html.erb @@ -0,0 +1,25 @@ +
+
+

更换背景图片

+
+ <%= error_messages_for 'attachment' %> + + <%= form_tag(organization_files_path(org, :in_org => params[:in_org]), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %> + + <%= render :partial => 'files/org_upload_attachment_list', :locals => {:container => org}%> +
+ <%= l(:button_cancel)%> + <%= l(:button_confirm)%> + <% end %> +
+ +
+ +
+ + \ No newline at end of file diff --git a/app/views/layouts/base_org_newstyle.html.erb b/app/views/layouts/base_org_newstyle.html.erb index f646c437f..a5f41081c 100644 --- a/app/views/layouts/base_org_newstyle.html.erb +++ b/app/views/layouts/base_org_newstyle.html.erb @@ -71,6 +71,16 @@ $('#ajax-modal').parent().css("top","40%").css("left","36%").css("border","3px solid #269ac9"); $('#ajax-modal').parent().addClass("popbox_polls"); } + + function orge_new_files_banner_upload() + { + $('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_org_new_files_banner',:locals => {:org => @organization, :org_attachment_type => 1}) %>'); + showModal('ajax-modal', '513px'); + $('#ajax-modal').siblings().remove(); + $('#ajax-modal').before(""); + $('#ajax-modal').parent().css("top","40%").css("left","36%").css("border","3px solid #269ac9"); + $('#ajax-modal').parent().addClass("popbox_polls"); + }
@@ -97,7 +107,6 @@ <% end %> - <%# 登录 %> <%= render :partial => 'organizations/org_logined_header' %> @@ -131,7 +140,30 @@
diff --git a/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb b/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb index 6b22496b6..f5b48544d 100644 --- a/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb +++ b/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb @@ -140,6 +140,7 @@ module Redmine if file && file.size > 0 a = Attachment.create(:file => file, :author => author) elsif token + # 通过token值找到对应的attachment a = Attachment.find_by_token_only(token) if a a.filename = attachment['filename'] unless attachment['filename'].blank? diff --git a/public/stylesheets/org_new_style.css b/public/stylesheets/org_new_style.css index 8fca32cb1..9155df3f1 100644 --- a/public/stylesheets/org_new_style.css +++ b/public/stylesheets/org_new_style.css @@ -40,8 +40,13 @@ a:hover.search-icon{ background:url(../images/org_new_style/icons.png) -387px -8 .searchbox:hover{ background:#999999; color:#fff;} /* banner */ -.banner{ width:100%; height:234px; background:#070317 url(../images/org_new_style/banner.jpg) 0 0 no-repeat; color:#fff; text-align:center; padding-top:70px; line-height:2.4;} -.banner h2{ font-size:42px; } +.banner{ width:100%; height:304px; background:#070317; color:#fff; text-align:center; line-height:2.4;} +.banner-inner{ width:1500px; margin:0 auto; position:relative; text-align:center;} +.banner-img{ height:304px;} +.banner-txt{position:absolute; top:30%; left:0%; width:1500px; margin:0 auto;} +.banner h1{ font-size:42px;} +.banner a{font-size:28px; color:#fff;} +.banner a:hover{ text-decoration:underline;} .banner p{ font-size:18px;} .banner span{ font-size:16px;} @@ -274,3 +279,5 @@ div.ui-progressbar { width: 100px; height:14px; margin: 2px 0 -5px 8px; display: + +