Proyectos de Subversion Moodle

Rev

| 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 mod_assign/user_submission_actionmenu
19
 
20
    Actions for editing and submitting assignments.
21
 
22
    Classes required for JS:
23
    * none
24
 
25
    Context variables required for this template:
26
    * see mod/assign/classes/output/user_submission_actionmenu.php
27
 
28
    Example context (json):
29
    {
30
        "submit": {
31
            "button": {
32
                "method" : "get",
33
                "url" : "#",
34
                "formid": "submit_button_1",
35
                "primary" : true,
36
                "tooltip" : "Submit tooltip",
37
                "label" : "Submit",
38
                "attributes": [
39
                    {
40
                      "name": "data-attribute",
41
                      "value": "yeah"
42
                    }
43
                ]
44
            },
45
            "help": {
46
                "title": "Help with something",
47
                "url": "http://example.org/help",
48
                "linktext": "",
49
                "icon":{
50
                    "attributes": [
51
                        {"name": "class", "value": "iconhelp"},
52
                        {"name": "src", "value": "../../../pix/help.svg"},
53
                        {"name": "alt", "value": "Help icon"}
54
                    ]
55
                }
56
            }
57
        },
58
        "previoussubmission": {
59
            "button": {
60
                "method" : "get",
61
                "url" : "#",
62
                "formid": "previous_button_2",
63
                "primary" : true,
64
                "tooltip" : "Submit tooltip",
65
                "label" : "Previous submission",
66
                "attributes": [
67
                    {
68
                      "name": "data-attribute",
69
                      "value": "yeah"
70
                    }
71
                ]
72
            },
73
            "help": {
74
                "title": "Help with something",
75
                "url": "http://example.org/help",
76
                "linktext": "",
77
                "icon":{
78
                    "attributes": [
79
                        {"name": "class", "value": "iconhelp"},
80
                        {"name": "src", "value": "../../../pix/help.svg"},
81
                        {"name": "alt", "value": "Help icon"}
82
                    ]
83
                }
84
            }
85
        },
86
        "edit": {
87
            "button": {
88
                "method" : "get",
89
                "url" : "#",
90
                "formid": "edit_button_3",
91
                "primary" : true,
92
                "tooltip" : "Submit tooltip",
93
                "label" : "Edit",
94
                "attributes": [
95
                    {
96
                      "name": "data-attribute",
97
                      "value": "yeah"
98
                    }
99
                ]
100
            },
101
            "help": {
102
                "title": "Help with something",
103
                "url": "http://example.org/help",
104
                "linktext": "",
105
                "icon":{
106
                    "attributes": [
107
                        {"name": "class", "value": "iconhelp"},
108
                        {"name": "src", "value": "../../../pix/help.svg"},
109
                        {"name": "alt", "value": "Help icon"}
110
                    ]
111
                }
112
            }
113
        },
114
        "remove": {
115
            "button": {
116
                "method" : "get",
117
                "url" : "#",
118
                "formid": "remove_button_4",
119
                "primary" : true,
120
                "tooltip" : "Submit tooltip",
121
                "label" : "Remove",
122
                "attributes": [
123
                    {
124
                      "name": "data-attribute",
125
                      "value": "yeah"
126
                    }
127
                ]
128
            },
129
            "help": {
130
                "title": "Help with something",
131
                "url": "http://example.org/help",
132
                "linktext": "",
133
                "icon":{
134
                    "attributes": [
135
                        {"name": "class", "value": "iconhelp"},
136
                        {"name": "src", "value": "../../../pix/help.svg"},
137
                        {"name": "alt", "value": "Help icon"}
138
                    ]
139
                }
140
            }
141
        }
142
    }
143
 
144
}}
145
<div class="container-fluid mb-4">
146
    <div class="row">
147
        {{#submit}}
148
        <div class="col-xs-6 mr-3">
149
            {{#button}}
150
                {{>core/single_button}}
151
            {{/button}}
152
            {{#help}}
153
                {{>core/help_icon}}
154
            {{/help}}
155
        </div>
156
        {{/submit}}
157
        {{#previoussubmission}}
158
        <div class="col-xs-6 mr-3">
159
            {{#button}}
160
                {{>core/single_button}}
161
            {{/button}}
162
            {{#help}}
163
                {{>core/help_icon}}
164
            {{/help}}
165
        </div>
166
        {{/previoussubmission}}
167
        {{#edit}}
168
        <div class="col-xs-6 mr-3">
169
            {{#begin}}
170
                {{#button}}
171
                    {{>core/action_link}}
172
                {{/button}}
173
            {{/begin}}
174
            {{^begin}}
175
                {{#button}}
176
                    {{>core/single_button}}
177
                {{/button}}
178
                {{#help}}
179
                    {{>core/help_icon}}
180
                {{/help}}
181
            {{/begin}}
182
        </div>
183
        {{/edit}}
184
        {{#remove}}
185
        <div class="col-xs-6">
186
            {{#button}}
187
                {{>core/single_button}}
188
            {{/button}}
189
        </div>
190
        {{/remove}}
191
    </div>
192
</div>