解决一些bug

This commit is contained in:
ouyangxuhua 2016-01-14 12:51:01 +08:00
parent 324513fc94
commit d6e7a2ade5
7 changed files with 18 additions and 11 deletions

View File

@ -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 = ""

View File

@ -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 "+

View File

@ -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

View File

@ -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 %>
<!-- 全站搜索的时候 返回的页码对象是obj_pages,而站内搜索返回的页码对象是feedback_pages -->
<%=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%>

View File

@ -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 %>
// $('#sub_dir_edit_<%#= @org_subfield.id %>').focus();
<% end %>

View File

@ -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,

View File

@ -22,7 +22,7 @@
<%= hidden_field_tag(:send_id, send_id) %>
<%= hidden_field_tag(:send_ids, send_ids) %>
<div class="sectionWrap fl mr15">
<ul class="fontGrey3 sectionContent">
<ul class="fontGrey3">
<% unless @orgs.empty? %>
<% @orgs.each do |org|%>
<li>