Skip to content
Snippets Groups Projects
indexing-models-administration.component.html 6.71 KiB
Newer Older
  • Learn to ignore specific revisions
  • <mat-sidenav-container autosize class="maarch-container">
    
            <mat-nav-list>
                <h3 mat-subheader>{{lang.actions}}</h3>
                <a mat-list-item routerLink="/administration/indexingModels/new">
                    <mat-icon color="primary" mat-list-icon class="fa fa-plus"></mat-icon>
                    <p mat-line>
                        {{lang.add}}
                    </p>
                </a>
            </mat-nav-list>
    
        <mat-sidenav-content>
            <div class="bg-head">
                <div class="bg-head-title" [class.customContainerRight]="appService.getViewMode()">
                    <div class="bg-head-title-label">
    
                    </div>
                    <div class="bg-head-title-tool">
                        <header-right></header-right>
                    </div>
    
                <div class="bg-head-content" [class.fullContainer]="appService.getViewMode()">
                </div>
            </div>
            <div class="container" [class.fullContainer]="appService.getViewMode()">
                <div class="container-content">
                    <div *ngIf="loading" style="display:flex;height:100%;">
                        <mat-spinner style="margin:auto;"></mat-spinner>
    
                    <mat-card *ngIf="!loading" class="card-app-content">
                        <div class="row">
                            <div class="col-md-6 col-xs-6">
                                <mat-form-field>
    
                                    <input matInput [formControl]="adminService.getFilterField()" placeholder="{{lang.filterBy}}">
    
                                </mat-form-field>
                            </div>
                            <div class="col-md-6 col-xs-6">
                                <mat-paginator #paginator [length]="100" [hidePageSize]="true" [pageSize]="10">
                                </mat-paginator>
                            </div>
                        </div>
    
                        <mat-table #table [dataSource]="adminService.getDataSource()" matSortDisableClear matSort>
    
                            <ng-container matColumnDef="id">
                                <mat-header-cell *matHeaderCellDef mat-sort-header>{{lang.technicalId}}</mat-header-cell>
                                <mat-cell *matCellDef="let element"> {{element.id}} </mat-cell>
                            </ng-container>
                            <ng-container matColumnDef="category">
                                <mat-header-cell *matHeaderCellDef mat-sort-header>{{lang.category_id}}</mat-header-cell>
                                <mat-cell *matCellDef="let element"> {{lang[element.category]}} </mat-cell>
                            </ng-container>
                            <ng-container matColumnDef="label">
                                <mat-header-cell *matHeaderCellDef mat-sort-header style="flex:2">{{lang.label}}</mat-header-cell>
                                <mat-cell *matCellDef="let element" style="flex:2"> {{element.label}} </mat-cell>
                            </ng-container>
                            <ng-container matColumnDef="private">
                                <mat-header-cell *matHeaderCellDef mat-sort-header>{{lang.perimeter}}</mat-header-cell>
                                <mat-cell *matCellDef="let element">
    
                                <span [ngClass]="{'dataLabelWarn': element.private, 'dataLabelPrimary': !element.private}"
    
                                      class="label">{{element.private ? lang.private : lang.public}}</span>
                                </mat-cell>
                            </ng-container>
                            <ng-container matColumnDef="default">
                                <mat-header-cell *matHeaderCellDef mat-sort-header>{{lang.default}}</mat-header-cell>
                                <mat-cell *matCellDef="let element">
    
                                <span [ngClass]="{'dataLabelWarn': !element.default, 'dataLabelPrimary': element.default}"
    
                                      class="label">{{element.default ? lang.yes : lang.no}}</span>
                                </mat-cell>
                            </ng-container>
                            <ng-container matColumnDef="enabled">
                                <mat-header-cell *matHeaderCellDef mat-sort-header>{{lang.status}}</mat-header-cell>
                                <mat-cell *matCellDef="let element">
                                    <span *ngIf="element.enabled" class="label dataLabelPrimary">{{lang.active}}</span>
                                    <span *ngIf="!element.enabled" class="label dataLabelWarn">{{lang.inactive}}</span>
                                </mat-cell>
                            </ng-container>
                            <ng-container matColumnDef="actions">
                                <mat-header-cell *matHeaderCellDef></mat-header-cell>
                                <mat-cell *matCellDef="let element" style="justify-content: flex-end;">
                                    <button mat-icon-button color="primary" *ngIf="element.enabled" matTooltip="{{lang.suspend}}"
                                            (click)="$event.stopPropagation();disableIndexingModel(element)" [disabled]="element.default">
                                        <mat-icon class="fa fa-pause fa-2x" aria-hidden="true"></mat-icon>
                                    </button>
                                    <button mat-icon-button color="accent" *ngIf="!element.enabled" matTooltip="{{lang.authorize}}" (click)="$event.stopPropagation();enableIndexingModel(element)">
                                        <mat-icon class="fa fa-check fa-2x" aria-hidden="true"></mat-icon>
                                    </button>
                                    <button mat-icon-button color="warn" matTooltip="{{lang.delete}}" (click)="$event.stopPropagation();delete(element)" [disabled]="element.default">
                                        <mat-icon class="fa fa-trash-alt fa-2x" aria-hidden="true"></mat-icon>
                                    </button>
                                </mat-cell>
                            </ng-container>
                            <mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
                            <mat-row *matRowDef="let row; columns: displayedColumns;"
                                     routerLink="/administration/indexingModels/{{row.id}}" style="cursor:pointer;"
                                     matTooltip="{{lang.view}}"></mat-row>
                        </mat-table>
                        <div class="mat-paginator"
                             style="min-height:48px;min-height: 48px;display: flex;justify-content: end;align-items: center;padding-right: 20px;">
                            {{indexingModels.length}} {{lang.indexingModels}}</div>
                    </mat-card>
                </div>
            </div>
        </mat-sidenav-content>
    </mat-sidenav-container>