Files
cbsnexora/src/app/shared/tabs/entity-notes-tab/entity-notes-tab.component.html
T

81 lines
2.7 KiB
HTML

<!--
Copyright since 2025 Mifos Initiative
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<div class="tab-container mat-typography">
<h3>{{ 'labels.heading.Notes' | translate }}</h3>
<div class="add-note-section">
<form
#formRef="ngForm"
[formGroup]="noteForm"
class="layout-row align-start-baseline gap-10px"
(ngSubmit)="addNote()"
>
<mat-form-field class="flex-85-minus-20px">
<textarea
required
formControlName="note"
matInput
placeholder="{{ 'labels.text.Write a note' | translate }} ..."
cdkTextareaAutosize
cdkAutosizeMinRows="2"
></textarea>
</mat-form-field>
<button type="submit" mat-raised-button class="flex-1" color="primary" [disabled]="!noteForm.valid">
<fa-icon icon="plus" class="m-r-10"></fa-icon>{{ 'labels.buttons.Add' | translate }}
</button>
</form>
</div>
<div class="notes-container">
@if (entityNotes && entityNotes.length > 0) {
<div>
@for (entityNote of entityNotes; track entityNote; let i = $index) {
<div class="note-card">
<div class="note-content">
{{ entityNote.note }}
</div>
<div class="note-footer">
<div class="note-meta">
<div class="created-by">
{{ 'labels.inputs.Created By' | translate }} {{ entityNote.createdByUsername }}
</div>
<div class="created-date">
{{ entityNote.createdOn | dateFormat }}
</div>
</div>
<div class="note-actions">
<button
type="button"
mat-raised-button
color="primary"
(click)="editNote(entityNote.id, entityNote.note, i)"
[title]="'labels.heading.Edit Note' | translate"
>
{{ 'labels.buttons.Edit' | translate }}
</button>
<button
type="button"
mat-raised-button
color="warn"
(click)="deleteNote(entityNote.id, i)"
[title]="('labels.inputs.Note' | translate) + ': ' + ('labels.buttons.Delete' | translate)"
>
{{ 'labels.buttons.Delete' | translate }}
</button>
</div>
</div>
</div>
}
</div>
} @else {
<div class="empty-state">{{ 'labels.text.NoNotesAvailable' | translate }}</div>
}
</div>
</div>