Module: DocumentationControllerBranding
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/controllers/concerns/documentation_controller_branding.rb
Instance Method Summary collapse
-
#docs_url(guide:, flavor:, chapter: nil) ⇒ Object
For new documentation at docs.theforeman.org We do not use flavor downstream, but keeping it here for the same method signature rubocop:disable Lint/UnusedMethodArgument.
- #documentation_url(section = nil, options = {}) ⇒ Object
- #plugin_documentation_url ⇒ Object
- #wiki_url(section: '') ⇒ Object
Instance Method Details
#docs_url(guide:, flavor:, chapter: nil) ⇒ Object
For new documentation at docs.theforeman.org We do not use flavor downstream, but keeping it here for the same method signature rubocop:disable Lint/UnusedMethodArgument
35 36 37 38 |
# File 'app/controllers/concerns/documentation_controller_branding.rb', line 35 def docs_url(guide:, flavor:, chapter: nil) url = ForemanThemeSatellite::Documentation::DOCS_GUIDES_LINKS.dig(guide, chapter) url || "#{ForemanThemeSatellite.documentation_root}/#{guide.downcase}/#{chapter}" end |
#documentation_url(section = nil, options = {}) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/concerns/documentation_controller_branding.rb', line 6 def documentation_url(section = nil, = {}) url = '' unless section.nil? dictionary = ForemanThemeSatellite::Documentation::USER_GUIDE_DICTIONARY matched_key = dictionary.keys.sort_by(&:length).reverse.find {|key| section.include? key} url = dictionary[matched_key] if matched_key end if url.empty? upstream_url = super(section, ) url = if (upstream_url =~ /redhat.com/) upstream_url else "#{ForemanThemeSatellite.documentation_root}/administering_red_hat_satellite" end end url end |
#plugin_documentation_url ⇒ Object
24 25 26 |
# File 'app/controllers/concerns/documentation_controller_branding.rb', line 24 def plugin_documentation_url ForemanThemeSatellite::Documentation::PLUGINS_DOCUMENTATION[plugin_documentation_params[:name]] || super end |
#wiki_url(section: '') ⇒ Object
28 29 30 |
# File 'app/controllers/concerns/documentation_controller_branding.rb', line 28 def wiki_url(section: '') documentation_url(section) end |