Module: ExploreHelper
- Defined in:
- app/helpers/explore_helper.rb
Instance Method Summary collapse
- #any_explore_nav_link?(links) ⇒ Boolean
- #explore_controller? ⇒ Boolean
- #explore_nav_link?(link) ⇒ Boolean
- #explore_nav_links ⇒ Object
- #filter_audit_path(options = {}) ⇒ Object
- #filter_groups_path(options = {}) ⇒ Object
- #filter_projects_path(options = {}) ⇒ Object
- #public_visibility_restricted? ⇒ Boolean
Instance Method Details
#any_explore_nav_link?(links) ⇒ Boolean
50 51 52 |
# File 'app/helpers/explore_helper.rb', line 50 def any_explore_nav_link?(links) links.any? { |link| explore_nav_link?(link) } end |
#explore_controller? ⇒ Boolean
38 39 40 |
# File 'app/helpers/explore_helper.rb', line 38 def explore_controller? controller.class.name.split("::").first == "Explore" end |
#explore_nav_link?(link) ⇒ Boolean
46 47 48 |
# File 'app/helpers/explore_helper.rb', line 46 def explore_nav_link?(link) explore_nav_links.include?(link) end |
#explore_nav_links ⇒ Object
42 43 44 |
# File 'app/helpers/explore_helper.rb', line 42 def explore_nav_links @explore_nav_links ||= get_explore_nav_links end |
#filter_audit_path(options = {}) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/helpers/explore_helper.rb', line 22 def filter_audit_path( = {}) exist_opts = { entity_type: params[:entity_type], entity_id: params[:entity_id], created_before: params[:created_before], created_after: params[:created_after], sort: params[:sort] } = exist_opts.merge().delete_if { |key, value| value.blank? } () end |
#filter_groups_path(options = {}) ⇒ Object
34 35 36 |
# File 'app/helpers/explore_helper.rb', line 34 def filter_groups_path( = {}) () end |
#filter_projects_path(options = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/helpers/explore_helper.rb', line 4 def filter_projects_path( = {}) exist_opts = { sort: params[:sort] || @sort, scope: params[:scope], group: params[:group], tag: params[:tag], visibility_level: params[:visibility_level], name: params[:name], personal: params[:personal], archived: params[:archived], shared: params[:shared], namespace_id: params[:namespace_id] } = exist_opts.merge().delete_if { |key, value| value.blank? } () end |
#public_visibility_restricted? ⇒ Boolean
54 55 56 |
# File 'app/helpers/explore_helper.rb', line 54 def public_visibility_restricted? Gitlab::VisibilityLevel.public_visibility_restricted? end |