From 62f94b1ecd920517dcbc1b8684984e6b74d82fee Mon Sep 17 00:00:00 2001 From: Godwin Date: Thu, 14 Jul 2016 16:54:32 -0700 Subject: [PATCH] Initial work on questions and payment and fix for confirmation email --- app/assets/stylesheets/_application.scss | 35 +++++++++++++++------- app/controllers/application_controller.rb | 2 +- app/controllers/conferences_controller.rb | 10 ++++++- app/helpers/application_helper.rb | 1 + app/views/conferences/_hosting.html.haml | 2 +- app/views/conferences/_payment.html.haml | 4 +-- app/views/conferences/_questions.html.haml | 7 +++-- config/locales/en.yml | 11 +++---- config/locales/es.yml | 10 +++---- 9 files changed, 54 insertions(+), 28 deletions(-) diff --git a/app/assets/stylesheets/_application.scss b/app/assets/stylesheets/_application.scss index c17bf46..ac10e75 100644 --- a/app/assets/stylesheets/_application.scss +++ b/app/assets/stylesheets/_application.scss @@ -605,10 +605,10 @@ input { content: '+'; border: 0; font-size: 2.5em; - top: 0;//-0.25em; - left: 0.175em; - // top: -0.125em; - // left: 0.05em; + // top: 0;//-0.25em; + // left: 0.175em; + top: -0.15em; + left: 0.05em; line-height: 1em; color: #FFF; height: 1em; @@ -741,6 +741,10 @@ form { height: 2.6em; } } + + &.centered { + text-align: center; + } } #main .columns th form { @@ -1158,6 +1162,10 @@ ul.warnings li, } } +.clearfix { + @include clearfix; +} + .flow-steps { ul { display: block; @@ -2281,29 +2289,34 @@ html :focus { } } -#main form.payment { - text-align: center; +#main form.custom-payment { + // text-align: center; input[type="number"] { - margin-top: 1em; + /*margin-top: 1em; font-size: 1.5em; text-align: center; - width: 4em; height: 1.9em; border: 0; @include default-box-shadow(top); background-color: $black; color: $colour-3; - vertical-align: bottom; + vertical-align: bottom;*/ + width: 4em; + margin-right: 0.5em; } - > button { + button { background-color: $colour-1; } .currency { color: #888; - font-size: 1.667em; + font-size: 1.5em; + } + + .number-field { + margin-bottom: 0; } } diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 03bf089..96aeaeb 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -235,7 +235,7 @@ class ApplicationController < LinguaFrancaApplicationController end expiry ||= (Time.now + 12.hours) session[:confirm_uid] = user.id - UserMailer.send_mail :email_confirmation do + UserMailer.send_mail! :email_confirmation do EmailConfirmation.create(user_id: user.id, expiry: expiry, url: url) end end diff --git a/app/controllers/conferences_controller.rb b/app/controllers/conferences_controller.rb index b092a64..17764fe 100644 --- a/app/controllers/conferences_controller.rb +++ b/app/controllers/conferences_controller.rb @@ -2109,7 +2109,15 @@ class ConferencesController < ApplicationController ] steps -= [:questions, :payment] unless status == :open - steps -= [:hosting] unless @registration.present? && view_context.same_city?(@registration.city, @conference.location) + if @registration.present? + if view_context.same_city?(@registration.city, @conference.location) + steps -= [:questions] + else + steps -= [:hosting] + end + else + steps -= [:hosting, :questions] + end steps -= [:administration] unless @registration.present? && @conference.host?(current_user) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 05b5a06..ac193d5 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1112,6 +1112,7 @@ module ApplicationHelper lang: options[:lang], min: options[:min], max: options[:max], + step: options[:step], aria: description_id ? { describedby: description_id } : nil } diff --git a/app/views/conferences/_hosting.html.haml b/app/views/conferences/_hosting.html.haml index f95b4c3..0de289c 100644 --- a/app/views/conferences/_hosting.html.haml +++ b/app/views/conferences/_hosting.html.haml @@ -13,7 +13,7 @@ = selectfield :first_day, @hosting_data['availability'][0] || @this_conference.start_date, conference_days_options_list(:before) = selectfield :last_day, @hosting_data['availability'][1] || @this_conference.start_date, conference_days_options_list(:after) = checkboxes :considerations, [:vegan, :smoking, :pets, :quiet], @hosting_data['considerations'], 'articles.conference_registration.host.considerations', heading: 'articles.conference_registration.headings.host.considerations', help: 'articles.conference_registration.paragraphs.host.considerations', vertical: true - = textarea :notes, @hosting_data['notes'], heading: 'articles.conference_registration.headings.host.notes', help: 'articles.conference_registration.paragraphs.host.notes', edit_on: :focus + = textarea :notes, @hosting_data['notes'], help: 'articles.conference_registration.paragraphs.host.notes', edit_on: :focus .actions.next-prev = button_tag (params[:step] == :save ? :save : :next), value: :hosting = button_tag :previous, value: :prev_contact_info, class: :subdued, formnovalidate: true diff --git a/app/views/conferences/_payment.html.haml b/app/views/conferences/_payment.html.haml index 1f28345..12f16a3 100644 --- a/app/views/conferences/_payment.html.haml +++ b/app/views/conferences/_payment.html.haml @@ -11,9 +11,9 @@ =_! '$50.00' = button_tag :amount_100, :name => :amount, :value => '100.0' do = _!'$100.00' - = form_tag register_path(@this_conference.slug), :class => :payment do + = form_tag register_path(@this_conference.slug), :class => ['custom-payment', :centered] do %span.currency=_!'$' - = number_field_tag :amount, nil, :required => true, :step => 0.01, :min => 0.00 + = numberfield :amount, nil, :required => true, :step => 0.01, :min => 0.00, label: false = button_tag :custom_amount, :value => :payment %p=_'articles.conference_registration.paragraphs.currency','(amounts are in $USD)' = form_tag register_path(@this_conference.slug), :class => :payment do diff --git a/app/views/conferences/_questions.html.haml b/app/views/conferences/_questions.html.haml index c8f211f..50231d1 100644 --- a/app/views/conferences/_questions.html.haml +++ b/app/views/conferences/_questions.html.haml @@ -1,10 +1,13 @@ = columns(medium: 12) do %h2=_'articles.conference_registration.headings.Registration_Info' = columns(medium: 12) do - %p=_'articles.conference_registration.paragraphs.Registration_Info', :p -= form_tag register_path(@this_conference.slug) do + %p=_'articles.conference_registration.paragraphs.Registration_Info', :p, vars: { city: @this_conference.location.city } += form_tag register_path(@this_conference.slug), class: [:centered, :clearfix] do = columns(medium: 12) do = radiobuttons :housing, ConferenceRegistration.all_housing_options, @registration.housing, 'articles.conference_registration.questions.housing', heading: 'articles.conference_registration.headings.housing', vertical: true, big: true, inline: true + = fieldset :hosting_dates, heading: 'articles.conference_registration.headings.arrival_and_departure' do + = selectfield :arrival, @registration.arrival || @this_conference.start_date, conference_days_options_list(:before) + = selectfield :departure, @registration.departure || @this_conference.start_date, conference_days_options_list(:after) = radiobuttons :bike, ConferenceRegistration.all_bike_options, @registration.bike, 'articles.conference_registration.questions.bike', heading: 'articles.conference_registration.headings.bike', inline: true, big: true = radiobuttons :food, ConferenceRegistration.all_food_options, @registration.food, 'articles.conference_registration.questions.food', heading: 'articles.conference_registration.headings.food', inline: true, big: true = columns(medium: 12) do diff --git a/config/locales/en.yml b/config/locales/en.yml index 935b73c..ad3bc9a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -5366,7 +5366,7 @@ en: location: Where are you coming from? name: What is your name? Payment: Payment - payment: Fees paid + payment: Payment Allergies: Allergies Stats: Stats Workshops: Workshops @@ -5393,19 +5393,20 @@ en: space: Available Space availability: Availability address: Address + notes: Notes paragraphs: Policy_Agreement: Ensuring that all attendees feel welcome, safe, and respected at all times is especially important to us all. Please ensure that you have fully read and understand our safer spaces policy below, if you have any questions or concerns you can reach out to the organizers at any time. Confirm_Agreement: By clicking the "I Agree" button, you are pledging to do your best to uphold Bike!Bike!'s safer space agreement. Thank you! Registration_Info: Please fill in this registration form to help us prepare - for your arrival to Guadalajara. If you wish to ask questions or tell us - information we did not ask, please fill in the "More Info" field at the - bottom of the page. + for your arrival to %{city}. If you wish to ask questions or tell us + information we did not ask, please fill in the preferences field at the + bottom of the page or use the contact us link. Payment: Thank you for completing your registration. We'll see you at Bike!Bike! Payment is by donation and can be done now or upon arrival but to help us fund the conference, we ask that you pay the registration donation as soon as you can. - currency: "(amounts are in $USD)" + currency: "(amounts are in USD)" email_confirm: Go to your inbox! You should see an email from Bike!Bike! in just a few moments. There will be a link in the email for you to click on. Check your spam box if you do not see it. If you encounter any problems, diff --git a/config/locales/es.yml b/config/locales/es.yml index 42441f4..0f9a488 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -729,7 +729,7 @@ es: email_confirm: Confirmar correo electrónico housing: ¿Necesitas hospedaje? other: ¿Hay algo más que quisieras decirnos? - payment: Cargos pagados + payment: Pago payment_confirm: Por favor confirma tu pago city: Ciudad date: Fecha @@ -737,9 +737,9 @@ es: fees_paid: Cargos pagados paragraphs: Registration_Info: Por favor llena esta forma de registro para ayudarnos a - prepararnos para tu llegada a Guadalajara. Si tienes alguna pregunta o información - que no te hayamos pedido por favor llena el campo "Más información" al final - de la página. + prepararnos para tu llegada a %{city}. Si tienes alguna pregunta o información + que no te hayamos pedido por favor llena el campo preferencias al final + de la página o utilice el enlace contáctenos. Payment: Las y los esperamos del 1 al 4 de octubre del 2015.Más información en: bikebike@gdlenbici.org Workshops: 'Título de la actividad: Que necesitas? Tipo de espacio? Tema? @@ -756,7 +756,7 @@ es: al ser confirmada podrás completar el registro, agregar talleres y pagar el donativo de registro. Si ya te registraste puedes re-confirmar tu dirección de e-mail para modificar los detalles de tu registro. - currency: (cantidades en dólares americanos $USD) + currency: (cantidades en dólares americanos USD) done: ¡Gracias por registrarte para Bike!Bike! email_confirm: ¡Ve a tu bandeja de entrada! Deberías ver un e-mail por parte de Bike!Bike! en unos momentos. Contendrá un enlace sobre el cual debes