|
|
|
@ -8,6 +8,7 @@ class TagsController < ApplicationController
|
|
|
|
|
include IssuesHelper
|
|
|
|
|
include UsersHelper
|
|
|
|
|
include BidsHelper
|
|
|
|
|
include ForumsHelper
|
|
|
|
|
include ActsAsTaggableOn::TagsHelper
|
|
|
|
|
helper :projects
|
|
|
|
|
include TagsHelper
|
|
|
|
@ -56,7 +57,8 @@ class TagsController < ApplicationController
|
|
|
|
|
@obj,@obj_pages,@results_count,@users_results,
|
|
|
|
|
@projects_results,
|
|
|
|
|
@issues_results,
|
|
|
|
|
@bids_results = refresh_results(@obj_id,@obj_flag,@selected_tags)
|
|
|
|
|
@bids_results,
|
|
|
|
|
@forums_results = refresh_results(@obj_id,@obj_flag,@selected_tags)
|
|
|
|
|
|
|
|
|
|
# 这里是做tag推荐用的, 用来生产推荐的tags
|
|
|
|
|
unless @obj.nil?
|
|
|
|
@ -83,7 +85,8 @@ class TagsController < ApplicationController
|
|
|
|
|
@obj,@obj_pages,@users_results,
|
|
|
|
|
@projects_results,
|
|
|
|
|
@issues_results,
|
|
|
|
|
@bids_results = refresh_results(@obj_id,@show_flag)
|
|
|
|
|
@bids_results,
|
|
|
|
|
@forums_results = refresh_results(@obj_id,@show_flag)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 删除已选tag
|
|
|
|
@ -98,7 +101,8 @@ class TagsController < ApplicationController
|
|
|
|
|
@obj,@obj_pages,@results_count,@users_results,
|
|
|
|
|
@projects_results,
|
|
|
|
|
@issues_results,
|
|
|
|
|
@bids_results = refresh_results(@obj_id,@show_flag)
|
|
|
|
|
@bids_results,
|
|
|
|
|
@forums_results = refresh_results(@obj_id,@show_flag)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def show_all
|
|
|
|
@ -161,6 +165,7 @@ private
|
|
|
|
|
@projects_results = nil
|
|
|
|
|
@issues_results = nil
|
|
|
|
|
@bids_results = nil
|
|
|
|
|
@forums_results = nil
|
|
|
|
|
@obj_pages = nil
|
|
|
|
|
@obj = nil
|
|
|
|
|
|
|
|
|
@ -176,12 +181,15 @@ private
|
|
|
|
|
@obj = Issue.find_by_id(obj_id)
|
|
|
|
|
@obj_pages,@issues_results,@results_count = for_pagination(get_issues_by_tag(selected_tags))
|
|
|
|
|
when '4' then
|
|
|
|
|
@obj_pages,@bids_results,@results_count = for_pagination(get_bids_by_tag(selected_tags))
|
|
|
|
|
@obj = Bid.find_by_id(obj_id)
|
|
|
|
|
@obj_pages,@bids_results,@results_count = for_pagination(get_bids_by_tag(selected_tags))
|
|
|
|
|
@obj = Bid.find_by_id(obj_id)
|
|
|
|
|
when '5'
|
|
|
|
|
@obj = Forum.find_by_id(obj_id)
|
|
|
|
|
@obj_pages,@forums_results,@results_count = for_pagination(get_forums_by_tag(selected_tags))
|
|
|
|
|
else
|
|
|
|
|
@obj = nil
|
|
|
|
|
end
|
|
|
|
|
return @obj,@obj_pages,@results_count,@users_results,@projects_results,@issues_results,@bids_results
|
|
|
|
|
return @obj,@obj_pages,@results_count,@users_results,@projects_results,@issues_results,@bids_results,@forums_results
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def for_pagination(results)
|
|
|
|
|