commit
91e180a8b2
|
@ -9,12 +9,12 @@
|
||||||
<ion-card-header>
|
<ion-card-header>
|
||||||
<h1 text-wrap>{{ course.displayname }}</h1>
|
<h1 text-wrap>{{ course.displayname }}</h1>
|
||||||
<p text-wrap>{{ 'addon.storagemanager.info' | translate }}</p>
|
<p text-wrap>{{ 'addon.storagemanager.info' | translate }}</p>
|
||||||
<ion-item no-padding padding-top>
|
<ion-item no-padding padding-top class="size" text-wrap>
|
||||||
<ion-row class="size">
|
<ion-icon name="cube" item-start></ion-icon>
|
||||||
<ion-icon name="cube"></ion-icon>
|
<h2 text-wrap>{{ 'addon.storagemanager.storageused' | translate }}</h2>
|
||||||
{{ 'addon.storagemanager.storageused' | translate }}
|
<div item-end>
|
||||||
{{ totalSize | coreBytesToSize }}
|
<p text-end>{{ totalSize | coreBytesToSize }}</p>
|
||||||
</ion-row>
|
</div>
|
||||||
<button ion-button icon-only item-end no-padding (click)="deleteForCourse()" [disabled]="totalSize == 0">
|
<button ion-button icon-only item-end no-padding (click)="deleteForCourse()" [disabled]="totalSize == 0">
|
||||||
<core-icon name="trash" label="{{ 'addon.storagemanager.deletecourse' | translate }}"></core-icon>
|
<core-icon name="trash" label="{{ 'addon.storagemanager.deletecourse' | translate }}"></core-icon>
|
||||||
</button>
|
</button>
|
||||||
|
@ -25,13 +25,11 @@
|
||||||
<ion-card *ngIf="section.totalSize > 0" class="section">
|
<ion-card *ngIf="section.totalSize > 0" class="section">
|
||||||
<ion-card-header>
|
<ion-card-header>
|
||||||
<ion-item no-padding>
|
<ion-item no-padding>
|
||||||
<ion-row>
|
<h2 text-wrap>{{ section.name }}</h2>
|
||||||
<h2 text-wrap>{{ section.name }}</h2>
|
<p>
|
||||||
</ion-row>
|
<ion-icon name="cube" item-start></ion-icon>
|
||||||
<ion-row class="size">
|
|
||||||
<ion-icon name="cube"></ion-icon>
|
|
||||||
{{ section.totalSize | coreBytesToSize }}
|
{{ section.totalSize | coreBytesToSize }}
|
||||||
</ion-row>
|
</p>
|
||||||
<button ion-button icon-only item-end no-padding (click)="deleteForSection(section)">
|
<button ion-button icon-only item-end no-padding (click)="deleteForSection(section)">
|
||||||
<core-icon name="trash" label="{{ 'addon.storagemanager.deletedatafrom' | translate: { name: section.name } }}"></core-icon>
|
<core-icon name="trash" label="{{ 'addon.storagemanager.deletedatafrom' | translate: { name: section.name } }}"></core-icon>
|
||||||
</button>
|
</button>
|
||||||
|
@ -39,21 +37,20 @@
|
||||||
</ion-card-header>
|
</ion-card-header>
|
||||||
<ion-card-content>
|
<ion-card-content>
|
||||||
<ng-container *ngFor="let module of section.modules">
|
<ng-container *ngFor="let module of section.modules">
|
||||||
<div *ngIf="module.totalSize > 0">
|
<ion-item no-padding *ngIf="module.totalSize > 0">
|
||||||
<ion-item no-padding>
|
<h2 class="{{module.handlerData.class}} addon-storagemanager-module-size">
|
||||||
<ion-row class="{{module.handlerData.class}}">
|
<img *ngIf="module.handlerData.icon" [src]="module.handlerData.icon" alt="" role="presentation" class="core-module-icon"
|
||||||
<img *ngIf="module.handlerData.icon" [src]="module.handlerData.icon" alt="" role="presentation" class="core-module-icon"
|
>
|
||||||
>{{ module.name }}
|
{{ module.name }}
|
||||||
</ion-row>
|
</h2>
|
||||||
<ion-row class="size">
|
<p>
|
||||||
<ion-icon name="cube"></ion-icon>
|
<ion-icon name="cube" item-start></ion-icon>
|
||||||
{{ module.totalSize | coreBytesToSize }}
|
{{ module.totalSize | coreBytesToSize }}
|
||||||
</ion-row>
|
</p>
|
||||||
<button ion-button icon-only outline item-end (click)="deleteForModule(module)">
|
<button ion-button icon-only outline item-end (click)="deleteForModule(module)">
|
||||||
<core-icon name="trash" label="{{ 'addon.storagemanager.deletedatafrom' | translate: { name: module.name } }}"></core-icon>
|
<core-icon name="trash" label="{{ 'addon.storagemanager.deletedatafrom' | translate: { name: module.name } }}"></core-icon>
|
||||||
</button>
|
</button>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
</div>
|
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</ion-card-content>
|
</ion-card-content>
|
||||||
</ion-card>
|
</ion-card>
|
||||||
|
|
|
@ -13,12 +13,7 @@ ion-app.app-root page-addon-storagemanager-course-storage {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 2rem;
|
font-size: 2rem;
|
||||||
}
|
}
|
||||||
.size {
|
|
||||||
margin-top: 4px;
|
|
||||||
}
|
|
||||||
.size ion-icon {
|
|
||||||
margin-right: 4px;
|
|
||||||
}
|
|
||||||
.core-module-icon {
|
.core-module-icon {
|
||||||
margin-right: 4px;
|
margin-right: 4px;
|
||||||
width: 16px;
|
width: 16px;
|
||||||
|
|
|
@ -19,6 +19,7 @@ import { CoreCourseModulePrefetchDelegate } from '@core/course/providers/module-
|
||||||
import { CoreCourseHelperProvider } from '@core/course/providers/helper';
|
import { CoreCourseHelperProvider } from '@core/course/providers/helper';
|
||||||
import { CoreDomUtilsProvider } from '@providers/utils/dom';
|
import { CoreDomUtilsProvider } from '@providers/utils/dom';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
import { CoreConstants } from '@core/constants';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays the amount of file storage used by each activity on the course, and allows
|
* Page that displays the amount of file storage used by each activity on the course, and allows
|
||||||
|
@ -84,6 +85,10 @@ export class AddonStorageManagerCourseStoragePage {
|
||||||
|
|
||||||
Promise.all(allPromises).then(() => {
|
Promise.all(allPromises).then(() => {
|
||||||
this.loaded = true;
|
this.loaded = true;
|
||||||
|
|
||||||
|
if (this.totalSize == 0) {
|
||||||
|
this.markCourseAsNotDownloaded();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -162,6 +167,25 @@ export class AddonStorageManagerCourseStoragePage {
|
||||||
modal.dismiss();
|
modal.dismiss();
|
||||||
|
|
||||||
this.domUtils.showErrorModalDefault(error, this.translate.instant('core.errordeletefile'));
|
this.domUtils.showErrorModalDefault(error, this.translate.instant('core.errordeletefile'));
|
||||||
|
}).finally(() => {
|
||||||
|
// @TODO This is a workaround that should be more specific solving MOBILE-3305.
|
||||||
|
// Also should take into account all modules are not downloaded.
|
||||||
|
|
||||||
|
// Mark course as not downloaded if course size is 0.
|
||||||
|
if (this.totalSize == 0) {
|
||||||
|
this.markCourseAsNotDownloaded();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mark course as not downloaded.
|
||||||
|
*/
|
||||||
|
protected markCourseAsNotDownloaded(): void {
|
||||||
|
// @TODO This is a workaround that should be more specific solving MOBILE-3305.
|
||||||
|
// Also should take into account all modules are not downloaded.
|
||||||
|
// Check after MOBILE-3188 is integrated.
|
||||||
|
|
||||||
|
this.courseProvider.setCourseStatus(this.course.id, CoreConstants.NOT_DOWNLOADED);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -490,6 +490,7 @@ export class CoreTabsComponent implements OnInit, AfterViewInit, OnChanges, OnDe
|
||||||
this.originalTabsContainer.style.paddingBottom = this.tabBarHeight + 'px';
|
this.originalTabsContainer.style.paddingBottom = this.tabBarHeight + 'px';
|
||||||
this.tabBarElement.classList.remove('tabs-hidden');
|
this.tabBarElement.classList.remove('tabs-hidden');
|
||||||
this.tabsShown = true;
|
this.tabsShown = true;
|
||||||
|
this.lastScroll = 0;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue