Skip to content

Commit 10640a4

Browse files
UX: Show message when viewing other user
1 parent 5a2daf5 commit 10640a4

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
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: 2 additions & 1 deletion
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
@@ -27,7 +28,7 @@ en:
2728
share_publicly: "Share Discourse Rewind summary publicly. Any forum user will be able to view your Discourse Rewind summary."
2829
profile_link: "View your %{rewindYear} Discourse Rewind"
2930
share:
30-
confirm: "Are you sure you want to share your Discourse Rewind summary? This will make it visible to all members of this forum. You can unshare at any time by clicking the share button again."
31+
confirm: "Are you sure you want to share your Discourse Rewind summary? This will make it visible to all members of this forum. Note that the report may contain private data like personal message excerpts. You can unshare at any time by clicking the share button again."
3132
enabled_success: "Your Discourse Rewind summary is now shared publicly."
3233
disabled_success: "Your Discourse Rewind summary is no longer shared publicly."
3334
disable_tooltip: "Click to unshare your Discourse Rewind summary."

0 commit comments

Comments
 (0)