Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 19 additions & 43 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<mat-card appearance="outlined" class="class-response">
@if (isHidden(response)) {
<details>
<details (toggle)="onToggleHiddenPost()">
<summary class="secondary-text notice-bg-bg">
<span class="flex-grow" i18n>This post is hidden from students.</span>
<span class="details-closed" i18n>(tap to view)</span>
Expand Down Expand Up @@ -84,6 +84,7 @@
@if (parentHidden || isHidden(reply)) {
<details
class="reply-details rounded-md notice-bg-border border-1 open:border-transparent open:pb-2"
(toggle)="onToggleHiddenPost()"
>
<summary class="secondary-text notice-bg-bg rounded-md" [class.py-2]="parentHidden">
@if (parentHidden) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export class ClassResponseTeacherComponent extends ClassResponse {
@Input() response: any;
@Output() showPostEvent: any = new EventEmitter();
@Output() submitButtonClicked: any = new EventEmitter();
@Output() toggleHiddenPost: any = new EventEmitter();

protected expanded: boolean = false;
protected repliesToShow: any[] = [];
Expand All @@ -87,4 +88,8 @@ export class ClassResponseTeacherComponent extends ClassResponse {
this.showPostEvent.emit(componentState);
}
}

protected onToggleHiddenPost(): void {
this.toggleHiddenPost.emit();
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
.class-response {
margin: 0 auto 16px;

&.mat-mdc-card {
padding: 0px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import { MatTooltipModule } from '@angular/material/tooltip';
templateUrl: 'class-response.component.html'
})
export class ClassResponse {
@Output() expandChanged: EventEmitter<any> = new EventEmitter();
protected expanded: boolean = false;
@Input() isDisabled: boolean;
@Input() mode: any;
Expand Down Expand Up @@ -129,6 +130,7 @@ export class ClassResponse {
} else {
this.showLastReply();
}
setTimeout(() => this.expandChanged.emit(), 100);
}

private hasAnyReply(): boolean {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,129 +1,95 @@
<component-header [component]="component" />
<div class="discussion-content">
<div class="discussion-content notice-bg-bg">
@if (mode === 'student') {
<component-annotations
class="annotations--inside"
class="annotations--inside block pt-1 px-2"
[annotations]="latestAnnotations"
[maxScore]="componentContent.maxScore"
[nodeId]="nodeId"
[componentId]="componentId"
/>
}
<div class="flex @container">
<div class="discussion-posts w-full @md:w-1/2">
<div class="discussion-posts-wrap">
<div class="discussion-posts" #postsGrid>
@if (mode === 'student' && !isDisabled) {
<mat-card
appearance="outlined"
class="discussion-new discussion-post"
[ngClass]="{
'discussion-new--focused md-whiteframe-z3': focus || newResponse || attachments.length
}"
>
<mat-form-field class="input--placeholder-only discussion-new__input-container">
<textarea
matInput
class="discussion-new__input--textarea"
placeholder="Share with class..."
i18n-placeholder
[(ngModel)]="newResponse"
[disabled]="isDisabled"
(ngModelChange)="studentDataChanged()"
(focus)="focus = true"
(blur)="focus = false"
cdkTextareaAutosize
maxlength="10000"
>
</textarea>
</mat-form-field>
@if (isStudentAttachmentEnabled && attachments.length) {
<div class="discussion-new__actions">
@for (attachment of attachments; track attachment) {
<div class="component__attachment discussion-new__attachment">
<img
[src]="attachment.iconURL"
alt="Image"
i18n-alt
class="discussion-post__attachment discussion-new__attachment__content"
/>
<button
mat-button
class="component__attachment__delete"
(click)="removeAttachment(attachment)"
title="Remove file"
i18n-title
[disabled]="isDisabled"
>
<mat-icon>cancel</mat-icon>
</button>
</div>
<div class="pb-2">
<mat-card
#newPost
appearance="outlined"
class="w-full scale-95 transition-transform duration-200 ease-in-out p-2 pb-0"
[ngClass]="{
'scale-100': focus || newResponse || attachments.length
}"
>
<mat-form-field class="form-field-no-hint">
<textarea
matInput
placeholder="Share with class..."
i18n-placeholder
[(ngModel)]="newResponse"
[disabled]="isDisabled"
(ngModelChange)="studentDataChanged()"
(focus)="focus = true"
(blur)="focus = false"
cdkTextareaAutosize
maxlength="10000"
>
</textarea>
</mat-form-field>
@if (isStudentAttachmentEnabled && attachments.length) {
<div>
@for (attachment of attachments; track attachment) {
<div class="component__attachment">
<img [src]="attachment.iconURL" class="w-full h-auto" alt="Image" i18n-alt />
<button
matIconButton
class="component__attachment__delete"
(click)="removeAttachment(attachment)"
title="Remove file"
i18n-title
[disabled]="isDisabled"
>
<mat-icon>cancel</mat-icon>
</button>
</div>
}
</div>
}
<div class="flex justify-end items-center gap-2 mt-1">
@if (isStudentAttachmentEnabled) {
<button
matIconButton
class="accent"
(click)="showStudentAssets()"
title="Add picture"
i18n-title
[disabled]="isDisabled"
>
<mat-icon>image</mat-icon>
</button>
}
</div>
}
<div class="discussion-new__actions flex justify-end items-center gap-5">
@if (isStudentAttachmentEnabled) {
<button
mat-button
color="accent"
(click)="showStudentAssets()"
title="Add picture"
i18n-title
[disabled]="isDisabled"
mat-flat-button
color="primary"
(click)="handleSubmitButtonClicked()"
[disabled]="isDisabled || (!newResponse && attachments.length == 0)"
i18n
>
<mat-icon>image</mat-icon>
Post
</button>
}
<button
mat-raised-button
color="primary"
(click)="handleSubmitButtonClicked()"
[disabled]="isDisabled || (!newResponse && attachments.length == 0)"
i18n
>
Post
</button>
</div>
</mat-card>
} @else {
<div
class="discussion-new__input--textarea input--textarea--disabled"
[(ngModel)]="newResponse"
></div>
</div>
</mat-card>
</div>
}
<div class="@md:hidden">
@for (componentState of topLevelResponses.all; track componentState) {
<class-response
[response]="componentState"
[numReplies]="componentState.replies.length"
(submitButtonClicked)="handleSubmitButtonClicked(componentState)"
[mode]="mode"
[isDisabled]="isDisabled"
class="post"
/>
}
</div>
<div class="hidden @sm:block">
@for (componentState of topLevelResponses.col2; track componentState) {
<class-response
[response]="componentState"
[numReplies]="componentState.replies.length"
(submitButtonClicked)="handleSubmitButtonClicked(componentState)"
[mode]="mode"
[isDisabled]="isDisabled"
class="post"
/>
}
</div>
</div>
<div class="discussion-posts hidden w-1/2 @md:block">
@for (componentState of topLevelResponses.col1; track componentState) {
@for (componentState of topLevelResponses.all; track componentState) {
<class-response
[response]="componentState"
[numReplies]="componentState.replies.length"
(submitButtonClicked)="handleSubmitButtonClicked(componentState)"
[mode]="mode"
[isDisabled]="isDisabled"
(expandChanged)="applyMasonry()"
class="post"
style="display: block"
/>
}
</div>
Expand Down
Loading
Loading