From 393f26c6798b001975981eda2a7a7520f79c5772 Mon Sep 17 00:00:00 2001 From: Stella Rouzi Date: Thu, 11 Jun 2015 15:15:02 +0300 Subject: [PATCH] De-activate buttons in registrations#show when conference has ended, so that user cannot edit registration details after the conference is over. --- app/views/conference_registrations/show.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/conference_registrations/show.html.haml b/app/views/conference_registrations/show.html.haml index 898493f2..298a1da3 100644 --- a/app/views/conference_registrations/show.html.haml +++ b/app/views/conference_registrations/show.html.haml @@ -101,9 +101,9 @@ .col-md-12 -if @registration .btn-group-vertical.pull-right - = link_to 'Edit your Registration', edit_conference_conference_registrations_path(@conference.short_title), class: 'btn btn-success' + = link_to 'Edit your Registration', edit_conference_conference_registrations_path(@conference.short_title), class: 'btn btn-success', disabled: @conference.end_date < Date.today = link_to 'Unregister', conference_conference_registrations_path(@conference.short_title), - method: :delete, class: 'btn btn-danger btn-xs', confirm: 'Are you sure you want to unregister?' + method: :delete, class: 'btn btn-danger btn-xs', confirm: 'Are you sure you want to unregister?', disabled: @conference.end_date < Date.today - else = link_to 'Register', new_conference_conference_registrations_path(@conference.short_title), class: 'btn btn-success btn-lg pull-right'