Module: BootdiskLinksHelper
- Defined in:
- app/helpers/bootdisk_links_helper.rb
Instance Method Summary collapse
- #bootdisk_authorized_for(options) ⇒ Object
- #bootdisk_help_link ⇒ Object
- #bootdisk_title_action_buttons(actions) ⇒ Object
- #bootdisk_url(options) ⇒ Object
-
#display_bootdisk_link_if_authorized(name, options = {}, html_options = {}) ⇒ Object
Core Foreman helpers can’t look up a URL against a mounted engine.
- #divider ⇒ Object
Instance Method Details
#bootdisk_authorized_for(options) ⇒ Object
17 18 19 |
# File 'app/helpers/bootdisk_links_helper.rb', line 17 def () User.current.allowed_to?() end |
#bootdisk_help_link ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'app/helpers/bootdisk_links_helper.rb', line 25 def bootdisk_help_link ( _('Boot disk Help'), { controller: 'foreman_bootdisk/disks', action: 'help' }, class: 'la' ) end |
#bootdisk_title_action_buttons(actions) ⇒ Object
36 37 38 39 40 41 42 43 44 45 |
# File 'app/helpers/bootdisk_links_helper.rb', line 36 def (actions) title_actions( ( ( _('Boot disk'), { class: 'btn btn-group' }, actions ) ) ) end |
#bootdisk_url(options) ⇒ Object
13 14 15 |
# File 'app/helpers/bootdisk_links_helper.rb', line 13 def bootdisk_url() ForemanBootdisk::Engine.routes.url_for(.merge(only_path: true, script_name: foreman_bootdisk_path)) end |
#display_bootdisk_link_if_authorized(name, options = {}, html_options = {}) ⇒ Object
Core Foreman helpers can’t look up a URL against a mounted engine
5 6 7 8 9 10 11 |
# File 'app/helpers/bootdisk_links_helper.rb', line 5 def (name, = {}, = {}) if () link_to(name, bootdisk_url(), ) else '' end end |
#divider ⇒ Object
21 22 23 |
# File 'app/helpers/bootdisk_links_helper.rb', line 21 def divider tag(:li, class: 'divider') end |