{{!
    This file is part of Moodle - http://moodle.org/

    Moodle is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Moodle is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
}}
{{!
    @template block_ned_myprofile/myprofile

    This template renders the content of the myprofile block.

    Classes required for JS:
        * none

        Data attributes required for JS:
        * none

        Context variables required for this template:
        * userfullname

        Optional context variables for this template:
        * userpicture
        * usercountry
        * usercity
        * useremail
        * userphone1
        * userphone2
        * userinstitution
        * useraddress
        * userfirstaccess
        * userlastaccess
        * usercurrentlogin
        * userlastip

    Example context (json):
    {
        "userpicture": "<img src='http://example.com/image.png' title='Picture of John Doe'>",
        "userfullname": "John Doe",
        "usercountry": "Australia",
        "usercity": "Perth",
        "useremail": "<a href=''>john.doe@example.com</a>",
        "userphone1": "123456789",
        "userphone2": "123456789",
        "userinstitution": "Institution",
        "useraddress": "Address",
        "userfirstaccess": "Friday, 6 July 2018, 9:03 AM",
        "userlastaccess": "Wednesday, 26 September 2018, 8:05 AM",
        "usercurrentlogin": "Wednesday, 26 September 2018, 7:17 AM",
        "userlastip": "0:0:0:0:0:0:0:1"
    }
}}
<div class="d-flex">
    <div>
        {{#userpicture}}
        <div class="myprofileitem picture">
            {{{ userpicture }}}
        </div>
        {{/userpicture}}
    </div>
    <div class="w-100 no-overflow">
        <div class="myprofileitem fullname">
            {{ userfullname }}
        </div>
        {{#userinstitution}}
            <div class="myprofileitem institution">
                <span><i class="fa fa-users" aria-hidden="true"></i></span>
                {{ userinstitution }}
            </div>
        {{/userinstitution}}
        {{#usercountry}}
            {{#usercity}}
                <div class="myprofileitem country">
                    <span><i class="fa fa-map-marker" aria-hidden="true"></i></span>
                    {{ usercity }}, {{ usercountry }}
                </div>
            {{/usercity}}
        {{/usercountry}}
        {{#useremail}}
            <div class="myprofileitem city">
                 <span><i class="fa fa-envelope" aria-hidden="true"></i></span>
                 {{{ useremail }}}
            </div>
        {{/useremail}}
        {{#userphone1}}
        <div class="myprofileitem phone1">
             <span><i class="fa fa-phone" aria-hidden="true"></i></span>
             {{ userphone1 }}
        </div>
        {{/userphone1}}
        {{#userphone2}}
        <div class="myprofileitem phone2">
             <span><i class="fa fa-phone" aria-hidden="true"></i></span>
             {{ userphone2 }}
        </div>
        {{/userphone2}}
        {{#useraddress}}
        <div class="myprofileitem address">
            <span>{{#str}} address {{/str}}:</span>
            {{ useraddress }}
        </div>
        {{/useraddress}}
        {{#userfirstaccess}}
        <div class="myprofileitem firstaccess">
             <span>{{#str}} firstaccess {{/str}}: </span>
             {{ userfirstaccess }}
        </div>
        {{/userfirstaccess}}
        {{#userlastaccess}}
        <div class="myprofileitem lastaccess">
             <span>{{#str}} lastaccess {{/str}}:</span>
             {{ userlastaccess }}
        </div>
        {{/userlastaccess}}
        {{#usercurrentlogin}}
        <div class="myprofileitem currentlogin">
             <span>{{#str}} login {{/str}}:</span>
             {{ usercurrentlogin }}
        </div>
        {{/usercurrentlogin}}
        {{#userlastip}}
        <div class="myprofileitem lastip">
             <span>IP:</span>
             {{ userlastip }}
        </div>
        {{/userlastip}}
    </div>
</div>
{{#hascoursecompletions}}
    <div class="course-completion">
        <div class="pb-2">
            <strong>{{namecoursecompletionsection}}</strong>
        </div>
        {{#coursecompletions}}
            <div>{{{icon}}} <a href="{{courseurl}}">{{course}}</a></div>
        {{/coursecompletions}}
    </div>
{{/hascoursecompletions}}