Proyectos de Subversion Moodle

Rev

Rev 5 | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |

{{!
    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_point_view/reactions

    Classes required for JS:
    * block_point_view
    * reactions-container
    * reactions
    * reaction
    * reactionnb
    * group_img
    * group_nb

    Data attributes required for JS:
    * data-reactionname

    Context variables required for this template:
    * reactions Possible reactions.
        * name Name of the reaction.
        * pix Pix src of the reaction.
        * text Text for the reaction.

    Example context (json):
    {
        "reactions": [
            {
                "name": "easy",
                "pix": "/blocks/point_view/pix/easy.png",
                "text": "Easy!"
            },
            {
                "name": "better",
                "pix": "/blocks/point_view/pix/better.png",
                "text": "I'm getting better!"
            },
            {
                "name": "hard",
                "pix": "/blocks/point_view/pix/hard.png",
                "text": "So hard..."
            }
        ]
    }
}}
<div class="block_point_view reactions-container">
    <span class="reactions invisible">
        {{# reactions }}
        <span class="reaction withtooltip position-relative d-inline-block">
            <img src="{{pix}}" alt="{{text}}" class="clickable" data-reactionname="{{name}}">
            <span class="tooltiptext">{{text}}</span>
        </span>
        <span class="reactionnb mx-2 pr-1 invisible" data-reactionname="{{name}}">0</span>
        {{/ reactions }}
    </span>
    <span class="group">
         <img src="/blocks/point_view/pix/group_.png" alt=" " class="group_img position-relative">
         <span class="group_nb text-center"><span class="position-relative d-inline-block"></span></span>
    </span>
</div>