post-update.component.html 4.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <div class="row justify-content-center">
  2. <div class="col-8">
  3. <form name="editForm" role="form" novalidate (ngSubmit)="save()" #editForm="ngForm">
  4. <h2 id="jhi-post-heading" jhiTranslate="zipConnectApp.post.home.createOrEditLabel">Create or edit a Post</h2>
  5. <div>
  6. <jhi-alert-error></jhi-alert-error>
  7. <div class="form-group" [hidden]="!post.id">
  8. <label for="id" jhiTranslate="global.field.id">ID</label>
  9. <input type="text" class="form-control" id="id" name="id"
  10. [(ngModel)]="post.id" readonly />
  11. </div>
  12. <div class="form-group">
  13. <label class="form-control-label" jhiTranslate="zipConnectApp.post.postId" for="field_postId">Post Id</label>
  14. <input type="number" class="form-control" name="postId" id="field_postId"
  15. [(ngModel)]="post.postId" />
  16. </div>
  17. <div class="form-group">
  18. <label class="form-control-label" jhiTranslate="zipConnectApp.post.timestamp" for="field_timestamp">Timestamp</label>
  19. <div class="input-group">
  20. <input id="field_timestamp" type="text" class="form-control" name="timestamp" ngbDatepicker #timestampDp="ngbDatepicker" [(ngModel)]="post.timestamp"
  21. />
  22. <span class="input-group-append">
  23. <button type="button" class="btn btn-secondary" (click)="timestampDp.toggle()"><fa-icon [icon]="'calendar-alt'"></fa-icon></button>
  24. </span>
  25. </div>
  26. </div>
  27. <div class="form-group">
  28. <label class="form-control-label" jhiTranslate="zipConnectApp.post.content" for="field_content">Content</label>
  29. <input type="text" class="form-control" name="content" id="field_content"
  30. [(ngModel)]="post.content" />
  31. </div>
  32. <div class="form-group">
  33. <label class="form-control-label" jhiTranslate="zipConnectApp.post.likes" for="field_likes">Likes</label>
  34. <input type="text" class="form-control" name="likes" id="field_likes"
  35. [(ngModel)]="post.likes" />
  36. </div>
  37. <div class="form-group">
  38. <label class="form-control-label" jhiTranslate="zipConnectApp.post.poster" for="field_poster">Poster</label>
  39. <select class="form-control" id="field_poster" name="poster" [(ngModel)]="post.poster" >
  40. <option [ngValue]="null"></option>
  41. <option [ngValue]="userOption.id === post.poster?.id ? post.poster : userOption" *ngFor="let userOption of users; trackBy: trackUserById">{{userOption.id}}</option>
  42. </select>
  43. </div>
  44. <div class="form-group">
  45. <label class="form-control-label" jhiTranslate="zipConnectApp.post.privacySetting" for="field_privacySetting">Privacy Setting</label>
  46. <select class="form-control" id="field_privacySetting" name="privacySetting" [(ngModel)]="post.privacySetting">
  47. <option [ngValue]="null"></option>
  48. <option [ngValue]="privacyOption.id === post.privacySetting?.id ? post.privacySetting : privacyOption" *ngFor="let privacyOption of privacysettings; trackBy: trackPrivacyById">{{privacyOption.id}}</option>
  49. </select>
  50. </div>
  51. <div class="form-group">
  52. <label class="form-control-label" jhiTranslate="zipConnectApp.post.poster" for="field_poster">Poster</label>
  53. <select class="form-control" id="field_poster" name="poster" [(ngModel)]="post.poster" >
  54. <option [ngValue]="null"></option>
  55. <option [ngValue]="userOption.id === post.poster?.id ? post.poster : userOption" *ngFor="let userOption of users; trackBy: trackUserById">{{userOption.id}}</option>
  56. </select>
  57. </div>
  58. </div>
  59. <div>
  60. <button type="button" id="cancel-save" class="btn btn-secondary" (click)="previousState()">
  61. <fa-icon [icon]="'ban'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
  62. </button>
  63. <button type="submit" id="save-entity" [disabled]="editForm.form.invalid || isSaving" class="btn btn-primary">
  64. <fa-icon [icon]="'save'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.save">Save</span>
  65. </button>
  66. </div>
  67. </form>
  68. </div>
  69. </div>