Class: Alchemy::Admin::DashboardController

Inherits:
BaseController show all
Defined in:
app/controllers/alchemy/admin/dashboard_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#leave

Methods included from Modules

included, #module_definition_for, register_module

Methods included from Alchemy::AbilityHelper

#current_ability

Methods included from ConfigurationMethods

#configuration, #multi_language?, #multi_site?, #prefix_locale?

Instance Method Details

#indexObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/alchemy/admin/dashboard_controller.rb', line 9

def index
  @last_edited_pages = Page.all_last_edited_from(current_alchemy_user)
  @all_locked_pages = Page.locked
  if Alchemy.user_class.respond_to?(:logged_in)
    @online_users = Alchemy.user_class.logged_in.to_a - [current_alchemy_user]
  end
  if current_alchemy_user.respond_to?(:sign_in_count) && current_alchemy_user.respond_to?(:last_sign_in_at)
    @last_sign_at = current_alchemy_user.
    @first_time = current_alchemy_user. == 1 && @last_sign_at.nil?
  end
  @sites = Site.all
end

#infoObject



22
23
24
# File 'app/controllers/alchemy/admin/dashboard_controller.rb', line 22

def info
  @alchemy_version = Alchemy.version
end

#update_checkObject



26
27
28
29
30
31
32
33
34
35
# File 'app/controllers/alchemy/admin/dashboard_controller.rb', line 26

def update_check
  @alchemy_version = Alchemy.version
  if @alchemy_version < latest_alchemy_version
    render text: 'true'
  else
    render text: 'false'
  end
rescue UpdateServiceUnavailable => e
  render text: e, status: 503
end