Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 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 datafield_picture/picture
19
 
20
    The purpose of this template is to enable the user to define a picture field.
21
 
22
    Classes required for JS:
23
    * none
24
 
25
    Data attributes required for JS:
26
    * none
27
 
28
    Context variables required for this template:
29
    * name string The field's name.
30
    * description string The field's description.
31
    * required bool The field's requiredness.
32
    * param1 int The fields width in single view value.
33
    * param2 int The fields height in single view value.
34
    * param3 int The file's maximum size.
35
    * param4 int The fields width in list view value.
36
    * param5 int The fields height in list view value.
37
    * filesizes array The field's file sizes.
38
 
39
    Example context (json):
40
    {
41
        "name": "A name",
42
        "description": "A description",
43
        "required": true,
44
        "param1": 100,
45
        "param2": 200,
46
        "param3": 67108864,
47
        "param4": 300,
48
        "param5": 400,
49
        "options": [ { "name": "Site upload limit (64MB)", "value": "0", "selected": true },
50
                     { "name": "64MB", "value": "67108864", "selected": false } ]
51
    }
52
}}
53
 
54
<fieldset>
55
    {{> mod_data/fields/basicfields }}
56
    {{> mod_data/fields/requiredfield }}
1441 ariadna 57
    <div class="row mb-2 fitem">
58
        <label for="param1" class="col-md-3 col-form-label">{{#str}}fieldwidthsingleview, data{{/str}}</label>
59
        <div class="col-md-9 felement">
1 efrain 60
            <input class="picturefieldsize form-control" type="text" name="param1" id="param1" value="{{param1}}">
61
        </div>
62
    </div>
1441 ariadna 63
    <div class="row mb-2 fitem">
64
        <label for="param2" class="col-md-3 col-form-label">{{#str}}fieldheightsingleview, data{{/str}}</label>
65
        <div class="col-md-9 felement">
1 efrain 66
            <input class="picturefieldsize form-control" type="text" name="param2" id="param2" value="{{param2}}">
67
        </div>
68
    </div>
1441 ariadna 69
    <div class="row mb-2 fitem">
70
        <label for="param4" class="col-md-3 col-form-label">{{#str}}fieldwidthlistview, data{{/str}}</label>
71
        <div class="col-md-9 felement">
1 efrain 72
            <input class="picturefieldsize form-control" type="text" name="param4" id="param4" value="{{param4}}">
73
        </div>
74
    </div>
1441 ariadna 75
    <div class="row mb-2 fitem">
76
        <label for="param5" class="col-md-3 col-form-label">{{#str}}fieldheightlistview, data{{/str}}</label>
77
        <div class="col-md-9 felement">
1 efrain 78
            <input class="picturefieldsize form-control" type="text" name="param5" id="param5" value="{{param5}}">
79
        </div>
80
    </div>
1441 ariadna 81
    <div class="row mb-2 fitem">
82
        <label for="param3"  class="col-md-3 col-form-label">{{#str}}maxsize, data{{/str}}</label>
83
        <div class="col-md-9 felement">
84
            <select id="param3" class="select form-select" name="param3">
1 efrain 85
                {{#options}}
86
                    <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
87
                {{/options}}
88
            </select>
89
        </div>
90
    </div>
91
</fieldset>