blob: bacdab580b69ab6d9f9697926aab3f5cd04a9fb5 [file] [log] [blame]
<!--
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.
-->
<fims-layout-card-over title="{{'Upload portrait' | translate}}" [navigateBackTo]="['../']">
<mat-card-content>
<div layout="column" layout-align="center center">
<fims-portrait [blob]="portrait" [size]="'large'"></fims-portrait>
</div>
<div layout="column" layout-align="center center" *hasPermission="{ id: 'customer_portrait', accessLevel: 'CHANGE' }">
<span translate>Selected file:</span> {{ fileSelectMsg | translate }}
<span *ngIf="fileSelectMsg" translate>
Press the upload button below to upload the portrait.
</span>
<div layout="row" layout-margin>
<td-file-upload #singleFileUpload (select)="selectEvent($event)" (upload)="uploadEvent($event)"
accept=".jpg,.png">
<mat-icon>file_upload</mat-icon>
<span translate>Click here to upload</span><span>{{ singleFileUpload.files?.name }}</span>
<ng-template td-file-input-label>
<mat-icon>attach_file</mat-icon>
<span translate>Choose a file to upload(max size 512 KB)</span>
</ng-template>
</td-file-upload>
</div>
<span layout-margin *ngIf="invalidSize" class="tc-red-500" translate>
Portrait can't exceed size of 512KB.
</span>
<div layout="row" layout-margin *hasPermission="{ id: 'customer_portrait', accessLevel: 'DELETE' }">
<button mat-raised-button color="warn" (click)="deletePortrait()">{{'DELETE PORTRAIT' | translate}}
</button>
</div>
</div>
</mat-card-content>
</fims-layout-card-over>