2013-01-07 09:04:09 +01:00
|
|
|
class Admin::PeopleController < ApplicationController
|
|
|
|
|
before_filter :verify_organizer
|
2013-07-10 16:13:53 +02:00
|
|
|
respond_to :html
|
2013-01-07 09:04:09 +01:00
|
|
|
|
|
|
|
|
def index
|
|
|
|
|
@people = Person.all
|
2013-06-14 13:17:40 +02:00
|
|
|
mails = []
|
|
|
|
|
@people.each do |p|
|
|
|
|
|
if p.registrations.count < 1 and p.confirmed?
|
|
|
|
|
mails << p.email
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
respond_to do |format|
|
|
|
|
|
format.html
|
|
|
|
|
format.text { render :text => mails }
|
|
|
|
|
end
|
2013-01-07 09:04:09 +01:00
|
|
|
end
|
|
|
|
|
|
2013-07-10 16:13:53 +02:00
|
|
|
def new
|
|
|
|
|
@person = Person.new
|
|
|
|
|
end
|
2013-01-07 09:04:09 +01:00
|
|
|
|
2013-07-10 16:13:53 +02:00
|
|
|
def create
|
|
|
|
|
@person = Person.new(params[:person])
|
|
|
|
|
flash[:notice] = 'Person was successfully created.' if @person.save
|
|
|
|
|
respond_with @person, :location => admin_people_path
|
2013-01-07 09:04:09 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def show
|
|
|
|
|
@person = Person.find(params[:id])
|
|
|
|
|
end
|
|
|
|
|
|
2013-07-10 16:13:53 +02:00
|
|
|
def edit
|
|
|
|
|
@person = Person.find(params[:id])
|
|
|
|
|
end
|
2013-01-07 09:04:09 +01:00
|
|
|
|
2013-07-10 16:13:53 +02:00
|
|
|
def update
|
|
|
|
|
@person = Person.find(params[:id])
|
|
|
|
|
flash[:notice] = 'Person was successfully updated' if @person.update_attributes(params[:person])
|
|
|
|
|
respond_with @person, :location => admin_people_path
|
2013-01-07 09:04:09 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def delete
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
end
|