From 5b3fff8a3f6bf376422f26ba0ebcab78b3b41fc2 Mon Sep 17 00:00:00 2001 From: Hakim Cassimally Date: Thu, 13 Nov 2014 14:54:07 +0000 Subject: [EastSussex] UI improvements to encourage good updates ESCC advised us of concerns that users: * were unaware of how much of their report/update would be visible on the site - make "public" text more visible. - label is presented as fairly flat, with the cursor suppressed (to avoid it looking like a button) but with an explanatory tooltip. The intent is for it to be highly visible, but not too startling. - https://github.com/mysociety/FixMyStreet-Commercial/issues/642 * often comment on an existing report when instead creating a new report would be more appropriate. - Present two buttons, one to create a new report in the same location, another to open the comment box. - (this functionality degrades without Javascript, by simply showing the comment box by default.) - https://github.com/mysociety/FixMyStreet-Commercial/issues/641 Most templates have been split into partials, to avoid long-term forking, however update-form.html is still forked from fixmystreet, which would ideally be fixed in a future commit. --- templates/web/eastsussex/header.html.template | 1 + .../web/eastsussex/report/new/after_name.html | 5 + templates/web/eastsussex/report/public_label.html | 1 + templates/web/eastsussex/report/update-form.html | 212 +++++++++++++++++++++ .../report/new/fill_in_details_form.html | 4 +- .../fixmystreet/report/new/form_user_loggedin.html | 12 +- .../report/new/form_user_loggedout.html | 10 +- templates/web/fixmystreet/report/public_label.html | 1 + web/cobrands/eastsussex/base.scss | 8 + web/cobrands/eastsussex/report-form.js | 22 +++ 10 files changed, 269 insertions(+), 7 deletions(-) create mode 100644 templates/web/eastsussex/report/new/after_name.html create mode 100644 templates/web/eastsussex/report/public_label.html create mode 100644 templates/web/eastsussex/report/update-form.html create mode 100644 templates/web/fixmystreet/report/public_label.html create mode 100644 web/cobrands/eastsussex/report-form.js diff --git a/templates/web/eastsussex/header.html.template b/templates/web/eastsussex/header.html.template index 20e3b9417..04aedc188 100644 --- a/templates/web/eastsussex/header.html.template +++ b/templates/web/eastsussex/header.html.template @@ -13,6 +13,7 @@ [% INCLUDE 'common_header_tags.html', js_override = '/cobrands/fixmystreet/fixmystreet.js', site_title = c.cobrand.site_title %] [% extra_js %] + [% IF c.req.uri.host == 'osm.fixmystreet.com' %] diff --git a/templates/web/eastsussex/report/new/after_name.html b/templates/web/eastsussex/report/new/after_name.html new file mode 100644 index 000000000..26c213c1d --- /dev/null +++ b/templates/web/eastsussex/report/new/after_name.html @@ -0,0 +1,5 @@ + + [% loc('public') %] + diff --git a/templates/web/eastsussex/report/public_label.html b/templates/web/eastsussex/report/public_label.html new file mode 100644 index 000000000..5c06a86d5 --- /dev/null +++ b/templates/web/eastsussex/report/public_label.html @@ -0,0 +1 @@ +[% loc('public') %] diff --git a/templates/web/eastsussex/report/update-form.html b/templates/web/eastsussex/report/update-form.html new file mode 100644 index 000000000..e4314b81d --- /dev/null +++ b/templates/web/eastsussex/report/update-form.html @@ -0,0 +1,212 @@ +[% allow_creation = !c.cobrand.only_authed_can_create || (c.user && c.user.from_body) %] +[% IF allow_creation %] + + + +
+

Create a new report near this location

+ +

+ If you've discovered a new, or recurring problem (even if it's similar to the one in this + report) then : +

+ +
+ + + +
+ +

OR...

+
+ + +
+

Discuss this report

+ +

+ This allows you to comment on this report, and discuss with local residents. +

+ + + +
+ +

[% loc( 'Provide an update') %]

+ + [% IF c.cobrand.moniker != 'emptyhomes' AND c.cobrand.moniker != 'stevenage' %] +
+ [% INCLUDE 'report/updates-sidebar-notes.html' %] +
+ [% END %] + + [% INCLUDE 'errors.html' %] + +
+
+ + + + + [% IF field_errors.update %] +
[% field_errors.update %]
+ [% END %] + + + [% IF c.user && c.user.belongs_to_body( problem.bodies_str ) %] + + + [% ELSE %] + [% IF problem.is_fixed AND c.user_exists AND c.user.id == problem.user_id %] + + + + + [% ELSIF !problem.is_fixed %] + +
+ + +
+ + [% END %] + [% END %] + + [% IF c.cobrand.allow_photo_upload %] +
+ [% IF upload_fileid %] + +

[% loc('You have already attached a photo to this update, attaching another one will replace it.') %]

+ + [% END %] + + [% IF field_errors.photo %] +

[% field_errors.photo %]

+ [% END %] + +
+ [% END %] + + [% IF c.user_exists %] + + [% INCLUDE name %] + + + + + [% ELSE %] + + + [% IF field_errors.email %] +

[% field_errors.email %]

+ [% END %] + + +
+

[% loc("Now to submit your update…") %]

+

[% loc("Do you have a FixMyStreet password?") %]

+ +
+
[% loc('Yes I have a password') %]
+ + + [% IF field_errors.password %] +

[% field_errors.password %]

+ [% END %] +
+ + +
+ +
+ + +
+ +
+

[% loc('Forgotten your password?') %] + [% loc('Confirm by email below, providing a new password at that point. When you confirm, your password will be updated.') %]

+
+ +
+
+
[% loc('No Let me confirm my update by email') %]
+ + [% INCLUDE name %] + + + +
+

[% loc('Providing a password is optional, but doing so will allow you to more easily report problems, leave updates and manage your reports.') %]

+
+ +
+ + +
+ +
+
+ + [% END %] +
+
+
+
+[% END %] + +[% BLOCK name %] + [% INCLUDE 'report/new/extra_name.html' %] + + [% name_public = update.anonymous==0 OR (c.cobrand.default_show_name AND update.anonymous=='') %] + + + [% IF field_errors.name %] +

[% field_errors.name %]

+ [% END %] + + + + +
+ + +
+
+ + +
+[% END %] diff --git a/templates/web/fixmystreet/report/new/fill_in_details_form.html b/templates/web/fixmystreet/report/new/fill_in_details_form.html index 78c3f420b..75e11c74f 100644 --- a/templates/web/fixmystreet/report/new/fill_in_details_form.html +++ b/templates/web/fixmystreet/report/new/fill_in_details_form.html @@ -34,13 +34,13 @@

[% field_errors.bodies %]

[% END %] - + [% IF field_errors.title %]

[% field_errors.title %]

[% END %] - + [% IF field_errors.detail %]

[% field_errors.detail %]

[% END %] diff --git a/templates/web/fixmystreet/report/new/form_user_loggedin.html b/templates/web/fixmystreet/report/new/form_user_loggedin.html index 977382ae3..848d331d4 100644 --- a/templates/web/fixmystreet/report/new/form_user_loggedin.html +++ b/templates/web/fixmystreet/report/new/form_user_loggedin.html @@ -1,11 +1,17 @@ -
+
[% INCLUDE 'report/new/extra_name.html' %] - + [% name_public = report.anonymous==0 OR (c.cobrand.default_show_name AND report.anonymous=='') %] + [% IF field_errors.name %]

[% field_errors.name %]

[% END %] @@ -13,7 +19,7 @@ [%# if there is nothing in the name field then set check box as default on form %]
- +
diff --git a/templates/web/fixmystreet/report/new/form_user_loggedout.html b/templates/web/fixmystreet/report/new/form_user_loggedout.html index 8ae8d15f6..31cccd44e 100644 --- a/templates/web/fixmystreet/report/new/form_user_loggedout.html +++ b/templates/web/fixmystreet/report/new/form_user_loggedout.html @@ -40,7 +40,13 @@ [% INCLUDE 'report/new/extra_name.html' %] - + [% name_public = report.anonymous==0 OR (c.cobrand.default_show_name AND report.anonymous=='') %] + [% IF field_errors.name %]

[% field_errors.name %]

[% END %] @@ -49,7 +55,7 @@ [%# if there is nothing in the name field then set check box as default on form %]
- +
diff --git a/templates/web/fixmystreet/report/public_label.html b/templates/web/fixmystreet/report/public_label.html new file mode 100644 index 000000000..2e00a79d2 --- /dev/null +++ b/templates/web/fixmystreet/report/public_label.html @@ -0,0 +1 @@ +[% loc('(public)') %] diff --git a/web/cobrands/eastsussex/base.scss b/web/cobrands/eastsussex/base.scss index 6285b8662..7e9c57b06 100644 --- a/web/cobrands/eastsussex/base.scss +++ b/web/cobrands/eastsussex/base.scss @@ -234,3 +234,11 @@ styling, but this doesn't dtrt with span, so adding ourselves */ z-index: 1; } } + +.label-warning { + background: lighten(#ff3300, 20%); + color: white; + font-size: 90%; + padding: 2px; + cursor: default; +} diff --git a/web/cobrands/eastsussex/report-form.js b/web/cobrands/eastsussex/report-form.js new file mode 100644 index 000000000..4e01572f7 --- /dev/null +++ b/web/cobrands/eastsussex/report-form.js @@ -0,0 +1,22 @@ +$(function () { + setup_anonymous_checkbox( $('#form_sign_in_no') ); + setup_anonymous_checkbox( $('#form-box--logged-in-name') ); + setup_anonymous_checkbox( $('#update_form') ); + + $('.public-warning').attr({ 'title': 'This information will be be visible to the public on the report' }); +}); + +function setup_anonymous_checkbox (div) { + var label = div.find( '.name-warning' ); + checkbox = div.find('input[type=checkbox]'); + + checkbox.change( function () { + var v = $(this).attr('checked'); + if (v) { + label.show(); + } + else { + label.hide(); + } + }); +} -- cgit v1.2.3