修改js bug。
This commit is contained in:
parent
0d6045406a
commit
7caa5673e7
|
@ -94,9 +94,53 @@ class TagsController < ApplicationController
|
||||||
$selected_tags << @tag
|
$selected_tags << @tag
|
||||||
$related_tags.delete(@tag)
|
$related_tags.delete(@tag)
|
||||||
|
|
||||||
@issues_results = get_issues_by_tag($selected_tags)
|
@obj_pages = nil
|
||||||
@projects_results = get_projects_by_tag($selected_tags)
|
@numbers = Setting.tags_show_search_results
|
||||||
@users_results = get_users_by_tag($selected_tags)
|
# @issues_results = get_issues_by_tag($selected_tags)
|
||||||
|
# @projects_results = get_projects_by_tag($selected_tags)
|
||||||
|
# @users_results = get_users_by_tag($selected_tags)
|
||||||
|
case @show_flag
|
||||||
|
when '1' then
|
||||||
|
@users_results = get_users_by_tag($selected_tags)
|
||||||
|
@obj = User.find_by_id(@obj_id)
|
||||||
|
|
||||||
|
@offset, @limit = api_offset_and_limit({:limit => @numbers})
|
||||||
|
@project_count = @users_results.count
|
||||||
|
@obj_pages = Paginator.new @project_count, @limit, params['page']
|
||||||
|
@offset ||= @obj_pages.offset
|
||||||
|
@users_results = @users_results.offset(@offset).limit(@limit).all
|
||||||
|
when '2' then
|
||||||
|
@projects_results = get_projects_by_tag($selected_tags)
|
||||||
|
@obj = Project.find_by_id(@obj_id)
|
||||||
|
|
||||||
|
@offset, @limit = api_offset_and_limit({:limit => @numbers})
|
||||||
|
@project_count = @projects_results.count
|
||||||
|
@obj_pages = Paginator.new @project_count, @limit, params['page']
|
||||||
|
@offset ||= @obj_pages.offset
|
||||||
|
@projects_results = @projects_results.offset(@offset).limit(@limit).order('lft').all
|
||||||
|
|
||||||
|
when '3' then
|
||||||
|
@issues_results = get_issues_by_tag($selected_tags)
|
||||||
|
@obj = Issue.find_by_id(@obj_id)
|
||||||
|
|
||||||
|
@offset, @limit = api_offset_and_limit({:limit => @numbers})
|
||||||
|
@project_count = @issues_results.count
|
||||||
|
@obj_pages = Paginator.new @project_count, @limit, params['page']
|
||||||
|
@offset ||= @obj_pages.offset
|
||||||
|
@issues_results = @issues_results.offset(@offset).limit(@limit).all
|
||||||
|
when '4'
|
||||||
|
@bids_results = get_bids_by_tag($selected_tags)
|
||||||
|
@obj = Bid.find_by_id(@obj_id)
|
||||||
|
|
||||||
|
@offset, @limit = api_offset_and_limit({:limit => @numbers})
|
||||||
|
@project_count = @bids_results.count
|
||||||
|
@obj_pages = Paginator.new @project_count, @limit, params['page']
|
||||||
|
@offset ||= @obj_pages.offset
|
||||||
|
@bids_results = @bids_results.offset(@offset).limit(@limit).all
|
||||||
|
|
||||||
|
else
|
||||||
|
@obj = nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def delete_tag
|
def delete_tag
|
||||||
|
@ -105,9 +149,53 @@ class TagsController < ApplicationController
|
||||||
$related_tags << @tag
|
$related_tags << @tag
|
||||||
$selected_tags.delete(@tag)
|
$selected_tags.delete(@tag)
|
||||||
|
|
||||||
@issues_results = get_issues_by_tag($selected_tags)
|
@obj_pages = nil
|
||||||
@projects_results = get_projects_by_tag($selected_tags)
|
@numbers = Setting.tags_show_search_results
|
||||||
@users_results = get_users_by_tag($selected_tags)
|
# @issues_results = get_issues_by_tag($selected_tags)
|
||||||
|
# @projects_results = get_projects_by_tag($selected_tags)
|
||||||
|
# @users_results = get_users_by_tag($selected_tags)
|
||||||
|
case @show_flag
|
||||||
|
when '1' then
|
||||||
|
@users_results = get_users_by_tag($selected_tags)
|
||||||
|
@obj = User.find_by_id(@obj_id)
|
||||||
|
|
||||||
|
@offset, @limit = api_offset_and_limit({:limit => @numbers})
|
||||||
|
@project_count = @users_results.count
|
||||||
|
@obj_pages = Paginator.new @project_count, @limit, params['page']
|
||||||
|
@offset ||= @obj_pages.offset
|
||||||
|
@users_results = @users_results.offset(@offset).limit(@limit).all
|
||||||
|
when '2' then
|
||||||
|
@projects_results = get_projects_by_tag($selected_tags)
|
||||||
|
@obj = Project.find_by_id(@obj_id)
|
||||||
|
|
||||||
|
@offset, @limit = api_offset_and_limit({:limit => @numbers})
|
||||||
|
@project_count = @projects_results.count
|
||||||
|
@obj_pages = Paginator.new @project_count, @limit, params['page']
|
||||||
|
@offset ||= @obj_pages.offset
|
||||||
|
@projects_results = @projects_results.offset(@offset).limit(@limit).order('lft').all
|
||||||
|
|
||||||
|
when '3' then
|
||||||
|
@issues_results = get_issues_by_tag($selected_tags)
|
||||||
|
@obj = Issue.find_by_id(@obj_id)
|
||||||
|
|
||||||
|
@offset, @limit = api_offset_and_limit({:limit => @numbers})
|
||||||
|
@project_count = @issues_results.count
|
||||||
|
@obj_pages = Paginator.new @project_count, @limit, params['page']
|
||||||
|
@offset ||= @obj_pages.offset
|
||||||
|
@issues_results = @issues_results.offset(@offset).limit(@limit).all
|
||||||
|
when '4'
|
||||||
|
@bids_results = get_bids_by_tag($selected_tags)
|
||||||
|
@obj = Bid.find_by_id(@obj_id)
|
||||||
|
|
||||||
|
@offset, @limit = api_offset_and_limit({:limit => @numbers})
|
||||||
|
@project_count = @bids_results.count
|
||||||
|
@obj_pages = Paginator.new @project_count, @limit, params['page']
|
||||||
|
@offset ||= @obj_pages.offset
|
||||||
|
@bids_results = @bids_results.offset(@offset).limit(@limit).all
|
||||||
|
|
||||||
|
else
|
||||||
|
@obj = nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def count(name)
|
def count(name)
|
||||||
|
|
Loading…
Reference in New Issue