mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
First checkin
This commit is contained in:
parent
f207e2c8b7
commit
90b30db9e8
260 changed files with 37349 additions and 0 deletions
28
app/controllers/admin/callforpapers_controller.rb
Normal file
28
app/controllers/admin/callforpapers_controller.rb
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
class Admin::CallforpapersController < ApplicationController
|
||||
before_filter :verify_organizer
|
||||
layout "admin"
|
||||
|
||||
def show
|
||||
@cfp = @conference.call_for_papers
|
||||
if @cfp.nil?
|
||||
@cfp = CallForPapers.new
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
@cfp = @conference.call_for_papers
|
||||
@cfp.update_attributes(params[:call_for_papers])
|
||||
redirect_to(admin_conference_cfp_info_path(:id => @conference.short_title), :notice => 'Call for Papers was successfully updated.')
|
||||
|
||||
end
|
||||
|
||||
def create
|
||||
@cfp = CallForPapers.new(params[:call_for_papers])
|
||||
@conference.call_for_papers = @cfp
|
||||
if @cfp.save
|
||||
redirect_to(admin_conference_cfp_info_path(:id => @conference.short_title), :notice => 'Call for Papers was successfully updated.')
|
||||
else
|
||||
redirect_to(admin_conference_cfp_info_path(:id => @conference.short_title), :error => 'Call for Papers failed.')
|
||||
end
|
||||
end
|
||||
end
|
||||
36
app/controllers/admin/conference_controller.rb
Normal file
36
app/controllers/admin/conference_controller.rb
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
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
|
||||
41
app/controllers/admin/events_controller.rb
Normal file
41
app/controllers/admin/events_controller.rb
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
class Admin::EventsController < ApplicationController
|
||||
before_filter :verify_organizer
|
||||
layout "admin"
|
||||
|
||||
def index
|
||||
@events = @conference.events
|
||||
end
|
||||
|
||||
def show
|
||||
@event = @conference.events.find(params[:id])
|
||||
@comments = @event.root_comments
|
||||
@comment_count = @event.comment_threads.count
|
||||
end
|
||||
|
||||
def edit
|
||||
@event_types = @conference.event_types
|
||||
@event = Event.find_by_id(params[:id])
|
||||
@person = @event.submitter
|
||||
@url = edit_admin_conference_event_path(@conference.short_title, @event)
|
||||
end
|
||||
|
||||
def comment
|
||||
event = @conference.events.find_by_id(params[:id])
|
||||
comment = Comment.build_from(event, current_user.id, params[:comment])
|
||||
comment.save!
|
||||
if !params[:parent].nil?
|
||||
comment.move_to_child_of(params[:parent])
|
||||
end
|
||||
|
||||
redirect_to admin_conference_event_path(:conference_id => @conference.short_title, :id => params[:id])
|
||||
end
|
||||
def create
|
||||
|
||||
end
|
||||
|
||||
def update_state
|
||||
event = Event.find(params[:id])
|
||||
event.send(:"#{params[:transition]}!", :send_mail => params[:send_mail])
|
||||
redirect_to(admin_conference_events_path(:conference_id => @conference.short_title), :notice => "Updated state")
|
||||
end
|
||||
end
|
||||
17
app/controllers/admin/eventtype_controller.rb
Normal file
17
app/controllers/admin/eventtype_controller.rb
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
class Admin::EventtypeController < ApplicationController
|
||||
before_filter :verify_organizer
|
||||
layout "admin"
|
||||
|
||||
def show
|
||||
render :event_type_list
|
||||
end
|
||||
|
||||
def update
|
||||
begin
|
||||
@conference.update_attributes!(params[:conference])
|
||||
redirect_to(admin_conference_eventtype_list_path(:conference_id => @conference.short_title), :notice => 'Event types were successfully updated.')
|
||||
rescue Exception => e
|
||||
redirect_to(admin_conference_eventtype_list_path(:conference_id => @conference.short_title), :alert => 'Event types update failed: #{e.message}')
|
||||
end
|
||||
end
|
||||
end
|
||||
24
app/controllers/admin/people_controller.rb
Normal file
24
app/controllers/admin/people_controller.rb
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
class Admin::PeopleController < ApplicationController
|
||||
before_filter :verify_organizer
|
||||
layout "admin"
|
||||
|
||||
def index
|
||||
@people = Person.all
|
||||
end
|
||||
|
||||
def create
|
||||
|
||||
end
|
||||
|
||||
def show
|
||||
@person = Person.find(params[:id])
|
||||
end
|
||||
|
||||
def update
|
||||
|
||||
end
|
||||
|
||||
def delete
|
||||
|
||||
end
|
||||
end
|
||||
16
app/controllers/admin/registrations_controller.rb
Normal file
16
app/controllers/admin/registrations_controller.rb
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
class Admin::RegistrationsController < ApplicationController
|
||||
before_filter :verify_organizer
|
||||
layout "admin"
|
||||
|
||||
def show
|
||||
session[:return_to] ||= request.referer
|
||||
@pdf_filename = "#{@conference.title}.pdf"
|
||||
@registrations = @conference.registrations.all(:joins => :person,
|
||||
:order => "people.last_name ASC",
|
||||
:select => "registrations.*,
|
||||
people.last_name AS last_name,
|
||||
people.first_name AS first_name,
|
||||
people.public_name AS public_name,
|
||||
people.email AS email")
|
||||
end
|
||||
end
|
||||
18
app/controllers/admin/rooms_controller.rb
Normal file
18
app/controllers/admin/rooms_controller.rb
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
class Admin::RoomsController < ApplicationController
|
||||
before_filter :verify_organizer
|
||||
layout "admin"
|
||||
|
||||
def show
|
||||
render :rooms_list
|
||||
end
|
||||
|
||||
def update
|
||||
if @conference.update_attributes(params[:conference])
|
||||
redirect_to(admin_conference_rooms_list_path(:conference_id => @conference.short_title), :notice => 'Rooms were successfully updated.')
|
||||
else
|
||||
redirect_to(admin_conference_rooms_list_path(:conference_id => @conference.short_title), :notice => 'Room update failed.')
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
18
app/controllers/admin/tracks_controller.rb
Normal file
18
app/controllers/admin/tracks_controller.rb
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
class Admin::TracksController < ApplicationController
|
||||
before_filter :verify_organizer
|
||||
layout "admin"
|
||||
|
||||
def show
|
||||
render :tracks_list
|
||||
end
|
||||
|
||||
def update
|
||||
if @conference.update_attributes(params[:conference])
|
||||
redirect_to(admin_conference_tracks_list_path(:conference_id => @conference.short_title), :notice => 'Tracks were successfully updated.')
|
||||
else
|
||||
redirect_to(admin_conference_tracks_list_path(:conference_id => @conference.short_title), :notice => 'Tracks update failed.')
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
20
app/controllers/admin/users_controller.rb
Normal file
20
app/controllers/admin/users_controller.rb
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
class Admin::UsersController < ApplicationController
|
||||
before_filter :verify_admin
|
||||
layout "admin"
|
||||
|
||||
def index
|
||||
@users = User.all(:joins => :person,
|
||||
:order => "people.last_name ASC",
|
||||
:select => "users.*,
|
||||
people.last_name AS last_name,
|
||||
people.first_name AS first_name,
|
||||
people.public_name AS public_name,
|
||||
people.email AS email")
|
||||
end
|
||||
|
||||
def update
|
||||
user = User.find(params[:id])
|
||||
user.update_attributes!(params[:user])
|
||||
redirect_to admin_users_path, :notice => "Updated #{user.email}"
|
||||
end
|
||||
end
|
||||
24
app/controllers/admin/venue_controller.rb
Normal file
24
app/controllers/admin/venue_controller.rb
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
class Admin::VenueController < ApplicationController
|
||||
before_filter :verify_organizer
|
||||
layout "admin"
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
def update
|
||||
@venue = @conference.venue
|
||||
venue_params = params[:venue]
|
||||
@venue.name = venue_params[:name]
|
||||
@venue.address= venue_params[:address]
|
||||
@venue.website = venue_params[:website]
|
||||
@venue.description = venue_params[:description]
|
||||
@venue.save
|
||||
redirect_to(admin_conference_venue_info_path(:conference_id => @conference.short_title), :notice => 'Venue was successfully updated.')
|
||||
end
|
||||
|
||||
def show
|
||||
@venue = @conference.venue
|
||||
render :venue_info
|
||||
end
|
||||
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue