Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

48 строки
2.5 KiB

  1. <h2 *ngIf="!document.id">{{ 'basic.new-document' | translate }}</h2>
  2. <h2 *ngIf="document.id">{{ 'basic.edit-document' | translate }}</h2>
  3. <div class="spt-form">
  4. <form [formGroup]="documentForm" (ngSubmit)="onSubmit()">
  5. <div class="mb-3">
  6. <label for="name" class="form-label">{{ 'form.name' | translate }}:</label>
  7. <input type="text" class="form-control" id="name" formControlName="name"/>
  8. </div>
  9. <div class="mb-3">
  10. <label for="description" class="form-label">{{ 'form.description' | translate }}:</label>
  11. <input type="text" class="form-control" id="description" formControlName="description"/>
  12. </div>
  13. <div class="mb-3">
  14. <label for="partner" class="form-label">{{ 'form.partner' | translate }}:</label>
  15. <input type="text" class="form-control" id="partner" [ngbTypeahead]="searchPartners"
  16. [inputFormatter]="formatter" [value]="documentForm.get('partnerName')?.value"
  17. [resultFormatter]="formatter" [editable]="false" (selectItem)="onAssignedToSelectPartner($event)"/>
  18. <input type="hidden" formControlName="partner"/>
  19. </div>
  20. <div class="mb-3">
  21. <label for="product" class="form-label">{{ 'form.product' | translate }}:</label>
  22. <input type="text" class="form-control" id="product" [ngbTypeahead]="searchProducts"
  23. [inputFormatter]="formatter" [value]="documentForm.get('productName')?.value"
  24. [resultFormatter]="formatter" [editable]="false" (selectItem)="onAssignedToSelectProduct($event)"/>
  25. <input type="hidden" formControlName="product"/>
  26. </div>
  27. <div class="mb-3" *ngIf="documentForm.get('documentUrl')?.value === null">
  28. <label for="image" class="form-label">{{ 'form.upload-image' | translate }}:</label>
  29. <input type="file" class="form-control" id="image" (change)="onFileSelected($event)" accept="image/*"/>
  30. </div>
  31. <div class="mb-3" *ngIf="documentForm.get('documentUrl')?.value !== null">
  32. <div class="delete-image" (click)="onDeleteFile()">
  33. <span class="bi bi-file-earmark-minus p-2" data-type="action-icon"></span>
  34. <p class="mb-0 ms-1">{{ 'system.delete-file' | translate }}</p>
  35. </div>
  36. </div>
  37. <button type="submit" class="btn btn-primary"
  38. [disabled]="this.documentForm.invalid"
  39. >{{ 'form.send' | translate }}
  40. </button>
  41. </form>
  42. </div>