77 < h2 class ="page-title " *ngIf ="form.id "> {{ form.name }}</ h2 >
88 < h2 class ="page-title " *ngIf ="!form.id "> New Form</ h2 >
99 </ div >
10+ < div class ="header-actions " *ngIf ="form.id ">
11+ < button class ="action-button " [ngClass] ="editingDetails ? 'btn-primary' : '' " (click) ="toggleEditDetails() ">
12+ < i class ="fa " [ngClass] ="editingDetails ? 'fa-times' : 'fa-edit' "> </ i >
13+ {{editingDetails ? 'Cancel' : 'Edit Form'}}
14+ </ button >
15+ </ div >
1016 </ div >
1117 < div class ="container-fluid bottom-gap-l ">
1218 < div class ="row ">
@@ -16,44 +22,77 @@ <h2 class="page-title" *ngIf="!form.id">New Form</h2>
1622 < div class ="details-card ">
1723 < div class ="details-form ">
1824 < div class ="form-field ">
19- < label class ="field-label "> Name</ label >
25+ < label class ="field-label "> Name: </ label >
2026 < div class ="field-content ">
21- < input type ="text " class ="form-input " placeholder ="Form name " name ="name "
22- [(ngModel)] ="form.name " (ngModelChange) ="onFormChange() " required >
27+ < span *ngIf ="!editingDetails && form.id " class ="field-value "> {{form.name}}</ span >
28+ < input *ngIf ="editingDetails && form.id " type ="text " class ="form-input "
29+ placeholder ="Form name " [(ngModel)] ="formEditForm.name ">
30+ < input *ngIf ="!form.id " type ="text " class ="form-input " placeholder ="Form name "
31+ name ="name " [(ngModel)] ="form.name " (ngModelChange) ="onFormChange() " required >
2332 < span class ="field-error " *ngIf ="generalFormSubmitted && !form.name "> Name is
2433 required</ span >
2534 </ div >
2635 </ div >
2736
2837 < div class ="form-field ">
29- < label class ="field-label "> Description</ label >
38+ < label class ="field-label "> Description: </ label >
3039 < div class ="field-content ">
31- < textarea class ="form-input " rows ="3 " placeholder ="Brief description of the form. "
32- [(ngModel)] ="form.description " (ngModelChange) ="onFormChange() "
33- name ="description "> </ textarea >
40+ < span *ngIf ="!editingDetails && form.id "
41+ class ="field-value "> {{form.description}}</ span >
42+ < textarea *ngIf ="editingDetails && form.id " class ="form-input " rows ="3 "
43+ placeholder ="Brief description of the form. "
44+ [(ngModel)] ="formEditForm.description "> </ textarea >
45+ < textarea *ngIf ="!form.id " class ="form-input " rows ="3 "
46+ placeholder ="Brief description of the form. " [(ngModel)] ="form.description "
47+ (ngModelChange) ="onFormChange() " name ="description "> </ textarea >
3448 </ div >
3549 </ div >
3650
3751 < div class ="form-field ">
38- < label class ="field-label "> Color</ label >
52+ < label class ="field-label "> Color: </ label >
3953 < div class ="field-content ">
40- < input type ="color " class ="form-input color-input " [(ngModel)] ="form.color "
41- (ngModelChange) ="onFormChange() " name ="color " required >
54+ < span *ngIf ="!editingDetails && form.id " class ="field-value ">
55+ < span
56+ style ="display: inline-block; width: 20px; height: 20px; border-radius: 3px; vertical-align: middle; margin-right: 8px; "
57+ [style.background-color] ="form.color "> </ span >
58+ {{form.color}}
59+ </ span >
60+ < input *ngIf ="editingDetails && form.id " type ="color " class ="form-input color-input "
61+ [(ngModel)] ="formEditForm.color ">
62+ < input *ngIf ="!form.id " type ="color " class ="form-input color-input "
63+ [(ngModel)] ="form.color " (ngModelChange) ="onFormChange() " name ="color " required >
4264 < span class ="field-error " *ngIf ="generalFormSubmitted && !form.color "> Color is
4365 invalid</ span >
4466 </ div >
4567 </ div >
4668
4769 < div class ="form-field ">
48- < label class ="field-label checkbox-label ">
49- < input type ="checkbox " [(ngModel)] ="form.default " (ngModelChange) ="onFormChange() "
50- name ="default ">
51- < span > Add To Every New Observation</ span >
52- </ label >
53- < p class ="field-hint "> This form will be automatically added to all new observations.</ p >
70+ < label class ="field-label "> Default Form:</ label >
71+ < div class ="field-content ">
72+ < span *ngIf ="!editingDetails && form.id " class ="field-value "> {{form.default ? 'Yes -
73+ Added to every new observation' : 'No'}}</ span >
74+ < label *ngIf ="editingDetails && form.id " class ="field-label checkbox-label ">
75+ < input type ="checkbox " [(ngModel)] ="formEditForm.default ">
76+ < span > Add To Every New Observation</ span >
77+ </ label >
78+ < label *ngIf ="!form.id " class ="field-label checkbox-label ">
79+ < input type ="checkbox " [(ngModel)] ="form.default "
80+ (ngModelChange) ="onFormChange() " name ="default ">
81+ < span > Add To Every New Observation</ span >
82+ </ label >
83+ </ div >
84+ </ div >
85+
86+ < div class ="form-actions " *ngIf ="editingDetails ">
87+ < button class ="action-button btn-primary " (click) ="saveFormDetails() ">
88+ < i class ="fa fa-save "> </ i > Save
89+ </ button >
90+ < button class ="action-button " (click) ="cancelEditDetails() ">
91+ < i class ="fa fa-times "> </ i > Cancel
92+ </ button >
5493 </ div >
5594
56- < div class ="form-actions ">
95+ < div class ="form-actions " *ngIf =" !editingDetails && !form.id " >
5796 < button class ="action-button btn-primary " *ngIf ="formDirty && !saving "
5897 (click) ="saveForm() " [disabled] ="!formValid ">
5998 < i class ="fa fa-save "> </ i > Save
0 commit comments