Skip to content
Snippets Groups Projects
attachments-list.component.html 5.8 KiB
Newer Older
  • Learn to ignore specific revisions
  • <ng-container *ngIf="loading; else elseLoading">
        <div class="loading">
            <mat-spinner></mat-spinner>
    
    </ng-container>
    <ng-template #elseLoading>
        <div (mouseover)="resetToggleInfo()">
            <div *ngIf="attachments.length == 0" style="text-align:center;font-size:24px;font-weight:bold;opacity:0.3;">
                {{lang.noAttachment}}
    
            <!--<button mat-button color="primary" (click)="createAttachment()">{{lang.addAttachment}}</button>-->
            <mat-button-toggle-group *ngIf="attachments.length > 0" class="filterTypes" (change)="filterType($event)">
                <mat-button-toggle [checked]="currentFilter === ''" [value]="''">Tous</mat-button-toggle>
                <mat-button-toggle *ngFor="let attachType of filterAttachTypes | sortBy : 'label'"
                    [checked]="currentFilter === attachType.id" [value]="attachType.id">{{attachType.label}}
                </mat-button-toggle>
            </mat-button-toggle-group>
            <mat-card *ngFor="let attachment of attachments | filterList:currentFilter:'type'"
    
                [class.signed]="attachment.status==='SIGN'" [style.background-image]="'url('+(attachment.thumbnailUrl | secureUrl | async)+')'"
    
                style="padding:0;margin: 30px;min-height: 300px;background-size: cover;overflow: hidden;"
                (mouseover)="$event.stopPropagation();toggleInfo(attachment,true)">
                <div class="layout" *ngIf="attachment.hideMainInfo" [@myAnimation] (click)="showAttachment(attachment)">
                    <button mat-raised-button color="primary"
                        (click)="$event.stopPropagation();showAttachment(attachment)">{{lang.viewResource}}</button>
    
                    <button mat-raised-button color="warn" *ngIf="attachment.status!=='SIGN' && attachment.status!=='FRZ'"
    
                        (click)="$event.stopPropagation();deleteAttachment(attachment)"
                        [disabled]="!attachment.canDelete">{{lang.deleteResource}}</button>
    
                <div class="pjToolsContent">
    
                    <span *ngIf="attachment.relation > 1" color="primary" class="versionButton">{{lang.version}} <b
                            color="secondary">{{attachment.relation}}</b></span>
    
                    <button color="primary" class="actionsButton" mat-icon-button [matMenuTriggerFor]="menuPjAction">
                        <mat-icon fontSet="fas" fontIcon="fa-ellipsis-v"></mat-icon>
                    </button>
                    <mat-menu #menuPjAction="matMenu">
    
                        <button mat-menu-item [disabled]="attachment.status === 'FRZ'" (click)="setInSignatureBook(attachment)">
    
                            <mat-checkbox color="primary" [(ngModel)]="attachment.inSignatureBook"></mat-checkbox>
                            {{lang.putInSignatureBook}}
                        </button>
                        <button mat-menu-item (click)="setInSendAttachment(attachment)" [disabled]="!mailevaEnabled">
                            <mat-checkbox color="primary" [(ngModel)]="attachment.inSendAttach"
                                [disabled]="!mailevaEnabled">
                            </mat-checkbox>
                            {{lang.putInSendAttach}}
                        </button>
    
                        <ng-container *ngIf="maarchParapheurEnabled && attachment.status === 'FRZ'">
                            <mat-divider></mat-divider>
                            <button mat-menu-item (click)="openMaarchParapheurWorkflow(attachment)">
                                {{lang.externalVisaWorkflow}}
                            </button>
                        </ng-container>
    
                    </mat-menu>
    
    
                <div class="infosPj">
                    <div class="stateInfo">
    
                        <i title="{{lang.inSignatureBook}}" class="fas fa-file-signature" *ngIf="attachment.inSignatureBook"></i>&nbsp;
                        <i title="{{lang.inShipping}}" class="fa fa-shipping-fast" *ngIf="attachment.inSendAttach"></i>
    
                    </div>
                    <div class="mainInfos" *ngIf="!attachment.hideMainInfo">
                        {{attachment.chrono}}&nbsp;
                    </div>
                    <div class="mainInfos" *ngIf="attachment.hideMainInfo">
                        {{attachment.title | shorten : 40:'...'}}
                    </div>
                    <div class="subInfos" *ngIf="!attachment.hideMainInfo">
                        {{attachment.typeLabel}}
                    </div>
                    <div class="subInfos" *ngIf="attachment.hideMainInfo">
                        <ng-container *ngIf="attachment.signDate !== undefined; else elseTemplate">
                            {{lang.signedAlt}} <b>{{attachment.signDate | timeAgo : 'full'}}</b> {{lang.by | lowercase}}
                            <b>{{attachment.signatory}}</b>
    
                        <ng-template #elseTemplate>
                            <ng-container *ngIf="attachment.modificationDate !== null; else creationTemplate">
                                {{lang.modified}} <b>{{attachment.modificationDate | timeAgo : 'full'}}</b>
                                {{lang.by | lowercase}} <b>{{attachment.modifiedBy}}</b>
                            </ng-container>
                            <ng-template #creationTemplate>
                                {{lang.created}} <b>{{attachment.creationDate | timeAgo : 'full'}}</b>
                                {{lang.by | lowercase}} <b>{{attachment.typistLabel}}</b>
                            </ng-template>
    
                    </div>
                    <div class="statusInfo">
                        {{lang['attachment_'+attachment.status]}}
                    </div>
    
            </mat-card>
        </div>
    
        <button mat-fab class="addPj" [class.addPjPanel]="target === 'panel'" [class.addPjProcess]="target === 'process'" color="primary" [title]="lang.addAttachment" (click)="createAttachment()">
    
            <mat-icon class="fa fa-plus"></mat-icon>
        </button>