From 1ecf484aaed07ebd6cb38c78a27b70a5aaaf4db5 Mon Sep 17 00:00:00 2001 From: Guy Warburg Date: Wed, 15 Mar 2017 17:22:23 +0200 Subject: [PATCH 1/3] Added fun flow to new --- locales/en/camps.json | 3 +++ locales/he/camps.json | 3 +++ public/scripts/camps.js | 3 +++ routes/api_camps_routes.js | 3 +++ views/pages/camps/new.jade | 18 ++++++++++++++++++ 5 files changed, 30 insertions(+) diff --git a/locales/en/camps.json b/locales/en/camps.json index 27d71fbb9..7a88b7bfb 100644 --- a/locales/en/camps.json +++ b/locales/en/camps.json @@ -91,6 +91,9 @@ "close": "Close", "website_publication": "Website Publication", "contact_person_id": "Contact Person", + "contact_person_name": "Contact Person Name", + "contact_person_email": "Contact Person Email", + "contact_person_phone": "Contact Person Phone", "facebook_page_url": "Facebook Page Link" }, "join": { diff --git a/locales/he/camps.json b/locales/he/camps.json index bc8f687b5..1ab8a4247 100644 --- a/locales/he/camps.json +++ b/locales/he/camps.json @@ -91,6 +91,9 @@ "close": "סגור", "website_publication": "פרסום באתר", "contact_person_id": "איש קשר", + "contact_person_name": "שם איש קשר", + "contact_person_email": "אימייל איש קשר", + "contact_person_phone": "טלפון אישר קשר", "facebook_page_url": "קישור לעמוד פייסבוק" }, "join": { diff --git a/public/scripts/camps.js b/public/scripts/camps.js index a78c12aca..62473642f 100644 --- a/public/scripts/camps.js +++ b/public/scripts/camps.js @@ -323,6 +323,9 @@ $('#camp_create_save').click(function() { camp_desc_en: $('#create_camp_desc_en').val(), contact_person_id: $('#create_camp_contact_person_id option:selected').val(), facebook_page_url: $('#create_camp_facebook_page_url').val(), + contact_person_name: $('#create_camp_contact_person_name').val(), + contact_person_email: $('#create_camp_contact_person_email').val(), + contact_person_phone: $('#create_camp_contact_person_phone').val(), main_contact: $('#create_camp_main_contact option:selected').val(), moop_contact: $('#create_camp_moop_contact option:selected').val(), safety_contact: $('#create_camp_safety_contact option:selected').val(), diff --git a/routes/api_camps_routes.js b/routes/api_camps_routes.js index 43e2cdbb5..60d7f7d93 100644 --- a/routes/api_camps_routes.js +++ b/routes/api_camps_routes.js @@ -54,6 +54,9 @@ module.exports = function (app, passport) { type: req.body.type, contact_person_id: req.body.contact_person_id, facebook_page_url: req.body.facebook_page_url, + contact_person_name: req.body.contact_person_name, + contact_person_email: req.body.contact_person_email, + contact_person_phone: req.body.contact_person_phone, accept_families: req.body.accept_families, main_contact: req.body.main_contact, moop_contact: req.body.moop_contact, diff --git a/views/pages/camps/new.jade b/views/pages/camps/new.jade index 57090f2c4..69766af16 100644 --- a/views/pages/camps/new.jade +++ b/views/pages/camps/new.jade @@ -42,6 +42,18 @@ block content .col-xs-12 label(for='create_camp_facebook_page_url')=t('camps:new.facebook_page_url') input.form-control(id='create_camp_facebook_page_url', name='facebook_page_url') + .col-md-4 + .col-xs-12 + label(for='create_camp_contact_person_name')=t('camps:new.contact_person_name') + input.form-control(id='create_camp_contact_person_name', name='contact_person_name') + .col-md-4 + .col-xs-12 + label(for='create_camp_contact_person_email')=t('camps:new.contact_person_email') + input.form-control(id='create_camp_contact_person_email', name='ontact_person_email') + .col-md-4 + .col-xs-12 + label(for='create_camp_contact_person_phone')=t('camps:new.contact_person_phone') + input.form-control(id='create_camp_contact_person_phone', name='contact_person_phone') h4=t('camps:new.contact_card_header') .camp-leaders.panel .panel-body @@ -181,6 +193,12 @@ block content span li.facebook_page_url=t('camps:new.facebook_page_url') span + li.contact_person_name=t('camps:new.contact_person_name') + span + li.contact_person_email=t('camps:new.contact_person_email') + span + li.contact_person_phone=t('camps:new.contact_person_phone') + span li.main_contact=t('camps:new.main_contact') span li.moop_contact=t('camps:new.moop_contact') From e8a2018d500a45c4749641fa51e07f251f5c003d Mon Sep 17 00:00:00 2001 From: Guy Warburg Date: Wed, 15 Mar 2017 17:30:51 +0200 Subject: [PATCH 2/3] =?UTF-8?q?added=20=E2=80=98accept=20families=E2=80=99?= =?UTF-8?q?=20field?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/scripts/camps.js | 1 + views/pages/camps/new.jade | 48 ++++++++++++++++++++++---------------- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/public/scripts/camps.js b/public/scripts/camps.js index 62473642f..a4738eaaa 100644 --- a/public/scripts/camps.js +++ b/public/scripts/camps.js @@ -326,6 +326,7 @@ $('#camp_create_save').click(function() { contact_person_name: $('#create_camp_contact_person_name').val(), contact_person_email: $('#create_camp_contact_person_email').val(), contact_person_phone: $('#create_camp_contact_person_phone').val(), + accept_families: $('#create_camp_accept_families:checked').length, main_contact: $('#create_camp_main_contact option:selected').val(), moop_contact: $('#create_camp_moop_contact option:selected').val(), safety_contact: $('#create_camp_safety_contact option:selected').val(), diff --git a/views/pages/camps/new.jade b/views/pages/camps/new.jade index 69766af16..33bac663c 100644 --- a/views/pages/camps/new.jade +++ b/views/pages/camps/new.jade @@ -34,26 +34,32 @@ block content .camp-publication.panel .panel-body .information - .col-md-6 - .col-xs-12 - label(for='create_camp_contact_person_id')=t('camps:new.contact_person_id') - select.form-control(id='create_camp_contact_person_id', name='contact_person_id') - .col-md-6 - .col-xs-12 - label(for='create_camp_facebook_page_url')=t('camps:new.facebook_page_url') - input.form-control(id='create_camp_facebook_page_url', name='facebook_page_url') - .col-md-4 - .col-xs-12 - label(for='create_camp_contact_person_name')=t('camps:new.contact_person_name') - input.form-control(id='create_camp_contact_person_name', name='contact_person_name') - .col-md-4 - .col-xs-12 - label(for='create_camp_contact_person_email')=t('camps:new.contact_person_email') - input.form-control(id='create_camp_contact_person_email', name='ontact_person_email') - .col-md-4 - .col-xs-12 - label(for='create_camp_contact_person_phone')=t('camps:new.contact_person_phone') - input.form-control(id='create_camp_contact_person_phone', name='contact_person_phone') + .row + .col-md-4 + .col-xs-12 + label(for='create_camp_contact_person_id')=t('camps:new.contact_person_id') + select.form-control(id='create_camp_contact_person_id', name='contact_person_id') + .col-md-4 + .col-xs-12 + label(for='create_camp_facebook_page_url')=t('camps:new.facebook_page_url') + input.form-control(id='create_camp_facebook_page_url', name='facebook_page_url') + .col-md-4 + .col-xs-12 + label(for='create_camp_accept_families')=t('camps:camps.accept_families') + input.checkbox(id='create_camp_accept_families', type='checkbox', name='accept_families') + .row + .col-md-4 + .col-xs-12 + label(for='create_camp_contact_person_name')=t('camps:new.contact_person_name') + input.form-control(id='create_camp_contact_person_name', name='contact_person_name') + .col-md-4 + .col-xs-12 + label(for='create_camp_contact_person_email')=t('camps:new.contact_person_email') + input.form-control(id='create_camp_contact_person_email', name='ontact_person_email') + .col-md-4 + .col-xs-12 + label(for='create_camp_contact_person_phone')=t('camps:new.contact_person_phone') + input.form-control(id='create_camp_contact_person_phone', name='contact_person_phone') h4=t('camps:new.contact_card_header') .camp-leaders.panel .panel-body @@ -193,6 +199,8 @@ block content span li.facebook_page_url=t('camps:new.facebook_page_url') span + li.accept_families=t('camps:camps.accept_families') + span li.contact_person_name=t('camps:new.contact_person_name') span li.contact_person_email=t('camps:new.contact_person_email') From d7cc5201a51f7fd4bcf8dd89c1896d5fb0841794 Mon Sep 17 00:00:00 2001 From: Guy Warburg Date: Wed, 15 Mar 2017 17:43:32 +0200 Subject: [PATCH 3/3] added fields to edit screen and throughout the api --- locales/en/camps.json | 3 +++ locales/he/camps.json | 3 +++ public/scripts/camps.js | 3 +++ routes/api_camps_routes.js | 3 +++ views/pages/camps/edit.jade | 48 ++++++++++++++++++++++++------------- views/pages/camps/new.jade | 2 +- 6 files changed, 44 insertions(+), 18 deletions(-) diff --git a/locales/en/camps.json b/locales/en/camps.json index 7a88b7bfb..3da24e01b 100644 --- a/locales/en/camps.json +++ b/locales/en/camps.json @@ -202,6 +202,9 @@ "location_area": "Area", "website_publication": "Website Publication", "contact_person_id": "Contact Person", + "contact_person_name": "Contact Person Name", + "contact_person_email": "Contact Person Email", + "contact_person_phone": "Contact Person Phone", "facebook_page_url": "Facebook Page Link", "upload": "Files & Forms Upload", "upload_header": "Upload Files", diff --git a/locales/he/camps.json b/locales/he/camps.json index 1ab8a4247..447176496 100644 --- a/locales/he/camps.json +++ b/locales/he/camps.json @@ -202,6 +202,9 @@ "location_area": "אזור", "upload": "העלאת מסמכים וקבצים", "upload_header": "העלאת קבצים", + "contact_person_name": "שם איש קשר", + "contact_person_email": "אימייל איש קשר", + "contact_person_phone": "טלפון אישר קשר", "security_file": "תיק בטיחות" }, "program": { diff --git a/public/scripts/camps.js b/public/scripts/camps.js index a4738eaaa..c9d023138 100644 --- a/public/scripts/camps.js +++ b/public/scripts/camps.js @@ -249,6 +249,9 @@ $('#camp_edit_save').click(function() { camp_desc_en: $('#edit_camp_desc_en').val(), contact_person_id: $('#edit_camp_contact_person_id option:selected').attr('value') || $('label[for="edit_camp_contact_person_id"]').attr('data-camp-contact-person-id'), facebook_page_url: $('#edit_camp_facebook_page_url').val(), + contact_person_name: $('#edit_camp_contact_person_name').val(), + contact_person_email: $('#edit_camp_contact_person_email').val(), + contact_person_phone: $('#edit_camp_contact_person_phone').val(), main_contact: $('#edit_camp_main_contact option:selected').val(), moop_contact: $('#edit_camp_moop_contact option:selected').val(), safety_contact: $('#edit_camp_safety_contact option:selected').val(), diff --git a/routes/api_camps_routes.js b/routes/api_camps_routes.js index 60d7f7d93..8c5316890 100644 --- a/routes/api_camps_routes.js +++ b/routes/api_camps_routes.js @@ -124,6 +124,9 @@ module.exports = function (app, passport) { contact_person_id: req.body.contact_person_id, facebook_page_url: req.body.facebook_page_url, accept_families: req.body.accept_families, + contact_person_name: req.body.contact_person_name, + contact_person_email: req.body.contact_person_email, + contact_person_phone: req.body.contact_person_phone, main_contact: req.body.main_contact, moop_contact: req.body.moop_contact, safety_contact: req.body.safety_contact, diff --git a/views/pages/camps/edit.jade b/views/pages/camps/edit.jade index 14f7592c7..c6d9f0f80 100644 --- a/views/pages/camps/edit.jade +++ b/views/pages/camps/edit.jade @@ -42,23 +42,37 @@ block content .camp-publication.panel .panel-body .information - .col-md-4 - .col-xs-12 - label(for='edit_camp_contact_person_id', data-camp-contact-person-id='#{camp.contact_person_id}') #{t('camps:edit.contact_person_id')}: #{camp.contact_person_id} - select.form-control(id='edit_camp_contact_person_id', name='contact_person_id') - option(selected) --- - .col-md-4 - .col-xs-12 - label(for='edit_camp_facebook_page_url')=t('camps:edit.facebook_page_url') - input.form-control(id='edit_camp_facebook_page_url', name='facebook_page_url', value='#{camp.facebook_page_url}') - .col-md-4 - .col-xs-12 - label(for='edit_camp_accept_families')=t('camps:camps.accept_families') - input.checkbox(id='edit_camp_accept_families', checked='#{camp.accept_families}', type='checkbox', name='accept_families') - script. - // set checkbox status - var checkbox = document.getElementById("edit_camp_accept_families"); - checkbox.checked = checkbox.attributes.checked.value == "1" ? true:false + .row + .col-md-4 + .col-xs-12 + label(for='edit_camp_contact_person_id', data-camp-contact-person-id='#{camp.contact_person_id}') #{t('camps:edit.contact_person_id')}: #{camp.contact_person_id} + select.form-control(id='edit_camp_contact_person_id', name='contact_person_id') + option(selected) --- + .col-md-4 + .col-xs-12 + label(for='edit_camp_facebook_page_url')=t('camps:edit.facebook_page_url') + input.form-control(id='edit_camp_facebook_page_url', name='facebook_page_url', value='#{camp.facebook_page_url}') + .col-md-4 + .col-xs-12 + label(for='edit_camp_accept_families')=t('camps:camps.accept_families') + input.checkbox(id='edit_camp_accept_families', checked='#{camp.accept_families}', type='checkbox', name='accept_families') + script. + // set checkbox status + var checkbox = document.getElementById("edit_camp_accept_families"); + checkbox.checked = checkbox.attributes.checked.value == "1" ? true:false + .row + .col-md-4 + .col-xs-12 + label(for='edit_camp_contact_person_name')=t('camps:edit.contact_person_name') + input.form-control(id='edit_camp_contact_person_name', name='contact_person_name', value='#{camp.contact_person_name}') + .col-md-4 + .col-xs-12 + label(for='edit_camp_contact_person_email')=t('camps:edit.contact_person_email') + input.form-control(id='edit_camp_contact_person_email', name='contact_person_email', value='#{camp.contact_person_email}') + .col-md-4 + .col-xs-12 + label(for='edit_camp_contact_person_phone')=t('camps:edit.contact_person_phone') + input.form-control(id='edit_camp_contact_person_phone', name='contact_person_phone', value='#{camp.contact_person_phone}') h4=t('camps:edit.contact_title') .camp-leaders.panel .panel-body diff --git a/views/pages/camps/new.jade b/views/pages/camps/new.jade index 33bac663c..d17486a8b 100644 --- a/views/pages/camps/new.jade +++ b/views/pages/camps/new.jade @@ -55,7 +55,7 @@ block content .col-md-4 .col-xs-12 label(for='create_camp_contact_person_email')=t('camps:new.contact_person_email') - input.form-control(id='create_camp_contact_person_email', name='ontact_person_email') + input.form-control(id='create_camp_contact_person_email', name='contact_person_email') .col-md-4 .col-xs-12 label(for='create_camp_contact_person_phone')=t('camps:new.contact_person_phone')