2011-10-30 23:02:41 +00:00
|
|
|
class Locomotive::GlobalActionsCell < ::Locomotive::MenuCell
|
|
|
|
|
2011-11-04 15:55:51 +00:00
|
|
|
attr_reader :current_locomotive_account, :current_site_url
|
2011-10-30 23:02:41 +00:00
|
|
|
|
|
|
|
def show(args)
|
2011-11-04 15:55:51 +00:00
|
|
|
@current_locomotive_account = args[:current_locomotive_account]
|
2011-10-30 23:02:41 +00:00
|
|
|
@current_site_url = args[:current_site_url]
|
|
|
|
super
|
|
|
|
end
|
|
|
|
|
|
|
|
protected
|
|
|
|
|
|
|
|
def build_list
|
2011-10-31 23:44:23 +00:00
|
|
|
add :welcome, :url => edit_my_account_url, :i18n_options => {
|
2011-10-30 23:02:41 +00:00
|
|
|
:key => 'locomotive.shared.header.welcome',
|
|
|
|
:arg => :name,
|
2011-11-04 15:55:51 +00:00
|
|
|
:value => @current_locomotive_account.name
|
2011-10-30 23:02:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
add :see, :url => current_site_url, :id => 'viewsite', :target => '_blank'
|
|
|
|
|
2011-11-04 15:55:51 +00:00
|
|
|
if Locomotive.config.multi_sites? && current_locomotive_account.sites.size > 1
|
2011-10-30 23:02:41 +00:00
|
|
|
add :switch, :url => '#', :id => 'sites-picker-link'
|
|
|
|
end
|
|
|
|
|
|
|
|
add :help, :url => '#', :class => 'tutorial', :id => 'help'
|
2011-11-08 00:11:15 +00:00
|
|
|
add :logout, :url => destroy_locomotive_account_session_url, :confirm => t('locomotive.messages.confirm')
|
2011-10-30 23:02:41 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def localize_label(label, options = {})
|
|
|
|
I18n.t("locomotive.shared.header.#{label}", options)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|