From b77994ac1f25eeb5229fc2b7c2f9d0e55d35d776 Mon Sep 17 00:00:00 2001 From: Erez Freiberger Date: Sun, 10 Feb 2019 02:31:32 +0200 Subject: [PATCH 1/2] remove early arrival and has ticket from people csv --- app/models/person.rb | 2 -- spec/models/person_spec.rb | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/app/models/person.rb b/app/models/person.rb index 1b2e40f1..35b6eebe 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -37,14 +37,12 @@ class Person < ActiveRecord::Base scope :in_camp, -> { joins(:camp) } def self.to_csv - humanize = lambda { |x| x ? "Yes" : "No" } CSV.generate(headers: true) do |csv| csv << CSV_ATTRIBUTES.map{ |attr| attr.titleize} Person.includes(:camp, :roles).where(:camps => {:event_id => Rails.application.config.default_event}).each do |p| csv << [ p.email, p.name, p.phone_number, p.roles.pluck(:identifier).join("|"), p.camp.en_name, p.camp.id, - humanize.call(p.needs_early_arrival), humanize.call(p.has_ticket) ] end end diff --git a/spec/models/person_spec.rb b/spec/models/person_spec.rb index 239d712e..1d22a8e4 100644 --- a/spec/models/person_spec.rb +++ b/spec/models/person_spec.rb @@ -61,7 +61,7 @@ def person_to_line(p) [p.email, p.name, p.phone_number, p.roles.pluck(:identifier).join('|'), - camp.en_name, camp.id.to_s, "Yes", "No"] + camp.en_name, camp.id.to_s] end describe "#self.to_csv" do From 41ce26987b2094d90903ae53071917ac5df833cc Mon Sep 17 00:00:00 2001 From: Erez Freiberger Date: Sun, 10 Feb 2019 02:31:57 +0200 Subject: [PATCH 2/2] email verification: remove print and make colors important --- app/assets/stylesheets/forms.css.scss | 4 ++-- app/views/camps/_person_fields.haml | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/forms.css.scss b/app/assets/stylesheets/forms.css.scss index ae801b94..66fbe380 100644 --- a/app/assets/stylesheets/forms.css.scss +++ b/app/assets/stylesheets/forms.css.scss @@ -10,10 +10,10 @@ } .email_valid { - background-color: lighten($c-green, 30%); + background-color: lighten($c-green, 30%) !important; } .email_invalid { - background-color: lighten($c-red, 30%); + background-color: lighten($c-red, 30%) !important; } .menu-heading { diff --git a/app/views/camps/_person_fields.haml b/app/views/camps/_person_fields.haml index d1f070f9..48a46bf7 100644 --- a/app/views/camps/_person_fields.haml +++ b/app/views/camps/_person_fields.haml @@ -4,7 +4,6 @@ const email_field = event.target; if (email_field.value != '') { verify_email(email_field.value, function (valid) { - console.log(`email is valid: ${valid}`); if (!valid) { email_field.classList.remove("email_valid"); email_field.classList.add("email_invalid");