mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Implement consistent admin interface
* Consistent route/model/controller/view layout * Get rid of unused photos, speakers, dietchoices, social_events controllers * Drop unused :public from Rooms and :description from CallForPapers
This commit is contained in:
parent
f6a87331be
commit
28063129c7
133 changed files with 1461 additions and 1461 deletions
|
|
@ -11,18 +11,6 @@ module Admin
|
|||
@attended = @conference.registrations.where('attended = ?', true).count
|
||||
end
|
||||
|
||||
def toogle_attended
|
||||
@registration.attended = !@registration.attended
|
||||
if @registration.save
|
||||
flash[:notice] = "Successfully updated Attended for #{@user.email}"
|
||||
redirect_to admin_conference_registrations_path(@conference.short_title)
|
||||
else
|
||||
flash[:notice] = "Update Attended for #{@user.email} failed!" \
|
||||
"#{@registration.errors.full_messages.join('. ')}"
|
||||
redirect_to admin_conference_registrations_path(@conference.short_title)
|
||||
end
|
||||
end
|
||||
|
||||
def edit; end
|
||||
|
||||
def update
|
||||
|
|
@ -48,6 +36,30 @@ module Admin
|
|||
end
|
||||
end
|
||||
|
||||
def present
|
||||
@registration.attended = true
|
||||
if @registration.save
|
||||
flash[:notice] = "#{@user.email} has attended"
|
||||
redirect_to admin_conference_registrations_path(@conference.short_title)
|
||||
else
|
||||
flash[:notice] = "Update Attended for #{@user.email} failed!" \
|
||||
"#{@registration.errors.full_messages.join('. ')}"
|
||||
redirect_to admin_conference_registrations_path(@conference.short_title)
|
||||
end
|
||||
end
|
||||
|
||||
def absent
|
||||
@registration.attended = false
|
||||
if @registration.save
|
||||
flash[:notice] = "#{@user.email} has not attended"
|
||||
redirect_to admin_conference_registrations_path(@conference.short_title)
|
||||
else
|
||||
flash[:notice] = "Update Attended for #{@user.email} failed!" \
|
||||
"#{@registration.errors.full_messages.join('. ')}"
|
||||
redirect_to admin_conference_registrations_path(@conference.short_title)
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def set_user
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue