Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 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
        * useridnumber
41
        * userfirstaccess
42
        * userlastaccess
43
        * usercurrentlogin
44
        * userlastip
45
        * userlastlogin
46
 
47
    Example context (json):
48
    {
49
        "userpicture": "<img src='http://example.com/image.png' title='Picture of John Doe'>",
50
        "userfullname": "John Doe",
51
        "usercountry": "Australia",
52
        "usercity": "Perth",
53
        "useremail": "<a href=''>john.doe@example.com</a>",
54
        "userphone1": "123456789",
55
        "userphone2": "123456789",
56
        "userinstitution": "Institution",
57
        "useraddress": "Address",
58
        "useridnumber": "12345",
59
        "userfirstaccess": "Friday, 6 July 2018, 9:03 AM",
60
        "userlastaccess": "Wednesday, 26 September 2018, 8:05 AM",
61
        "usercurrentlogin": "Wednesday, 26 September 2018, 7:17 AM",
62
        "userlastip": "0:0:0:0:0:0:0:1",
63
        "userlastlogin": "Wednesday, 25 September 2018, 9:01 AM"
64
    }
65
}}
66
<div>
67
    {{#userpicture}}
68
    <div class="myprofileitem picture">
69
        {{{ userpicture }}}
70
    </div>
71
    {{/userpicture}}
72
</div>
73
<div class="w-100 no-overflow">
74
    <div class="myprofileitem fullname">
75
        {{ userfullname }}
76
    </div>
77
    {{#usercountry}}
78
    <div class="myprofileitem country">
79
        <span>{{#str}} country {{/str}}:</span>
80
        {{ usercountry }}
81
    </div>
82
    {{/usercountry}}
83
    {{#usercity}}
84
    <div class="myprofileitem city">
85
         <span>{{#str}} city {{/str}}:</span>
86
         {{ usercity }}
87
    </div>
88
    {{/usercity}}
89
    {{#useremail}}
90
        <div class="myprofileitem city">
91
             <span>{{#str}} email {{/str}}:</span>
92
             {{{ useremail }}}
93
        </div>
94
    {{/useremail}}
95
    {{#userphone1}}
96
    <div class="myprofileitem phone1">
97
         <span>{{#str}} phone1 {{/str}}:</span>
98
         {{ userphone1 }}
99
    </div>
100
    {{/userphone1}}
101
    {{#userphone2}}
102
    <div class="myprofileitem phone2">
103
         <span>{{#str}} phone2 {{/str}}:</span>
104
         {{ userphone2 }}
105
    </div>
106
    {{/userphone2}}
107
    {{#userinstitution}}
108
    <div class="myprofileitem institution">
109
        <span>{{#str}} institution {{/str}}:</span>
110
        {{ userinstitution }}
111
    </div>
112
    {{/userinstitution}}
113
    {{#useraddress}}
114
    <div class="myprofileitem address">
115
        <span>{{#str}} address {{/str}}:</span>
116
        {{ useraddress }}
117
    </div>
118
    {{/useraddress}}
119
    {{#useridnumber}}
120
    <div class="myprofileitem idnumber">
121
        <span>{{#str}} idnumber {{/str}}:</span>
122
        {{{ useridnumber }}}
123
    </div>
124
    {{/useridnumber}}
125
    {{#userfirstaccess}}
126
    <div class="myprofileitem firstaccess">
127
         <span>{{#str}} firstaccess {{/str}}: </span>
128
         {{ userfirstaccess }}
129
    </div>
130
    {{/userfirstaccess}}
131
    {{#userlastaccess}}
132
    <div class="myprofileitem lastaccess">
133
         <span>{{#str}} lastaccess {{/str}}:</span>
134
         {{ userlastaccess }}
135
    </div>
136
    {{/userlastaccess}}
137
    {{#usercurrentlogin}}
138
    <div class="myprofileitem currentlogin">
139
         <span>{{#str}} login {{/str}}:</span>
140
         {{ usercurrentlogin }}
141
    </div>
142
    {{/usercurrentlogin}}
143
    {{#userlastlogin}}
144
    <div class="myprofileitem lastlogin">
145
         <span>{{#str}} lastlogin {{/str}}:</span>
146
         {{ userlastlogin }}
147
    </div>
148
    {{/userlastlogin}}
149
    {{#userlastip}}
150
    <div class="myprofileitem lastip">
151
         <span>IP:</span>
152
         {{ userlastip }}
153
    </div>
154
    {{/userlastip}}
155
</div>