{{!
    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_deft/configuration

    This template renders the registration page

    Example context (json):
    {
         "configured": false,
         "registrationurl": "https://deftly.us/enrol/lti/register.php?token=5fb5b5ca827e76092897cd369d3a59cdf266813496a3285dasf0ef98b04",
         "registrationurl": "https://moodlesite/admin/settings.php?settion=blocksettingdeft"
    }
}}
<div>
    {{# disabled }}
        <p><a href="{{ returnurl }}">{{# str }} returntosettings, block_deft {{/ str }}</a></p>
    {{/ disabled }}
    {{^ configured }}
        <div class="registrationcontainer"></div>
        {{# error }}
        <p>{{# str }} configuremanually, block_deft {{/ str }}</p>
        <p><a href="{{ returnurl }}">{{# str }} returntosettings, block_deft {{/ str }}</a></p>
        {{/ error }}
    {{/ configured }}
    {{# configured }}
        <p>{{# str }} toolconfigured, block_deft {{/ str }}</p>
        <p><a href="{{ returnurl }}">{{# str }} returntosettings, block_deft {{/ str }}</a></p>
    {{/ configured }}
</div>
{{# js }}
    {{^ configured }}
        {{^ error }}
            require(['block_deft/configure'], function(Configure) {
                Configure.init("{{ registrationurl }}", "{{ finishurl }}");
            });
        {{/ error }}
    {{/ configured }}
    {{# configured }}
        require(['block_deft/test'], function(Test) {
            Test.init("{{ contextid }}");
        });
    {{/ configured }}
{{/ js }}
