Skip to content

Commit c197f66

Browse files
committed
Switch show and hide post buttons to icon buttons
- Move show/hide buttons to top of post/comment - Simplify tooltip text
1 parent 8bab975 commit c197f66

3 files changed

Lines changed: 33 additions & 47 deletions

File tree

src/assets/wise5/components/discussion/class-response-teacher/class-response-teacher.component.html

Lines changed: 27 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -17,50 +17,40 @@
1717
/>
1818
</div>
1919
</div>
20-
</div>
21-
<div class="post" [innerHTML]="response.studentData.responseTextHTML"></div>
22-
@for (attachment of response.studentData.attachments; track attachment) {
23-
<img [src]="attachment.iconURL" i18n-alt alt="Post attachment" class="attachment" />
24-
}
25-
<div class="flex justify-end items-center">
26-
<br />
20+
<span class="flex-grow"></span>
2721
@if (
2822
response.latestInappropriateFlagAnnotation == null ||
2923
response.latestInappropriateFlagAnnotation.data == null ||
3024
response.latestInappropriateFlagAnnotation.data.action != 'Delete'
3125
) {
3226
<button
33-
mat-stroked-button
34-
color="warn"
27+
matIconButton
3528
(click)="hidePost(response)"
36-
matTooltip="Hide this post so students will not see it"
29+
matTooltip="Hide from students"
3730
matTooltipPosition="above"
3831
i18n-matTooltip
39-
i18n
4032
>
41-
Hide Post
33+
<mat-icon>visibility_on</mat-icon>
4234
</button>
43-
}
44-
@if (
35+
} @else if (
4536
response.latestInappropriateFlagAnnotation != null &&
4637
response.latestInappropriateFlagAnnotation.data.action === 'Delete'
4738
) {
48-
<mat-icon color="warn" matTooltip="Post is hidden from students" i18n-matTooltip
49-
>visibility_off</mat-icon
50-
>
5139
<button
52-
mat-stroked-button
53-
color="warn"
40+
matIconButton
5441
(click)="showPost(response)"
55-
matTooltip="Make this post viewable to students"
42+
matTooltip="Show to students"
5643
matTooltipPosition="above"
5744
i18n-matTooltip
58-
i18n
5945
>
60-
Show Post
46+
<mat-icon color="warn">visibility_off</mat-icon>
6147
</button>
6248
}
6349
</div>
50+
<div class="post" [innerHTML]="response.studentData.responseTextHTML"></div>
51+
@for (attachment of response.studentData.attachments; track attachment) {
52+
<img [src]="attachment.iconURL" i18n-alt alt="Post attachment" class="attachment" />
53+
}
6454
</div>
6555
@if (response.replies.length > 0) {
6656
<div class="notice-bg-bg">
@@ -97,58 +87,50 @@
9787
tooltipPosition="after"
9888
/>
9989
</div>
100-
</div>
101-
<div class="pt-1" [innerHTML]="reply.studentData.responseHTML"></div>
102-
<div class="flex justify-end items-center">
90+
<span class="flex-grow"></span>
10391
@if (
10492
(response.latestInappropriateFlagAnnotation == null ||
10593
response.latestInappropriateFlagAnnotation.data.action !== 'Delete') &&
10694
(reply.latestInappropriateFlagAnnotation == null ||
10795
reply.latestInappropriateFlagAnnotation.data.action != 'Delete')
10896
) {
10997
<button
110-
mat-stroked-button
111-
color="warn"
98+
matIconButton
11299
(click)="hidePost(reply)"
113-
i18n-matTooltip
114-
matTooltip="Hide this post so students will not see it"
100+
matTooltip="Hide from students"
115101
matTooltipPosition="above"
116-
i18n
102+
i18n-matTooltip
117103
>
118-
Hide Post
104+
<mat-icon>visibility_on</mat-icon>
119105
</button>
120-
}
121-
@if (
106+
} @else if (
122107
response.latestInappropriateFlagAnnotation != null &&
123108
response.latestInappropriateFlagAnnotation.data.action === 'Delete'
124109
) {
125110
<mat-icon
111+
tabindex="0"
126112
color="warn"
127-
matTooltip="Parent post is hidden, so this post is also hidden"
113+
matTooltip="Parent post is hidden, so this comment is also hidden"
114+
matTooltipPosition="above"
128115
i18n-matTooltip
129116
>visibility_off</mat-icon
130117
>
131-
}
132-
@if (
118+
} @else if (
133119
reply.latestInappropriateFlagAnnotation != null &&
134120
reply.latestInappropriateFlagAnnotation.data.action === 'Delete'
135121
) {
136-
<mat-icon color="warn" matTooltip="Post is hidden from students" i18n-matTooltip
137-
>visibility_off</mat-icon
138-
>
139122
<button
140-
mat-stroked-button
141-
color="warn"
123+
matIconButton
142124
(click)="showPost(reply)"
143-
i18n-matTooltip
144-
matTooltip="Make this post viewable to students"
125+
matTooltip="Show to students"
145126
matTooltipPosition="above"
146-
i18n
127+
i18n-matTooltip
147128
>
148-
Show Post
129+
<mat-icon color="warn">visibility_off</mat-icon>
149130
</button>
150131
}
151132
</div>
133+
<div class="pt-1" [innerHTML]="reply.studentData.responseHTML"></div>
152134
</div>
153135
}
154136
</div>

src/assets/wise5/components/discussion/class-response-teacher/class-response-teacher.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ export class ClassResponseTeacherComponent extends ClassResponse {
4444
protected repliesToShow: any[] = [];
4545

4646
protected hidePost(componentState: any): void {
47-
if (confirm($localize`Are you sure you want to hide this post?`)) {
47+
if (confirm($localize`Are you sure you want to hide this content?`)) {
4848
this.hidePostEvent.emit(componentState);
4949
}
5050
}
5151

5252
protected showPost(componentState: any): void {
53-
if (confirm($localize`Are you sure you want to show this post?`)) {
53+
if (confirm($localize`Are you sure you want to show this content?`)) {
5454
this.showPostEvent.emit(componentState);
5555
}
5656
}

src/assets/wise5/components/discussion/class-response/class-response.component.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,8 @@
7474
outline: none;
7575
}
7676
}
77+
78+
.mat-icon {
79+
vertical-align: top;
80+
}
7781
}

0 commit comments

Comments
 (0)