aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2013-09-17 17:46:13 +0100
committerStruan Donald <struan@exo.org.uk>2013-09-17 17:46:13 +0100
commitba8091c297f5074ddbd8ec7899793835b5319d8b (patch)
treee09a32c9cf949d7bac3e3646499d6eaae7ed37dc
parentb5fee0ef1e6c883f3c569812cdaf0fbfb0e7fa6a (diff)
Save last show name publicly status
Stops people who never want to show their name having to click the option every time. Fixes #134
-rw-r--r--locale/FixMyStreetMobileApp.po10
-rw-r--r--locale/en_GB.UTF-8/LC_MESSAGES/FixMyStreetMobileApp.po10
-rw-r--r--src/js/views/submit.js9
-rw-r--r--src/templates/en/submit_confirm.html2
-rw-r--r--src/templates/en/submit_name.html2
-rw-r--r--templates/submit_confirm.html2
-rw-r--r--templates/submit_name.html2
7 files changed, 20 insertions, 17 deletions
diff --git a/locale/FixMyStreetMobileApp.po b/locale/FixMyStreetMobileApp.po
index dc2a5c4..38ae830 100644
--- a/locale/FixMyStreetMobileApp.po
+++ b/locale/FixMyStreetMobileApp.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 1.0\n"
"Report-Msgid-Bugs-To: struan@mysociety.org\n"
-"POT-Creation-Date: 2013-09-16 17:29+0100\n"
+"POT-Creation-Date: 2013-09-17 17:25+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <team@fixmystreet.com>\n"
@@ -193,7 +193,7 @@ msgstr ""
msgid "Oh dear - we can't detect an internet connection. However you can still start a report now and complete it later, by going to 'drafts' when you're back online."
msgstr ""
-#: templates/submit_confirm.html:21 templates/submit_name.html:26
+#: templates/submit_confirm.html:23 templates/submit_name.html:26
msgid "Optionally enter your phone number"
msgstr ""
@@ -249,7 +249,7 @@ msgstr ""
msgid "Please enter your full name, councils need this information - if you do not wish your name to be shown on the site, untick the box below"
msgstr ""
-#: templates/strings.js:8 templates/submit_confirm.html:18 templates/submit_name.html:23
+#: templates/strings.js:8 templates/submit_confirm.html:20 templates/submit_name.html:23
msgid "Please enter your name"
msgstr ""
@@ -277,7 +277,7 @@ msgstr ""
msgid "Remove Photo"
msgstr ""
-#: templates/submit_confirm.html:29 templates/submit_password.html:15
+#: templates/submit_confirm.html:31 templates/submit_password.html:15
msgid "Report"
msgstr ""
@@ -309,7 +309,7 @@ msgstr ""
msgid "Send confirmation email"
msgstr ""
-#: templates/submit_confirm.html:25 templates/submit_name.html:31 templates/submit_password.html:33
+#: templates/submit_confirm.html:27 templates/submit_name.html:31 templates/submit_password.html:33
msgid "Show my name publicly"
msgstr ""
diff --git a/locale/en_GB.UTF-8/LC_MESSAGES/FixMyStreetMobileApp.po b/locale/en_GB.UTF-8/LC_MESSAGES/FixMyStreetMobileApp.po
index 42a056f..8570110 100644
--- a/locale/en_GB.UTF-8/LC_MESSAGES/FixMyStreetMobileApp.po
+++ b/locale/en_GB.UTF-8/LC_MESSAGES/FixMyStreetMobileApp.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 1.0\n"
"Report-Msgid-Bugs-To: struan@mysociety.org\n"
-"POT-Creation-Date: 2013-09-16 17:29+0100\n"
+"POT-Creation-Date: 2013-09-17 17:25+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <team@fixmystreet.com>\n"
@@ -208,7 +208,7 @@ msgid ""
"back online."
msgstr ""
-#: templates/submit_confirm.html:21 templates/submit_name.html:26
+#: templates/submit_confirm.html:23 templates/submit_name.html:26
msgid "Optionally enter your phone number"
msgstr ""
@@ -268,7 +268,7 @@ msgid ""
"wish your name to be shown on the site, untick the box below"
msgstr ""
-#: templates/strings.js:8 templates/submit_confirm.html:18
+#: templates/strings.js:8 templates/submit_confirm.html:20
#: templates/submit_name.html:23
msgid "Please enter your name"
msgstr ""
@@ -297,7 +297,7 @@ msgstr ""
msgid "Remove Photo"
msgstr ""
-#: templates/submit_confirm.html:29 templates/submit_password.html:15
+#: templates/submit_confirm.html:31 templates/submit_password.html:15
msgid "Report"
msgstr ""
@@ -329,7 +329,7 @@ msgstr ""
msgid "Send confirmation email"
msgstr ""
-#: templates/submit_confirm.html:25 templates/submit_name.html:31
+#: templates/submit_confirm.html:27 templates/submit_name.html:31
#: templates/submit_password.html:33
msgid "Show my name publicly"
msgstr ""
diff --git a/src/js/views/submit.js b/src/js/views/submit.js
index fcebd52..6cf75bb 100644
--- a/src/js/views/submit.js
+++ b/src/js/views/submit.js
@@ -278,8 +278,9 @@
$('p.top').show();
this.model.set('name', $('#form_name').val());
this.model.set('phone', $('#form_phone').val());
- this.model.set('may_show_name', $('#form_may_show_name').val());
+ this.model.set('may_show_name', $('#form_may_show_name').is(':checked'));
FMS.currentUser.set('name', $('#form_name').val());
+ FMS.currentUser.set('may_show_name', $('#form_may_show_name').is(':checked'));
if ( this.model.get('title_list') && this.model.get('title_list').length > 0 ) {
FMS.currentUser.set('title', $('#form_title').val());
@@ -341,8 +342,9 @@
this.model.set('submit_clicked', 'submit_register');
this.model.set('phone', $('#form_phone').val());
this.model.set('name', $('#form_name').val());
- this.model.set('may_show_name', $('#form_may_show_name').val());
+ this.model.set('may_show_name', $('#form_may_show_name').is(':checked'));
FMS.currentUser.set('name', $('#form_name').val());
+ FMS.currentUser.set('may_show_name', $('#form_may_show_name').is(':checked'));
} else {
// if this is set then we are registering a password
if ( ! this.model.get('submit_clicked') ) {
@@ -440,9 +442,10 @@
beforeSubmit: function() {
this.model.set('name', $('#form_name').val());
this.model.set('phone', $('#form_phone').val());
- this.model.set('may_show_name', $('#form_may_show_name').val());
+ this.model.set('may_show_name', $('#form_may_show_name').is(':checked'));
this.model.set('submit_clicked', 'submit_register');
FMS.currentUser.set('name', $('#form_name').val());
+ FMS.currentUser.set('may_show_name', $('#form_may_show_name').is(':checked'));
},
onReportError: function(model, err, options) {
diff --git a/src/templates/en/submit_confirm.html b/src/templates/en/submit_confirm.html
index 1ce4b6c..01e7da8 100644
--- a/src/templates/en/submit_confirm.html
+++ b/src/templates/en/submit_confirm.html
@@ -21,7 +21,7 @@
<input data-role="none" type="tel" value="<%= user.phone %>" name="name" id="form_phone" placeholder="Optionally enter your phone number">
</div>
<div class="checkbox-group noborder">
- <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1" checked>
+ <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1" <% if ( typeof user.may_show_name == 'undefined' || user.may_show_name ) { %>checked<% } %>>
<label class="inline" for="form_may_show_name">Show my name publicly</label>
</div>
</div>
diff --git a/src/templates/en/submit_name.html b/src/templates/en/submit_name.html
index cf3f866..c193e20 100644
--- a/src/templates/en/submit_name.html
+++ b/src/templates/en/submit_name.html
@@ -27,7 +27,7 @@
</div>
<div data-role="fieldcontain">
<fieldset data-role="controlgroup">
- <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1" checked>
+ <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1" <% if ( typeof user.may_show_name == 'undefined' || user.may_show_name ) { %>checked<% } %>>
<label for="form_may_show_name">Show my name publicly</label>
</fieldset>
</div>
diff --git a/templates/submit_confirm.html b/templates/submit_confirm.html
index 1a20b28..6c7b8e2 100644
--- a/templates/submit_confirm.html
+++ b/templates/submit_confirm.html
@@ -21,7 +21,7 @@
<input data-role="none" type="tel" value="<%= user.phone %>" name="name" id="form_phone" placeholder="[% loc('Optionally enter your phone number') %]">
</div>
<div class="checkbox-group noborder">
- <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1" checked>
+ <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1" <% if ( typeof user.may_show_name == 'undefined' || user.may_show_name ) { %>checked<% } %>>
<label class="inline" for="form_may_show_name">[% loc('Show my name publicly') %]</label>
</div>
</div>
diff --git a/templates/submit_name.html b/templates/submit_name.html
index dec5ee7..1951ffa 100644
--- a/templates/submit_name.html
+++ b/templates/submit_name.html
@@ -27,7 +27,7 @@
</div>
<div data-role="fieldcontain">
<fieldset data-role="controlgroup">
- <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1" checked>
+ <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1" <% if ( typeof user.may_show_name == 'undefined' || user.may_show_name ) { %>checked<% } %>>
<label for="form_may_show_name">[% loc('Show my name publicly') %]</label>
</fieldset>
</div>