From d6e7a2ade5cc78060cc4eae08764b3c0b8011b68 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Thu, 14 Jan 2016 12:51:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=B8=80=E4=BA=9Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/files_controller.rb | 1 + app/controllers/org_subfields_controller.rb | 5 +++++ app/controllers/organizations_controller.rb | 2 +- app/views/files/_org_subfield_list.html.erb | 4 ++-- app/views/org_subfields/update_sub_dir.js.erb | 13 +++++++------ app/views/organizations/_subfield_list.html.erb | 2 +- app/views/users/_resource_share_for_orgs.html.erb | 2 +- 7 files changed, 18 insertions(+), 11 deletions(-) diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 41a32d100..6788d215b 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -173,6 +173,7 @@ class FilesController < ApplicationController # #render 'stores' # redirect_to search_course_files_url end + @page = params[:page] || 1 end def find_course_attache keywords,course,sort = "" diff --git a/app/controllers/org_subfields_controller.rb b/app/controllers/org_subfields_controller.rb index 9b8cbcf93..5850629f0 100644 --- a/app/controllers/org_subfields_controller.rb +++ b/app/controllers/org_subfields_controller.rb @@ -21,6 +21,11 @@ class OrgSubfieldsController < ApplicationController end def show + @flag = params[:flag] || false + sort = "" + @sort = "" + @order = "" + @is_remote = false @organization = Organization.find(params[:id]) @org_subfield = OrgSubfield.find_by_sql("select distinct org_subfields.* from org_subfields,"+ "subfield_subdomain_dirs where org_subfields.id = subfield_subdomain_dirs.org_subfield_id and "+ diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 9f80503d8..25ee3dc48 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -114,7 +114,7 @@ class OrganizationsController < ApplicationController @organization = Organization.find(params[:id]) @organization.name = params[:organization][:name] @organization.description = params[:organization][:description] - @organization.domain = params[:organization][:domain] + # @organization.domain = params[:organization][:domain] @organization.is_public = params[:organization][:is_public] == 'on' ? 1 : 0 #@organization.name = params[:organization][:name] @organization.save diff --git a/app/views/files/_org_subfield_list.html.erb b/app/views/files/_org_subfield_list.html.erb index 504558b15..86f007e82 100644 --- a/app/views/files/_org_subfield_list.html.erb +++ b/app/views/files/_org_subfield_list.html.erb @@ -68,10 +68,10 @@ <% if org_subfield_attachments.count == 10 %> <% if params[:action] == 'search_files_in_subfield' %> - <%=link_to "点击展开更多", search_files_in_subfield_org_subfield_files_path({:org_subfield_id => org_subfield.id,:page => @obj_pages.nil? ? @feedback_pages.page + 1 : @obj_pages.page + 1}.merge(params)),:id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %> + <%=link_to "点击展开更多", search_files_in_subfield_org_subfield_files_path(:org_subfield_id => org_subfield.id,:page => @page.to_i + 1, :name => params[:name],:insite => params[:insite]),:id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %> <% else %> - <%=link_to "点击展开更多", org_subfield_files_path(:org_subfield_id => org_subfield.id, :page => @page + 1), :id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %> + <%=link_to "点击展开更多", org_subfield_files_path(:org_subfield_id => org_subfield.id, :page => @page.nil? ? 2 :(@page + 1)), :id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %> <%end%> <% end%> diff --git a/app/views/org_subfields/update_sub_dir.js.erb b/app/views/org_subfields/update_sub_dir.js.erb index 963c55100..6794633d2 100644 --- a/app/views/org_subfields/update_sub_dir.js.erb +++ b/app/views/org_subfields/update_sub_dir.js.erb @@ -1,10 +1,11 @@ -<%# if @exist == false %> +<% if @exist == false %> $('#sub_dir_show_<%= @org_subfield.id %>').html('<%= @sub_dir.name %>'); $('#sub_dir_edit_<%= @org_subfield.id %>').find('input').val('<%= @sub_dir.name %>'); - $('#sub_dir_show_<%= @org_subfield.id %>').show(); - $('#sub_dir_edit_<%= @org_subfield.id %>').hide(); -<%# else %> +// $('#sub_dir_show_<%= @org_subfield.id %>').show(); +// $('#sub_dir_edit_<%= @org_subfield.id %>').hide(); +<% else %> + $('#sub_dir_edit_<%= @org_subfield.id %>').find('input').val('<%= @org_subfield.subfield_subdomain_dir.nil? ? '': @org_subfield.subfield_subdomain_dir.name %>'); // alert("该目录已存在,请重新输入"); // $('#sub_dir_edit_<%#= @org_subfield.id %>').find('input').val('<%#= @org_subfield.subfield_subdomain_dir.nil? ? "未设置":@org_subfield.subfield_subdomain_dir.name %>'); -// $('#sub_dir_edit_<%= @org_subfield.id %>').focus(); -<%# end %> \ No newline at end of file +// $('#sub_dir_edit_<%#= @org_subfield.id %>').focus(); +<% end %> \ No newline at end of file diff --git a/app/views/organizations/_subfield_list.html.erb b/app/views/organizations/_subfield_list.html.erb index 36f0a1294..6b47844bb 100644 --- a/app/views/organizations/_subfield_list.html.erb +++ b/app/views/organizations/_subfield_list.html.erb @@ -78,7 +78,7 @@ } function update_sub_dir(show_id, edit_id, field_id, input_value) { - if ($(show_id).html().trim() != input_value.trim()) { + if ($(show_id).html().trim() != input_value.trim() && input_value.trim() != '') { if (confirm('确定修改为' + input_value + "?")) $.ajax({ url: "/org_subfields/" + field_id + "/update_sub_dir?sub_dir_name=" + input_value, diff --git a/app/views/users/_resource_share_for_orgs.html.erb b/app/views/users/_resource_share_for_orgs.html.erb index 9da439c8e..37fb3442e 100644 --- a/app/views/users/_resource_share_for_orgs.html.erb +++ b/app/views/users/_resource_share_for_orgs.html.erb @@ -22,7 +22,7 @@ <%= hidden_field_tag(:send_id, send_id) %> <%= hidden_field_tag(:send_ids, send_ids) %>
-