indexation.component.html 6.26 KB
Newer Older
1
<mat-sidenav-container class="maarch-container">
2
    <ng-template #adminMenuTemplate>
3
4
5
6
        <app-select-indexing-model #appSelectIndexingModel [adminMode]="true" [indexingForm]="indexingForm"
            (afterListModelsLoaded)="loadIndexingModel($event)"
            (afterSelectedListModel)="this.currentIndexingModel = $event;indexingForm.loadForm($event.id)">
        </app-select-indexing-model>
7
        <ng-container *ngIf="!isEmptyIndexingModels()">
8
9
            <div class="indexing-form-container">
                <app-indexing-form *ngIf="currentIndexingModel.id !== undefined" #indexingForm
10
11
                    [groupId]="currentGroupId" [indexingFormId]="currentIndexingModel.id"
                    (retrieveDocumentEvent)="appDocumentViewer.saveDocService()"></app-indexing-form>
12
13
            </div>
            <div class="actions-indexing-form">
14
                <ng-container
15
                    *ngIf="actionsListLoaded && actionsList.length > 0 && indexingForm !== undefined && selectedAction !== undefined">
16
17
18
                    <button mat-button class="button-form-primary" [disabled]="selectedAction.id === 0"
                        [matMenuTriggerFor]="menu" style="width:350px;margin-right:20px;"
                        [title]="selectedAction.label">
19
20
21
                        <span class="menu-label" [innerHTML]="selectedAction.label">
                        </span>
                        <i class="fa fa-chevron-down menu-icon"></i></button>
22
                    <mat-menu #menu="matMenu" [class]="'menuForm menuAction'">
23
24
                        <div class="menuTitle">
                            <span>
25
                                {{'lang.actions' | translate}}
26
27
28
                            </span>
                            <mat-form-field floatLabel="never" appearance="outline" class="smallInput"
                                (click)="$event.stopPropagation();">
29
30
                                <input matInput id="searchTerm" placeholder="{{'lang.filterBy' | translate}}"
                                    #listFilter autocomplete="off" (click)="$event.stopPropagation();"
31
32
33
34
35
36
37
38
39
40
                                    (keydown)="$event.stopPropagation()">
                            </mat-form-field>
                        </div>
                        <ng-container *ngFor="let action of actionsList | filterList:listFilter.value:'label'">
                            <button *ngIf="showActionInCurrentCategory(action)" mat-menu-item
                                (click)="selectAction(action)" [title]="action.label"
                                [class.listModels-menu-selected]="action.id === selectedAction.id"
                                [disabled]="!action.enabled">
                                <span style="flex:1;">{{action.label}}</span><small
                                    style="position: absolute;top: 15px;left: 140px;" color="warn"
41
                                    *ngIf="!action.enabled">{{'lang.badActionParam' | translate}}</small>
42
                            </button>
43
44
                        </ng-container>
                    </mat-menu>
45
                    <button mat-button *ngIf="!appService.getViewMode()"
46
                        [disabled]="actionService.loading || selectedAction.id === 0 || (appDocumentViewer !== undefined && !appDocumentViewer.isEditorLoaded())"
47
                        class="button-form-primary-filled"
48
                        style="width: 150px;align-items: center;justify-content: center;text-align: center;display: flex;"
49
                        (click)="onSubmit()">{{'lang.validate' | translate}}</button>
50
51
52
53
54
                    <button mat-icon-button *ngIf="appService.getViewMode()" class="button-form-primary"
                        (click)="onSubmit()">
                        <mat-icon class="fa fa-check"></mat-icon>
                    </button>
                </ng-container>
55
                <div class="emptyAction" *ngIf="actionsListLoaded && actionsList.length === 0"
56
                    [innerHTML]="'lang.noAvailableAction' | translate"></div>
57
58
            </div>
        </ng-container>
59
60
        <div *ngIf="isEmptyIndexingModels()" class="emptyModel"
            [innerHTML]="'lang.noAvailableIndexingModel' | translate"></div>
61
    </ng-template>
62
63
64
65
    <mat-sidenav-content>
        <div class="bg-head">
            <div class="bg-head-title" [class.customContainerRight]="appService.getViewMode()">
                <div class="bg-head-title-label">
66
                    <app-header-left></app-header-left>
67
68
                </div>
                <div class="bg-head-title-tool">
69
                    <app-header-right></app-header-right>
70
71
72
                </div>
            </div>
        </div>
73
74
75
76
77
        <div class="bg-head-content" [class.fullContainer]="appService.getViewMode()">
            <button mat-button class="attach-button" (click)="snav2.toggle()">
                <i class="fa fa-paperclip"></i> {{'lang.attachments' | translate}} <span class="count-badge" [class.count-badge-empty]="appIndexationAttachmentsList.getCountAttachments() === 0">{{appIndexationAttachmentsList.getCountAttachments()}}</span>
            </button>
        </div>
78
79
        <div class="document-container" [class.fullContainer]="appService.getViewMode()">
            <div class="content">
80
81
82
83
                <app-document-viewer
                    [style.display]="this.currentIndexingModel.category !== 'registeredMail' ? 'block' : 'none'"
                    #appDocumentViewer [editMode]="true" [tmpFilename]="tmpFilename" (triggerEvent)="refreshDatas()"
                    style="height:100%;width:100%;">
84
                </app-document-viewer>
85
86
                <div *ngIf="this.currentIndexingModel.category === 'registeredMail'"
                    style="font-size: 120px;opacity: 0.4;">
87
88
                    <i class="fas fa-dolly-flatbed"></i>
                </div>
89
90
91
            </div>
        </div>
    </mat-sidenav-content>
92
93
94
95
96
97
    <mat-sidenav #snav2 [fixedInViewport]="appService.getViewMode()" position='end'
        [opened]="false" [mode]="appService.getViewMode() ? 'over' : 'side'"
        class="panel-right" style="overflow-x:hidden;width:300px;" [class.docView]="!filtersListService.filterMode"
        autoFocus="false">
        <app-indexation-attachments-list #appIndexationAttachmentsList></app-indexation-attachments-list>
    </mat-sidenav>
98
</mat-sidenav-container>