2 This file is part of Moodle - http://moodle.org/
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.
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.
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/>.
18 @template core/inplace_editable
20 Displays the value that can be edited inline.
22 Classes required for JS:
25 Data attributes required for JS:
26 * data-inplaceeditable
27 * data-inplaceeditablelink
36 Context variables required for this template:
39 Example context (json):
41 "displayvalue" : "<a href=\"#\">Moodle</a>",
44 "component" : "core_unknown",
45 "itemtype" : "unknown",
46 "edithint" : "Edit this",
47 "editlabel" : "New name for this",
54 <span class="inplaceeditable inplaceeditable-{{type}}" data-inplaceeditable="1" data-component="{{component}}" data-itemtype="{{itemtype}}" data-itemid="{{itemid}}"
55 data-value="{{value}}" data-editlabel="{{editlabel}}" data-type="{{type}}" data-options="{{options}}">
56 {{^ linkeverything }}{{{displayvalue}}}{{/ linkeverything }}
57 <a href="#" class="quickeditlink aalink" data-inplaceeditablelink="1" title="{{edithint}}">
58 {{# linkeverything }}{{{displayvalue}}}{{/ linkeverything }}
59 <span class="quickediticon visibleifjs">{{#pix}}t/editstring,core,{{{edithint}}}{{/pix}}</span>
63 require(['core/inplace_editable']);