mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
#152 Support for custom 'empty folder' template
- default background image for empty folders - support for user-defined custom templates - readme updated
This commit is contained in:
@@ -64,6 +64,10 @@
|
||||
color: #777;
|
||||
}
|
||||
|
||||
:host .empty-folder-content > img {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Utils */
|
||||
|
||||
:host .sr-only {
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 226 KiB |
@@ -100,5 +100,18 @@
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr *ngIf="folder?.list?.entries?.length === 0">
|
||||
<td class="mdl-data-table__cell--non-numeric empty-folder-content"
|
||||
[attr.colspan]="1 + columns?.length">
|
||||
<template *ngIf="emptyFolderTemplate"
|
||||
ngFor [ngForOf]="[folder]"
|
||||
[ngForTemplate]="emptyFolderTemplate">
|
||||
</template>
|
||||
<img *ngIf="!emptyFolderTemplate"
|
||||
[src]="__baseUrl + '/document-list.empty-folder.png'">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
@@ -23,7 +23,8 @@ import {
|
||||
EventEmitter,
|
||||
AfterContentInit,
|
||||
AfterViewChecked,
|
||||
OnChanges
|
||||
OnChanges,
|
||||
TemplateRef
|
||||
} from 'angular2/core';
|
||||
import { AlfrescoService } from './../services/alfresco.service';
|
||||
import { MinimalNodeEntity, NodePaging } from './../models/document-library.model';
|
||||
@@ -45,6 +46,8 @@ export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit,
|
||||
|
||||
DEFAULT_ROOT_FOLDER: string = '/Sites/swsdp/documentLibrary';
|
||||
|
||||
__baseUrl = __moduleName.replace('/document-list.js', '');
|
||||
|
||||
@Input()
|
||||
navigate: boolean = true;
|
||||
|
||||
@@ -73,6 +76,7 @@ export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit,
|
||||
|
||||
actions: ContentActionModel[] = [];
|
||||
columns: ContentColumnModel[] = [];
|
||||
emptyFolderTemplate: TemplateRef;
|
||||
|
||||
private _folder: NodePaging;
|
||||
|
||||
|
@@ -0,0 +1,45 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
Directive,
|
||||
ContentChild,
|
||||
TemplateRef,
|
||||
OnInit,
|
||||
AfterContentInit
|
||||
} from 'angular2/core';
|
||||
import { DocumentList } from './document-list';
|
||||
|
||||
@Directive({
|
||||
selector: 'empty-folder-content'
|
||||
})
|
||||
export class EmptyFolderContent implements OnInit, AfterContentInit {
|
||||
|
||||
@ContentChild(TemplateRef)
|
||||
template: any;
|
||||
|
||||
constructor(
|
||||
private documentList: DocumentList) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
ngAfterContentInit() {
|
||||
this.documentList.emptyFolderTemplate = this.template;
|
||||
}
|
||||
}
|
@@ -17,10 +17,12 @@
|
||||
|
||||
// note: contains only limited subset of available fields
|
||||
|
||||
// TODO: deprecated
|
||||
export class FolderEntity {
|
||||
items: DocumentEntity[];
|
||||
}
|
||||
|
||||
// TODO: deprecated
|
||||
export class DocumentEntity {
|
||||
nodeRef: string;
|
||||
nodeType: string;
|
||||
@@ -52,6 +54,7 @@ export class DocumentEntity {
|
||||
location: LocationEntity;
|
||||
}
|
||||
|
||||
// TODO: deprecated
|
||||
export class LocationEntity {
|
||||
repositoryId: string;
|
||||
site: string;
|
||||
@@ -62,6 +65,7 @@ export class LocationEntity {
|
||||
parent: LocationParentEntity;
|
||||
}
|
||||
|
||||
// TODO: deprecated
|
||||
export class LocationParentEntity {
|
||||
nodeRef: string;
|
||||
}
|
||||
|
Reference in New Issue
Block a user