aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2017-08-09 16:46:39 +0100
committerStruan Donald <struan@exo.org.uk>2017-08-16 10:42:23 +0100
commitf066a3937216e0cc4dc0413efc8e8f90e79b6066 (patch)
tree46b9dd9d5c71b3ba8b44358e5a2864b33b24f6a1 /web
parent60b941bc7868c4b0a829f7d497262015d6ab69c4 (diff)
enable body users to report problems anonymously
uses the body user but flags the report as anonymous Fixes #fixmystreetforcouncils/207
Diffstat (limited to 'web')
-rw-r--r--web/cobrands/fixmystreet/fixmystreet.js3
-rw-r--r--web/cobrands/fixmystreet/staff.js10
2 files changed, 13 insertions, 0 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js
index 4d38c81d2..291455aa7 100644
--- a/web/cobrands/fixmystreet/fixmystreet.js
+++ b/web/cobrands/fixmystreet/fixmystreet.js
@@ -912,6 +912,9 @@ fixmystreet.update_pin = function(lonlat, savePushState) {
if (!data.contribute_as.another_user) {
$select.find('option[value=another_user]').remove();
}
+ if (!data.contribute_as.anonymous_user) {
+ $select.find('option[value=anonymous_user]').remove();
+ }
if (!data.contribute_as.body) {
$select.find('option[value=body]').remove();
}
diff --git a/web/cobrands/fixmystreet/staff.js b/web/cobrands/fixmystreet/staff.js
index 66f9411cd..95fbad81a 100644
--- a/web/cobrands/fixmystreet/staff.js
+++ b/web/cobrands/fixmystreet/staff.js
@@ -173,21 +173,31 @@ $.extend(fixmystreet.set_up, {
txt = opt.text;
var $emailInput = $('input[name=email]').add('input[name=rznvy]');
var $nameInput = $('input[name=name]');
+ var $phoneInput = $('input[name=phone]');
var $showNameCheckbox = $('input[name=may_show_name]');
var $addAlertCheckbox = $('#form_add_alert');
if (val === 'myself') {
$emailInput.val($emailInput.prop('defaultValue')).prop('disabled', true);
$nameInput.val($nameInput.prop('defaultValue')).prop('disabled', false);
+ $phoneInput.val($phoneInput.prop('defaultValue')).prop('disabled', false);
$showNameCheckbox.prop('checked', false).prop('disabled', false);
$addAlertCheckbox.prop('checked', true).prop('disabled', false);
} else if (val === 'another_user') {
$emailInput.val('').prop('disabled', false);
$nameInput.val('').prop('disabled', false);
+ $phoneInput.val('').prop('disabled', false);
$showNameCheckbox.prop('checked', false).prop('disabled', true);
$addAlertCheckbox.prop('checked', true).prop('disabled', false);
+ } else if (val === 'anonymous_user') {
+ $emailInput.val('-').prop('disabled', true);
+ $nameInput.val('-').prop('disabled', true);
+ $phoneInput.val('-').prop('disabled', true);
+ $showNameCheckbox.prop('checked', false).prop('disabled', true);
+ $addAlertCheckbox.prop('checked', false).prop('disabled', true);
} else if (val === 'body') {
$emailInput.val('-').prop('disabled', true);
$nameInput.val(txt).prop('disabled', true);
+ $phoneInput.val('-').prop('disabled', true);
$showNameCheckbox.prop('checked', true).prop('disabled', true);
$addAlertCheckbox.prop('checked', false).prop('disabled', true);
}