1 class SystemController < ApplicationController
2 before_filter :authenticate_admin!, :except => [:start]
16 Pettanr::Application.manifest = Pettanr::Manifest.new JSON.parse(open(Rails.root + 'public/manifest.json').read)
17 Pettanr::Application.manifest.init
18 respond_to do |format|
19 format.html { redirect_to({:action => :index}) }
30 @admin = current_admin
31 respond_to do |format|
32 if @admin.create_token
33 flash[:notice] = I18n.t('flash.notice.created', :model => Admin.human_attribute_name(:authentication_token))
34 format.html { redirect_to({:action => :auth_token}) }
36 flash[:notice] = I18n.t('flash.notice.not_created', :model => Admin.human_attribute_name(:authentication_token))
37 format.html { render action: "auth_token" }
43 respond_to do |format|
44 if current_admin.delete_token
45 flash[:notice] = I18n.t('flash.notice.destroyed', :model => Admin.human_attribute_name(:authentication_token))
46 format.html { redirect_to :action => :auth_token}
48 flash[:notice] = I18n.t('flash.notice.not_destroyed', :model => Admin.human_attribute_name(:authentication_token))
49 format.html { render action: "auth_token" }
55 @admin = Admin.find params[:id]
56 respond_to do |format|
58 format.html { redirect_to({:action => :waiting_list}, {:notice => 'admin was successfully approved.'}) }
60 format.html { render action: "waiting_list" }
66 @waits = Admin.find(:all, :conditions => ['approve = 0'])
70 @newadmin = Admin.find params[:id]
71 if admin_signed_in? and current_admin.activate
72 @newadmin.activate = 1
79 MagicNumber['test_layout'] = false
80 respond_to do |format|
81 format.html { render text: 'production', status: 200 }
86 MagicNumber['test_layout'] = 'test'
87 respond_to do |format|
88 format.html { render text: 'test', status: 200 }