1
00:00:00,670 --> 00:00:09,250
In this video, we are going to display the user details, and that is the user profile, including

2
00:00:09,250 --> 00:00:13,370
the profile picture that we uploaded in the previous video.

3
00:00:13,390 --> 00:00:15,010
So let's have a look.

4
00:00:15,010 --> 00:00:23,380
When I click on profile in here, I want to have the real user details from the back end, including

5
00:00:23,380 --> 00:00:25,090
the profile picture.

6
00:00:25,300 --> 00:00:33,250
So let's locate the template where we are rendering that and that is Inside View's users.

7
00:00:33,250 --> 00:00:34,990
And then the profile.

8
00:00:35,080 --> 00:00:40,690
And this is the image for the profile photo, and this image is from the Pixabay.

9
00:00:40,720 --> 00:00:44,530
So how are you going to display the data?

10
00:00:44,530 --> 00:00:46,240
And here is a logic.

11
00:00:46,240 --> 00:00:49,570
We need to locate the controller for that.

12
00:00:49,570 --> 00:00:56,440
So inside controllers, users and this is a controller for fetching user profile.

13
00:00:56,440 --> 00:01:03,040
So all what you are going to do is that we are going to send the user details to the template.

14
00:01:03,040 --> 00:01:04,269
So here we go.

15
00:01:04,300 --> 00:01:08,440
We're going to make this of rest, then the render.

16
00:01:09,120 --> 00:01:18,030
And then I want to display the user's profile templates and our past in the user details.

17
00:01:18,030 --> 00:01:23,710
So inside the template or profile, I have access to this user.

18
00:01:23,730 --> 00:01:27,180
But before we continue, let's check something here.

19
00:01:27,390 --> 00:01:32,940
If we get back to the roots, let's see the root for the profile.

20
00:01:32,940 --> 00:01:35,310
And here we have two.

21
00:01:35,340 --> 00:01:38,010
This one was for testing purposes.

22
00:01:38,010 --> 00:01:42,960
And then lastly is for the protected profile page.

23
00:01:42,960 --> 00:01:51,870
So I'm going to remove this one from here because this one was for testing and the endpoint for this

24
00:01:51,900 --> 00:01:57,870
is going to be forward slash profile and let's change to profile page.

25
00:01:57,870 --> 00:01:59,940
That is a real endpoint.

26
00:02:00,120 --> 00:02:04,080
So if you go to profile, it remains the same.

27
00:02:04,080 --> 00:02:06,480
So how are you going to make use of it?

28
00:02:06,480 --> 00:02:13,830
Remember, we have passed the log in user into the template, so we are going to make use of it.

29
00:02:13,830 --> 00:02:16,770
So this is the image for the profile.

30
00:02:16,770 --> 00:02:23,550
I'm going to remove this one and make this of edges here and equal to the user.

31
00:02:23,550 --> 00:02:27,150
And then the property is called profile image.

32
00:02:29,100 --> 00:02:29,930
Save it.

33
00:02:29,940 --> 00:02:30,570
And now.

34
00:02:30,600 --> 00:02:32,130
Moment of truth.

35
00:02:32,870 --> 00:02:41,900
And you can see that I have the profile image when I click on this one and then choose a different image.

36
00:02:41,900 --> 00:02:49,020
Let me use this image as my profile and let's have a look where it's being uploaded.

37
00:02:49,040 --> 00:02:58,100
If I go to the profile and this is the image I just uploaded, the next step is that let's populate

38
00:02:58,100 --> 00:02:59,080
these details.

39
00:02:59,090 --> 00:03:02,300
So let's locate those fellows.

40
00:03:02,300 --> 00:03:03,730
And here we go.

41
00:03:03,740 --> 00:03:09,530
We have name, and in here I'm going to use Edge as as that.

42
00:03:09,770 --> 00:03:10,970
And.

43
00:03:11,730 --> 00:03:14,250
ICO to user.

44
00:03:14,460 --> 00:03:15,180
Dirt.

45
00:03:15,180 --> 00:03:16,170
Food name.

46
00:03:17,890 --> 00:03:20,830
And then the email.

47
00:03:20,860 --> 00:03:27,940
Let me copy this one and as that and change this one to email.

48
00:03:28,030 --> 00:03:35,440
In case you're not familiar with optional training, this one is being used to avoid using an operator

49
00:03:35,440 --> 00:03:38,830
so this one can be read in as this.

50
00:03:39,400 --> 00:03:45,310
In case we have user, then I'm going to make use of user dot email.

51
00:03:45,310 --> 00:03:47,980
So this one is same as this.

52
00:03:48,310 --> 00:03:52,390
So let's save it and let's refresh it and let's see.

53
00:03:52,390 --> 00:03:56,470
And we have Ben and then the email.

54
00:03:56,470 --> 00:03:59,980
So what about the date for the date?

55
00:03:59,980 --> 00:04:05,980
I'm going to remove this one and paste that and change this one to create it.

56
00:04:05,980 --> 00:04:06,640
Add.

57
00:04:07,270 --> 00:04:08,950
Let's have a look.

58
00:04:10,780 --> 00:04:14,450
And this is the date for the date.

59
00:04:14,470 --> 00:04:16,899
We have two ways of formatting it.

60
00:04:16,930 --> 00:04:25,900
One is we can create a utility method or function to format that, or we can use built in method called

61
00:04:25,900 --> 00:04:28,140
to look our date string.

62
00:04:28,220 --> 00:04:31,570
I'm going to make use of that as a dot to.

63
00:04:32,440 --> 00:04:32,980
Look.

64
00:04:35,790 --> 00:04:37,170
All right, save it.

65
00:04:37,170 --> 00:04:39,270
And now let's have a look.

66
00:04:39,830 --> 00:04:43,640
And we have the formatted date.

67
00:04:43,940 --> 00:04:44,630
All right.

68
00:04:44,630 --> 00:04:45,630
The next video.

69
00:04:45,650 --> 00:04:49,640
Let's finish up with the profile image upload functionality.

70
00:04:49,640 --> 00:04:54,830
And that is we want to display error message and redirect upon success.

71
00:04:54,830 --> 00:04:57,290
So let's get into that in the next video.

