Skip to content

Commit

Permalink
Merge branch 'main' of github.com:snap-cloud/snapcon
Browse files Browse the repository at this point in the history
* 'main' of github.com:snap-cloud/snapcon:
  delete ticket currency migration
  Fix duplicate column in schema.rb
  rubocop styling fix
  delete event enable
  • Loading branch information
cycomachead committed Aug 1, 2024
2 parents 85e2994 + 75fd0cb commit 04290cc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/controllers/admin/events_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,17 @@ def toggle_attendance
end
end

def destroy
@event = Event.find(params[:id])
if @event.destroy
flash[:notice] = 'Event successfully deleted.'
redirect_to admin_conference_program_events_path(@conference.short_title)
else
flash[:alert] = 'Event could not be deleted.'
redirect_to admin_conference_program_event_path(@conference.short_title, @event)
end
end

private

def event_params
Expand Down
2 changes: 2 additions & 0 deletions app/views/admin/events/_proposal.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
= link_to 'Preview', conference_program_proposal_path(@conference.short_title, @event.id), class: 'btn btn-mini btn-primary'
= link_to 'Registrations', registrations_admin_conference_program_event_path(@conference.short_title, @event), class: 'btn btn-success'
= link_to 'Edit', edit_admin_conference_program_event_path(@conference.short_title, @event), class: 'btn btn-mini btn-primary'
= link_to 'Delete', admin_conference_program_event_path(@conference.short_title, @event), method: :delete, data: { confirm: 'Are you sure you want to delete this event?' }, class: 'btn btn-mini btn-danger'


.row
.col-md-12
Expand Down

0 comments on commit 04290cc

Please sign in to comment.