| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You 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. |
| --> |
| |
| <ng-container *ngIf="office$ | async as office"> |
| <fims-layout-card-over title="{{office.parentIdentifier ? office.name : office.name + ' (Headquarter)'}}" subTitle="{{office.description}}" |
| [navigateBackTo]="office.parentIdentifier ? ['../../', this.office.parentIdentifier] : undefined"> |
| <fims-layout-card-over-header-menu layout="row" layout-align="end center"> |
| <td-search-box #searchBox placeholder="{{'Search' | translate}}" (search)="searchOffice($event)" |
| [alwaysVisible]="false"></td-search-box> |
| <a mat-icon-button [routerLink]="['edit']" *hasPermission="{ id: 'office_offices', accessLevel: 'CHANGE' }"> |
| <mat-icon>mode_edit</mat-icon> |
| </a> |
| <button mat-icon-button (click)="deleteOffice(office)" title="{{'Delete this office' | translate}}" |
| *ngIf="canDelete$ | async"> |
| <mat-icon>delete</mat-icon> |
| </button> |
| </fims-layout-card-over-header-menu> |
| <fims-two-column-layout> |
| <mat-nav-list left> |
| <h3 mat-subheader translate>Management</h3> |
| <a mat-list-item [routerLink]="['tellers']" *hasPermission="{ id: 'teller_management', accessLevel: 'READ'}"> |
| <mat-icon matListAvatar>person</mat-icon> |
| <h3 matLine translate>Tellers</h3> |
| <p matLine translate>Manage tellers</p> |
| </a> |
| </mat-nav-list> |
| <ng-container right> |
| <mat-list> |
| <h3 mat-subheader translate>Address</h3> |
| <mat-list-item *ngIf="office.address"> |
| <mat-icon matListAvatar>location_on</mat-icon> |
| <h3 matLine>{{office.address.street}}, {{office.address.postalCode}}, {{office.address.city}}<span *ngIf="office.address.region">({{office.address.region}})</span> |
| </h3> |
| <p matLine>{{office.address.country}}</p> |
| </mat-list-item> |
| <mat-list-item *ngIf="!office.address"> |
| <mat-icon matListAvatar>location_on</mat-icon> |
| <h3 matLine translate>No address available</h3> |
| </mat-list-item> |
| <h3 mat-subheader translate>Branch offices</h3> |
| </mat-list> |
| |
| <fims-data-table flex |
| (onFetch)="fetchBranches(office.identifier, $event)" |
| (onActionCellClick)="rowSelect($event)" |
| [columns]="columns" |
| [data]="branchData" |
| [sortable]="true" |
| [pageable]="true"> |
| </fims-data-table> |
| </ng-container> |
| </fims-two-column-layout> |
| </fims-layout-card-over> |
| <a mat-fab color="accent" title="{{'Create branch office' | translate}}" class="mat-fab-position-bottom-right" |
| [routerLink]="['../../../create']" |
| [queryParams]="{ parentId: office.identifier }" *hasPermission="{ id: 'office_offices', accessLevel: 'CHANGE' }"> |
| <mat-icon>add</mat-icon> |
| </a> |
| </ng-container> |