-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
273 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{{! | ||
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_mooduell/viewpage | ||
Template which defines a mooduell view page. | ||
Classes required for JS: | ||
* none | ||
Data attributes required for JS: | ||
* none | ||
Context variables required for this template: | ||
Example context (json): | ||
{ | ||
"categories" : [ | ||
[ | ||
{ | ||
"catid":"7", | ||
"contextid":"1", | ||
"catname":"MooDuell Pr\u00e4sentation", | ||
"courseid":"50" | ||
} | ||
] | ||
] | ||
} | ||
}} | ||
|
||
<li class="accordion-item" data-id="{{id}}" data-sortorder="{{sortorder}}"> | ||
{{#canedit}} | ||
<span tabindex="0" role="button" aria-haspopup="true" data-drag-type="move" title="{{title}}"> | ||
<i class="fa fa-arrows"></i> | ||
</span> | ||
{{/canedit}} | ||
<div class="card"> | ||
<div class="card-header p-0 border-0"> | ||
<h5 class="accordion-header m-0" id="heading-{{id}}-{{uid}}"> | ||
<button class="btn btn-link btn-block text-left collapsed wbfaqcollapsebutton" type="button" data-toggle="faqcollapse" data-target="#collapse-{{id}}-{{uid}}" aria-expanded="{{#open}}true{{/open}}{{^open}}false{{/open}}" aria-controls="collapse-{{id}}-{{uid}}"> | ||
<span class="lexa-h4 text-dark">{{title}}</span> | ||
{{#canedit}} | ||
<span class="wb_faq_edit_entry_elements"> | ||
{{#enabled}} | ||
<a class="local_wb_faq_toggle_entry_visibility" data-id="{{id}}"><i class="toggle-visibility fa fa-eye | ||
mr-3"></i></a> | ||
{{/enabled}} | ||
{{^enabled}} | ||
<a class="local_wb_faq_toggle_entry_visibility" data-id="{{id}}"><i class="toggle-visibility fa fa-eye-slash | ||
mr-3"></i></a> | ||
{{/enabled}} | ||
<a class="local_wb_faq_edit_question" data-id="{{id}}"><i class="fa fa-pencil mr-3"></i></a> | ||
<a class="local_wb_faq_delete_question" data-id="{{id}}"><i class="fa fa-trash-o mr-3"></i></a> | ||
</span> | ||
{{/canedit}} | ||
</button> | ||
</h5> | ||
</div> | ||
<div id="collapse-{{id}}-{{uid}}" class="accordion-collapse collapse {{#open}}show{{/open}}" aria-labelledby="heading-{{id}}-{{uid}}"> | ||
<div class="accordion-body p-3"> | ||
<span class="lexa-input">{{{content}}}</span> | ||
</div> | ||
</div> | ||
</div> | ||
</li> | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{{! | ||
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_mooduell/viewpage | ||
Template which defines a mooduell view page. | ||
Classes required for JS: | ||
* none | ||
Data attributes required for JS: | ||
* none | ||
Context variables required for this template: | ||
Example context (json): | ||
{ | ||
"categories" : [ | ||
[ | ||
{ | ||
"catid":"7", | ||
"contextid":"1", | ||
"catname":"MooDuell Pr\u00e4sentation", | ||
"courseid":"50" | ||
} | ||
] | ||
] | ||
} | ||
}} | ||
|
||
<div class="current-faq wb-breadcrumb"> | ||
{{#canedit}} | ||
<span> | ||
<a class="local_wb_faq_edit_button local_wb_faq_edit_category btn btn-secondary" data-faqroot="{{root}}" data-uid="{{uid}}">{{#str}} addcategory, local_wb_faq {{/str}} <i class="fa fa-plus"></i></a> | ||
<a class="local_wb_faq_edit_button local_wb_faq_edit_question btn btn-secondary" data-faqroot="{{root}}" data-uid="{{uid}}">{{#str}} addquestion, local_wb_faq {{/str}} <i class="fa fa-plus"></i></a> | ||
</span> | ||
{{/canedit}} | ||
|
||
<!-- Existing code for displaying breadcrumbs --> | ||
<div class="d-flex mt-2"> | ||
{{#breadcrumbs}} | ||
<div class="btn btn-primary mb-2 px-4 mr-2 wbfaqbreadcrumb" data-catvalue="{{datacat}}" data-action="goto" data-targetid='{{id}}'>{{name}}</div> | ||
{{/breadcrumbs}} | ||
</div> | ||
</div> | ||
|
||
<ul class="draggable-cat list-unstyled"> | ||
{{#categories}} | ||
{{>local_wb_faq/category}} | ||
{{/categories}} | ||
</ul> | ||
|
||
{{#entries.0}} | ||
{{#headertitle}} | ||
<h2 class="lexa-h2">{{name}}</h2> | ||
{{/headertitle}} | ||
{{/entries.0}} | ||
|
||
|
||
|
||
<ul class="accordion draggable list-unstyled wbfaqaccordion" id="wb-faq-accordion"> | ||
{{#entries}} | ||
{{>local_wb_faq/entry}} | ||
{{/entries}} | ||
</ul> | ||
|
||
|
||
{{#js}} | ||
require(['local_wb_faq/reordering'], function(reordering) { | ||
reordering.init('.draggable'); | ||
reordering.init('.draggable-cat'); | ||
}); | ||
{{/js}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{{! | ||
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_mooduell/viewpage | ||
Template which defines a mooduell view page. | ||
Classes required for JS: | ||
* none | ||
Data attributes required for JS: | ||
* none | ||
Context variables required for this template: | ||
Example context (json): | ||
{ | ||
"categories" : [ | ||
[ | ||
{ | ||
"catid":"7", | ||
"contextid":"1", | ||
"catname":"MooDuell Pr\u00e4sentation", | ||
"courseid":"50" | ||
} | ||
] | ||
] | ||
} | ||
}} | ||
|
||
<div class="local_wb_faq_container local_wb_faq_container-{{uid}}"> | ||
<div class="col-md-6 m-auto"> | ||
<div class="local_wb_faq-{{uid}}"></div> | ||
</div> | ||
</div> | ||
|
||
{{! Has to be included this way to make it work when lazy loaded via ajax }} | ||
<script> | ||
if (typeof require == 'function') { | ||
require(['local_wb_faq/faq', 'local_wb_faq/searchinput'], function(faq,search) { | ||
faq.init({{{json}}}, {{{root}}}, '{{{uid}}}'); | ||
}); | ||
} | ||
</script> | ||
|
||
{{#js}} | ||
require(['local_wb_faq/faq', 'local_wb_faq/searchinput'], function(faq,search) { | ||
faq.init({{{json}}}, {{{root}}}, '{{{uid}}}'); | ||
}); | ||
require(['local_wb_faq/edit'], function(edit) { | ||
edit.init(); | ||
}); | ||
{{/js}} |