Sha256: 84e9acc35f8b748509b09e2e1564ba4b941a456f137fcc48e43bfe191b73a6fc

Contents?: true

Size: 1.08 KB

Versions: 18

Compression:

Stored size: 1.08 KB

Contents

module Locomotive
  class GlobalActionsCell < MenuCell

    attr_reader :current_locomotive_account, :current_site_url

    def show(args)
      @current_locomotive_account = args[:current_locomotive_account]
      @current_site_url           = args[:current_site_url]
      super
    end

    protected

    def build_list
      add :welcome, url: edit_my_account_path, i18n_options: {
        key:    'locomotive.shared.header.welcome',
        arg:    :name,
        value:  @current_locomotive_account.name
      }

      add :see, url: current_site_url, id: 'viewsite', target: '_blank'

      if Locomotive.config.multi_sites? && current_locomotive_account.sites.size > 1
        add :switch, url: '#', id: 'sites-picker-link'
      end

      add :help, url: 'http://doc.locomotivecms.com', class: 'tutorial', id: 'help', target: '_blank'
      add :logout, url: destroy_locomotive_session_path, data: { confirm: t('locomotive.messages.confirm') }, method: :delete
    end

    def localize_label(label, options = {})
      I18n.t("locomotive.shared.header.#{label}", options)
    end

  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
locomotive_cms-2.5.7 app/cells/locomotive/global_actions_cell.rb
locomotive_cms-2.5.6 app/cells/locomotive/global_actions_cell.rb
locomotive_cms-2.5.6.rc2 app/cells/locomotive/global_actions_cell.rb
locomotive_cms-2.5.6.rc1 app/cells/locomotive/global_actions_cell.rb
locomotive_cms-2.5.5 app/cells/locomotive/global_actions_cell.rb
locomotive_cms-2.5.4 app/cells/locomotive/global_actions_cell.rb
locomotive_cms-2.5.3 app/cells/locomotive/global_actions_cell.rb
locomotive_cms-2.5.2 app/cells/locomotive/global_actions_cell.rb
locomotive_cms-2.5.1 app/cells/locomotive/global_actions_cell.rb
locomotive_cms-2.5.0 app/cells/locomotive/global_actions_cell.rb
locomotive_cms-2.5.0.rc3 app/cells/locomotive/global_actions_cell.rb
locomotive_cms-2.5.0.rc2 app/cells/locomotive/global_actions_cell.rb
locomotive_cms-2.5.0.rc1 app/cells/locomotive/global_actions_cell.rb
locomotive_cms-2.4.1 app/cells/locomotive/global_actions_cell.rb
locomotive_cms-2.4.0 app/cells/locomotive/global_actions_cell.rb
locomotive_cms-2.3.1 app/cells/locomotive/global_actions_cell.rb
locomotive_cms-2.3.0 app/cells/locomotive/global_actions_cell.rb
locomotive_cms-2.2.3 app/cells/locomotive/global_actions_cell.rb