WEBVTT 00:01.700 --> 00:05.390 So we have the displaying of an individual sail working really well. 00:05.510 --> 00:07.140 And, of course, we'll have to do the refund. 00:07.160 --> 00:08.430 We'll get to that before too long. 00:09.260 --> 00:13.520 So now we obviously need to do the same thing for showing all subscriptions. 00:13.520 --> 00:22.400 And I could if I wanted to go back to my code over here and duplicate this entire page and make it a 00:22.820 --> 00:27.040 subscription page Dutko HTML and that would work really well. 00:27.200 --> 00:29.230 But we can probably simplify this. 00:29.240 --> 00:31.400 So let's go back to our handlers. 00:32.210 --> 00:37.320 Handlers don't go right here and let's modify the way that we're showing a sale. 00:37.340 --> 00:42.230 So right now we're just showing this and we have the title and the world and everything else hardcoded 00:42.380 --> 00:48.950 we can pass that is data to this handler so we can say make a string map and that's going to be a sign 00:48.950 --> 00:53.000 the value of make a map, string, string. 00:53.900 --> 01:01.460 Now, the reason I'm doing that is if you look at our render function, which is where is it web render 01:01.460 --> 01:04.160 right here the very top of this file. 01:04.370 --> 01:07.270 We're passing certain kinds of data to every template. 01:07.280 --> 01:10.530 And one of those things is a string map, which is a map of string string. 01:11.210 --> 01:16.250 So back here in our handlers, I can create a string map and then populate the only two things that 01:16.250 --> 01:22.540 change between the showing a sale and what I want to do now, which is showing a subscription. 01:22.910 --> 01:24.920 Those are the title and the cancel button. 01:25.880 --> 01:27.800 So I'll put an entry in their string map. 01:28.340 --> 01:31.420 So title is equal to for sale. 01:31.430 --> 01:37.550 I'll just call it sale and string map and I'll call this one cancel. 01:38.510 --> 01:47.000 And the cancel button has a URL that goes to admin, slash all sales and then I just pass this string 01:47.000 --> 01:47.330 map. 01:47.630 --> 01:52.010 Has Temperley do so for the member string map put in string map. 01:53.400 --> 02:00.030 And now if I go back to my template sale page, go HTML and come up here to the top where there is a 02:00.030 --> 02:05.700 title, I can just replace that with index dot string map. 02:06.370 --> 02:15.150 I'm looking for title and I can copy this whole thing and paste it here and go down here to the council 02:15.300 --> 02:20.220 and I'll make this and I'll put it in single code so we don't get what looks like an error but is not 02:21.690 --> 02:28.160 index dot string that council which are better spelled right. 02:29.880 --> 02:32.100 And then close my single quotes right here. 02:33.060 --> 02:34.560 Now if I start my application. 02:34.560 --> 02:35.430 So I'll stop it. 02:35.580 --> 02:38.390 Make stop and make start. 02:41.680 --> 02:47.050 And go back to my Web browser and go to all sales because we hadn't done subscriptions yet, this should 02:47.050 --> 02:47.530 still work. 02:48.160 --> 02:48.850 There it is. 02:48.850 --> 02:50.590 And the cancel button should still work. 02:51.220 --> 02:51.920 And it does. 02:52.600 --> 03:00.460 So now I can go back to my coat, hide my terminal, open my handler's, duplicate this entire handler 03:01.420 --> 03:02.110 and rename it. 03:03.980 --> 03:05.930 And I'll rename it to show subscription 03:08.930 --> 03:11.030 and change the title to subscription 03:14.030 --> 03:23.450 subscription and change this to all subscriptions like that and go back to my roots and duplicate this 03:23.450 --> 03:31.280 root and change that to the one that we get from our old subscriptions page, which is sub script schnozz 03:31.730 --> 03:34.580 and have it show subscription. 03:37.060 --> 03:43.130 And if I made everything right, let's have a look just to verify this admin, all subscriptions subscription 03:43.130 --> 03:43.610 that good. 03:43.780 --> 03:45.100 Let's restart our application. 03:46.060 --> 03:48.820 Make start Mixter. 03:51.780 --> 03:55.710 And go back here to our Web browser and go to all subscriptions. 03:57.080 --> 04:04.060 And click on Order for that's for Diana Prince and there it is, order for Diana Prince subscription. 04:04.070 --> 04:07.580 And if I click on Cancel It, you take me back to all subscriptions. 04:08.180 --> 04:08.860 And it does. 04:09.890 --> 04:15.470 Now, there's still a bit of code duplication around here, of course, for example, or or potential 04:15.470 --> 04:17.480 code duplication, for example. 04:17.480 --> 04:20.000 I have this format currency. 04:20.030 --> 04:23.390 And should I put it here, I may have to use that in lots of places. 04:23.390 --> 04:28.970 I could actually take it out of here and put it in my base load if I wanted to write down here. 04:28.970 --> 04:33.590 And it's JavaScript and that would be something that might be useful if I'm going to put that in more 04:33.590 --> 04:34.100 places. 04:34.640 --> 04:36.590 But for right now, I'll leave it where it is. 04:36.590 --> 04:38.770 And if I need to move it, move it later on. 04:39.200 --> 04:42.710 So let's move on to refunding orders.