Sha256: 3946bb3b6a6f7032c2391d7e5efd4db3ec7be1264b831fe4e8bd810db7f9c653

Contents?: true

Size: 1.12 KB

Versions: 6

Compression:

Stored size: 1.12 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_url, :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/templates/basics', :class => 'tutorial', :id => 'help'
      add :logout, :url => destroy_locomotive_session_url, :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

6 entries across 6 versions & 2 rubygems

Version Path
tribeca_cms-0.1.1 app/cells/locomotive/global_actions_cell.rb
tribeca_cms-2.0.0.rc12 app/cells/locomotive/global_actions_cell.rb
locomotive_cms-2.0.0.rc12 app/cells/locomotive/global_actions_cell.rb
locomotive_cms-2.0.0.rc11 app/cells/locomotive/global_actions_cell.rb
locomotive_cms-2.0.0.rc10 app/cells/locomotive/global_actions_cell.rb
locomotive_cms-2.0.0.rc9 app/cells/locomotive/global_actions_cell.rb