|
1 | 1 | <div class="org-header"> |
2 | 2 | <div class="org-header__container"> |
3 | 3 | @if (!isLoading && organization) { |
4 | | - <div class="org-header__content"> |
5 | | - <div class="org-header__logo"> |
6 | | - @if (organization.logoUrl && !isEditing) { |
7 | | - <img |
8 | | - [src]="organization.logoUrl" |
9 | | - [alt]="organization.name" |
10 | | - class="org-logo" |
11 | | - /> |
12 | | - } @else { |
13 | | - <div class="org-logo-fallback"> |
14 | | - {{ organization.name.charAt(0) }} |
15 | | - </div> |
16 | | - } |
17 | | - @if (isEditing) { |
18 | | - <div class="org-logo__edit"> |
19 | | - <input type="file" (change)="onFileChange($event)" /> |
20 | | - @if (!organization.logoUrl) { |
21 | | - <div class="org-logo-fallback"> |
22 | | - {{ organization.name.charAt(0) }} |
23 | | - </div> |
24 | | - } |
25 | | - </div> |
26 | | - } |
| 4 | + <div class="org-header__content"> |
| 5 | + <div class="org-header__logo"> |
| 6 | + @if (organization.logoUrl && !isEditing) { |
| 7 | + <img |
| 8 | + [src]="organization.logoUrl" |
| 9 | + [alt]="organization.name" |
| 10 | + class="org-logo" |
| 11 | + /> |
| 12 | + } @else { |
| 13 | + <div class="org-logo-fallback"> |
| 14 | + {{ organization.name.charAt(0) }} |
27 | 15 | </div> |
28 | | - <div class="org-header__info"> |
29 | | - <div class="org-header__main"> |
30 | | - <h1 class="org-name">{{ organization.name }}</h1> |
31 | | - @if (!isEditing) { |
32 | | - <span |
33 | | - class="org-status" |
34 | | - [class]="getStatusClass(organization.status)" |
35 | | - > |
36 | | - {{ getStatusLabel(organization.status) }} |
37 | | - </span> |
38 | | - } @else { |
39 | | - <div class="org-select-wrapper"> |
40 | | - <select [(ngModel)]="editForm.status" class="org-select"> |
41 | | - <option value="active">Active</option> |
42 | | - <option value="inactive">Inactive</option> |
43 | | - <option value="pending">Pending</option> |
44 | | - <option value="unknown">Unknown</option> |
45 | | - </select> |
46 | | - </div> |
47 | | - } |
48 | | - @if (!isEditing) { |
49 | | - <button |
50 | | - (click)="enableEdit()" |
51 | | - class="btn btn-edit" |
52 | | - > |
53 | | - <i class="fas fa-edit"></i> Chỉnh sửa |
54 | | - </button> |
55 | | - } |
| 16 | + } @if (isEditing) { |
| 17 | + <div class="org-logo__edit"> |
| 18 | + <input type="file" (change)="onFileChange($event)" /> |
| 19 | + @if (!organization.logoUrl) { |
| 20 | + <div class="org-logo-fallback"> |
| 21 | + {{ organization.name.charAt(0) }} |
56 | 22 | </div> |
| 23 | + } |
| 24 | + </div> |
| 25 | + } |
| 26 | + </div> |
| 27 | + <div class="org-header__info"> |
| 28 | + <div class="org-header__main"> |
| 29 | + <h1 class="org-name">{{ organization.name }}</h1> |
57 | 30 | @if (!isEditing) { |
58 | | - <div class="view-mode-details"> |
59 | | - @if (organization.description) { |
60 | | - <p class="org-description"> |
61 | | - {{ organization.description }} |
62 | | - </p> |
63 | | - } |
64 | | - <div class="org-meta"> |
65 | | - <div class="org-meta__item"> |
66 | | - <i class="fas fa-map-marker-alt"></i> |
67 | | - <span>{{ organization.address }}</span> |
68 | | - </div> |
69 | | - <div class="org-meta__item"> |
70 | | - <i class="fas fa-envelope"></i> |
71 | | - <span>{{ organization.email }}</span> |
72 | | - </div> |
73 | | - <div class="org-meta__item"> |
74 | | - <i class="fas fa-phone"></i> |
75 | | - <span>{{ organization.phone }}</span> |
76 | | - </div> |
77 | | - </div> |
78 | | - </div> |
| 31 | + <span |
| 32 | + class="org-status" |
| 33 | + [class]="getStatusClass(organization.status)" |
| 34 | + > |
| 35 | + {{ getStatusLabel(organization.status) }} |
| 36 | + </span> |
| 37 | + } @else { |
| 38 | + <div class="org-select-wrapper"> |
| 39 | + <select [(ngModel)]="editForm.status" class="org-select"> |
| 40 | + <option value="active">Active</option> |
| 41 | + <option value="inactive">Inactive</option> |
| 42 | + <option value="pending">Pending</option> |
| 43 | + <option value="unknown">Unknown</option> |
| 44 | + </select> |
| 45 | + </div> |
| 46 | + } @if (!isEditing && myId === organization.ownerId) { |
| 47 | + <button (click)="enableEdit()" class="btn btn-edit"> |
| 48 | + <i class="fas fa-edit"></i> Chỉnh sửa |
| 49 | + </button> |
79 | 50 | } |
80 | | - @if (isEditing) { |
81 | | - <div class="edit-mode-form"> |
82 | | - <div class="form-group"> |
83 | | - <label for="org-description">Mô tả</label> |
84 | | - <textarea |
85 | | - id="org-description" |
86 | | - [(ngModel)]="editForm.description" |
87 | | - placeholder="Mô tả" |
88 | | - ></textarea> |
89 | | - </div> |
90 | | - <div class="form-group"> |
91 | | - <label for="org-address">Địa chỉ</label> |
92 | | - <input |
93 | | - id="org-address" |
94 | | - [(ngModel)]="editForm.address" |
95 | | - placeholder="Địa chỉ" |
96 | | - /> |
97 | | - </div> |
98 | | - <div class="form-group"> |
99 | | - <label for="org-email">Email</label> |
100 | | - <input |
101 | | - id="org-email" |
102 | | - [(ngModel)]="editForm.email" |
103 | | - placeholder="Email" |
104 | | - /> |
105 | | - </div> |
106 | | - <div class="form-group"> |
107 | | - <label for="org-phone">Số điện thoại</label> |
108 | | - <input |
109 | | - id="org-phone" |
110 | | - [(ngModel)]="editForm.phone" |
111 | | - placeholder="Số điện thoại" |
112 | | - /> |
113 | | - </div> |
114 | | - <div class="form-actions"> |
115 | | - <button class="btn btn-cancel" (click)="cancelEdit()">Hủy</button> |
116 | | - <button |
117 | | - class="btn btn-save" |
118 | | - (click)="saveEdit()" |
119 | | - [disabled]="isSaving" |
120 | | - > |
121 | | - Lưu |
122 | | - </button> |
123 | | - </div> |
124 | | - </div> |
125 | | - } |
126 | | - </div> |
127 | | - </div> |
| 51 | + </div> |
| 52 | + @if (!isEditing) { |
| 53 | + <div class="view-mode-details"> |
| 54 | + @if (organization.description) { |
| 55 | + <p class="org-description"> |
| 56 | + {{ organization.description }} |
| 57 | + </p> |
128 | 58 | } |
| 59 | + <div class="org-meta"> |
| 60 | + <div class="org-meta__item"> |
| 61 | + <i class="fas fa-map-marker-alt"></i> |
| 62 | + <span>{{ organization.address }}</span> |
| 63 | + </div> |
| 64 | + <div class="org-meta__item"> |
| 65 | + <i class="fas fa-envelope"></i> |
| 66 | + <span>{{ organization.email }}</span> |
| 67 | + </div> |
| 68 | + <div class="org-meta__item"> |
| 69 | + <i class="fas fa-phone"></i> |
| 70 | + <span>{{ organization.phone }}</span> |
| 71 | + </div> |
| 72 | + </div> |
| 73 | + </div> |
| 74 | + } @if (isEditing) { |
| 75 | + <div class="edit-mode-form"> |
| 76 | + <div class="form-group"> |
| 77 | + <label for="org-description">Mô tả</label> |
| 78 | + <textarea |
| 79 | + id="org-description" |
| 80 | + [(ngModel)]="editForm.description" |
| 81 | + placeholder="Mô tả" |
| 82 | + ></textarea> |
| 83 | + </div> |
| 84 | + <div class="form-group"> |
| 85 | + <label for="org-address">Địa chỉ</label> |
| 86 | + <input |
| 87 | + id="org-address" |
| 88 | + [(ngModel)]="editForm.address" |
| 89 | + placeholder="Địa chỉ" |
| 90 | + /> |
| 91 | + </div> |
| 92 | + <div class="form-group"> |
| 93 | + <label for="org-email">Email</label> |
| 94 | + <input |
| 95 | + id="org-email" |
| 96 | + [(ngModel)]="editForm.email" |
| 97 | + placeholder="Email" |
| 98 | + /> |
| 99 | + </div> |
| 100 | + <div class="form-group"> |
| 101 | + <label for="org-phone">Số điện thoại</label> |
| 102 | + <input |
| 103 | + id="org-phone" |
| 104 | + [(ngModel)]="editForm.phone" |
| 105 | + placeholder="Số điện thoại" |
| 106 | + /> |
| 107 | + </div> |
| 108 | + <div class="form-actions"> |
| 109 | + <button class="btn btn-cancel" (click)="cancelEdit()">Hủy</button> |
| 110 | + <button |
| 111 | + class="btn btn-save" |
| 112 | + (click)="saveEdit()" |
| 113 | + [disabled]="isSaving" |
| 114 | + > |
| 115 | + Lưu |
| 116 | + </button> |
| 117 | + </div> |
129 | 118 | </div> |
| 119 | + } |
130 | 120 | </div> |
| 121 | + </div> |
| 122 | + } |
| 123 | + </div> |
| 124 | +</div> |
0 commit comments