{{!
    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 report_competency/report

    Moodle template competency breakdown report.

    This template includes ajax functionality, so it cannot be shown in the template library.
}}
<div data-region="competency-breakdown-report" data-courseid="{{course.id}}" data-userid="{{user.id}}" data-moduleid="{{moduleid}}">
<div class="my-2" data-region="configurecoursecompetencies">
{{#pushratingstouserplans}}
    <div class="wrapper-fw">
        <div class="alert alert-light d-inline-flex align-items-center">
            <span class="mr-3">
                <svg width="24" height="24" fill="none" viewBox="0 0 24 24">
                    <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M11.25 4.75L8.75 7L11.25 9.25"></path>
                    <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12.75 19.25L15.25 17L12.75 14.75"></path>
                    <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9.75 7H13.25C16.5637 7 19.25 9.68629 19.25 13V13.25"></path>
                    <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M14.25 17H10.75C7.43629 17 4.75 14.3137 4.75 11V10.75"></path>
                </svg>
            </span>
            {{#str}}coursecompetencyratingsarepushedtouserplans, tool_lp{{/str}}
        </div>
    </div>
{{/pushratingstouserplans}}
{{^pushratingstouserplans}}
    <div class="wrapper-fw">
        <div class="alert alert-light d-inline-flex align-items-center">
            <span class="mr-3">
                <svg width="24" height="24" fill="none" viewBox="0 0 24 24">
                    <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 13V15"></path>
                    <circle cx="12" cy="9" r="1" fill="currentColor"></circle>
                    <circle cx="12" cy="12" r="7.25" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></circle>
                </svg>
            </span>
            {{#str}}coursecompetencyratingsarenotpushedtouserplans, tool_lp{{/str}}
        </div>
    </div>
{{/pushratingstouserplans}}
</div>
<div class="row">
<span class="col-md-12">
    <table class="generaltable">
        <summary class="accesshide">
            <p>{{#str}}coursecompetencybreakdownsummary, report_competency{{/str}}</p>
        </summary>
        <tr>
            <th scope="col">
                <span>{{#str}}competency, report_competency{{/str}}</span>
            </th>
            <th scope="col">
                <span>{{#str}}rating, report_competency{{/str}}</span>
            </th>
        </tr>
        {{#usercompetencies}}
        <tr>
            {{#competency}}
            <td>
                <a href="#" data-action="competency-dialogue" data-id="{{competency.id}}">
                    {{{competency.shortname}}} <em data-id="{{competency.id}}">{{competency.idnumber}}</em>
                </a>
            </td>
            {{/competency}}
            {{#usercompetencycourse}}
            <td data-user-competency="true"
                data-userid="{{user.id}}"
                data-competencyid="{{competencyid}}"
                data-courseid="{{course.id}}">
                <span class="badge badge-link {{#proficiency}}badge-success{{/proficiency}}"">
                    {{#proficiency}}<span class="mr-2"><svg width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M4.75 12C4.75 7.99594 7.99594 4.75 12 4.75V4.75C16.0041 4.75 19.25 7.99594 19.25 12V12C19.25 16.0041 16.0041 19.25 12 19.25V19.25C7.99594 19.25 4.75 16.0041 4.75 12V12Z"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9.75 12.75L10.1837 13.6744C10.5275 14.407 11.5536 14.4492 11.9564 13.7473L14.25 9.75"></path></svg></span>{{/proficiency}}
                    {{> report_competency/user_competency_summary}}
                </span>
            </td>
            {{/usercompetencycourse}}
        </tr>
        {{/usercompetencies}}
    </table>
</span>
</div>
</div>
{{#js}}
require(['tool_lp/competencydialogue'], function(Compdialogue) {
    Compdialogue.init();
});
require(['report_competency/grading_popup'], function(Popup) {
    (new Popup('[data-region=competency-breakdown-report]', '[data-user-competency=true]'));
});
{{/js}}
