2015-03-10 22:59:14 +00:00
|
|
|
module ExploreHelper
|
2016-08-06 02:03:01 +00:00
|
|
|
def filter_projects_path(options = {})
|
2015-03-10 22:59:14 +00:00
|
|
|
exist_opts = {
|
|
|
|
sort: params[:sort],
|
|
|
|
scope: params[:scope],
|
|
|
|
group: params[:group],
|
|
|
|
tag: params[:tag],
|
|
|
|
visibility_level: params[:visibility_level],
|
|
|
|
}
|
|
|
|
|
|
|
|
options = exist_opts.merge(options)
|
2017-03-01 13:31:56 +00:00
|
|
|
request_path_with_options(options)
|
|
|
|
end
|
|
|
|
|
|
|
|
def filter_groups_path(options = {})
|
|
|
|
request_path_with_options(options)
|
2015-03-10 22:59:14 +00:00
|
|
|
end
|
2016-02-03 19:13:26 +00:00
|
|
|
|
|
|
|
def explore_controller?
|
|
|
|
controller.class.name.split("::").first == "Explore"
|
|
|
|
end
|
2017-03-01 13:31:56 +00:00
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def request_path_with_options(options = {})
|
|
|
|
request.path + "?#{options.to_param}"
|
|
|
|
end
|
2015-03-10 22:59:14 +00:00
|
|
|
end
|