Skip to content

Commit

Permalink
Merge pull request #18 from asihud/add-website-fields
Browse files Browse the repository at this point in the history
Add website fields
  • Loading branch information
asihud authored Mar 15, 2017
2 parents e6c229a + d7cc520 commit 76e8560
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 25 deletions.
6 changes: 6 additions & 0 deletions locales/en/camps.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -199,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",
Expand Down
6 changes: 6 additions & 0 deletions locales/he/camps.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@
"close": "סגור",
"website_publication": "פרסום באתר",
"contact_person_id": "איש קשר",
"contact_person_name": "שם איש קשר",
"contact_person_email": "אימייל איש קשר",
"contact_person_phone": "טלפון אישר קשר",
"facebook_page_url": "קישור לעמוד פייסבוק"
},
"join": {
Expand Down Expand Up @@ -199,6 +202,9 @@
"location_area": "אזור",
"upload": "העלאת מסמכים וקבצים",
"upload_header": "העלאת קבצים",
"contact_person_name": "שם איש קשר",
"contact_person_email": "אימייל איש קשר",
"contact_person_phone": "טלפון אישר קשר",
"security_file": "תיק בטיחות"
},
"program": {
Expand Down
7 changes: 7 additions & 0 deletions public/scripts/camps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -323,6 +326,10 @@ $('#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(),
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(),
Expand Down
6 changes: 6 additions & 0 deletions routes/api_camps_routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -121,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,
Expand Down
48 changes: 31 additions & 17 deletions views/pages/camps/edit.jade
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
42 changes: 34 additions & 8 deletions views/pages/camps/new.jade
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +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')
.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='contact_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
Expand Down Expand Up @@ -181,6 +199,14 @@ 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')
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')
Expand Down

0 comments on commit 76e8560

Please sign in to comment.