mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
37 lines
982 B
Ruby
37 lines
982 B
Ruby
|
|
class Admin::ConferenceController < ApplicationController
|
||
|
|
before_filter :verify_organizer
|
||
|
|
layout "admin"
|
||
|
|
|
||
|
|
def index
|
||
|
|
@conferences = Conference.all
|
||
|
|
if @conferences.count == 0
|
||
|
|
redirect_to new_admin_conference_path
|
||
|
|
return
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
def new
|
||
|
|
@conference = Conference.new
|
||
|
|
end
|
||
|
|
|
||
|
|
def create
|
||
|
|
@conference = Conference.new(params[:conference])
|
||
|
|
if @conference.save
|
||
|
|
redirect_to(admin_conference_path(:id => @conference.short_title), :notice => 'Conference was successfully created.')
|
||
|
|
else
|
||
|
|
render :action => "new"
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
def update
|
||
|
|
@conference = Conference.find_all_by_short_title(params[:id]).first
|
||
|
|
@conference.update_attributes(params[:conference])
|
||
|
|
flash[:notice] = "Updated Conference"
|
||
|
|
redirect_to(admin_conference_path(:id => @conference.short_title), :notice => 'Conference was successfully updated.')
|
||
|
|
end
|
||
|
|
|
||
|
|
def show
|
||
|
|
@conference = Conference.find_all_by_short_title(params[:id]).first
|
||
|
|
end
|
||
|
|
end
|