Module: DashboardHelper

Includes:
IconsHelper
Defined in:
app/helpers/dashboard_helper.rb

Constant Summary

Constants included from IconsHelper

IconsHelper::DEFAULT_ICON_SIZE

Instance Method Summary collapse

Methods included from IconsHelper

#audit_icon, #boolean_to_icon, #custom_icon, #external_snippet_icon, #file_type_icon_class, #gl_loading_icon, #sprite_file_icons_path, #sprite_icon, #sprite_icon_path, #visibility_level_icon

Instance Method Details

#feature_entry(title, href: nil, enabled: true, doc_href: nil, last: false, css_class: nil) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'app/helpers/dashboard_helper.rb', line 10

def feature_entry(title, href: nil, enabled: true, doc_href: nil, last: false, css_class: nil)
  enabled_text = enabled ? 'enabled' : 'not enabled'
  label = "#{title}: #{enabled_text}"
  link_or_title = title

  tag.p(aria: { label: label }, class: ['gl-py-4', 'gl-m-0', ('gl-border-b' unless last), css_class].compact) do
    concat(link_or_title)

    concat(tag.span(class: %w[gl-float-right]) do
      concat(boolean_to_icon(enabled))

      if href.present?
        concat(render(Pajamas::ButtonComponent.new(icon: 'settings', category: :tertiary, size: :small, href: href,
          button_options: { title: _('Configure'), class: 'gl-ml-2 has-tooltip', aria: { label: _('Configure') } })))
      end

      if doc_href.present?
        link_to_doc = link_to(
          sprite_icon('question-o'),
          doc_href,
          class: 'gl-ml-4 gl-mr-2 has-tooltip',
          title: _('Documentation'),
          target: '_blank',
          rel: 'noopener noreferrer'
        )

        concat(link_to_doc)
      end
    end)
  end
end

#has_start_trial?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'app/helpers/dashboard_helper.rb', line 6

def has_start_trial?
  false
end

#user_groups_requiring_reauthObject



42
43
44
# File 'app/helpers/dashboard_helper.rb', line 42

def user_groups_requiring_reauth
  []
end