commit
204d8dc0a4
|
@ -34,8 +34,8 @@
|
||||||
contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId">
|
contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId">
|
||||||
</core-course-module-description>
|
</core-course-module-description>
|
||||||
|
|
||||||
<ion-list *ngIf="subfolder && (subfolder!.files.length + subfolder!.folders.length > 0)">
|
<ion-list *ngIf="contents && (contents!.files.length + contents!.folders.length > 0)">
|
||||||
<ng-container *ngFor="let folder of subfolder!.folders">
|
<ng-container *ngFor="let folder of contents!.folders">
|
||||||
<ion-item class="item-file" (click)="openFolder(folder)" detail="true" button>
|
<ion-item class="item-file" (click)="openFolder(folder)" detail="true" button>
|
||||||
<ion-icon name="fas-folder" slot="start" [attr.aria-label]="'core.folder' | translate"></ion-icon>
|
<ion-icon name="fas-folder" slot="start" [attr.aria-label]="'core.folder' | translate"></ion-icon>
|
||||||
<ion-label>
|
<ion-label>
|
||||||
|
@ -43,12 +43,12 @@
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container *ngFor="let file of subfolder!.files">
|
<ng-container *ngFor="let file of contents!.files">
|
||||||
<core-file [file]="file" [component]="component" [componentId]="componentId"></core-file>
|
<core-file [file]="file" [component]="component" [componentId]="componentId"></core-file>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</ion-list>
|
</ion-list>
|
||||||
|
|
||||||
<core-empty-box *ngIf="!subfolder || (subfolder!.files.length + subfolder!.folders.length == 0)" icon="far-folder-open"
|
<core-empty-box *ngIf="!contents || (contents!.files.length + contents!.folders.length == 0)" icon="far-folder-open"
|
||||||
[message]=" 'addon.mod_folder.emptyfilelist' | translate"></core-empty-box>
|
[message]=" 'addon.mod_folder.emptyfilelist' | translate"></core-empty-box>
|
||||||
|
|
||||||
</core-loading>
|
</core-loading>
|
||||||
|
|
|
@ -42,6 +42,7 @@ export class AddonModFolderIndexComponent extends CoreCourseModuleMainResourceCo
|
||||||
|
|
||||||
component = AddonModFolderProvider.COMPONENT;
|
component = AddonModFolderProvider.COMPONENT;
|
||||||
canGetFolder = false;
|
canGetFolder = false;
|
||||||
|
contents?: AddonModFolderFolderFormattedData;
|
||||||
|
|
||||||
constructor(@Optional() courseContentsPage?: CoreCourseContentsPage) {
|
constructor(@Optional() courseContentsPage?: CoreCourseContentsPage) {
|
||||||
super('AddonModFolderIndexComponent', courseContentsPage);
|
super('AddonModFolderIndexComponent', courseContentsPage);
|
||||||
|
@ -57,6 +58,7 @@ export class AddonModFolderIndexComponent extends CoreCourseModuleMainResourceCo
|
||||||
|
|
||||||
if (this.subfolder) {
|
if (this.subfolder) {
|
||||||
this.description = this.folderInstance ? this.folderInstance.intro : this.module.description;
|
this.description = this.folderInstance ? this.folderInstance.intro : this.module.description;
|
||||||
|
this.contents = this.subfolder;
|
||||||
|
|
||||||
this.loaded = true;
|
this.loaded = true;
|
||||||
this.refreshIcon = CoreConstants.ICON_REFRESH;
|
this.refreshIcon = CoreConstants.ICON_REFRESH;
|
||||||
|
@ -112,7 +114,7 @@ export class AddonModFolderIndexComponent extends CoreCourseModuleMainResourceCo
|
||||||
this.dataRetrieved.emit(this.folderInstance || this.module);
|
this.dataRetrieved.emit(this.folderInstance || this.module);
|
||||||
|
|
||||||
this.description = this.folderInstance ? this.folderInstance.intro : this.module.description;
|
this.description = this.folderInstance ? this.folderInstance.intro : this.module.description;
|
||||||
this.subfolder = AddonModFolderHelper.formatContents(this.module.contents);
|
this.contents = AddonModFolderHelper.formatContents(this.module.contents);
|
||||||
} finally {
|
} finally {
|
||||||
this.fillContextMenu(refresh);
|
this.fillContextMenu(refresh);
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
cursor: text;
|
cursor: text;
|
||||||
img {
|
::ng-deep img {
|
||||||
@include padding(null, null, null, 2px);
|
@include padding(null, null, null, 2px);
|
||||||
max-width: 95%;
|
max-width: 95%;
|
||||||
width: auto;
|
width: auto;
|
||||||
|
@ -78,7 +78,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make empty elements selectable (to move the cursor).
|
// Make empty elements selectable (to move the cursor).
|
||||||
*:empty:after {
|
::ng-deep *:empty:after {
|
||||||
content: '\200B';
|
content: '\200B';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue