registration#delete: retain ticket purchases

This commit is contained in:
Rishabh Saxena 2016-09-26 20:57:11 +05:30
parent 85fcd4e1b7
commit d1c0c7d97a
No known key found for this signature in database
GPG key ID: FA3BDC38A9CB6807
5 changed files with 55 additions and 28 deletions

View file

@ -116,8 +116,12 @@
-if @registration
.btn-group-vertical.pull-right
= link_to 'Edit your Registration', edit_conference_conference_registration_path(@conference.short_title), class: 'btn btn-success', disabled: @conference.end_date < Date.today
= link_to 'Unregister', conference_conference_registration_path(@conference.short_title),
method: :delete, class: 'btn btn-danger btn-xs', confirm: 'Are you sure you want to unregister?', disabled: @conference.end_date < Date.today
- if @tickets.any?
= link_to 'Unregister', conference_conference_registration_path(@conference.short_title), method: :delete, class: 'btn btn-danger btn-xs',
data: { confirm: "Your ticket purchases won't be refunded. Are you sure you want to unregister?" }, disabled: @conference.end_date < Date.today
- else
= link_to 'Unregister', conference_conference_registration_path(@conference.short_title), method: :delete, class: 'btn btn-danger btn-xs',
data: { confirm: "You haven't purchased any ticket. Are you sure you want to unregister?" }, disabled: @conference.end_date < Date.today
- else
= link_to 'Register', new_conference_conference_registration_path(@conference.short_title), class: 'btn btn-success btn-lg pull-right'