From 01abbfecc4cb2d68c47328f4f6d6a6456a971012 Mon Sep 17 00:00:00 2001 From: namangupta01 <01namangupta@gmail.com> Date: Fri, 4 Aug 2017 01:29:30 +0530 Subject: [PATCH 1/4] Speaker is ask to register only when registration_period is set --- app/views/proposals/index.html.haml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/proposals/index.html.haml b/app/views/proposals/index.html.haml index 5ed332dc..43b17199 100644 --- a/app/views/proposals/index.html.haml +++ b/app/views/proposals/index.html.haml @@ -49,6 +49,7 @@ %br It will also be more likely that visitors find your proposal interesting enough to attend. + - if Conference.where(short_title: params[:conference_id]).first.registration_period %p %strong Why do I need to register to the conference? @@ -73,7 +74,8 @@ = link_to registered_text(event), registrations_conference_program_proposal_path(@conference.short_title, event), class: 'btn btn-xs btn-danger' %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.where(short_title: params[:conference_id]).first.registration_period + = 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} }" - progress_percentage = event.calculate_progress .progress From b1f32caf7cef65358aff15d70f42f90b9848892c Mon Sep 17 00:00:00 2001 From: namangupta01 <01namangupta@gmail.com> Date: Sun, 6 Aug 2017 01:13:14 +0530 Subject: [PATCH 2/4] speaker is only ask to register when registrations are open and speaker haven't registered yet --- app/views/proposals/_tooltip.html.haml | 13 +++++----- app/views/proposals/index.html.haml | 36 ++++++++++++++------------ 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/app/views/proposals/_tooltip.html.haml b/app/views/proposals/_tooltip.html.haml index 168d2d26..dba9c991 100644 --- a/app/views/proposals/_tooltip.html.haml +++ b/app/views/proposals/_tooltip.html.haml @@ -1,11 +1,12 @@ - progress_status = event.progress_status %ul.list-unstyled - %li{'class'=>class_for_todo(progress_status['registered'])} - %span{'class'=>icon_for_todo(progress_status['registered'])} - - if progress_status['registered'] - Speaker(s) registered to the conference - - else - = link_to 'Speaker(s) not registered to the conference', new_conference_conference_registration_path(event.program.conference.short_title) + - if @conference.registration_open? || (@conference.user_registered? current_user) + %li{'class'=>class_for_todo(progress_status['registered'])} + %span{'class'=>icon_for_todo(progress_status['registered'])} + - if progress_status['registered'] + Speaker(s) registered to the conference + - else + = link_to 'Speaker(s) not registered to the conference', new_conference_conference_registration_path(event.program.conference.short_title) %li{'class'=>class_for_todo(progress_status['biographies'])} %span{'class'=>icon_for_todo(progress_status['biographies'])} - if progress_status['biographies'] diff --git a/app/views/proposals/index.html.haml b/app/views/proposals/index.html.haml index 43b17199..ac833747 100644 --- a/app/views/proposals/index.html.haml +++ b/app/views/proposals/index.html.haml @@ -48,13 +48,12 @@ 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.where(short_title: params[:conference_id]).first.registration_period - %p - %strong - Why do I need to register to the conference? - %p - Knowing the number of visitors for the conference helps the organizers plan better. + - if (@conference.registration_open?) && !(@conference.user_registered? current_user) + %p + %strong + Why do I need to register to the conference? + %p + Knowing the number of visitors for the conference helps the organizers plan better. %table.table.table-striped#events - @events.each do |event| @@ -74,15 +73,20 @@ = link_to registered_text(event), registrations_conference_program_proposal_path(@conference.short_title, event), class: 'btn btn-xs btn-danger' %td.col-md-2{style: "padding:20px 8px 20px 8px;"} - - if Conference.where(short_title: params[:conference_id]).first.registration_period - = 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} }" - - - progress_percentage = event.calculate_progress - .progress - %div{class: "progress-bar #{event_progress_color(progress_percentage)}", style: "width:#{progress_percentage}%;"} - = event.progress_status.reject{ |_key, value| value || value.nil? }.length - left - + = 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) + - progress_percentage = event.calculate_progress + .progress + %div{class: "progress-bar #{event_progress_color(progress_percentage)}", style: "width:#{progress_percentage}%;"} + = event.progress_status.reject{ |_key, value| value || value.nil? }.length + left + - else + - progress_list = event.progress_status + - progress_percentage = (100 * progress_list.values.count(true) / (progress_list.values.compact.count-1)).to_s + .progress + %div{class: "progress-bar #{event_progress_color(progress_percentage)}", style: "width:#{progress_percentage}%;"} + = event.progress_status.reject{ |_key, value| value || value.nil? }.length-1 + left %td.col-md-3{style: "padding:20px 0px 20px 0px;"} .pull-right - if event.transition_possible? :confirm 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 3/4] 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}%;"} From a0e3ea75ed1958fe93a0f607f729f10825ceee8c Mon Sep 17 00:00:00 2001 From: Naman Gupta <01namangupta@gmail.com> Date: Thu, 2 Nov 2017 21:44:12 +0530 Subject: [PATCH 4/4] consecutive ruby lines are made into the ruby filter --- app/views/proposals/index.html.haml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/views/proposals/index.html.haml b/app/views/proposals/index.html.haml index d22c325e..bc704296 100644 --- a/app/views/proposals/index.html.haml +++ b/app/views/proposals/index.html.haml @@ -67,7 +67,7 @@ %small.text-muted = event.event_type.title = "(#{event.event_type.length} min)" - = "in #{event.track.name}" if event.track + = "in #{event.traistck.name}" if event.track - if event.require_registration %br = link_to registered_text(event), registrations_conference_program_proposal_path(@conference.short_title, event), class: 'btn btn-xs btn-danger' @@ -81,8 +81,9 @@ = event.progress_status.reject{ |_key, value| value || value.nil? }.length left - else - - progress_list = event.progress_status - - progress_percentage = (100 * progress_list.values.count(true) / (progress_list.values.compact.count-1)).to_s + :ruby + progress_list = event.progress_status + progress_percentage = (100 * progress_list.values.count(true) / (progress_list.values.compact.count-1)).to_s .progress %div{class: "progress-bar #{event_progress_color(progress_percentage)}", style: "width:#{progress_percentage}%;"} = event.progress_status.reject{ |_key, value| value || value.nil? }.length-1