summaryrefslogtreecommitdiffstats
path: root/welco/static
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2015-11-18 13:40:03 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2015-11-18 13:40:03 (GMT)
commitfac2fda8b9d7a1e933d50f775efc58ad27a03b85 (patch)
tree8bf64cec17cccac70f9c5b13fca31337fa2f5d43 /welco/static
parent39a6382bbaa072bce76ebb29b1bcc935964346ce (diff)
downloadwelco-fac2fda8b9d7a1e933d50f775efc58ad27a03b85.zip
welco-fac2fda8b9d7a1e933d50f775efc58ad27a03b85.tar.gz
welco-fac2fda8b9d7a1e933d50f775efc58ad27a03b85.tar.bz2
misc: require post date to be set (#9016)
Diffstat (limited to 'welco/static')
-rw-r--r--welco/static/js/welco.js24
1 files changed, 23 insertions, 1 deletions
diff --git a/welco/static/js/welco.js b/welco/static/js/welco.js
index 1a54055..e50ffb0 100644
--- a/welco/static/js/welco.js
+++ b/welco/static/js/welco.js
@@ -14,6 +14,11 @@ $(function() {
$(zone).removeClass('has-page-displayed');
$(zone).removeClass('has-contact-displayed');
$('#create-new-contact').off('click').on('click', window.displayPopup);
+ if ($('#id_post_date').length && !$('#id_post_date').val()) {
+ $('div.qualif button.done').attr('disabled', 'disabled');
+ } else {
+ $('div.qualif button.done').removeAttr('disabled');
+ }
if (typeof(callback) === 'function') callback();
},
error: function(error) { console.log(':(', error); }
@@ -77,6 +82,11 @@ $(function() {
var zone = $('.cell.qualif');
$(zone).find('> div').replaceWith(data);
$(zone).find('select').select2();
+ if ($('#id_post_date').length && !$('#id_post_date').val()) {
+ $('div.qualif button.done').attr('disabled', 'disabled');
+ } else {
+ $('div.qualif button.done').removeAttr('disabled');
+ }
}
});
}
@@ -95,7 +105,14 @@ $(function() {
source_pk: source_pk},
method: 'POST',
dataType: 'html',
- success: function(data) { $('.cell.qualif > div').replaceWith(data); },
+ success: function(data) {
+ $('.cell.qualif > div').replaceWith(data);
+ if ($('#id_post_date').length && !$('#id_post_date').val()) {
+ $('div.qualif button.done').attr('disabled', 'disabled');
+ } else {
+ $('div.qualif button.done').removeAttr('disabled');
+ }
+ },
error: function(error) { console.log(':(', error); }
});
return false;
@@ -167,6 +184,11 @@ $(function() {
$('div.source .active').data('registered-mail-number', registered_mail_number);
$('div.source .active').data('mail-number', mail_number);
$('#source-mainarea form').effect('highlight');
+ if ($('#id_post_date').length && !$('#id_post_date').val()) {
+ $('div.qualif button.done').attr('disabled', 'disabled');
+ } else {
+ $('div.qualif button.done').removeAttr('disabled');
+ }
},
error: function(error) { console.log(':(', error); }
});