{{!
    This file is part of Moodle - https://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 koperedashboard_contracts/accept

    Example context (json):
    {
        "coursename": "English 101 - Basics",
        "contenthtml": "<h3>Student Contract</h3><p>By clicking <strong>Accept</strong>, you agree to the terms of this course contract.</p><ul><li>Payment terms</li><li>Attendance policy</li><li>Certificate rules</li></ul>",
        "posturl": "https://moodle.example.com/local/koperedashboard_contracts/accept.php?courseid=12",
        "sesskey": "abc123XYZ987"
    }
}}

<div class="kopere_dashboard-card">
    <div class="muted">{{{coursename}}}</div>

    <div style="margin-top: 16px;">
        {{{contenthtml}}}
    </div>

    <form method="post" action="{{{posturl}}}" style="margin-top: 16px;" id="kopere_dashboard-contract-accept-form">
        <input type="hidden" name="sesskey" value="{{{sesskey}}}">
        <input type="hidden" name="accept" value="1">
        <input type="hidden" name="readseconds" value="0" id="kopere_dashboard-readseconds">

        <button type="submit" class="btn btn-primary" id="kopere_dashboard-accept-btn">
            {{#str}}btn_accept, koperedashboard_contracts{{/str}}
        </button>

        <div class="muted" style="margin-top: 10px;">
            Reading time: <span id="kopere_dashboard-timer">0</span>s
        </div>
    </form>
</div>
