mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
add option to delete registration
This commit is contained in:
parent
f53af55a74
commit
6879ca28e5
3 changed files with 16 additions and 1 deletions
|
|
@ -28,4 +28,18 @@ class Admin::RegistrationsController < ApplicationController
|
||||||
redirect_to admin_conference_registrations_path(@conference.short_title, @registration)
|
redirect_to admin_conference_registrations_path(@conference.short_title, @registration)
|
||||||
flash[:notice] = "Updated '#{params[:view_field]}' for #{(Person.where("id = ?", @registration.person_id).first).email}"
|
flash[:notice] = "Updated '#{params[:view_field]}' for #{(Person.where("id = ?", @registration.person_id).first).email}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def delete
|
||||||
|
registration = @conference.registrations.where(:id => params[:id]).first
|
||||||
|
person = Person.where("id = ?", registration.person_id).first
|
||||||
|
|
||||||
|
begin registration.destroy
|
||||||
|
redirect_to admin_conference_registrations_path
|
||||||
|
flash[:notice] = "Deleted registration for #{person.public_name} #{person.email}"
|
||||||
|
rescue Exception => e
|
||||||
|
Rails.logger.debug e.backtrace.join("\n")
|
||||||
|
redirect_to(admin_conference_registrations_path(@conference.short_title), :alert => 'Failed to delete registration:' + e.message)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -40,7 +40,7 @@
|
||||||
%td
|
%td
|
||||||
= link_to "Edit", "#", :class => "btn btn-primary"
|
= link_to "Edit", "#", :class => "btn btn-primary"
|
||||||
%td
|
%td
|
||||||
= link_to "Delete", "#", :class => "btn btn-danger", :confirm => "Really delete registration for #{registration.public_name}?"
|
= link_to "Delete", admin_conference_registrations_path(@conference.short_title, :id => registration.id), :method => :delete, :class => "btn btn-danger", :confirm => "Really delete registration for #{registration.public_name} #{registration.email}?"
|
||||||
|
|
||||||
:javascript
|
:javascript
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ Osem::Application.routes.draw do
|
||||||
put "/schedule" => "schedule#update"
|
put "/schedule" => "schedule#update"
|
||||||
get "/registrations" => "registrations#show"
|
get "/registrations" => "registrations#show"
|
||||||
put "/registrations/change_field" => "registrations#change_field"
|
put "/registrations/change_field" => "registrations#change_field"
|
||||||
|
delete "/registrations" => "registrations#delete"
|
||||||
get "/emailsettings" => "emails#show", :as => "email_settings"
|
get "/emailsettings" => "emails#show", :as => "email_settings"
|
||||||
put "/emailsettings" => "emails#update", :as => "email_settings"
|
put "/emailsettings" => "emails#update", :as => "email_settings"
|
||||||
get "/supporter_levels" => "SupporterLevels#show"
|
get "/supporter_levels" => "SupporterLevels#show"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue