MOBILE-3833 assignment: Add collapsible footer action buttons
parent
7da65f383c
commit
c5b8b4fb19
|
@ -134,6 +134,3 @@
|
||||||
[moduleId]="module.id">
|
[moduleId]="module.id">
|
||||||
</addon-mod-assign-submission>
|
</addon-mod-assign-submission>
|
||||||
</core-loading>
|
</core-loading>
|
||||||
|
|
||||||
<core-course-module-navigation collapsible-footer [hidden]="showLoading" [courseId]="courseId" [currentModuleId]="module.id">
|
|
||||||
</core-course-module-navigation>
|
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
</ion-item>
|
</ion-item>
|
||||||
|
|
||||||
<!-- Tabs: see the submission or grade it. -->
|
<!-- Tabs: see the submission or grade it. -->
|
||||||
<core-tabs [selectedIndex]="selectedTab" [hideUntil]="loaded" parentScrollable="true" (ionChange)="tabSelected($event)">
|
<core-tabs [hideUntil]="loaded" parentScrollable="true" (ionChange)="tabSelected($event)">
|
||||||
<!-- View the submission tab. -->
|
<!-- View the submission tab. -->
|
||||||
<core-tab [title]="'addon.mod_assign.submission' | translate" id="submission">
|
<core-tab [title]="'addon.mod_assign.submission' | translate" id="submission">
|
||||||
<ng-template>
|
<ng-template>
|
||||||
|
@ -139,10 +139,36 @@
|
||||||
[submission]="userSubmission" [plugin]="plugin">
|
[submission]="userSubmission" [plugin]="plugin">
|
||||||
</addon-mod-assign-submission-plugin>
|
</addon-mod-assign-submission-plugin>
|
||||||
|
|
||||||
<!-- Add or edit submission. -->
|
<!-- Team members that need to submit it too. -->
|
||||||
<ion-item class="ion-text-wrap" *ngIf="canEdit">
|
<ion-item-divider class="ion-text-wrap" *ngIf="membersToSubmit && membersToSubmit.length > 0">
|
||||||
<ion-label>
|
<ion-label>
|
||||||
<div *ngIf="!unsupportedEditPlugins.length && !showErrorStatementEdit">
|
<h2>{{ 'addon.mod_assign.userswhoneedtosubmit' | translate: {$a: ''} }}</h2>
|
||||||
|
</ion-label>
|
||||||
|
</ion-item-divider>
|
||||||
|
<ng-container *ngIf="membersToSubmit && membersToSubmit.length > 0 && !blindMarking">
|
||||||
|
<ng-container *ngFor="let user of membersToSubmit">
|
||||||
|
<ion-item class="ion-text-wrap" core-user-link [userId]="user.id" [courseId]="courseId"
|
||||||
|
[attr.aria-label]="user.fullname">
|
||||||
|
<core-user-avatar [user]="user" slot="start" [linkProfile]="false"></core-user-avatar>
|
||||||
|
<ion-label>
|
||||||
|
<h2>{{ user.fullname }}</h2>
|
||||||
|
</ion-label>
|
||||||
|
</ion-item>
|
||||||
|
</ng-container>
|
||||||
|
</ng-container>
|
||||||
|
<ng-container *ngIf="membersToSubmit && membersToSubmit.length > 0 && blindMarking">
|
||||||
|
<ng-container *ngFor="let blindId of membersToSubmitBlind">
|
||||||
|
<ion-item class="ion-text-wrap">
|
||||||
|
<ion-label>{{ 'addon.mod_assign.hiddenuser' | translate }} {{ blindId }}</ion-label>
|
||||||
|
</ion-item>
|
||||||
|
</ng-container>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<!-- Add or edit submission. -->
|
||||||
|
<div collapsible-footer *ngIf="loaded && !isSubmittedForGrading" [hidden]="selectedTab !== 'submission'" slot="fixed">
|
||||||
|
<div class="list-item-limited-width adaptable-buttons-row" *ngIf="canEdit || canSubmit">
|
||||||
|
<ng-container *ngIf="canEdit">
|
||||||
|
<ng-container *ngIf=" !unsupportedEditPlugins.length && !showErrorStatementEdit">
|
||||||
<!-- If has offline data, show edit. -->
|
<!-- If has offline data, show edit. -->
|
||||||
<ion-button expand="block" class="ion-text-wrap" *ngIf="hasOffline" (click)="goToEdit()">
|
<ion-button expand="block" class="ion-text-wrap" *ngIf="hasOffline" (click)="goToEdit()">
|
||||||
{{ 'addon.mod_assign.editsubmission' | translate }}
|
{{ 'addon.mod_assign.editsubmission' | translate }}
|
||||||
|
@ -173,17 +199,23 @@
|
||||||
userSubmission!.status != statusReopened" (click)="goToEdit()">
|
userSubmission!.status != statusReopened" (click)="goToEdit()">
|
||||||
{{ 'addon.mod_assign.editsubmission' | translate }}
|
{{ 'addon.mod_assign.editsubmission' | translate }}
|
||||||
</ion-button>
|
</ion-button>
|
||||||
</div>
|
</ng-container>
|
||||||
<div *ngIf="unsupportedEditPlugins && unsupportedEditPlugins.length && !showErrorStatementEdit">
|
<ion-item class="core-danger-item ion-text-wrap" *ngIf="(unsupportedEditPlugins
|
||||||
<p class="core-danger-item">{{ 'addon.mod_assign.erroreditpluginsnotsupported' | translate }}</p>
|
&& unsupportedEditPlugins.length && !showErrorStatementEdit)|| showErrorStatementEdit">
|
||||||
<p class="core-danger-item" *ngFor="let name of unsupportedEditPlugins">{{ name }}</p>
|
<ion-label>
|
||||||
</div>
|
<ng-container
|
||||||
<div *ngIf="showErrorStatementEdit">
|
*ngIf="unsupportedEditPlugins && unsupportedEditPlugins.length && !showErrorStatementEdit">
|
||||||
<p class="core-danger-item">{{ 'addon.mod_assign.cannoteditduetostatementsubmission' | translate }}</p>
|
<p>{{ 'addon.mod_assign.erroreditpluginsnotsupported' | translate }}</p>
|
||||||
</div>
|
<p *ngFor="let name of unsupportedEditPlugins">{{ name }}</p>
|
||||||
|
</ng-container>
|
||||||
|
<ng-container *ngIf="showErrorStatementEdit">
|
||||||
|
<p>{{ 'addon.mod_assign.cannoteditduetostatementsubmission' | translate }}</p>
|
||||||
|
</ng-container>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
|
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- Submit for grading form. -->
|
<!-- Submit for grading form. -->
|
||||||
<ng-container *ngIf="canSubmit">
|
<ng-container *ngIf="canSubmit">
|
||||||
<ion-item class="ion-text-wrap" *ngIf="submissionStatement">
|
<ion-item class="ion-text-wrap" *ngIf="submissionStatement">
|
||||||
|
@ -211,31 +243,10 @@
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
</div>
|
||||||
<!-- Team members that need to submit it too. -->
|
<core-course-module-navigation [courseId]="courseId" [currentModuleId]="moduleId">
|
||||||
<ion-item-divider class="ion-text-wrap" *ngIf="membersToSubmit && membersToSubmit.length > 0">
|
</core-course-module-navigation>
|
||||||
<ion-label>
|
</div>
|
||||||
<h2>{{ 'addon.mod_assign.userswhoneedtosubmit' | translate: {$a: ''} }}</h2>
|
|
||||||
</ion-label>
|
|
||||||
</ion-item-divider>
|
|
||||||
<ng-container *ngIf="membersToSubmit && membersToSubmit.length > 0 && !blindMarking">
|
|
||||||
<ng-container *ngFor="let user of membersToSubmit">
|
|
||||||
<ion-item class="ion-text-wrap" core-user-link [userId]="user.id" [courseId]="courseId"
|
|
||||||
[attr.aria-label]="user.fullname">
|
|
||||||
<core-user-avatar [user]="user" slot="start" [linkProfile]="false"></core-user-avatar>
|
|
||||||
<ion-label>
|
|
||||||
<h2>{{ user.fullname }}</h2>
|
|
||||||
</ion-label>
|
|
||||||
</ion-item>
|
|
||||||
</ng-container>
|
|
||||||
</ng-container>
|
|
||||||
<ng-container *ngIf="membersToSubmit && membersToSubmit.length > 0 && blindMarking">
|
|
||||||
<ng-container *ngFor="let blindId of membersToSubmitBlind">
|
|
||||||
<ion-item class="ion-text-wrap">
|
|
||||||
<ion-label>{{ 'addon.mod_assign.hiddenuser' | translate }} {{ blindId }}</ion-label>
|
|
||||||
</ion-item>
|
|
||||||
</ng-container>
|
|
||||||
</ng-container>
|
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</core-tab>
|
</core-tab>
|
||||||
|
|
||||||
|
|
|
@ -184,7 +184,7 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy, Can
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component being initialized.
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.isSubmittedForGrading = !!this.submitId;
|
this.isSubmittedForGrading = !!this.submitId;
|
||||||
|
@ -1195,6 +1195,7 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy, Can
|
||||||
* @param tab The tab that was selected.
|
* @param tab The tab that was selected.
|
||||||
*/
|
*/
|
||||||
tabSelected(tab: CoreTabComponent): void {
|
tabSelected(tab: CoreTabComponent): void {
|
||||||
|
this.selectedTab = tab.id;
|
||||||
// Block sync when selecting grade tab, unblock when leaving it.
|
// Block sync when selecting grade tab, unblock when leaving it.
|
||||||
this.setGradeSyncBlocked(tab.id === 'grade');
|
this.setGradeSyncBlocked(tab.id === 'grade');
|
||||||
}
|
}
|
||||||
|
|
|
@ -482,6 +482,9 @@ export class CoreTabsBaseComponent<T extends CoreTabBase> implements OnInit, Aft
|
||||||
*/
|
*/
|
||||||
async selectTab(tabId: string, e?: Event): Promise<void> {
|
async selectTab(tabId: string, e?: Event): Promise<void> {
|
||||||
const index = this.tabs.findIndex((tab) => tabId == tab.id);
|
const index = this.tabs.findIndex((tab) => tabId == tab.id);
|
||||||
|
if (index < 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
return this.selectByIndex(index, e);
|
return this.selectByIndex(index, e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue