{{!
    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 theme_moove/frontpage_login

    Accessibility toolbar template

    Example context (json): {
        "logintoken": "thecsrflogintoken",
        "canloginbyemail": true,
        "canloginasguest": true
    }
}}
<div class="card-body">
    <h3>{{#str}}platform_access, theme_moove{{/str}}</h3>
    <form class="signup-form" action="{{{ config.wwwroot }}}/login/index.php" method="POST" role="form">
        <input type="hidden" name="logintoken" value="{{logintoken}}">
        <label for="username">
            {{^canloginbyemail}}
                {{#str}}username{{/str}}
            {{/canloginbyemail}}
            {{#canloginbyemail}}
                {{#str}}usernameemail{{/str}}
            {{/canloginbyemail}}
        </label>
        <div class="input-group">
            <div class="input-group-addon"><i class="fa fa-envelope add-on"></i></div>
            <input type="text" class="form-control" id="username" name="username" placeholder="{{#str}}username{{/str}}" required />
        </div>

        <label for="password">{{#str}}password{{/str}}</label>
        <div class="input-group">
            <div class="input-group-addon"><i class="fa fa-lock add-on"></i></div>
            <input type="password" class="form-control" id="password" name="password" placeholder="{{#str}}password{{/str}}" required />
        </div>

        <div class="sign-up-btn">
            <button type="submit" class="btn btn-primary">{{#str}}login{{/str}}</button>
        </div>
    </form>

    {{#output.has_identity_providers}}
        <h5 class="mt-2">{{#str}} potentialidps, auth {{/str}}</h5>
        <div class="potentialidplist" class="m-t-1">
            {{#output.get_identity_providers}}
                <div class="potentialidp">
                    <a href="{{{url}}}" title={{#quote}}{{name}}{{/quote}} class="btn btn-secondary btn-block">
                    {{#iconurl}}
                        <img src="{{iconurl}}" alt="" width="24" height="24"/>
                    {{/iconurl}}
                    {{name}}
                    </a>
                </div>
            {{/output.get_identity_providers}}
        </div>
    {{/output.has_identity_providers}}

    <p class="my-2"><a href="{{{ config.wwwroot }}}/login/forgot_password.php">{{#str}}forgotten{{/str}}</a></p>

    {{#cansignup}}
        <a class="btn btn-register btn-primary" href="{{{ config.wwwroot }}}/login/signup.php?">{{#str}}newaccount{{/str}}</a>
    {{/cansignup}}

    {{#canloginasguest}}
        <form action="{{{ config.wwwroot }}}/login/index.php" method="post" id="guestlogin">
            <input type="hidden" name="username" value="guest" />
            <input type="hidden" name="password" value="guest" />
            <input type="hidden" name="logintoken" value="{{logintoken}}">
            <button class="btn btn-default btn-block mt-2" type="submit">{{#str}}loginguest{{/str}}</button>
        </form>
    {{/canloginasguest}}
</div>
