Proyectos de Subversion Moodle

Rev

Rev 4 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
4 ariadna 1
{{!
2
    This file is part of Moodle - http://moodle.org/
3
 
4
    Moodle is free software: you can redistribute it and/or modify
5
    it under the terms of the GNU General Public License as published by
6
    the Free Software Foundation, either version 3 of the License, or
7
    (at your option) any later version.
8
 
9
    Moodle is distributed in the hope that it will be useful,
10
    but WITHOUT ANY WARRANTY; without even the implied warranty of
11
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
    GNU General Public License for more details.
13
 
14
    You should have received a copy of the GNU General Public License
15
    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
16
}}
17
{{!
18
    @template block_point_view/reactions
19
 
20
    Classes required for JS:
21
    * block_point_view
22
    * reactions-container
23
    * reactions
24
    * reaction
25
    * reactionnb
26
    * group_img
27
    * group_nb
28
 
29
    Data attributes required for JS:
30
    * data-reactionname
31
 
32
    Context variables required for this template:
33
    * reactions Possible reactions.
34
        * name Name of the reaction.
35
        * pix Pix src of the reaction.
36
        * text Text for the reaction.
37
 
38
    Example context (json):
39
    {
40
        "reactions": [
41
            {
42
                "name": "easy",
43
                "pix": "/blocks/point_view/pix/easy.png",
44
                "text": "Easy!"
45
            },
46
            {
47
                "name": "better",
48
                "pix": "/blocks/point_view/pix/better.png",
49
                "text": "I'm getting better!"
50
            },
51
            {
52
                "name": "hard",
53
                "pix": "/blocks/point_view/pix/hard.png",
54
                "text": "So hard..."
55
            }
56
        ]
57
    }
58
}}
59
<div class="block_point_view reactions-container">
60
    <span class="reactions invisible">
61
        {{# reactions }}
62
        <span class="reaction withtooltip position-relative d-inline-block">
5 ariadna 63
            <img src="{{pix}}" alt="{{text}}" class="clickable" data-reactionname="{{name}}" />
4 ariadna 64
            <span class="tooltiptext">{{text}}</span>
65
        </span>
66
        <span class="reactionnb mx-2 pr-1 invisible" data-reactionname="{{name}}">0</span>
67
        {{/ reactions }}
68
    </span>
69
    <span class="group">
5 ariadna 70
         <img src="/blocks/point_view/pix/group_.png" alt=" " class="group_img position-relative" />
4 ariadna 71
         <span class="group_nb text-center"><span class="position-relative d-inline-block"></span></span>
72
    </span>
73
</div>