From e607aca68015b7cd339496311e92b62941df00a9 Mon Sep 17 00:00:00 2001 From: Your Name <01namangupta@gmail.com> Date: Fri, 13 Oct 2017 02:39:36 +0530 Subject: [PATCH] user ability for registration is used for chcking whether a user can register or not --- app/views/proposals/_tooltip.html.haml | 2 +- app/views/proposals/index.html.haml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/proposals/_tooltip.html.haml b/app/views/proposals/_tooltip.html.haml index dba9c991..b10b5a7a 100644 --- a/app/views/proposals/_tooltip.html.haml +++ b/app/views/proposals/_tooltip.html.haml @@ -1,6 +1,6 @@ - progress_status = event.progress_status %ul.list-unstyled - - if @conference.registration_open? || (@conference.user_registered? current_user) + - if can? :create, @conference.registrations.new %li{'class'=>class_for_todo(progress_status['registered'])} %span{'class'=>icon_for_todo(progress_status['registered'])} - if progress_status['registered'] diff --git a/app/views/proposals/index.html.haml b/app/views/proposals/index.html.haml index ac833747..d22c325e 100644 --- a/app/views/proposals/index.html.haml +++ b/app/views/proposals/index.html.haml @@ -48,7 +48,7 @@ The more information you add to your proposal, the more likely it is that the conference organizers accept your proposal. %br It will also be more likely that visitors find your proposal interesting enough to attend. - - if (@conference.registration_open?) && !(@conference.user_registered? current_user) + - if can? :create, @conference.registrations.new %p %strong Why do I need to register to the conference? @@ -74,7 +74,7 @@ %td.col-md-2{style: "padding:20px 8px 20px 8px;"} = link_to 'Complete your proposal', 'javascript: void(0)', "type"=>"button", "data-trigger"=>"focus", "data-toggle"=>"popover", "title"=>"Your todo list", "data-content"=>"#{render partial: 'tooltip', locals: { event: event} }" - - if (@conference.registration_open?) || (@conference.user_registered? current_user) + - if can? :create, @conference.registrations.new - progress_percentage = event.calculate_progress .progress %div{class: "progress-bar #{event_progress_color(progress_percentage)}", style: "width:#{progress_percentage}%;"}