aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/FixMyStreet/DB/Result/Comment.pm8
-rw-r--r--templates/web/base/report/_update_state.html2
2 files changed, 7 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm
index a20c336a5..76e8d3185 100644
--- a/perllib/FixMyStreet/DB/Result/Comment.pm
+++ b/perllib/FixMyStreet/DB/Result/Comment.pm
@@ -267,9 +267,13 @@ sub meta_line {
my $meta = '';
- if ($self->anonymous or !$self->name) {
+ my $contributed_as = $self->get_extra_metadata('contributed_as') || '';
+ my $staff = $self->user->from_body || $self->get_extra_metadata('is_body_user') || $self->get_extra_metadata('is_superuser');
+ my $anon = $self->anonymous || !$self->name;
+
+ if ($anon && (!$staff || $contributed_as eq 'anonymous_user' || $contributed_as eq 'another_user')) {
$meta = sprintf( _( 'Posted anonymously at %s' ), Utils::prettify_dt( $self->confirmed ) )
- } elsif ($self->user->from_body || $self->get_extra_metadata('is_body_user') || $self->get_extra_metadata('is_superuser') ) {
+ } elsif ($staff) {
my $user_name = FixMyStreet::Template::html_filter($self->user->name);
my $body;
if ($self->get_extra_metadata('is_superuser')) {
diff --git a/templates/web/base/report/_update_state.html b/templates/web/base/report/_update_state.html
index ecac68850..d484dcb05 100644
--- a/templates/web/base/report/_update_state.html
+++ b/templates/web/base/report/_update_state.html
@@ -12,7 +12,7 @@
<p class="meta-2">
[% INCLUDE meta_line %]
- [% IF c.user_exists AND c.user.id == update.user_id AND !update.anonymous %]
+ [% IF c.user_exists AND c.user.id == update.user_id AND !update.anonymous AND NOT (c.user.from_body OR c.user.is_superuser) %]
<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 %]