{{!
    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/>.
}}
{{!
    Competency detail template.

    Classes required for JS:
    * competencydialogue

    Context variables required for this template:
    

    * competencyid - competency id
    * nbusersrated - number of user rated
    * nbuserstotal - users number 
    
    * scalecompetencyitems - scale used in the competency
      * color - color of the scale value
      * name - name of scale value
      * nbuser - number of users rated with this scale value
    

}}
<div class="tile_count">
    <div class="tile_stats_count rating">
        <table>
            <tr>
                <td class="convaschart">
                    {{#nbuserrated}}
                    <canvas class="detail-competency" id="canvas-graph-{{competencyid}}" height="80" width="80"></canvas>
                    {{/nbuserrated}}
                    {{^nbuserrated}}
                    <div class="no-data-available">
                        <span>{{#str}}nodataavailable, report_lpmonitoring{{/str}}</span>
                    </div>
                    {{/nbuserrated}}
                    <h5>{{#str}}totalusers, report_lpmonitoring{{/str}}</h5>
                    <div class="count">
                        <a role="button" title="{{#str}}totalusers, report_lpmonitoring{{/str}}" class="blue totalnbusers" href="#" data-competencyid="{{competencyid}}">{{nbuserrated}}/{{nbusertotal}}</a>
                    </div>
                </td>
                <td class="scalevalues">
                    <table class="tile_info" data-type="final">
                        <tr>
                         <td></td>
                         <td><span class="nbusers fa fa-user"> </span></td>
                        </tr>
                        {{#scalecompetencyitems}}
                        <tr>        
                            <td>
                                <p class="truncate"><i class="fa fa-square" style="color:{{color}}"></i>{{name}}</p>
                            </td>
                            <td >
                                {{#nbusers}}
                                <a
                                    class="scaleinfo"
                                    data-scalevalue ="{{value}}"
                                    data-competencyid = "{{competencyid}}"
                                    title="{{#str}}linkedusers, report_lpmonitoring{{/str}}"
                                    href="#"
                                    >
                                <span class="nbusers">{{nbusers}}</span>
                                </a>
                                {{/nbusers}}
                                {{^nbusers}}
                                    <span class="nbusers">{{nbusers}}</span>
                                {{/nbusers}}
                                </a>
                            </td>
                        </tr>
                        {{/scalecompetencyitems}}
                    </table>
                </td>
            </tr>
        </table>
    </div>
</div>