Module: NavHelper
Instance Method Summary collapse
- #admin_monitoring_nav_links ⇒ Object
- #header_link?(link) ⇒ Boolean
- #header_links ⇒ Object
- #page_gutter_class ⇒ Object
- #page_has_markdown? ⇒ Boolean
- #page_with_sidebar_class ⇒ Object
- #super_sidebar_loading_state_class ⇒ Object
Instance Method Details
#admin_monitoring_nav_links ⇒ Object
55 56 57 |
# File 'app/helpers/nav_helper.rb', line 55 def admin_monitoring_nav_links %w[system_info background_migrations background_jobs health_check] end |
#header_link?(link) ⇒ Boolean
10 11 12 |
# File 'app/helpers/nav_helper.rb', line 10 def header_link?(link) header_links.include?(link) end |
#header_links ⇒ Object
6 7 8 |
# File 'app/helpers/nav_helper.rb', line 6 def header_links @header_links ||= get_header_links end |
#page_gutter_class ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'app/helpers/nav_helper.rb', line 29 def page_gutter_class if (page_has_markdown? || current_path?('projects/merge_requests#diffs')) && !current_controller?('conflicts') if [:collapsed_gutter] == 'true' ["page-gutter", ('right-sidebar-collapsed' unless ).to_s] else ["page-gutter", ('right-sidebar-expanded' unless ).to_s] end elsif current_path?('jobs#show') %w[page-gutter build-sidebar right-sidebar-expanded] elsif current_controller?('wikis') && current_action?('show', 'create', 'edit', 'update', 'history', 'git_access', 'destroy', 'diff') %w[page-gutter has-wiki-sidebar] else [] end end |
#page_has_markdown? ⇒ Boolean
46 47 48 49 50 51 52 53 |
# File 'app/helpers/nav_helper.rb', line 46 def page_has_markdown? current_path?('projects/merge_requests#show') || current_path?('projects/merge_requests/conflicts#show') || current_path?('issues#show') || current_path?('milestones#show') || current_path?('issues#designs') || current_path?('incidents#show') end |
#page_with_sidebar_class ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'app/helpers/nav_helper.rb', line 14 def class_name = page_gutter_class class_name << 'page-with-super-sidebar' class_name << 'page-with-super-sidebar-collapsed' if class_name -= ['right-sidebar-expanded'] if defined?(@right_sidebar) && !@right_sidebar class_name end |
#super_sidebar_loading_state_class ⇒ Object
25 26 27 |
# File 'app/helpers/nav_helper.rb', line 25 def ['super_sidebar_collapsed'] == 'true' ? 'super-sidebar-is-icon-only' : '' end |