1
00:00:01,360 --> 00:00:05,410
So now that we have the information displayed on our calendar correctly, we need to be able to actually

2
00:00:05,410 --> 00:00:11,320
process it and that means we're going to have to put a form tag around the entire calendar, add a submit

3
00:00:11,320 --> 00:00:15,960
button, create the necessary route and create a calendar post handler.

4
00:00:15,970 --> 00:00:17,320
So let's get started doing that.

5
00:00:17,990 --> 00:00:23,770
So I'm going to go over to my Idy and I'm looking at my admin reservation calendar page Dot Temple.

6
00:00:24,160 --> 00:00:31,450
And right here, just before I arrange through the rooms, I'll put a form tag in form method equals

7
00:00:31,450 --> 00:00:36,250
post action equals and I'll use the same Yooralla do for the calendar.

8
00:00:36,250 --> 00:00:40,330
So I'll just copy this and paste it in here.

9
00:00:41,740 --> 00:00:46,690
And that's all I need for my opening form tag and then I'll take the closing form tag and put that down

10
00:00:46,690 --> 00:00:49,390
here just after the range closes.

11
00:00:50,360 --> 00:00:55,650
And of course because it's a method equals post, we have to put in our hidden CSF token.

12
00:00:55,660 --> 00:00:58,270
So let's put that in input type equals hidden.

13
00:01:02,070 --> 00:01:12,690
Name equals six R.F. Underscore Tolkan, and the value is equal to dot CSR token from our template data.

14
00:01:13,070 --> 00:01:19,620
OK, so we have that Alesco add a button to submit this after our range ends.

15
00:01:19,620 --> 00:01:24,810
But before our closing tag for the form, we'll put an HRO just to make it look a little nicer.

16
00:01:25,200 --> 00:01:27,390
Input type equals submit.

17
00:01:30,980 --> 00:01:38,840
Class equals button button primary, and the value will be equal to save changes.

18
00:01:39,830 --> 00:01:42,960
OK, so let's make sure that renders properly looks good.

19
00:01:42,980 --> 00:01:43,940
There's our save button.

20
00:01:44,510 --> 00:01:55,460
Let's go to our roots file wherever their roots find the display calendar link, which is right here.

21
00:01:55,490 --> 00:02:02,150
I'll just duplicate that changes method to post and put the word post here and I'll create a function

22
00:02:02,150 --> 00:02:05,840
that doesn't exist yet named admin post reservations calendar.

23
00:02:05,930 --> 00:02:13,340
So I'll put that at the bottom of my handler's funk with the receiver of type pointer to repository.

24
00:02:15,730 --> 00:02:22,720
The name I just copied, so I'll paste it in and it has two arguments, like all handlers W HTP response

25
00:02:22,720 --> 00:02:26,050
writer and a pointer to a request.

26
00:02:28,910 --> 00:02:36,020
And let's just make sure this works, log dot, print line works will stop our application, start our

27
00:02:36,020 --> 00:02:40,640
application and just make sure that this everything is hooked up properly so we don't bang your head

28
00:02:40,730 --> 00:02:42,680
against the wall for no reason whatsoever.

29
00:02:43,520 --> 00:02:48,440
This display the page to make sure it's current and gave me a blank screen, but I should see the word

30
00:02:48,440 --> 00:02:49,910
works and I do.

31
00:02:49,910 --> 00:02:51,230
So that works perfectly.

32
00:02:51,380 --> 00:02:54,020
OK, so that gets us started with this.

33
00:02:54,020 --> 00:02:55,160
I'm going to give this a comment.

34
00:02:59,330 --> 00:03:00,230
Handle's.

35
00:03:02,520 --> 00:03:04,770
Post of reservation calendar.

36
00:03:06,000 --> 00:03:11,430
OK, so that gets us started in the next lecture, will actually do something with the posted data and

37
00:03:11,430 --> 00:03:13,800
there's a fair bit of code required to make this happen.

38
00:03:13,980 --> 00:03:19,080
None of it's difficult, but we'll go through it one step at a time in the next lecture or two.
