1{{!
2    This file is part of Moodle - http://moodle.org/
3
4    Moodle is free software: you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation, either version 3 of the License, or
7    (at your option) any later version.
8
9    Moodle is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13
14    You should have received a copy of the GNU General Public License
15    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
16}}
17{{!
18    @template block_myprofile/myprofile
19
20    This template renders the content of the myprofile block.
21
22    Classes required for JS:
23        * none
24
25        Data attributes required for JS:
26        * none
27
28        Context variables required for this template:
29        * userfullname
30
31        Optional context variables for this template:
32        * userpicture
33        * usercountry
34        * usercity
35        * useremail
36        * userphone1
37        * userphone2
38        * userinstitution
39        * useraddress
40        * userfirstaccess
41        * userlastaccess
42        * usercurrentlogin
43        * userlastip
44
45    Example context (json):
46    {
47        "userpicture": "<img src='http://example.com/image.png' title='Picture of John Doe'>",
48        "userfullname": "John Doe",
49        "usercountry": "Australia",
50        "usercity": "Perth",
51        "useremail": "<a href=''>john.doe@example.com</a>",
52        "userphone1": "123456789",
53        "userphone2": "123456789",
54        "userinstitution": "Institution",
55        "useraddress": "Address",
56        "userfirstaccess": "Friday, 6 July 2018, 9:03 AM",
57        "userlastaccess": "Wednesday, 26 September 2018, 8:05 AM",
58        "usercurrentlogin": "Wednesday, 26 September 2018, 7:17 AM",
59        "userlastip": "0:0:0:0:0:0:0:1"
60    }
61}}
62<div>
63    {{#userpicture}}
64    <div class="myprofileitem picture">
65        {{{ userpicture }}}
66    </div>
67    {{/userpicture}}
68</div>
69<div class="w-100 no-overflow">
70    <div class="myprofileitem fullname">
71        {{ userfullname }}
72    </div>
73    {{#usercountry}}
74    <div class="myprofileitem country">
75        <span>{{#str}} country {{/str}}:</span>
76        {{ usercountry }}
77    </div>
78    {{/usercountry}}
79    {{#usercity}}
80    <div class="myprofileitem city">
81         <span>{{#str}} city {{/str}}:</span>
82         {{ usercity }}
83    </div>
84    {{/usercity}}
85    {{#useremail}}
86        <div class="myprofileitem city">
87             <span>{{#str}} email {{/str}}:</span>
88             {{{ useremail }}}
89        </div>
90    {{/useremail}}
91    {{#userphone1}}
92    <div class="myprofileitem phone1">
93         <span>{{#str}} phone1 {{/str}}:</span>
94         {{ userphone1 }}
95    </div>
96    {{/userphone1}}
97    {{#userphone2}}
98    <div class="myprofileitem phone2">
99         <span>{{#str}} phone2 {{/str}}:</span>
100         {{ userphone2 }}
101    </div>
102    {{/userphone2}}
103    {{#userinstitution}}
104    <div class="myprofileitem institution">
105        <span>{{#str}} institution {{/str}}:</span>
106        {{ userinstitution }}
107    </div>
108    {{/userinstitution}}
109    {{#useraddress}}
110    <div class="myprofileitem address">
111        <span>{{#str}} address {{/str}}:</span>
112        {{ useraddress }}
113    </div>
114    {{/useraddress}}
115    {{#userfirstaccess}}
116    <div class="myprofileitem firstaccess">
117         <span>{{#str}} firstaccess {{/str}}: </span>
118         {{ userfirstaccess }}
119    </div>
120    {{/userfirstaccess}}
121    {{#userlastaccess}}
122    <div class="myprofileitem lastaccess">
123         <span>{{#str}} lastaccess {{/str}}:</span>
124         {{ userlastaccess }}
125    </div>
126    {{/userlastaccess}}
127    {{#usercurrentlogin}}
128    <div class="myprofileitem currentlogin">
129         <span>{{#str}} login {{/str}}:</span>
130         {{ usercurrentlogin }}
131    </div>
132    {{/usercurrentlogin}}
133    {{#userlastip}}
134    <div class="myprofileitem lastip">
135         <span>IP:</span>
136         {{ userlastip }}
137    </div>
138    {{/userlastip}}
139</div>
140