2015-04-26 12:48:37 +05:30
|
|
|
module ExploreHelper
|
2016-09-13 17:45:13 +05:30
|
|
|
def filter_projects_path(options = {})
|
2015-04-26 12:48:37 +05:30
|
|
|
exist_opts = {
|
2017-08-17 22:00:37 +05:30
|
|
|
sort: params[:sort] || @sort,
|
2015-04-26 12:48:37 +05:30
|
|
|
scope: params[:scope],
|
|
|
|
group: params[:group],
|
|
|
|
tag: params[:tag],
|
|
|
|
visibility_level: params[:visibility_level],
|
2017-08-17 22:00:37 +05:30
|
|
|
name: params[:name],
|
|
|
|
personal: params[:personal],
|
|
|
|
archived: params[:archived],
|
|
|
|
shared: params[:shared],
|
2017-09-10 17:25:29 +05:30
|
|
|
namespace_id: params[:namespace_id]
|
2015-04-26 12:48:37 +05:30
|
|
|
}
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
options = exist_opts.merge(options).delete_if { |key, value| value.blank? }
|
|
|
|
request_path_with_options(options)
|
|
|
|
end
|
|
|
|
|
|
|
|
def filter_groups_path(options = {})
|
|
|
|
request_path_with_options(options)
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|
2016-04-02 18:10:28 +05:30
|
|
|
|
|
|
|
def explore_controller?
|
|
|
|
controller.class.name.split("::").first == "Explore"
|
|
|
|
end
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def request_path_with_options(options = {})
|
|
|
|
request.path + "?#{options.to_param}"
|
|
|
|
end
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|