@@ -3,73 +3,156 @@ <h3>DXCinema Show Times</h3>
33</ div >
44< dx-scheduler
55 timeZone ="America/Los_Angeles "
6- id ="scheduler "
76 [dataSource] ="data "
87 [views] ="['day', 'week', 'timelineDay'] "
98 currentView ="day "
9+ [currentDate] ="currentDate "
1010 [firstDayOfWeek] ="0 "
1111 [startDayHour] ="9 "
1212 [endDayHour] ="23 "
1313 [showAllDayPanel] ="false "
14+ [height] ="600 "
1415 [groups] ="['theatreId'] "
15- [currentDate] ="currentDate "
1616 [crossScrollingEnabled] ="true "
1717 [cellDuration] ="20 "
18- [height] ="600 "
1918 appointmentTemplate ="appointment-template "
2019 appointmentTooltipTemplate ="tooltip-template "
21- (onAppointmentFormOpening) ="onAppointmentFormOpening($event) "
2220>
23- < dxo-scheduler-editing [allowAdding] ="false "> </ dxo-scheduler-editing >
24-
2521 < dxi-scheduler-resource
2622 fieldExpr ="movieId "
27- [useColorAsDefault] ="true "
2823 [dataSource] ="moviesData "
24+ [useColorAsDefault] ="true "
2925 >
3026 </ dxi-scheduler-resource >
3127
3228 < dxi-scheduler-resource fieldExpr ="theatreId " [dataSource] ="theatreData ">
3329 </ dxi-scheduler-resource >
3430
35- < div *dxTemplate ="let model of 'appointment-template' ">
36- < div class ="showtime-preview ">
37- < div > {{
38- (getMovieById | apply : model.appointmentData.movieId : this).text
39- }}</ div >
40- < div
41- > Ticket Price:
42- < strong > {{ "$" + model.targetedAppointmentData.price }}</ strong >
31+ < dxo-scheduler-editing
32+ [allowAdding] ="false "
33+ [popup] ="{
34+ maxWidth: 440,
35+ onOptionChanged: onPopupOptionChanged
36+ } "
37+ >
38+ < dxo-scheduler-form [onInitialized] ="onFormInitialized ">
39+ < dxi-scheduler-item
40+ template ="movie-info-form-template "
41+ > </ dxi-scheduler-item >
42+
43+ < dxi-scheduler-item
44+ itemType ="group "
45+ [colCount] ="2 "
46+ [colCountByScreen] ="{ xs: 2 } "
47+ >
48+ < dxi-scheduler-item
49+ dataField ="movieId "
50+ editorType ="dxSelectBox "
51+ [label] ="{ text: 'Movie' } "
52+ [colSpan] ="1 "
53+ [editorOptions] ="{
54+ items: moviesData,
55+ displayExpr: 'text',
56+ valueExpr: 'id',
57+ stylingMode: getEditorStylingMode(),
58+ onValueChanged: onMovieValueChanged,
59+ onContentReady: onMovieEditorContentReady
60+ } "
61+ >
62+ </ dxi-scheduler-item >
63+
64+ < dxi-scheduler-item
65+ dataField ="price "
66+ editorType ="dxSelectBox "
67+ [label] ="{ text: 'Price' } "
68+ [colSpan] ="1 "
69+ [editorOptions] ="{
70+ items: [5, 10, 15, 20],
71+ displayExpr: priceDisplayExpr,
72+ stylingMode: getEditorStylingMode(),
73+ onContentReady: onPriceEditorContentReady
74+ } "
75+ >
76+ </ dxi-scheduler-item >
77+ </ dxi-scheduler-item >
78+
79+ < dxi-scheduler-item name ="startDateGroup "> </ dxi-scheduler-item >
80+
81+ < dxi-scheduler-item
82+ name ="endDateGroup "
83+ [disabled] ="true "
84+ > </ dxi-scheduler-item >
85+ </ dxo-scheduler-form >
86+ </ dxo-scheduler-editing >
87+
88+ < div
89+ *dxTemplate ="let data of 'movie-info-form-template' "
90+ class ="movie-info-container "
91+ >
92+ < ng-container *ngIf ="currentSelectedMovie as movie; else noMovieSelected ">
93+ < div class ="movie-info ">
94+ < div class ="movie-preview-image ">
95+ < img [src] ="movie.image " [alt] ="movie.text " />
96+ </ div >
97+ < div class ="movie-details ">
98+ < div class ="title "> {{ movie.text }} ({{ movie.year }})</ div >
99+ < div > Director: {{ movie.director }}</ div >
100+ < div > Duration: {{ movie.duration }} minutes</ div >
101+ </ div >
43102 </ div >
44- < div class =" dropdown-appointment-dates " >
45- {{
46- (model.targetedAppointmentData.displayStartDate
47- | date : "shortTime") +
48- " - " +
49- (model.targetedAppointmentData.displayEndDate | date : "shortTime")
50- }}
103+ </ ng-container >
104+ < ng-template #noMovieSelected >
105+ < div class =" movie-info " >
106+ < div class =" movie-preview-image " > </ div >
107+ < div class =" movie-details " >
108+ < div class =" title " > Select a movie </ div >
109+ </ div >
51110 </ div >
52- </ div >
111+ </ ng-template >
53112 </ div >
54113
55- < div *dxTemplate ="let model of 'tooltip -template' ">
114+ < div *dxTemplate ="let model of 'appointment -template' ">
56115 < ng-container
57116 *ngIf ="getMovieById | apply : model.appointmentData.movieId as movie "
58117 >
59- < div class ="movie-tooltip ">
60- < img [src] ="movie. image " / >
61- < div class ="movie-info " >
62- < div class =" movie-title " >
63- {{ movie.text + " (" + movie.year + ")" }}
64- </ div >
118+ < div class ="movie-preview ">
119+ < div class ="movie-preview- image ">
120+ < img [src] ="movie.image " [alt] =" movie.text " / >
121+ </ div >
122+ < div class =" movie-details " >
123+ < div class =" title " > {{ movie.text }} < /div >
65124 < div >
66- {{ "Director: " + movie.director }}
125+ Ticket Price:
126+ < strong > ${{ model.targetedAppointmentData.price }}</ strong >
67127 </ div >
68128 < div >
69- {{ "Duration: " + movie.duration + " minutes" }}
129+ {{
130+ (model.targetedAppointmentData.displayStartDate
131+ | date : "shortTime") +
132+ " - " +
133+ (model.targetedAppointmentData.displayEndDate
134+ | date : "shortTime")
135+ }}
70136 </ div >
71137 </ div >
72138 </ div >
73139 </ ng-container >
74140 </ div >
141+
142+ < div *dxTemplate ="let model of 'tooltip-template' ">
143+ < ng-container
144+ *ngIf ="getMovieById | apply : model.appointmentData.movieId as movie "
145+ >
146+ < div class ="movie-info ">
147+ < div class ="movie-preview-image ">
148+ < img [src] ="movie.image " [alt] ="movie.text " />
149+ </ div >
150+ < div class ="movie-details ">
151+ < div class ="title "> {{ movie.text + " (" + movie.year + ")" }}</ div >
152+ < div > Director: {{ movie.director }}</ div >
153+ < div > Duration: {{ movie.duration }} minutes</ div >
154+ </ div >
155+ </ div >
156+ </ ng-container >
157+ </ div >
75158</ dx-scheduler >
0 commit comments