up csc placeholder and file csv upload

This commit is contained in:
Tykayn 2025-09-15 13:03:21 +02:00 committed by tykayn
parent 8694a04ea9
commit a359d0f9b1
18 changed files with 632 additions and 452 deletions

View file

@ -1,44 +1,70 @@
<div class="translate-texts">
<div class="columns">
<div class="column">
<div id="fromText">
<div id="fromText">
<!-- delete button from_text-->
@if (fromText.length > 0) {
<button (click)="emptyText('fromText')" class="delete-button button">x</button>
}
<textarea (keyup)="onFromTextChanged()" [(ngModel)]="fromText" cols="30" id="from_text"
name="from_text"
placeholder=""
rows="10"></textarea>
<sae-main-button></sae-main-button>
<button (click)="clickFileUpload(fileUpload)" class=" click-file-upload is-outlined">
<i class="ri-upload-cloud-2-line"></i>
<span class="label">
@if (!fileIsUploaded && !textFocused) {
<button (click)="clickFileUpload(fileUpload)" class=" click-file-upload is-outlined">
<span class="label">
Upload .csv file
</span>
</button>
<input #fileUpload (change)="onFileSelected($event)" class="is-outlined" id="fileUploadTranslator" type="file">
</div>
</div>
<div class="column">
<i class="ri-upload-cloud-2-line"></i>
</button>
<!-- hidden text input-->
<input #fileUpload
accept=".csv"
(change)="onFileSelected($event)" class="is-outlined" id="fileUploadTranslator"
type="file">
}
@if (fileIsUploaded) {
<div class="file-selected">
<div class="labeling">
<div id="toText">
@if (toText.length > 0) {
<button (click)="emptyText('toText')" class="delete-button button">x</button>
}
<textarea [(ngModel)]="toText" cols="30" id="to_text" name="to_text" rows="10"></textarea>
</div>
@if (loadingResume) {
<div class="loading">
loading...
<div>
<i class="ri ri-file-2-line"></i>
</div>
<div class="label">
{{ filePath }}
</div>
<div class="weight">
{{ fileWeight }}
</div>
</div>
}
<button class="remove-file-upload" (click)="onRemoveFileSelected()">x</button>
</div>
}
<!-- delete button from_text-->
</div>
<button (click)="emptyText('fromText')" [ngClass]="{
'is-visible' : fromText.length
}" class="delete-button button">x
</button>
<textarea
(focus)="focusFromText()"
(keyup)="onFromTextChanged()"
[(ngModel)]="fromText"
cols="30"
id="from_text"
name="from_text"
placeholder="Copy/paste clients question \n or Drag and drop extracted .csv file from CRM portal..."
rows="5"></textarea>
</div>
<div id="toText">
@if (loadingResume) {
<div class="loading">
loading...
</div>
}
@if (toText.length > 0) {
<button (click)="emptyText('toText')" class="delete-button button">x</button>
}
<textarea [(ngModel)]="toText" cols="30" id="to_text" name="to_text" rows="10"></textarea>
</div>
</div>