From a6f6f63d6d3bbe7b450853f9778ceabb70dd64da Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 6 Apr 2016 11:05:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E4=B8=8A=E4=BC=A0=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 2 +- .../_org_upload_attachment_list.html.erb | 4 +-- ...org_upload_attachment_list_banner.html.erb | 32 +++++++++++++++++++ .../_upload_org_new_files_banner.html.erb | 2 +- 4 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 app/views/files/_org_upload_attachment_list_banner.html.erb diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 19e85bdc4..1dacffb6f 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -660,7 +660,7 @@ class AttachmentsController < ApplicationController end def has_login - unless @attachment.container_type == "Organization" + unless @attachment && @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 diff --git a/app/views/files/_org_upload_attachment_list.html.erb b/app/views/files/_org_upload_attachment_list.html.erb index 973aeddd6..06fa23387 100644 --- a/app/views/files/_org_upload_attachment_list.html.erb +++ b/app/views/files/_org_upload_attachment_list.html.erb @@ -23,10 +23,8 @@ - <%= l(:label_no_file_uploaded)%> + 建议上传高度不超过52px的图片 -(<%= l(:label_max_size) %>:<%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>) -

建议上传高度不超过52px的图片

diff --git a/app/views/files/_org_upload_attachment_list_banner.html.erb b/app/views/files/_org_upload_attachment_list_banner.html.erb new file mode 100644 index 000000000..5388afb5b --- /dev/null +++ b/app/views/files/_org_upload_attachment_list_banner.html.erb @@ -0,0 +1,32 @@ + + + <%= file_field_tag 'attachments[dummy][file]', + :id => "_file#{container.id}", + :class => ie8? ? '':'file_selector', + :multiple => true, + :onchange => "addInputFiles_board(this, '#{container.id}','"+"submit_resource"+"');", + :style => ie8? ? '': 'display:none', + :data => { + :max_file_size => Setting.attachment_max_size.to_i.kilobytes, + :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), + :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, + :upload_path => uploads_path(:format => 'js'), + :description_placeholder => l(:label_optional_description), + :field_is_public => l(:field_is_public), + :are_you_sure => l(:text_are_you_sure), + :file_count => l(:label_file_count), + :delete_all_files => l(:text_are_you_sure_all), + :lebel_file_uploding => l(:lebel_file_uploding), + :containerid => "#{container.id}" + } %> + + + + + 建议上传 长度为1452px/高度为304px 的图片 + +
+
+ + +
\ No newline at end of file diff --git a/app/views/files/_upload_org_new_files_banner.html.erb b/app/views/files/_upload_org_new_files_banner.html.erb index cf044e089..0cb767bf2 100644 --- a/app/views/files/_upload_org_new_files_banner.html.erb +++ b/app/views/files/_upload_org_new_files_banner.html.erb @@ -6,7 +6,7 @@ <%= 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}%> + <%= render :partial => 'files/org_upload_attachment_list_banner', :locals => {:container => org}%>
<%= l(:button_cancel)%> <%= l(:button_confirm)%>