diff options
author | Zarino Zappia <mail@zarino.co.uk> | 2016-10-13 14:22:27 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-05-31 16:55:17 +0100 |
commit | 6b9bd2aaeb12a9514619b433895469ede7f4d98b (patch) | |
tree | 860b6116bc9908e008d27da4ab8c42899302ff48 /templates | |
parent | a752a967ffd846e2ea6eb7f6a4789b0bf1a8dbf0 (diff) |
Allow users to hide their name on reports/updates.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/web/base/my/anonymize.html | 26 | ||||
-rw-r--r-- | templates/web/base/report/_main.html | 4 | ||||
-rw-r--r-- | templates/web/base/report/_report_meta_info.html | 3 | ||||
-rw-r--r-- | templates/web/base/report/update.html | 5 | ||||
-rw-r--r-- | templates/web/fixmystreet.com/report/_report_meta_info.html | 3 |
5 files changed, 40 insertions, 1 deletions
diff --git a/templates/web/base/my/anonymize.html b/templates/web/base/my/anonymize.html new file mode 100644 index 000000000..e82a03ce0 --- /dev/null +++ b/templates/web/base/my/anonymize.html @@ -0,0 +1,26 @@ +[% INCLUDE 'header.html', + title = loc('Hide my name'), + bodyclass = 'twothirdswidthpage' %] + +<form method="post" action="/my/anonymize" class="box-warning hide-name-form"> + <input type="hidden" name="token" value="[% csrf_token %]"> + + [% IF update %] + <input type="hidden" name="update" value="[% update.id %]"> + <input class="btn-primary" type="submit" name="hide" value="[% loc('Hide my name in this update') %]"> + [% ELSIF problem %] + [% IF problem.bodies_str %] + <p>[% tprintf(loc('Your name has already been sent to %s, but we can hide it on this page:'), problem.body(c)) %]</p> + [% END %] + <input type="hidden" name="problem" value="[% problem.id %]"> + <input class="btn-primary" type="submit" name="hide" value="[% loc('Hide my name on this report') %]"> + [% END %] + + [% IF NOT c.user.from_body %] + <p>[% loc('Alternatively, we can hide your name on <strong>all of your reports and updates</strong> across the site:') %]</p> + <input class="btn" type="submit" name="hide_everywhere" value="[% loc('Hide my name everywhere') %]"> + [% END %] + +</form> + +[% INCLUDE 'footer.html' %] diff --git a/templates/web/base/report/_main.html b/templates/web/base/report/_main.html index 83a3a1109..405cb2118 100644 --- a/templates/web/base/report/_main.html +++ b/templates/web/base/report/_main.html @@ -64,6 +64,10 @@ [% INCLUDE 'report/_report_meta_info.html' %] </p> + [% IF anonymized ~%] + <p class="form-success">[% anonymized %]</p> + [% END ~%] + [% INCLUDE 'report/_main_sent_info.html' %] [% mlog = problem.latest_moderation_log_entry(); IF mlog %] <p>[% tprintf(loc('Moderated by %s at %s'), mlog.admin_user, prettify_dt(mlog.whenedited)) %]</p> diff --git a/templates/web/base/report/_report_meta_info.html b/templates/web/base/report/_report_meta_info.html index da7339c81..e2a6412a3 100644 --- a/templates/web/base/report/_report_meta_info.html +++ b/templates/web/base/report/_report_meta_info.html @@ -1,2 +1,5 @@ [% problem.meta_line(c) | html %] +[% IF c.user_exists AND c.user.id == problem.user_id AND !problem.anonymous %] + <small>(<a href="/my/anonymize?problem=[% problem.id | uri %]" class="js-hide-name">[% loc('Hide your name?') %]</a>)</small> +[% END %] [%- IF !problem.used_map %]; <strong>([% loc('there is no pin shown as the user did not use the map') %])</strong>[% END %] diff --git a/templates/web/base/report/update.html b/templates/web/base/report/update.html index 51c1a9e4f..1f1438bfc 100644 --- a/templates/web/base/report/update.html +++ b/templates/web/base/report/update.html @@ -24,7 +24,7 @@ <div class="item-list__update-wrap"> [% IF update.whenanswered %] <div class="item-list__update-text"> - <p class="meta-2"> [% INCLUDE meta_line %] </p> + <p class="meta-2">[% INCLUDE meta_line %]</p> </div> [% ELSE %] <a name="update_[% update.id %]" class="internal-link-fixed-header"></a> @@ -45,6 +45,9 @@ <p class="meta-2"> [% INCLUDE meta_line %] + [% IF c.user_exists AND c.user.id == update.user_id AND !update.anonymous %] + <small>(<a href="/my/anonymize?update=[% update.id | uri %]" class="js-hide-name">[% loc('Hide your name?') %]</a>)</small> + [% END %] [% mlog = update.latest_moderation_log_entry(); IF mlog %] <br />[% tprintf(loc('Moderated by %s at %s'), mlog.admin_user, prettify_dt(mlog.whenedited)) %] [% END %] diff --git a/templates/web/fixmystreet.com/report/_report_meta_info.html b/templates/web/fixmystreet.com/report/_report_meta_info.html index 88abd97be..5063d5284 100644 --- a/templates/web/fixmystreet.com/report/_report_meta_info.html +++ b/templates/web/fixmystreet.com/report/_report_meta_info.html @@ -2,4 +2,7 @@ [% IF c.cobrand.moniker != problem.get_cobrand_logged.moniker AND problem.get_cobrand_logged.is_council %] using <a href="https://www.fixmystreet.com/about/council">FixMyStreet Professional</a> [% END %] +[% IF c.user_exists AND c.user.id == problem.user_id AND !problem.anonymous %] + <small>(<a href="/my/anonymize?problem=[% problem.id | uri %]" class="js-hide-name">[% loc('Hide your name?') %]</a>)</small> +[% END %] [%- IF !problem.used_map %]; <strong>([% loc('there is no pin shown as the user did not use the map') %])</strong>[% END %] |