first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
+118
View File
@@ -0,0 +1,118 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_data/action_bar
General actions bar at the top of the pages in the database activity.
Context variables required for this template:
* d - The database instance id.
* urlselect - The data object containing the required properties to render core/url_select.
* fieldselect - The data object containing the required properties to render core/single_select.
* saveaspreset - Whether to display the save as preset button (mod_data/save_as_preset).
* exportpreset - The data object containing the required properties to render core/single_button.
Example context (json):
{
"d": 1,
"hasback": true,
"backurl": "https://example.com",
"backtitle": "Back",
"title": "Some title",
"urlselect": {
"id": "url_select_test",
"action": "https://example.com/post",
"formid": "url_select_form",
"sesskey": "sesskey",
"classes": "urlselect",
"label": "",
"helpicon": false,
"showbutton": null,
"options": [
{
"name": "Some name",
"value": "/mod/data/someurl.php",
"selected": false
}
],
"disabled": false,
"title": null
},
"extraurlselect": {
"id": "extra_url_select_test",
"action": "https://example.com/post",
"formid": "extra_url_select_form",
"sesskey": "sesskey",
"classes": "urlselect",
"label": "",
"helpicon": false,
"showbutton": null,
"options": [
{
"name": "Some name",
"value": "/mod/data/someurl.php",
"selected": false
}
],
"disabled": false,
"title": null
},
"buttons": {
"id": "single_button_test",
"method" : "post",
"formid": "single_button_form",
"url" : "https://example.com/post",
"primary" : false,
"tooltip" : null,
"label" : "Label",
"attributes": []
}
}
}}
<div class="container-fluid tertiary-navigation">
<div class="row">
<div class="d-flex">
{{#hasback}}
<div class="navitem mb-0 backbutton border-right">
<a href="{{backurl}}" role="button" title="{{backtitle}}" class="d-flex align-items-center">{{!
}}{{#pix}} i/previous, moodle {{/pix}}{{!
}}</a>
</div>
{{/hasback}}
{{#urlselect}}
<div class="navitem mb-0">
{{>core/url_select}}
</div>
{{/urlselect}}
{{#title}}
<div class="navitem mb-0 title d-flex align-items-center">
<h2>{{title}}</h2>
</div>
{{/title}}
</div>
<div class="ml-sm-auto d-flex">
{{#extraurlselect}}
<div class="navitem mb-0">
{{>core/url_select}}
</div>
{{/extraurlselect}}
{{#buttons}}
<div class="navitem mb-0">
{{>core/single_button}}
</div>
{{/buttons}}
</div>
</div>
</div>
<hr/>
@@ -0,0 +1,50 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_data/defaulttemplate_addtemplate
Default template for the add page in the database activity.
Context variables required for this template:
* fields - The database fields to display
Example context (json):
{
"fields": [
{
"fieldname": "Field1",
"fieldcontent": "[[Field1]]"
},
{
"fieldname": "Field2",
"fieldcontent": "[[Field2]]"
}
]
}
}}
<div id="defaulttemplate-addentry">
{{#fields}}
<div class="mb-3 pt-3">
<div class="font-weight-bold">{{fieldname}}</div>
{{{fieldcontent}}}
</div>
{{/fields}}
##otherfields##
{{#tags}}
<div class="mb-3 pt-3">
<div class="font-weight-bold">{{#str}}tags{{/str}}</div>
{{{.}}}
</div>
{{/tags}}
</div>
@@ -0,0 +1,61 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_data/defaulttemplate_asearchtemplate
Default template for the advanced search view in the database activity.
Context variables required for this template:
* fields - The database fields to display
Example context (json):
{
"fields": [
{
"fieldname": "Field1",
"fieldcontent": "[[Field1]]"
},
{
"fieldname": "Field2",
"fieldcontent": "[[Field2]]"
}
]
}
}}
<div class="defaulttemplate-asearch container">
<div class="row row-cols-1 row-cols-md-2 row-cols-lg-3">
<div class="mb-3 col">
<div class="font-weight-bold mb-2">{{#str}}authorfirstname, mod_data{{/str}}</div>
##firstname##
</div>
<div class="mb-3 col">
<div class="font-weight-bold mb-2">{{#str}}authorlastname, mod_data{{/str}}</div>
##lastname##
</div>
{{#fields}}
<div class="mb-3 col">
<div class="font-weight-bold mb-2">{{fieldname}}</div>
{{{fieldcontent}}}
</div>
{{/fields}}
{{#tags}}
<div class="mb-3 col">
<div class="font-weight-bold mb-2">{{#str}}tags{{/str}}</div>
{{.}}
</div>
{{/tags}}
</div>
</div>
@@ -0,0 +1,70 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_data/defaulttemplate_listtemplate
Default template for the list view page in the database activity.
Context variables required for this template:
* fields - The database fields to display
Example context (json):
{
"fields": [
{
"fieldname": "Field1",
"fieldcontent": "[[Field1]]"
},
{
"fieldname": "Field2",
"fieldcontent": "[[Field2]]"
}
]
}
}}
<div class="defaulttemplate-listentry my-5 p-5 card">
<div class="row my-6">
<div class="col-auto">##userpicture##</div>
<div class="col">
<div class="row h-100">
<div class="col-3 align-self-center">
##user##<br/><span class="data-timeinfo">##timeadded##</span>
</div>
<div class="col-4 col-md-6 text-right align-self-center data-timeinfo">
<span class="font-weight-bold ">{{#str}}datemodified, mod_data{{/str}}&nbsp;</span>##timemodified##
</div>
<div class="col-4 col-md-3 ml-auto align-self-center d-flex flex-row-reverse">
<div>##actionsmenu##</div>
<div class="ml-auto my-auto ##approvalstatusclass##">##approvalstatus##</div>
</div>
</div>
</div>
</div>
<hr/>
<div class="defaulttemplate-list-body">
{{#fields}}
<div class="row my-3 align-items-start justify-content-start">
<div class="col-4 col-lg-3 font-weight-bold">{{fieldname}}</div>
<div class="col-8 col-lg-9 ml-n3">{{{fieldcontent}}}</div>
</div>
{{/fields}}
{{#tags}}
<div class="mb-4">
<span class="font-weight-bold">{{#str}}tags{{/str}}</span>
<p class="mt-2">{{.}}</p>
</div>
{{/tags}}
</div>
</div>
@@ -0,0 +1,45 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_data/defaulttemplate_rsstemplate
Default template for the RSS page in the database activity.
Context variables required for this template:
* fields - The database fields to display
Example context (json):
{
"fields": [
{
"fieldname": "Field1",
"fieldcontent": "[[Field1]]"
},
{
"fieldname": "Field2",
"fieldcontent": "[[Field2]]"
}
]
}
}}
<div id="defaulttemplate-rss">
<div class="defaulttemplate-single-body my-5">
{{#fields}}
<div class="mt-4">
<span class="font-weight-bold">{{fieldname}}</span>
<p class="mt-2">{{{fieldcontent}}}</p>
</div>
{{/fields}}
</div>
</div>
@@ -0,0 +1,73 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_data/defaulttemplate_singletemplate
Default template for the single view page in the database activity.
Context variables required for this template:
* fields - The database fields to display
Example context (json):
{
"fields": [
{
"fieldname": "Field1",
"fieldcontent": "[[Field1]]"
},
{
"fieldname": "Field2",
"fieldcontent": "[[Field2]]"
}
]
}
}}
<div id="defaulttemplate-single" class="my-5">
<div class="defaulttemplate-single-body my-5">
<div class="row my-6">
<div class="col-auto">##userpicture##</div>
<div class="col">
<div class="row h-100">
<div class="col-3 align-self-center">
##user##<br/><span class="data-timeinfo">##timeadded##</span>
</div>
<div class="col-4 col-md-6 text-right align-self-center data-timeinfo">
<span class="font-weight-bold ">{{#str}}datemodified, mod_data{{/str}}&nbsp;</span>##timemodified##
</div>
<div class="col-4 col-md-3 ml-auto align-self-center d-flex flex-row-reverse">
<div>##actionsmenu##</div>
<div class="ml-auto my-auto ##approvalstatusclass##">##approvalstatus##</div>
</div>
</div>
</div>
</div>
<hr/>
<div class="my-6">
{{#fields}}
<div class="mt-4">
<span class="font-weight-bold">{{fieldname}}</span>
<p class="mt-2">{{{fieldcontent}}}</p>
</div>
{{/fields}}
##otherfields##
{{#tags}}
<div class="mt-4">
<span class="font-weight-bold">{{#str}}tags{{/str}}</span>
<p class="mt-2">{{.}}</p>
</div>
{{/tags}}
</div>
</div>
</div>
@@ -0,0 +1,54 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_data/fields/basicfields
The purpose of this template is to enable the user to define the two values which every field has.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* name string The field's name.
* description string The field's description.
Example context (json):
{
"name": "A name",
"description": "A description"
}
}}
<div class="form-group row fitem">
<div class="col-md-3 col-form-label d-flex pb-0 pr-md-0">
<label for="name" class="mb-0">{{#str}}fieldname, data{{/str}}</label>
</div>
<div class="col-md-9 form-inline align-items-start felement">
<input class="fieldname form-control" type="text" name="name" id="name" value="{{name}}">
</div>
</div>
<div class="form-group row fitem">
<div class="col-md-3 col-form-label d-flex pb-0 pr-md-0">
<label for="description" class="mb-0">{{#str}}fielddescription, data{{/str}}</label>
</div>
<div class="col-md-9 form-inline align-items-start felement">
<input class="fielddescription form-control" type="text" name="description" id="description" value="{{description}}">
</div>
</div>
@@ -0,0 +1,45 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_data/fields/requiredfield
The purpose of this template is to enable the user to define the 'required' field.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* none
Example context (json):
{
"required": false
}
}}
<div class="form-group row fitem">
<div class="col-md-3 d-flex pb-0 pr-md-0">
<label for="required" class="mb-0">{{#str}}requiredfield, data{{/str}}</label>
</div>
<div class="col-md-9 form-inline align-items-start felement">
<input class="requiredfield form-check-input" type="checkbox" name="required" id="required" {{#required}}
checked="checked" {{/required}}>
</div>
</div>
@@ -0,0 +1,82 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_data/fields_action_bar
Actions bar at the top of the field pages in the database activity.
Context variables required for this template:
* d - The database id.
* fieldselect - The data object containing the required properties to render core/single_select.
Example context (json):
{
"tertiarytitle": "Manage fields",
"fieldselect": {
"id": "single_select_test",
"name": "fieldselector",
"method": "get",
"action": "https://example.com/post",
"formid": "single_select_form",
"sesskey": "sesskey",
"classes": "singleselect",
"label": "",
"helpicon": false,
"options": [
{
"name": "Some name",
"value": "somevalue",
"selected": false,
"optgroup": false
}
],
"disabled": false,
"title": null
},
"hasback" : true,
"backurl": "https://moodlesite.com/mod/data/preset.php",
"backtitle": "Back"
}
}}
<div class="container-fluid tertiary-navigation">
<div class="row">
<div class="d-flex">
{{#hasback}}
<div class="navitem mb-0 backbutton border-right">
<a href="{{backurl}}" role="button" title="{{backtitle}}" class="d-flex align-items-center">{{!
}}{{#pix}} i/previous, moodle {{/pix}}{{!
}}</a>
</div>
{{/hasback}}
{{#urlselect}}
<div class="navitem mb-0">
{{>core/url_select}}
</div>
{{/urlselect}}
{{#tertiarytitle}}
<div class="navitem mb-0 title d-flex align-items-center">
<h2>{{tertiarytitle}}</h2>
</div>
{{/tertiarytitle}}
</div>
<div class="ml-sm-auto d-flex">
{{#fieldselect}}
<div class='navitem mb-0 fieldadd'>
{{>core/action_menu}}
</div>
{{/fieldselect}}
</div>
</div>
</div>
<hr/>
+31
View File
@@ -0,0 +1,31 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_data/fields_footer
The mod_data fields sticky footer content.
Example context (json):
{
"pageurl": "http://yoursite/mod/data/field.php"
}
}}
{{< core/sticky_footer }}
{{$ stickyclasses }} justify-content-start{{/ stickyclasses }}
{{$ stickycontent }}
<div class="pl-3">
<a href="{{pageurl}}">{{#str}} viewtemplates, mod_data {{/str}}</a>
</div>
{{/ stickycontent }}
{{/ core/sticky_footer }}
@@ -0,0 +1,48 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_data/fields_mapping_body
Display a modal to decide on field mapping
Example context (json):
{
"presetname": "Image gallery",
"fieldstocreate": "A, B, C",
"fieldstodelete": "A, B, C",
"cancelbutton": "",
"mapfieldsbutton": "",
"applybutton": ""
}
}}
<div class="p-2">
{{#fieldstocreate}}
<div class="my-2"><span>{{#str}}mapping:fieldstocreate, mod_data, {{.}}{{/str}}</span></div>
{{/fieldstocreate}}
{{#fieldstoremove}}
<div class="my-2">
<span>{{#str}}mapping:fieldstodelete, mod_data, {{.}}{{/str}}</span>
</div>
{{#fieldstocreate}}
<div class="my-2">
{{#str}}mapping:warningmessagedeleteandcreate, mod_data{{/str}}
</div>
{{/fieldstocreate}}
{{^fieldstocreate}}
<div class="my-2">
{{#str}}mapping:warningmessagedelete, mod_data{{/str}}
</div>
{{/fieldstocreate}}
{{/fieldstoremove}}
</div>
@@ -0,0 +1,33 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_data/fields_mapping_footer
Display a modal to decide on field mapping
Example context (json):
{
"mapfieldsbutton": "",
"applybutton": ""
}
}}
<button class="btn" data-action="cancel">
{{#str}} cancel {{/str}}
</button>
<a href="{{mapfieldsbutton}}" class="btn btn-secondary" role="button" data-action="mapfields">
{{#str}} mapping:mapfields, mod_data {{/str}}
</a>
<a href="{{applybutton}}" class="btn btn-primary" role="button" data-action="applypreset">
{{#str}} mapping:applypresets, mod_data {{/str}}
</a>
@@ -0,0 +1,33 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_data/fields_otherfields
The ##otherfields## template.
Example context (json):
{
"fieldname": "This is the field name",
"fieldcontent": "This is the field name",
"classes": "added_fields"
}
}}
<div class="{{^classes}}tag_otherfields{{/classes}} {{#classes}}{{classes}}{{/classes}}">
{{#fields}}
<div class="mt-4">
<span class="font-weight-bold">{{fieldname}}</span>
<p class="mt-2">{{{fieldcontent}}}</p>
</div>
{{/fields}}
</div>
@@ -0,0 +1,51 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_data/preset_preview
The preset preview.
Example context (json):
{
"formactionurl": "#",
"cmid": "42",
"description": "Preset description",
"preview": "<p>The preset preview HTML</p>",
"userid": "0",
"shortname": "imagegallery"
}
}}
<div id="template-preview" class="mt-4">
<div class="template-preview-content">
{{{preview}}}
</div>
</div>
{{< core/sticky_footer }}
{{$ stickycontent }}
<form method="post" action="{{formactionurl}}">
<input type="hidden" name="cmid" value="{{cmid}}">
<input type="hidden" name="mode" value="usepreset">
<input type="hidden" name="action" value="select">
<input type="hidden" name="fullname" value="{{userid}}/{{shortname}}">
<input type="submit" name="selectpreset" data-action="selectpreset" value="{{#str}}usepreset, mod_data{{/str}}" class="btn btn-primary"
data-cmid="{{cmid}}" data-presetname="{{userid}}/{{shortname}}">
</form>
{{/ stickycontent }}
{{/ core/sticky_footer }}
{{#js}}
require(['mod_data/importmappingdialogue'], function(importPreset) {
importPreset.init();
});
{{/js}}
+125
View File
@@ -0,0 +1,125 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_data/presets
Form containing all database presets displayed within a table.
Context variables required for this template:
* formactionurl - The form action url.
* id - The database course module id (cmid).
* presets - List of presets containing id, name, fullname, shortname and actions.
Example context (json):
{
"formactionurl": "http://www.example.com",
"id": 1,
"presets": [
{
"id": 1,
"cmid": 1,
"name": "Image gallery",
"shortname": "imagegallery",
"fullname": "Image gallery",
"description": "Use this preset to collect images",
"userid": 0,
"url": "http://www.example.com",
"actions": [],
"presetindex": 0
},
{
"id": 2,
"cmid": 2,
"name": "Preset saved manually",
"shortname": "Preset saved manually",
"fullname": "Preset saved manually (admin)",
"userid": 2,
"url": "http://www.example.com",
"actions": [],
"presetindex": 1
}
]
}
}}
{{#str}}presetshelp, mod_data{{/str}}
<form method="post" action="{{formactionurl}}" class="mt-4">
<input type="hidden" name="id" value="{{id}}">
<input type="hidden" name="mode" value="usepreset">
<input type="hidden" name="action" value="select">
<fieldset>
<legend class="sr-only">{{#str}}presets, mod_data{{/str}}</legend>
<table id="presets-list" class="generaltable fullwidth">
<thead>
<tr>
<th class="pl-4 border-top-0" scope="col" style="width: 3%">
<span class="sr-only">{{#str}}select{{/str}}</span>
</th>
<th class="pl-4 border-top-0" scope="col" style="width:30%">{{#str}} name {{/str}}</th>
<th class="pl-4 border-top-0" scope="col">{{#str}} description {{/str}}</th>
<th class="pl-4 border-top-0" scope="col" style="width: 3%">
<span class="sr-only">{{#str}}actions{{/str}}</span>
</th>
</tr>
</thead>
<tbody>
{{#presets}}
<tr>
<td class="p-4 border-right">
<input type="radio" name="fullname" value="{{userid}}/{{shortname}}" data-cmid="{{cmid}}" aria-labelledby="preset-name-{{presetindex}}" >
</td>
<td class="p-4">
<a id="preset-name-{{presetindex}}" href="{{{url}}}">{{fullname}}</a>
</td>
<td class="p-4">{{description}}</td>
<td class="p-4 preset_action_menu">
{{#actions}}
<div class="float-right">
{{>core/action_menu}}
</div>
{{/actions}}
</td>
</tr>
{{/presets}}
</tbody>
</table>
</fieldset>
{{< core/sticky_footer }}
{{$ stickycontent }}
<input
type="submit"
name="selectpreset"
data-action="selectpreset"
value="{{#str}}usepreset, mod_data{{/str}}"
class="btn btn-secondary"
disabled
>
{{/ stickycontent }}
{{/ core/sticky_footer }}
</form>
{{#js}}
require(['mod_data/selectpreset'], function(selectPreset) {
selectPreset.init();
});
require(['mod_data/editpreset'], function(editPreset) {
editPreset.init();
});
require(['mod_data/importmappingdialogue'], function(importPreset) {
importPreset.init();
});
{{/js}}
@@ -0,0 +1,81 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_data/presets_action_bar
Actions bar at the top of the presets page in the database activity.
Context variables required for this template:
* actionsselect - The presets actions selector.
* id - The database course module id (cmid).
Example context (json):
{
"actionsselect": {
"classes": "moodle-actionmenu",
"instance": "1",
"triggerrole": "button",
"primary": {
"attributes": [
{"name": "id", "value": "action-menu-1"},
{"name": "role", "value": "menu"}
],
"items": [
{
"attributes": [
{"name": "role", "value": "menuitem"}
],
"rawhtml": "Actions"
}
]
},
"secondary": {
"attributes": [
{"name": "id", "value": "action-menu-1-menu"},
{"name": "role", "value": "menuitem"}
],
"items": [
{
"rawhtml": "Import preset"
},
{
"rawhtml": "Export preset"
}
]
}
},
"id" : 1
}
}}
<div class="container-fluid tertiary-navigation">
<div class="row">
<div class="col">
<h2>{{#str}}presets, mod_data{{/str}}</h2>
</div>
<div class="col-auto">
{{#actionsselect}}
<div class='navitem mb-0 presetsactions'>
{{>core/action_menu}}
</div>
{{/actionsselect}}
</div>
</div>
</div>
<hr/>
{{#js}}
require(['mod_data/saveaspreset', 'mod_data/importpresets'], (saveAsPreset, importPresets) => {
saveAsPreset.init();
importPresets.init();
});
{{/js}}
@@ -0,0 +1,40 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_data/save_as_preset
Trigger button for the save as preset modal form.
Classes required for JS:
* none
Data attributes required for JS:
* All data attributes are required
Context variables required for this template:
* d - The database id.
Example context (json):
{
"d": 1
}
}}
<button type="button" class="btn btn-secondary" data-action="saveaspreset" data-dataid={{d}}>
{{#str}}saveaspreset, mod_data{{/str}}
</button>
{{#js}}
require(['mod_data/saveaspreset'], function(saveAsPreset) {
saveAsPreset.init();
});
{{/js}}
+124
View File
@@ -0,0 +1,124 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_data/template_editor
Template editor in the database activity.
Example context (json):
{
"title": "Defines browsing interface for multiple entries",
"sesskey": "XXXXX",
"disableeditor": true,
"url": {},
"usehtmleditor": true,
"toolbar": {
"toolshelp": "Available tags help",
"hastools": true,
"tools": [
{
"name": "Fields",
"tags": [
{
"tag": "[[Checkme]]",
"tagname": "Checkme - [[Checkme]]"
},
{
"tag": "[[Description]]",
"tagname": "Description - [[Description]]"
},
{
"tag": "[[Name]]",
"tagname": "Name - [[Name]]"
}
]
}
]
},
"editors": [
{
"name": "Header",
"fieldname": "listtemplateheader",
"value": ""
},
{
"name": "Repeated entry",
"fieldname": "listtemplate",
"value": "Template content"
},
{
"name": "Footer",
"fieldname": "listtemplatefooter",
"value": ""
}
]
}
}}
<div>{{title}}</div>
<form id="edittemplateform" action="{{{url}}}" method="post">
<input name="sesskey" value="{{sesskey}}" type="hidden" />
<input name="defaultform" type="hidden" value=""/>
<input name="resetall" type="hidden" value=""/>
<div class="d-flex flex-row align-items-center">
{{#toolbar}}
{{> mod_data/template_editor_tools }}
{{/toolbar}}
<div class="d-flex flex-column">
{{#editors}}
<div class="m-1">
<div class="template_heading">
<label for="{{fieldname}}">{{name}}</label>
</div>
<div>
<textarea
id="{{fieldname}}"
name="{{fieldname}}"
class="form-control"
rows="15"
cols="80"
{{#usehtmleditor}}data-fieldtype="editor"{{/usehtmleditor}}
>{{value}}</textarea>
</div>
</div>
{{/editors}}
</div>
</div>
{{#disableeditor}}
<div class="container-fluid mt-4">
<div class="row">
<div class="ml-auto">
<input
type="checkbox"
name="useeditor"
id="useeditor"
value="1"
{{#usehtmleditor}}checked{{/usehtmleditor}}
/>
<label for="useeditor">{{#str}} editorenable, data {{/str}}</label>
</div>
</div>
</div>
{{/disableeditor}}
{{< core/sticky_footer }}
{{$ stickycontent }}
<div>
<input
class="btn btn-primary mx-1"
type="submit"
value="{{#str}} save {{/str}}"
/>
</div>
{{/ stickycontent }}
{{/ core/sticky_footer }}
</form>
@@ -0,0 +1,28 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_data/template_editor_resetmodal
Reset template modal content.
Example context (json):
{
"resetallname": "resetallcheck"
}
}}
<p>{{#str}} resettemplateconfirm, mod_data, {{templatename}} {{/str}}</p>
<div class="form-check">
<input type="checkbox" class="form-check-input" id="modalcheckbox" name="{{resetallname}}">
<label class="form-check-label" for="modalcheckbox">{{#str}} resetalltemplates, mod_data {{/str}}</label>
</div>
@@ -0,0 +1,138 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_data/template_editor_tools
Tag tool box for the template editor in the mod_data.
Example context (json):
{
"toolshelp": "Available tags",
"hastools": true,
"tools": [
{
"name": "Fields",
"tags": [
{
"tag": "[[Checkme]]",
"tagname": "Checkme - [[Checkme]]"
},
{
"tag": "[[Description]]",
"tagname": "Description - [[Description]]"
},
{
"tag": "[[Name]]",
"tagname": "Name - [[Name]]"
}
]
},
{
"name": "Actions",
"tags": [
{
"tag": "##actionsmenu##",
"tagname": "Actions menu - ##actionsmenu##"
},
{
"tag": "##edit##",
"tagname": "Edit - ##edit##"
},
{
"tag": "##delete##",
"tagname": "Delete - ##delete##"
},
{
"tag": "##approve##",
"tagname": "Approve - ##approve##"
},
{
"tag": "##disapprove##",
"tagname": "Undo approval - ##disapprove##"
},
{
"tag": "##export##",
"tagname": "Export - ##export##"
},
{
"tag": "##more##",
"tagname": "More - ##more##"
},
{
"tag": "##moreurl##",
"tagname": "More URL - ##moreurl##"
},
{
"tag": "##delcheck##",
"tagname": "Bulk delete checkbox - ##delcheck##"
}
]
},
{
"name": "Other",
"tags": [
{
"tag": "##tags##",
"tagname": "Tags - ##tags##"
},
{
"tag": "##timeadded##",
"tagname": "Time added - ##timeadded##"
},
{
"tag": "##timemodified##",
"tagname": "Time modified - ##timemodified##"
},
{
"tag": "##user##",
"tagname": "User - ##user##"
},
{
"tag": "##userpicture##",
"tagname": "User picture - ##userpicture##"
},
{
"tag": "##approvalstatus##",
"tagname": "Approval status - ##approvalstatus##"
},
{
"tag": "##id##",
"tagname": "Entry ID - ##id##"
},
{
"tag": "##comments##",
"tagname": "Comments - ##comments##"
}
]
}
]
}
}}
{{#hastools}}
<div class="p-2">
<label for="availabletags">{{#str}} availabletags, data {{/str}}</label>
{{{toolshelp}}}
<div class="no-overflow" id="availabletags_wrapper">
<select name="fields1[]" id="availabletags" size="20" onclick="insert_field_tags(this)" class="form-control">
{{#tools}}
<optgroup label="{{name}}">
{{#tags}}
<option value="{{tag}}">{{tagname}}</option>
{{/tags}}
</optgroup>
{{/tools}}
</select>
</div>
</div>
{{/hastools}}
@@ -0,0 +1,105 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_data/templates_action_bar
Actions bar at the top of the template pages in the database activity.
Context variables required for this template:
* d - The database id.
* selectmenu - The data object containing the required properties to render core/selectmenu.
* actionsselect - The presets actions selector.
Example context (json):
{
"d": 1,
"selectmenu": {
"name": "Templates tertiary navigation selector",
"value": "opt",
"baseid": "select-menu1",
"selectedoption": "Single view template",
"options": [
{
"selected": false,
"name": "Add entry template",
"id": "select-menu-group1"
},
{
"selected": true,
"name": "Single view template",
"value": "opt2",
"id": "select-menu-option2"
}
]
},
"actionsselect": {
"classes": "moodle-actionmenu",
"instance": "1",
"triggerrole": "button",
"primary": {
"attributes": [
{"name": "id", "value": "action-menu-1"},
{"name": "role", "value": "menu"}
],
"items": [
{
"attributes": [
{"name": "role", "value": "menuitem"}
],
"rawhtml": "Actions"
}
]
},
"secondary": {
"attributes": [
{"name": "id", "value": "action-menu-1-menu"},
{"name": "role", "value": "menuitem"}
],
"items": [
{
"rawhtml": "Import preset"
},
{
"rawhtml": "Export preset"
}
]
}
}
}
}}
<div class="container-fluid tertiary-navigation">
<div class="row">
<div class="navitem mb-0 col">
{{#selectmenu}}
<div>
{{>core/tertiary_navigation_selector}}
</div>
{{/selectmenu}}
</div>
<div class="col-auto">
{{#actionsselect}}
<div class='navitem mb-0 presetsactions'>
{{>core/action_menu}}
</div>
{{/actionsselect}}
</div>
</div>
</div>
<hr/>
{{#js}}
require(['mod_data/saveaspreset', 'mod_data/resetalltemplates'], function(saveAsPreset, resetAll) {
saveAsPreset.init();
resetAll.init();
});
{{/js}}
+109
View File
@@ -0,0 +1,109 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_data/view_action_bar
Actions bar at the top of the view pages in the database activity.
Context variables required for this template:
* urlselect - The data object containing the required properties to render core/url_select.
* actionsselect - The presets actions selector.
Example context (json):
{
"urlselect": {
"id": "url_select_test",
"action": "https://example.com/post",
"formid": "url_select_form",
"sesskey": "sesskey",
"classes": "urlselect",
"label": "",
"helpicon": false,
"showbutton": null,
"options": [
{
"name": "List view",
"value": "/mod/data/someurl.php",
"selected": false
},
{
"name": "Single view",
"value": "/mod/data/someurl.php",
"selected": true
}
],
"disabled": false,
"title": null
},
"actionsselect": {
"classes": "moodle-actionmenu",
"instance": "1",
"triggerrole": "button",
"primary": {
"attributes": [
{"name": "id", "value": "action-menu-1"},
{"name": "role", "value": "menu"}
],
"items": [
{
"attributes": [
{"name": "role", "value": "menuitem"}
],
"rawhtml": "Actions"
}
]
},
"secondary": {
"attributes": [
{"name": "id", "value": "action-menu-1-menu"},
{"name": "role", "value": "menuitem"}
],
"items": [
{
"rawhtml": "Import entries"
},
{
"rawhtml": "Export entries"
}
]
}
}
}
}}
<div class="container-fluid tertiary-navigation d-flex">
<div class="row ml-auto">
<div class="col">
{{#addentrybutton}}
<div class="navitem mb-0">
{{>core/single_button}}
</div>
{{/addentrybutton}}
</div>
<div class="col">
{{#urlselect}}
<div class="navitem mb-0">
{{>core/url_select}}
</div>
{{/urlselect}}
</div>
<div class="col">
{{#actionsselect}}
<div class='navitem mb-0 entriesactions'>
{{>core/action_menu}}
</div>
{{/actionsselect}}
</div>
</div>
</div>
<hr/>
+52
View File
@@ -0,0 +1,52 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_data/view_footer
The mod_data sticky footer content.
Example context (json):
{
"selectall": "<button>Select all</button>",
"deleteselected": "<button>Cancel selection</button>",
"pagination": "1, 2, 3...",
"addentrybutton": {
"disabled": false,
"url": "#",
"id": "test-id",
"classes": "btn btn-link",
"attributes": [
{
"name": "title",
"value": "Add entry"
}
],
"text": "Add"
}
}
}}
{{#selectall}}
<div class="navitem">
{{{selectall}}}
{{{deleteselected}}}
</div>
{{/selectall}}
<div class="navitem submit mr-auto ml-auto">
{{{pagination}}}
</div>
{{#addentrybutton}}
<div class="navitem">
{{> core/action_link}}
</div>
{{/addentrybutton}}
@@ -0,0 +1,68 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_data/view_noentries
Form containing all database presets displayed within a table.
Context variables required for this template:
* noitemsimgurl - The image url.
* importentriesbutton stdClass - Import entries single button to be rendered
* addentrybutton stdClass - Add entry single button to be rendered
Example context (json):
{
"noitemsimgurl": "https://moodlesite/theme/image.php/boost/mod_data/1535727318/nofields",
"importentriesbutton": {
"id" : "id1",
"method" : "get",
"url" : "#",
"primary" : false,
"tooltip" : "This is a tooltip",
"label" : "Button1",
"attributes": [
{
"name": "data-attribute",
"value": "no"
}
]
},
"addentrybutton": {
"id" : "id2",
"method" : "get",
"url" : "#",
"primary" : true,
"tooltip" : "This is a tooltip",
"label" : "Button2",
"attributes": [
{
"name": "data-attribute",
"value": "yeah"
}
]
}
}
}}
<div class="text-xs-center text-center mt-4" data-region="empty-message">
<img src="{{noitemsimgurl}}" alt="" style="height: 70px; width: 70px;">
<h5 class="h5 mt-3 mb-0">{{#str}} norecords, mod_data {{/str}}</h5>
<div class="mt-5 mb-0" id="action_bar">
{{#importentriesbutton}}
{{> core/single_button }}
{{/importentriesbutton}}
{{#addentrybutton}}
{{> core/single_button }}
{{/addentrybutton}}
</div>
</div>
+96
View File
@@ -0,0 +1,96 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template mod_data/zero_state
Form containing all database presets displayed within a table.
Context variables required for this template:
* noitemsimgurl - The image url.
* importpresetbutton stdClass - Import preset single button to be rendered
* createfieldbutton stdClass - Create a field action menu to be rendered
* usepresetbutton stdClass - Use a preset single button to be rendered
Example context (json):
{
"noitemsimgurl": "https://moodlesite/theme/image.php/boost/mod_data/1535727318/nofields",
"title": "Title",
"importpresetbutton": {
"id" : "id1",
"method" : "get",
"url" : "#",
"primary" : false,
"tooltip" : "This is a tooltip",
"label" : "Button1",
"attributes": [
{
"name": "data-attribute",
"value": "no"
}
]
},
"createfieldbutton": {
"id" : "id2",
"method" : "get",
"url" : "#",
"primary" : true,
"tooltip" : "This is a tooltip",
"label" : "Button2",
"attributes": [
{
"name": "data-attribute",
"value": "yeah"
}
]
},
"usepresetbutton": {
"id" : "id3",
"method" : "get",
"url" : "#",
"primary" : false,
"tooltip" : "This is a tooltip",
"label" : "Button3",
"attributes": [
{
"name": "data-attribute",
"value": "perhaps"
}
]
}
}
}}
<div class="text-xs-center text-center mt-4" data-region="empty-message">
<img src="{{noitemsimgurl}}" alt="" style="height: 70px; width: 70px;">
<h5 class="h5 mt-3 mb-0">{{{ title }}}</h5>
{{#intro}}
<p class="mt-3 mb-0">{{{ intro }}}</p>
{{/intro}}
<div class="mt-5 mb-0 whitebutton" id="action_bar">
{{#createfieldbutton}}
{{>core/action_menu}}
{{/createfieldbutton}}
{{#importpresetbutton}}
{{>core/single_button}}
{{/importpresetbutton}}
{{#usepresetbutton}}
{{>core/single_button}}
{{/usepresetbutton}}
</div>
{{#js}}
require(['mod_data/importpresets'], function(importPresetsModal) {
importPresetsModal.init();
});
{{/js}}
</div>