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_course/addresourceoractivitybutton
19
 
20
    Displays a add resource or activity button.
21
 
22
    Example context (json):
23
    {
24
        "sectionnum": 0,
25
        "modid": 1,
26
        "activityname": "Activity example",
27
        "sectionreturn": 0
28
    }
29
}}
30
<button class="section-modchooser section-modchooser-link {{!
31
    }}{{^hasactionlinks}}btn add-content d-flex justify-content-center align-items-center p-1 icon-no-margin{{/hasactionlinks}}{{!
32
    }}{{#hasactionlinks}}dropdown-item{{/hasactionlinks}}"
33
    data-action="open-chooser"
34
    data-sectionnum="{{sectionnum}}"
35
    {{#sectionreturn}}data-sectionreturnnum="{{.}}"{{/sectionreturn}}
36
    {{#modid}}
37
        data-beforemod="{{modid}}"
38
        aria-label="{{#str}}insertresourceoractivitybefore, core, { "activityname": {{#quote}} {{activityname}} {{/quote}} } {{/str}}"
39
        tabindex="0"
40
        title="{{#str}}addresourceoractivity, core{{/str}}"
41
    {{/modid}}
42
>
43
    {{^hasactionlinks}}
44
        {{#modid}}
45
            {{#pix}} t/add, core {{/pix}}
46
        {{/modid}}
47
        {{^modid}}
48
            <div class="px-1">
49
                {{#pix}} t/add, core {{/pix}}
50
                <span class="activity-add-text pe-1">{{#str}}addresourceoractivity, core{{/str}}</span>
51
            </div>
52
        {{/modid}}
53
    {{/hasactionlinks}}
54
    {{#hasactionlinks}}
55
        {{#pix}} i/activities, core {{/pix}}{{#str}}activityorresource, core{{/str}}
56
    {{/hasactionlinks}}
57
</button>