1
00:00:01,680 --> 00:00:06,780
So my next step is to create some handlers and what I normally do in situations like this, where I've

2
00:00:06,780 --> 00:00:11,690
created three or four new routes to the application, is I go and create stub handlers.

3
00:00:12,060 --> 00:00:16,170
So the first one I've done is for new reservations.

4
00:00:16,170 --> 00:00:20,190
So I'm going to copy that Eurail and I'm going to go back to my roots file.

5
00:00:22,520 --> 00:00:28,580
And inside my admin, part of my roots, the part that's protected, I don't want everybody to have

6
00:00:28,580 --> 00:00:32,650
access to the particular pages that are in the admin.

7
00:00:32,840 --> 00:00:35,000
So I make sure you put it inside this part.

8
00:00:35,000 --> 00:00:36,850
Muxtape root for admin.

9
00:00:37,010 --> 00:00:42,110
I'll create a new handler, just a stub handler, Mux doGet and I'll paste in that you URL and I'll

10
00:00:42,110 --> 00:00:48,260
delete the slash admin part because that's automatically added by this thing and I'll create some stub

11
00:00:48,260 --> 00:00:51,890
handlers so handlers don't repo.

12
00:00:52,250 --> 00:00:54,860
And this one is new reservations.

13
00:00:54,980 --> 00:00:57,950
And since it's an admin, I'm going to start it with the name admin.

14
00:00:58,170 --> 00:01:01,040
OK, just like I did admin dashboard here.

15
00:01:01,040 --> 00:01:06,560
This just lets me keep my handlers nice and clean so we have one for new reservations.

16
00:01:06,860 --> 00:01:07,760
We have another one.

17
00:01:07,940 --> 00:01:10,130
I believe it's for all reservations.

18
00:01:10,130 --> 00:01:11,270
It's over here.

19
00:01:11,420 --> 00:01:11,660
Yeah.

20
00:01:11,710 --> 00:01:20,870
Reservations dash all so I'll create one for admin all reservations and change the euro to all.

21
00:01:21,770 --> 00:01:22,760
And I have one more.

22
00:01:22,760 --> 00:01:23,660
And what was that called.

23
00:01:26,770 --> 00:01:29,980
Reservation dash calendar one for that to.

24
00:01:32,250 --> 00:01:40,800
Reservation calendar and actually probably should be plural just to keep things consistent so that an

25
00:01:40,800 --> 00:01:45,020
ass back in the admin layout just change out to reservations calendar.

26
00:01:45,090 --> 00:01:48,960
OK, so now I have these three routes set up, but I have no handlers for them.

27
00:01:49,460 --> 00:01:52,400
So we need to create a new handler called admin new reservation.

28
00:01:52,420 --> 00:01:53,250
So let's do that.

29
00:01:53,530 --> 00:01:54,660
Let's go to our handlers.

30
00:01:56,790 --> 00:01:58,950
And at the very bottom, I'll create a new function.

31
00:01:59,280 --> 00:02:05,790
I'll just duplicate this one and change the name to admin, new reservations.

32
00:02:05,790 --> 00:02:09,900
And then I want to have a page for that, which I'll have to create in a minute, and I'll call it new

33
00:02:10,470 --> 00:02:12,710
reservations, OK?

34
00:02:13,410 --> 00:02:21,240
And then I'll duplicate this again and I'll get the correct path name, which is admin all reservations

35
00:02:22,500 --> 00:02:29,490
and go back to my handlers and put it in all reservations and make that admin all reservations for the

36
00:02:29,490 --> 00:02:31,210
name of the template, which I have to create a minute.

37
00:02:32,280 --> 00:02:34,410
And finally, the last one is admin.

38
00:02:37,340 --> 00:02:47,660
Reservations calendar, so I'll copy that name, go back to my handlers and change this to so admin

39
00:02:47,660 --> 00:02:54,920
dashboard, I mean, all reservations have been new reservations, duplicate this paste in the correct

40
00:02:54,920 --> 00:03:02,510
name and change that to admin reservations calendar.

41
00:03:03,170 --> 00:03:05,300
And I will just create three new templates.

42
00:03:06,330 --> 00:03:10,100
So the first one has to be called admin all reservation.

43
00:03:10,110 --> 00:03:15,310
So I'll copy the names so I don't make a typographical error created here.

44
00:03:15,620 --> 00:03:18,050
New file paste.

45
00:03:19,420 --> 00:03:28,390
And added to my git repository and go back to my handlers and get the next one, which is admin new

46
00:03:28,390 --> 00:03:33,640
reservations, copy that, create a new template.

47
00:03:36,440 --> 00:03:43,580
Paste in the name added to my git repository and finally looks like there's an error somewhere in here,

48
00:03:43,580 --> 00:03:49,880
but I'll get that in a minute, copy this one and go back and create a new template.

49
00:03:53,030 --> 00:03:56,930
And paste in that name and add that to my get repository.

50
00:03:56,960 --> 00:04:03,320
Now let's see what the areas and handlers it says there's an error here somewhere at the very bottom.

51
00:04:03,530 --> 00:04:04,340
So where is it?

52
00:04:04,880 --> 00:04:06,560
Oh, I got a slash in there and get rid of that.

53
00:04:08,110 --> 00:04:12,680
OK, so now those exist, but there's nothing in those templates.

54
00:04:12,680 --> 00:04:14,920
So let's just take our dashboard as a starting point.

55
00:04:15,860 --> 00:04:22,490
Select all and copy and we'll do one for all reservations and we'll change the name to all reservations.

56
00:04:27,800 --> 00:04:36,950
And make this all reservations content, select all copy new reservations, make this new reservations

57
00:04:37,940 --> 00:04:44,270
and new reservations, and in here we'll do reservation calendar.

58
00:04:48,710 --> 00:04:52,970
And we'll just changes to the reservation calendar content.

59
00:04:53,330 --> 00:04:59,270
OK, let's stop our application, start our application and let's see if that worked.

60
00:04:59,870 --> 00:05:04,820
So I'll reload this page and I'll have to log in, of course, because I started and stopped my application

61
00:05:05,450 --> 00:05:11,800
admin added Mint.com password log in and that gets me here.

62
00:05:11,810 --> 00:05:14,300
Let's go to the dashboard and see if these all work.

63
00:05:14,300 --> 00:05:15,160
So reservations.

64
00:05:15,170 --> 00:05:18,620
This should show me the new reservations page with just some dummy content here.

65
00:05:19,070 --> 00:05:19,700
And it does.

66
00:05:20,120 --> 00:05:23,170
This should show me all reservations and it does.

67
00:05:23,520 --> 00:05:25,100
Now let's try the reservation calendar.

68
00:05:26,070 --> 00:05:26,530
Good.

69
00:05:26,790 --> 00:05:32,280
So now we have some stub handlers in place, so in the next few lectures we'll start putting the logic

70
00:05:32,280 --> 00:05:38,790
in here that allows me to show new reservations, to show our reservations and to actually put a calendar

71
00:05:38,790 --> 00:05:45,390
in place, a really simple one that allows me to turn blockings or blocks on and off and shows which

72
00:05:45,390 --> 00:05:48,330
dates are already busy with existing reservations.

73
00:05:48,480 --> 00:05:51,120
And we'll take care of that in the next few lectures.
