MOBILE-3833 assignment: Add collapsible footer action buttons
parent
7da65f383c
commit
c5b8b4fb19
|
@ -134,6 +134,3 @@
|
|||
[moduleId]="module.id">
|
||||
</addon-mod-assign-submission>
|
||||
</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>
|
||||
|
||||
<!-- 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. -->
|
||||
<core-tab [title]="'addon.mod_assign.submission' | translate" id="submission">
|
||||
<ng-template>
|
||||
|
@ -139,10 +139,36 @@
|
|||
[submission]="userSubmission" [plugin]="plugin">
|
||||
</addon-mod-assign-submission-plugin>
|
||||
|
||||
<!-- Add or edit submission. -->
|
||||
<ion-item class="ion-text-wrap" *ngIf="canEdit">
|
||||
<!-- Team members that need to submit it too. -->
|
||||
<ion-item-divider class="ion-text-wrap" *ngIf="membersToSubmit && membersToSubmit.length > 0">
|
||||
<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. -->
|
||||
<ion-button expand="block" class="ion-text-wrap" *ngIf="hasOffline" (click)="goToEdit()">
|
||||
{{ 'addon.mod_assign.editsubmission' | translate }}
|
||||
|
@ -173,17 +199,23 @@
|
|||
userSubmission!.status != statusReopened" (click)="goToEdit()">
|
||||
{{ 'addon.mod_assign.editsubmission' | translate }}
|
||||
</ion-button>
|
||||
</div>
|
||||
<div *ngIf="unsupportedEditPlugins && unsupportedEditPlugins.length && !showErrorStatementEdit">
|
||||
<p class="core-danger-item">{{ 'addon.mod_assign.erroreditpluginsnotsupported' | translate }}</p>
|
||||
<p class="core-danger-item" *ngFor="let name of unsupportedEditPlugins">{{ name }}</p>
|
||||
</div>
|
||||
<div *ngIf="showErrorStatementEdit">
|
||||
<p class="core-danger-item">{{ 'addon.mod_assign.cannoteditduetostatementsubmission' | translate }}</p>
|
||||
</div>
|
||||
</ng-container>
|
||||
<ion-item class="core-danger-item ion-text-wrap" *ngIf="(unsupportedEditPlugins
|
||||
&& unsupportedEditPlugins.length && !showErrorStatementEdit)|| showErrorStatementEdit">
|
||||
<ion-label>
|
||||
<ng-container
|
||||
*ngIf="unsupportedEditPlugins && unsupportedEditPlugins.length && !showErrorStatementEdit">
|
||||
<p>{{ 'addon.mod_assign.erroreditpluginsnotsupported' | translate }}</p>
|
||||
<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-item>
|
||||
|
||||
</ng-container>
|
||||
|
||||
<!-- Submit for grading form. -->
|
||||
<ng-container *ngIf="canSubmit">
|
||||
<ion-item class="ion-text-wrap" *ngIf="submissionStatement">
|
||||
|
@ -211,31 +243,10 @@
|
|||
</ion-label>
|
||||
</ion-item>
|
||||
</ng-container>
|
||||
|
||||
<!-- Team members that need to submit it too. -->
|
||||
<ion-item-divider class="ion-text-wrap" *ngIf="membersToSubmit && membersToSubmit.length > 0">
|
||||
<ion-label>
|
||||
<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>
|
||||
</div>
|
||||
<core-course-module-navigation [courseId]="courseId" [currentModuleId]="moduleId">
|
||||
</core-course-module-navigation>
|
||||
</div>
|
||||
</ng-template>
|
||||
</core-tab>
|
||||
|
||||
|
|
|
@ -184,7 +184,7 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy, Can
|
|||
}
|
||||
|
||||
/**
|
||||
* Component being initialized.
|
||||
* @inheritdoc
|
||||
*/
|
||||
ngOnInit(): void {
|
||||
this.isSubmittedForGrading = !!this.submitId;
|
||||
|
@ -1195,6 +1195,7 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy, Can
|
|||
* @param tab The tab that was selected.
|
||||
*/
|
||||
tabSelected(tab: CoreTabComponent): void {
|
||||
this.selectedTab = tab.id;
|
||||
// Block sync when selecting grade tab, unblock when leaving it.
|
||||
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> {
|
||||
const index = this.tabs.findIndex((tab) => tabId == tab.id);
|
||||
if (index < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
return this.selectByIndex(index, e);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue