diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index c1f9cf750..173e5fabc 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 == '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' + 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 @@ -660,8 +660,10 @@ private 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/views/files/_org_upload_attachment_list.html.erb b/app/views/files/_org_upload_attachment_list.html.erb new file mode 100644 index 000000000..973aeddd6 --- /dev/null +++ b/app/views/files/_org_upload_attachment_list.html.erb @@ -0,0 +1,34 @@ + + <%= l(:label_no_file_uploaded)%> + +(<%= l(:label_max_size) %>:<%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>) +
+ + +建议上传高度不超过52px的图片
+ +尺寸最好55*33
<%= error_messages_for 'attachment' %> <%= form_tag(organization_files_path(org, :in_org => params[:in_org], :logo => true), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %> - <%= render :partial => 'files/org_subfield_upload_attachment_list', :locals => {:container => org}%> + <%= render :partial => 'files/org_upload_attachment_list', :locals => {:container => org}%> <%= l(:button_cancel)%> <%= l(:button_confirm)%> diff --git a/app/views/layouts/base_org_newstyle.html.erb b/app/views/layouts/base_org_newstyle.html.erb index f2426d9f1..38fb49d8d 100644 --- a/app/views/layouts/base_org_newstyle.html.erb +++ b/app/views/layouts/base_org_newstyle.html.erb @@ -12,7 +12,7 @@ <%= stylesheet_link_tag 'org_new_style','jquery/jquery-ui-1.9.2' %> <%= javascript_include_tag 'cookie','project', 'organization','header','prettify','select_list_move','org'%> <%= javascript_include_tag 'attachments' %> - <%= call_hook :view_layouts_base_html_head %> + <%#= call_hook :view_layouts_base_html_head %> <%= yield :header_tags -%> @@ -77,14 +77,24 @@