Module: Refinery::SiteBarHelper
- Defined in:
- app/helpers/refinery/site_bar_helper.rb
Instance Method Summary collapse
- #display_site_bar? ⇒ Boolean
- #site_bar_edit_link ⇒ Object
-
#site_bar_switch_link ⇒ Object
Generates the link to determine where the site bar switch button returns to.
- #site_bar_translate_locale_args ⇒ Object
Instance Method Details
#display_site_bar? ⇒ Boolean
29 30 31 32 |
# File 'app/helpers/refinery/site_bar_helper.rb', line 29 def .allow?(:read, :site_bar) && "#{controller_name}##{action_name}" !~ %r{preview#show} end |
#site_bar_edit_link ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'app/helpers/refinery/site_bar_helper.rb', line 16 def return nil if admin? || @page.nil? link_to t('refinery.admin.pages.page.edit', **), refinery.admin_edit_page_path(@page.nested_url, switch_locale: (@page.translations.first.locale unless @page.translated_to_default_locale?)), data: {turbolinks: false} end |
#site_bar_switch_link ⇒ Object
Generates the link to determine where the site bar switch button returns to.
7 8 9 10 11 12 13 14 |
# File 'app/helpers/refinery/site_bar_helper.rb', line 7 def link_to_if(admin?, t('.switch_to_your_website', **), refinery.root_path(), data: {turbolinks: false}) do link_to t('.switch_to_your_website_editor', **), Refinery::Core.backend_path, 'data-turbolinks' => false end end |
#site_bar_translate_locale_args ⇒ Object
25 26 27 |
# File 'app/helpers/refinery/site_bar_helper.rb', line 25 def { locale: Refinery::I18n.current_locale } end |