From a5fa68c9289c7220a25e7901accc11e029999052 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Mon, 14 Dec 2015 16:41:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=A0=8F=E7=9B=AE=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E8=B5=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/files_controller.rb | 6 +++++- app/views/files/_upload_subfield_file.html.erb | 6 ++---- app/views/files/subfield_upload_file.js.erb | 6 ++++++ app/views/layouts/base_org.html.erb | 4 ++-- app/views/organizations/_org_left_subfield_list.html.erb | 6 +++++- config/routes.rb | 1 + public/stylesheets/org.css | 4 +++- 7 files changed, 24 insertions(+), 9 deletions(-) create mode 100644 app/views/files/subfield_upload_file.js.erb diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 6ed42bd6e..7b375377c 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -392,8 +392,8 @@ class FilesController < ApplicationController sort = "#{Attachment.table_name}.created_on desc" end @container_type = 2 - @organization = Organization.find(params[:organization_id]) @containers = [ OrgSubfield.includes(:attachments).reorder(sort).find(@org_subfield.id)] + @organization = Organization.find(@containers.first.organization_id) show_attachments @containers render :layout => 'base_org' # @subfield = params[:org_subfield_id] @@ -733,4 +733,8 @@ class FilesController < ApplicationController # format.html end end + + def subfield_upload_file + @org_subfield = OrgSubfield.find(params[:org_subfield_id]) + end end diff --git a/app/views/files/_upload_subfield_file.html.erb b/app/views/files/_upload_subfield_file.html.erb index c3ca72ecd..5d8723d03 100644 --- a/app/views/files/_upload_subfield_file.html.erb +++ b/app/views/files/_upload_subfield_file.html.erb @@ -10,7 +10,7 @@ - <%= render :partial => 'files/attachement_list',:locals => {:org_subfield => org_subfield} %> + <%= render :partial => 'files/attachement_list'%>
<%= l(:button_cancel)%> <%= l(:button_confirm)%> @@ -18,9 +18,7 @@ - <% content_for :header_tags do %> - <%= javascript_include_tag 'attachments' %> - <% end %> +