1 class SystemController < ApplicationController
2 before_filter :authenticate_admin!, :except => [:start]
16 Manifest::load JSON.parse(open(Rails.root + 'public/manifest.json').read)
17 Manifest.manifest.init
18 LocalManifest::load JSON.parse(open(Rails.root + 'public/local_manifest.json').read)
19 LocalManifest.manifest.init
20 Manifest.manifest.init_after_load_manifest
21 Manifest.manifest.load_models_manifest
22 respond_to do |format|
23 format.html { redirect_to({:action => :index}) }
31 @admin = current_admin
32 respond_to do |format|
33 if @admin.create_token
34 flash[:notice] = I18n.t('flash.notice.created', :model => Admin.human_attribute_name(:authentication_token))
35 format.html { redirect_to({:action => :auth_token}) }
37 flash[:notice] = I18n.t('flash.notice.not_created', :model => Admin.human_attribute_name(:authentication_token))
38 format.html { render action: "auth_token" }
44 respond_to do |format|
45 if current_admin.delete_token
46 flash[:notice] = I18n.t('flash.notice.destroyed', :model => Admin.human_attribute_name(:authentication_token))
47 format.html { redirect_to :action => :auth_token}
49 flash[:notice] = I18n.t('flash.notice.not_destroyed', :model => Admin.human_attribute_name(:authentication_token))
50 format.html { render action: "auth_token" }
56 @admin = Admin.find params[:id]
57 respond_to do |format|
59 format.html { redirect_to({:action => :waiting_list}, {:notice => 'admin was successfully approved.'}) }
61 format.html { render action: "waiting_list" }
67 @waits = Admin.find(:all, :conditions => ['approve = 0'])
71 @newadmin = Admin.find params[:id]
72 if admin_signed_in? and current_admin.activate
73 @newadmin.activate = 1