-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
31e15e7
commit 904a6c3
Showing
9 changed files
with
143 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
#googlemap{ | ||
height: 500px; | ||
height: 400px; | ||
width: 500px; | ||
margin: 0 auto; | ||
img { | ||
max-width: none; | ||
} | ||
} | ||
|
||
span#geocoding_target{ | ||
font-weight: bold; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
var validateControlGroup = function(input){ | ||
_.each($(input).find('input, select'), function(self){ | ||
Meteor.call('validate_input', $(self).val(), $(self).data('id'), $(self).data('validate'), function(err, res){ | ||
if(err){ | ||
$(input).addClass('error'); | ||
$(input).removeClass('success'); | ||
if($(input).find('.help-inline')){ | ||
$(input).find('.help-inline').html(__(err.reason)); | ||
} | ||
ok = false; | ||
} else { | ||
$(input).removeClass('error'); | ||
$(input).addClass('success'); | ||
if($(input).find('.help-inline')){ | ||
$(input).find('.help-inline').html('Ok!'); | ||
} | ||
} | ||
}); | ||
}); | ||
}; | ||
|
||
|
||
Template.profile_creation.events = { | ||
'submit form': function(e){ | ||
e.preventDefault(); | ||
var res = {}; | ||
|
||
// validate all input | ||
_.each($('form .control-group'),function(input){ | ||
validateControlGroup(input); | ||
}); | ||
|
||
var values = {}; | ||
var docid; | ||
_.each($('form input, form select'), function(input){ | ||
docid = $(input).data('id'); | ||
if(docid){ | ||
values[docid] = $(input).val(); | ||
} | ||
}); | ||
|
||
Meteor.call('update_profile', values); | ||
}, | ||
'blur form input': function(e){ | ||
e.preventDefault(); | ||
var element = e.target; | ||
var parent = $(element).parents(".control-group"); | ||
|
||
_.each($(parent), function(input){ | ||
validateControlGroup(input); | ||
}) | ||
}, | ||
'change form select': function(e){ | ||
e.preventDefault(); | ||
var element = e.target; | ||
var parent = $(element).parents(".control-group"); | ||
|
||
_.each($(parent), function(input){ | ||
validateControlGroup(input); | ||
}) | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters