1
1
< div >
2
- < div >
3
- < button
4
- type ="button "
5
- (click) ="newEntry() "
6
- data-toggle ="modal "
7
- data-target ="#editRecordsByDate "
8
- class ="btn btn-primary "
9
- >
2
+ < div >
3
+ < button type ="button " (click) ="newEntry() " data-toggle ="modal " data-target ="#editRecordsByDate " class ="btn btn-primary ">
10
4
Add new entry
11
5
</ button >
12
- < button
13
- type ="button "
14
- (click) ="onDisplayModeChange() "
15
- class ="btn btn-primary float-right "
16
- *ngIf ="isFeatureToggleCalendarActive "
17
- >
6
+ < button type ="button " (click) ="onDisplayModeChange() " class ="btn btn-primary float-right " *ngIf ="isFeatureToggleCalendarActive ">
18
7
< em class ="fas fa-list " *ngIf ="displayGridView "> </ em >
19
8
< em class ="fas fa-th " *ngIf ="!displayGridView "> </ em >
20
9
</ button >
21
- </ div >
22
- < div style ="height: 15px "> </ div >
23
- < app-month-picker [selectedDate] ="selectedDate " (dateSelected) ="dateSelected($event) "> </ app-month-picker >
24
- < div style ="height: 15px "> </ div >
10
+ </ div >
11
+ < div style ="height: 15px "> </ div >
12
+ < app-month-picker [selectedDate] ="selectedDate " (dateSelected) ="dateSelected($event) "> </ app-month-picker >
13
+ < div style ="height: 15px "> </ div >
25
14
26
15
27
- < div id ="gridView " [hidden] ="!displayGridView ">
28
- < div *ngIf ="timeEntriesDataSource$ | async as dataSource ">
29
- < app-loading-bar *ngIf ="dataSource.isLoading "> </ app-loading-bar >
30
- < app-calendar
31
- *ngIf ="!dataSource.isLoading "
32
- [timeEntries$] ="timeEntriesDataSource$ "
33
- [currentDate] ="selectedDate.toDate() "
34
- [calendarView] ="calendarView "
35
- (changeDate) ="changeDate($event) "
36
- (changeView) ="changeView($event) "
37
- (viewModal) ="editEntry($event.id) "
38
- (deleteTimeEntry) ="openModal($event.timeEntry) "
39
- >
40
- </ app-calendar >
16
+ < div id ="gridView " [hidden] ="!displayGridView ">
17
+ < div *ngIf ="timeEntriesDataSource$ | async as dataSource ">
18
+ < app-loading-bar *ngIf ="dataSource.isLoading "> </ app-loading-bar >
19
+ < app-calendar *ngIf ="!dataSource.isLoading " [timeEntries$] ="timeEntriesDataSource$ " [currentDate] ="selectedDate.toDate() " [calendarView] ="calendarView " (changeDate) ="changeDate($event) " (changeView) ="changeView($event) " (viewModal) ="editEntry($event.id) "
20
+ (deleteTimeEntry) ="openModal($event.timeEntry) ">
21
+ </ app-calendar >
22
+ </ div >
41
23
</ div >
42
- </ div >
43
24
44
- < div id ="listView " [hidden] ="displayGridView ">
45
- < table
46
- class ="table table-sm table-striped mb-0 "
47
- datatable
48
- [dtTrigger] ="dtTrigger "
49
- [dtOptions] ="dtOptions "
50
- *ngIf ="(timeEntriesDataSource$ | async) as dataSource ">
51
- < caption > </ caption >
52
- < thead class ="thead-blue ">
53
- < tr class ="d-flex ">
54
- < th class ="col "> Date</ th >
55
- < th class ="col "> Time in - out</ th >
56
- < th class ="col "> Duration</ th >
57
- < th class ="col "> Customer</ th >
58
- < th class ="col "> Project</ th >
59
- < th class ="col "> Activity</ th >
60
- < th class ="col "> </ th >
61
- </ tr >
62
- </ thead >
63
- < app-loading-bar *ngIf ="dataSource.isLoading "> </ app-loading-bar >
64
- < tbody *ngIf ="!dataSource.isLoading ">
65
- < tr class ="d-flex " *ngFor ="let entry of dataSource.data ">
66
- < td class ="col "> {{ entry.start_date | date: 'MM/dd/yyyy' }}</ td >
67
- < td class ="col "> {{ entry.start_date | date: 'HH:mm' }} - {{ entry.end_date | date: 'HH:mm' }}</ td >
68
- < td class ="col "> {{ entry.end_date | substractDate: entry.start_date }}</ td >
69
- < td class ="col "> {{ entry.customer_name }}</ td >
70
- < td class ="col "> {{ entry.project_name }}</ td >
71
- < td class ="col "> {{ entry.activity_name }}</ td >
72
- < td class ="col ">
73
- < button
74
- class ="btn btn-sm btn-primary "
75
- data-toggle ="modal "
76
- data-target ="#editRecordsByDate "
77
- (click) ="editEntry(entry.id) "
78
- >
25
+ < div id ="listView " [hidden] ="displayGridView ">
26
+ < table class ="table table-sm table-striped mb-0 " datatable [dtTrigger] ="dtTrigger " [dtOptions] ="dtOptions " *ngIf ="(timeEntriesDataSource$ | async) as dataSource ">
27
+ < caption > </ caption >
28
+ < thead class ="thead-blue ">
29
+ < tr class ="d-flex ">
30
+ < th class ="col "> Date</ th >
31
+ < th class ="col "> Time in - out</ th >
32
+ < th class ="col "> Duration</ th >
33
+ < th class ="col "> Customer</ th >
34
+ < th class ="col "> Project</ th >
35
+ < th class ="col "> Activity</ th >
36
+ < th class ="col "> </ th >
37
+ </ tr >
38
+ </ thead >
39
+ < app-loading-bar *ngIf ="dataSource.isLoading "> </ app-loading-bar >
40
+ < tbody *ngIf ="!dataSource.isLoading ">
41
+ < tr class ="d-flex " *ngFor ="let entry of dataSource.data ">
42
+ < td class ="col "> {{ entry.start_date | date: 'MM/dd/yyyy' }}</ td >
43
+ < td class ="col "> {{ dateTimeOffset.parseDateTimeOffset(entry.start_date,entry.timezone_offset) }} - {{ dateTimeOffset.parseDateTimeOffset(entry.end_date,entry.timezone_offset) }}</ td >
44
+ < td class ="col "> {{ entry.end_date | substractDate: entry.start_date }}</ td >
45
+ < td class ="col "> {{ entry.customer_name }}</ td >
46
+ < td class ="col "> {{ entry.project_name }}</ td >
47
+ < td class ="col "> {{ entry.activity_name }}</ td >
48
+ < td class ="col ">
49
+ < button class ="btn btn-sm btn-primary " data-toggle ="modal " data-target ="#editRecordsByDate " (click) ="editEntry(entry.id) ">
79
50
< i class ="fa fa-edit fa-xs "> </ i >
80
51
</ button >
81
- < button
82
- class ="btn btn-sm btn-danger ml-2 "
83
- data-toggle ="modal "
84
- data-target ="#deleteModal "
85
- (click) ="openModal(entry) "
86
- >
52
+ < button class ="btn btn-sm btn-danger ml-2 " data-toggle ="modal " data-target ="#deleteModal " (click) ="openModal(entry) ">
87
53
< i class ="fa fa-trash fa-xs "> </ i >
88
54
</ button >
89
- </ td >
90
- </ tr >
91
- </ tbody >
92
- </ table >
93
- </ div >
55
+ </ td >
56
+ </ tr >
57
+ </ tbody >
58
+ </ table >
59
+ </ div >
94
60
</ div >
95
61
96
62
< div class ="modal fade " id ="editRecordsByDate " tabindex ="-1 " role ="dialog ">
97
- < div class ="modal-dialog modal-dialog-centered modal-lg " role ="document ">
98
- < div class ="modal-content " cdkDrag (cdkDragEnded) ="resetDraggablePosition($event) ">
99
- < div class ="modal-header ">
100
- < h5 class ="modal-title "> {{ entryId ? 'Edit Entry' : 'New Entry' }}</ h5 >
101
- < div >
102
- < button class ="btn shadow-none " data-bs-toggle ="tooltip " title ="Clean form values " (click) ="detailsFields.cleanFieldsForm() ">
63
+ < div class ="modal-dialog modal-dialog-centered modal-lg " role ="document ">
64
+ < div class ="modal-content " cdkDrag (cdkDragEnded) ="resetDraggablePosition($event) ">
65
+ < div class ="modal-header ">
66
+ < h5 class ="modal-title "> {{ entryId ? 'Edit Entry' : 'New Entry' }}</ h5 >
67
+ < div >
68
+ < button class ="btn shadow-none " data-bs-toggle ="tooltip " title ="Clean form values " (click) ="detailsFields.cleanFieldsForm() ">
103
69
< em class ="fa fa-eraser "> </ em >
104
70
</ button >
105
- < button class ="btn shadow-none " data-bs-toggle ="tooltip " title ="Drag modal " cdkDragHandle >
71
+ < button class ="btn shadow-none " data-bs-toggle ="tooltip " title ="Drag modal " cdkDragHandle >
106
72
< em class ="fa fa-grip-vertical "> </ em >
107
73
</ button >
74
+ </ div >
75
+ </ div >
76
+ < div class ="modal-body ">
77
+ < app-details-fields [entryToEdit] ="entry " (saveEntry) ="saveEntry($event) " (projectSelected) ="projectSelected($event) " [canMarkEntryAsWIP] ="canMarkEntryAsWIP " #detailsFields >
78
+ </ app-details-fields >
79
+ </ div >
108
80
</ div >
109
- </ div >
110
- < div class ="modal-body ">
111
- < app-details-fields
112
- [entryToEdit] ="entry "
113
- (saveEntry) ="saveEntry($event) "
114
- (projectSelected) ="projectSelected($event) "
115
- [canMarkEntryAsWIP] ="canMarkEntryAsWIP "
116
- #detailsFields
117
- >
118
- </ app-details-fields >
119
- </ div >
120
81
</ div >
121
- </ div >
122
82
</ div >
123
83
124
- < app-dialog
125
- *ngIf ="showModal "
126
- class ="modal fade "
127
- id ="deleteModal "
128
- tabindex ="-1 "
129
- role ="dialog "
130
- aria-hidden ="true "
131
- [body] ="message "
132
- [title] ="'Delete Entry' "
133
- (closeModalEvent) ="removeEntry() "
134
- >
135
- </ app-dialog >
84
+ < app-dialog *ngIf ="showModal " class ="modal fade " id ="deleteModal " tabindex ="-1 " role ="dialog " aria-hidden ="true " [body] ="message " [title] ="'Delete Entry' " (closeModalEvent) ="removeEntry() ">
85
+ </ app-dialog >
0 commit comments