Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1441 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 core/action_link
19
 
20
    Action link template.
21
 
22
    Context variables required for this template:
23
    * disabled - Flag that indicates whether the action link to be rendered is disabled or not.
24
    * url - The action link URL.
25
    * id - The ID.
26
    * classes - CSS classes for the action link.
27
    * attributes - Array of attributes.
28
      * name - Attribute name.
29
      * value - Attribute value.
30
    * icon - The icon context data for this action link.
31
    * text - The text for this action link.
32
 
33
    Example context (json):
34
    {
35
        "disabled": false,
36
        "url": "#",
37
        "id": "test-id",
38
        "classes": "btn btn-link",
39
        "attributes": [
40
            {
41
                "name": "title",
42
                "value": "Action link's title"
43
            }
44
        ],
45
        "icon": {
46
            "attributes": [
47
                {"name": "src", "value": "https://raw.githubusercontent.com/moodle/moodle/master/pix/t/check.png"},
48
                {"name": "alt", "value": "Action link's icon"}
49
            ]
50
        },
51
        "text": "This is an action link"
52
    }
53
}}
54
{{^disabled}}
55
    <a href="{{{url}}}" id="{{id}}" class="btn btn-icon btn-light" {{#attributes}} {{name}}="{{value}}" {{/attributes}} data-bs-toggle="tooltip" data-bs-placement="top" title="{{{text}}}" aria-label="{{{text}}}">
56
        <svg class="" width="18" height="18" stroke-width="2" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" color="currentColor">
57
            <path d="M18.5 12H6m0 0l6-6m-6 6l6 6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
58
        </svg>
59
    </a>
60
    {{#hasactions}}
61
        {{> core/actions }}
62
    {{/hasactions}}
63
{{/disabled}}
64
{{#disabled}}
65
    <span class="currentlink btn btn-icon btn-secondary" {{#attributes}} {{name}}="{{value}}" {{/attributes}}></span>
66
{{/disabled}}