Skip to content

Commit 4fb1e46

Browse files
UX: Show message when viewing other user
1 parent 5a2daf5 commit 4fb1e46

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

plugins/discourse-rewind/assets/javascripts/discourse/components/rewind.gjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import DButton from "discourse/components/d-button";
1010
import concatClass from "discourse/helpers/concat-class";
1111
import { ajax } from "discourse/lib/ajax";
1212
import { popupAjaxError } from "discourse/lib/ajax-error";
13+
import { eq } from "discourse/truth-helpers";
1314
import { i18n } from "discourse-i18n";
1415
import ActivityCalendar from "discourse/plugins/discourse-rewind/discourse/components/reports/activity-calendar";
1516
import AiUsage from "discourse/plugins/discourse-rewind/discourse/components/reports/ai-usage";
@@ -326,6 +327,15 @@ export default class Rewind extends Component {
326327
</div>
327328
{{/if}}
328329

330+
{{#unless (eq this.currentUser.id @user.id)}}
331+
<p class="rewind-other-user">{{htmlSafe
332+
(i18n
333+
"discourse_rewind.viewing_other_user"
334+
username=@user.username
335+
)
336+
}}</p>
337+
{{/unless}}
338+
329339
{{#each this.rewind as |report|}}
330340
{{#let
331341
(this.getReportComponent report.identifier)

plugins/discourse-rewind/assets/stylesheets/common/rewind.scss

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,19 @@
119119
padding-bottom: var(--safe-area-inset-bottom);
120120
padding-top: 2em;
121121

122-
.rewind-error {
122+
.rewind-error,
123+
.rewind-other-user {
123124
color: var(--rewind-green);
124125
font-family: var(--pixel-text);
125126
text-align: left;
127+
}
128+
129+
.rewind-other-user {
130+
font-size: var(--font-down-1);
131+
text-align: center;
132+
}
133+
134+
.rewind-error {
126135
line-height: 1em;
127136
padding: 2em;
128137
}

plugins/discourse-rewind/config/locales/client.en.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ en:
99
placeholder: Discourse Rewind
1010
title: Rewind
1111
loading: "Reticulating splines..."
12+
viewing_other_user: "You are viewing <strong>%{username}'s</strong> Discourse Rewind report."
1213
cannot_view_rewind_gibberish: >
1314
[ACCESS DENIED::REWIND MAINFRAME SUBROUTINE FAILURE]<br><br>
1415

0 commit comments

Comments
 (0)