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


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

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


24
25
26
# File 'app/controllers/alchemy/admin/dashboard_controller.rb', line 24

def info
  @alchemy_version = Alchemy.version
end

#update_checkObject


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

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