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 respond_to do |format|
19 format.html { redirect_to({:action => :index}) }
27 @admin = current_admin
28 respond_to do |format|
29 if @admin.create_token
30 flash[:notice] = I18n.t('flash.notice.created', :model => Admin.human_attribute_name(:authentication_token))
31 format.html { redirect_to({:action => :auth_token}) }
33 flash[:notice] = I18n.t('flash.notice.not_created', :model => Admin.human_attribute_name(:authentication_token))
34 format.html { render action: "auth_token" }
40 respond_to do |format|
41 if current_admin.delete_token
42 flash[:notice] = I18n.t('flash.notice.destroyed', :model => Admin.human_attribute_name(:authentication_token))
43 format.html { redirect_to :action => :auth_token}
45 flash[:notice] = I18n.t('flash.notice.not_destroyed', :model => Admin.human_attribute_name(:authentication_token))
46 format.html { render action: "auth_token" }
52 @admin = Admin.find params[:id]
53 respond_to do |format|
55 format.html { redirect_to({:action => :waiting_list}, {:notice => 'admin was successfully approved.'}) }
57 format.html { render action: "waiting_list" }
63 @waits = Admin.find(:all, :conditions => ['approve = 0'])
67 @newadmin = Admin.find params[:id]
68 if admin_signed_in? and current_admin.activate
69 @newadmin.activate = 1
76 MagicNumber['test_layout'] = false
77 respond_to do |format|
78 format.html { render text: 'production', status: 200 }
83 MagicNumber['test_layout'] = 'test'
84 respond_to do |format|
85 format.html { render text: 'test', status: 200 }