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
+30
View File
@@ -0,0 +1,30 @@
{{!
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 core_course/activity_date
Template for displaying the activity's dates.
Example context (json):
{
"label": "Opens:",
"datestring": "6 April 2021, 6:46 PM"
}
}}
<div>
<strong>{{label}}</strong> {{{datestring}}}
</div>
+80
View File
@@ -0,0 +1,80 @@
{{!
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 core_course/activity_info
Container to display activity information such as:
- Activity dates
- Activity completion requirements (automatic completion)
- Manual completion button
Example context (json):
{
"activityname": "Course announcements",
"hascompletion": true,
"uservisible": true,
"hasdates": true,
"isautomatic": true,
"istrackeduser": true,
"showmanualcompletion": true,
"activitydates": [
{
"label": "Opens:",
"timestamp": 1293876000
}
],
"completiondetails": [
{
"statuscomplete": 1,
"description": "Viewed"
},
{
"statusincomplete": 1,
"description": "Receive a grade"
}
]
}
}}
<div data-region="activity-information" data-activityname="{{activityname}}" class="activity-information">
{{#hascompletion}}
{{#uservisible}}
<div class="completion-info" data-region="completion-info">
{{#isautomatic}}
<div class="automatic-completion-conditions" data-region ="completionrequirements" role="list" aria-label="{{#str}}completionrequirements, core_course, {{activityname}}{{/str}}">
{{#completiondetails}}
{{> core_course/completion_automatic }}
{{/completiondetails}}
</div>
{{/isautomatic}}
{{^isautomatic}}
{{#showmanualcompletion}}
{{> core_course/completion_manual }}
{{/showmanualcompletion}}
{{/isautomatic}}
</div>
{{/uservisible}}
{{/hascompletion}}
{{#hasdates}}
<div data-region="activity-dates" class="activity-dates">
{{#activitydates}}
{{>core_course/activity_date}}
{{/activitydates}}
</div>
{{/hasdates}}
</div>
+81
View File
@@ -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 core_course/activity_list
Displays a list of activities to recommend in the activity chooser.
No example given as the js will fire and create records from the template library page.
}}
{{#search}}
<form class="row">
<div class="input-group pt-4 pb-1 col-md-6">
<label for="search">
<span class="sr-only">{{#str}} searchactivitiesbyname, course {{/str}}</span>
</label>
<input type="text" name="search" id="search" class="form-control rounded-left" autocomplete="off"
placeholder="{{#str}}search, core {{/str}}" {{#query}} value="{{query}}" autofocus {{/query}}
>
<div class="input-group-append">
<button type="submit" class="btn btn-outline-secondary rounded-right">
<i class="icon fa fa-search fa-fw m-0" aria-hidden="true"></i>
<span class="sr-only">{{#str}}submitsearch, course {{/str}}</span>
</button>
</div>
</div>
</form>
{{#query}}
<div class="pt-1 pb-1">
<span role="alert">{{#str}} searchresults, course, {{searchresultsnumber}} {{/str}}</span>
</div>
{{/query}}
{{/search}}
{{#categories}}
{{#hascategorydata}}
<h3 class="pt-4">{{categoryname}}</h3>
<table class="table table-striped table-hover">
<thead>
<tr class="d-flex">
<th scope="col" class="col-7 c0">{{#str}}module, course{{/str}}</th>
<th scope="col" class="col-5 c1">{{#str}}recommend, course{{/str}}</th>
</tr>
</thead>
<tbody>
{{#categorydata}}
<tr class="d-flex">
<td class="col-7 c0"><span>{{{icon}}}</span>{{name}}</td>
{{#id}}
<td class="col-5 c1 colselect">
<input class="activity-recommend-checkbox" type="checkbox" aria-label="{{#str}}recommendcheckbox, course, {{name}}{{/str}}" data-area="{{componentname}}" data-id="{{id}}" {{#recommended}}checked="checked"{{/recommended}} />
</td>
{{/id}}
{{^id}}
<td class="col-5"></td>
{{/id}}
</tr>
{{/categorydata}}
</tbody>
</table>
{{/hascategorydata}}
{{/categories}}
{{#js}}
require([
'core_course/recommendations',
], function(Recommendations) {
Recommendations.init();
});
{{/js}}
@@ -0,0 +1,85 @@
{{!
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 core_course/activity_navigation
Displays the activity navigation
Context variables required for this template:
* prevlink Object - The action link data for the previous activity link. Corresponds with the core/action_link context.
* nextlink Object - The action link data for the next activity link. Corresponds with the core/action_link context.
* activitylist Object - The data for the activity selector menu. Corresponds with the core/url_select context.
Example context (json):
{
"prevlink": {
"disabled": false,
"url": "#",
"id": "test-id-1",
"classes": "btn btn-link",
"attributes": [
{
"name": "title",
"value": "Activity A"
}
],
"text": "◄ Activity A"
},
"nextlink": {
"disabled": false,
"url": "#",
"id": "test-id-2",
"classes": "btn btn-link",
"attributes": [
{
"name": "title",
"value": "Activity C"
}
],
"text": "Activity C ►"
},
"activitylist": {
"id": "url_select_test",
"action": "#",
"options": [
{"name": "Jump to...", "value": "#0"},
{"name": "Activity A", "value": "#1"},
{"name": "Activity B", "value": "#2"},
{"name": "Activity C", "value": "#3"}
]
}
}
}}
<div class="mt-5 mb-1 activity-navigation container-fluid">
{{< core/columns-1to1to1}}
{{$column1}}
<div class="float-left">
{{#prevlink}}{{> core/action_link }}{{/prevlink}}
</div>
{{/column1}}
{{$column2}}
<div class="mdl-align">
{{#activitylist}}{{> core/url_select }}{{/activitylist}}
</div>
{{/column2}}
{{$column3}}
<div class="float-right">
{{#nextlink}}{{> core/action_link }}{{/nextlink}}
</div>
{{/column3}}
{{/ core/columns-1to1to1}}
</div>
+180
View File
@@ -0,0 +1,180 @@
{{!
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 core_course/activitychooser
Chooser dialog template.
Example context (json):
{
"recommendedBeginning": true,
"favouritesFirst": true,
"favourites": [
{
"title": "Option name 1",
"description": "Option description 1"
},
{
"title": "Option name 2",
"description": "Option description 2"
}
],
"recommended": [
{
"title": "Option name 3",
"description": "Option description 3"
}
],
"showAll": true
}
}}
<div data-region="carousel" class="carousel slide d-flex flex-fill">
<div class="carousel-inner d-flex flex-fill" aria-live="polite">
<div class="carousel-item p-3 active" data-region="modules">
<div class="modchoosercontainer d-flex flex-column flex-fill" aria-label="{{#str}} activitymodules, core {{/str}}">
<div class="searchcontainer mb-3">
{{>core_course/local/activitychooser/search}}
</div>
<div data-region="chooser-container" class="chooser-container">
<div class="nav nav-tabs flex-shrink-0 z-index-1" id="activities-{{uniqid}}" role="tablist">
<a class="nav-item nav-link {{#favouritesFirst}}active{{/favouritesFirst}} {{^favourites}}d-none{{/favourites}}"
id="starred-tab-{{uniqid}}"
data-toggle="tab"
data-region="favourite-tab-nav"
href="#starred-{{uniqid}}"
role="tab"
aria-label="{{#str}} aria:favouritestab, core_course {{/str}}"
aria-controls="starred-{{uniqid}}"
aria-selected="{{#favouritesFirst}}true{{/favouritesFirst}}{{^favouritesFirst}}false{{/favouritesFirst}}"
tabindex="{{#favouritesFirst}}0{{/favouritesFirst}}{{^favouritesFirst}}-1{{/favouritesFirst}}"
>
{{#str}} favourites, core {{/str}}
</a>
{{#recommendedBeginning}}
<a class="nav-item nav-link {{#recommendedFirst}}active{{/recommendedFirst}} {{^recommended}}d-none{{/recommended}}"
id="recommended-tab-{{uniqid}}"
data-region="recommended-tab-nav"
data-toggle="tab"
href="#recommended-{{uniqid}}"
role="tab"
aria-label="{{#str}} aria:recommendedtab, core_course {{/str}}"
aria-controls="recommended-{{uniqid}}"
aria-selected="false"
tabindex="-1"
>
{{#str}} recommended, core {{/str}}
</a>
{{/recommendedBeginning}}
<a class="nav-item nav-link {{#fallback}}active{{/fallback}} {{^showAll}}d-none{{/showAll}}"
id="all-tab-{{uniqid}}"
data-toggle="tab"
data-region="default-tab-nav"
href="#all-{{uniqid}}"
role="tab"
aria-label="{{#str}} aria:defaulttab, core_course {{/str}}"
aria-controls="all-{{uniqid}}"
aria-selected="{{#fallback}}true{{/fallback}}{{^fallback}}false{{/fallback}}"
tabindex="{{#fallback}}0{{/fallback}}{{^fallback}}-1{{/fallback}}"
>
{{#str}} all, core {{/str}}
</a>
<a class="nav-item nav-link {{#activitiesFirst}}active{{/activitiesFirst}} {{^showActivities}}d-none{{/showActivities}}"
id="activity-tab-{{uniqid}}"
data-toggle="tab"
data-region="activity-tab-nav"
href="#activity-{{uniqid}}"
role="tab"
aria-label="{{#str}} activities, core {{/str}}"
aria-controls="activity-{{uniqid}}"
aria-selected="{{#activitiesFirst}}true{{/activitiesFirst}}{{^activitiesFirst}}false{{/activitiesFirst}}"
tabindex="{{#activitiesFirst}}0{{/activitiesFirst}}{{^activitiesFirst}}-1{{/activitiesFirst}}"
>
{{#str}} activities, core {{/str}}
</a>
<a class="nav-item nav-link {{^showResources}}d-none{{/showResources}}"
id="resources-tab-{{uniqid}}"
data-toggle="tab"
data-region="resources-tab-nav"
href="#resources-{{uniqid}}"
role="tab"
aria-label="{{#str}} resources, core {{/str}}"
aria-controls="resources-{{uniqid}}"
aria-selected="false"
tabindex="-1"
>
{{#str}} resources, core {{/str}}
</a>
{{^recommendedBeginning}}
<a class="nav-item nav-link {{#recommendedFirst}}active{{/recommendedFirst}} {{^recommended}}d-none{{/recommended}}"
id="recommended-tab-{{uniqid}}"
data-region="recommended-tab-nav"
data-toggle="tab"
href="#recommended-{{uniqid}}"
role="tab"
aria-label="{{#str}} aria:recommendedtab, core_course {{/str}}"
aria-controls="recommended-{{uniqid}}"
aria-selected="false"
tabindex="-1"
>
{{#str}} recommended, core {{/str}}
</a>
{{/recommendedBeginning}}
</div>
<div class="tab-content flex-fill border-left border-right border-bottom bg-light" id="tabbed-activities-{{uniqid}}">
<div class="tab-pane {{#favouritesFirst}}active{{/favouritesFirst}}" id="starred-{{uniqid}}" data-region="favourites" role="tabpanel" aria-labelledby="starred-tab-{{uniqid}}">
<div class="optionscontainer d-flex flex-wrap p-1 mw-100 position-relative" role="menubar" data-region="chooser-options-container" data-render="favourites-area">
{{>core_course/local/activitychooser/favourites}}
</div>
</div>
<div class="tab-pane {{#fallback}}active{{/fallback}} {{^showAll}}d-none{{/showAll}}" id="all-{{uniqid}}" data-region="default" role="tabpanel" aria-labelledby="all-tab-{{uniqid}}">
<div class="optionscontainer d-flex flex-wrap p-1 mw-100 position-relative" role="menubar" data-region="chooser-options-container">
{{#default}}
{{>core_course/local/activitychooser/item}}
{{/default}}
</div>
</div>
<div class="tab-pane {{#activitiesFirst}}active{{/activitiesFirst}}" id="activity-{{uniqid}}" data-region="activity" role="tabpanel" aria-labelledby="activity-tab-{{uniqid}}">
<div class="optionscontainer d-flex flex-wrap p-1 mw-100 position-relative" role="menubar" data-region="chooser-options-container">
{{#activities}}
{{>core_course/local/activitychooser/item}}
{{/activities}}
</div>
</div>
<div class="tab-pane" id="resources-{{uniqid}}" data-region="resources" role="tabpanel" aria-labelledby="resources-tab-{{uniqid}}">
<div class="optionscontainer d-flex flex-wrap p-1 mw-100 position-relative" role="menubar" data-region="chooser-options-container">
{{#resources}}
{{>core_course/local/activitychooser/item}}
{{/resources}}
</div>
</div>
<div class="tab-pane {{#recommendedFirst}}active{{/recommendedFirst}}" id="recommended-{{uniqid}}" data-region="recommended" role="tabpanel" aria-labelledby="recommended-tab-{{uniqid}}">
<div class="optionscontainer d-flex flex-wrap p-1 mw-100 position-relative" role="menubar" data-region="chooser-options-container">
{{#recommended}}
{{>core_course/local/activitychooser/item}}
{{/recommended}}
</div>
</div>
</div>
</div>
</div>
</div>
<div class="carousel-item" data-region="help"></div>
<!--The following div is used as a place for additional plugins to have widgets in the chooser.-->
<div class="carousel-item" data-region="pluginCarousel"></div>
</div>
</div>
@@ -0,0 +1,44 @@
{{!
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 core_course/activitychooserbutton
Displays a add activity or resource button.
Context variables required for this template:
* sectionid - Relative section number (field course_sections.section).
* sectionreturn - The section to link back to.
Example context (json):
{
"sectionid": 1,
"sectionreturn": 0
}
}}
{{< core_courseformat/local/content/divider}}
{{$extraclasses}}always-visible my-3{{/extraclasses}}
{{$content}}
<button class="btn add-content section-modchooser section-modchooser-link d-flex justify-content-center align-items-center py-1 px-2"
data-action="open-chooser"
data-sectionid="{{sectionid}}"
{{#sectionreturn}}data-sectionreturnid="{{.}}"{{/sectionreturn}}
>
{{#pix}} t/add, core {{/pix}}
<span class="activity-add-text pr-1">{{#str}}addresourceoractivity, core{{/str}}</span>
</button>
{{/content}}
{{/ core_courseformat/local/content/divider}}
@@ -0,0 +1,44 @@
{{!
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 core_course/activitychooserbuttonactivity
Displays a add activity or resource button.
Context variables required for this template:
* id - Which activity we want to add the new activity before.
* num - Relative section number (field course_sections.section).
* sectionreturn - The section to link back to.
Example context (json):
{
"id": 0,
"sectionnum": 1,
"sectionreturn": 5
}
}}
<button class="btn add-content section-modchooser section-modchooser-link activitychooser-button d-flex justify-content-center align-items-center p-1 icon-no-margin"
data-action="open-chooser"
data-sectionid="{{sectionnum}}"
{{#sectionreturn}}data-sectionreturnid="{{.}}"{{/sectionreturn}}
data-beforemod="{{id}}"
aria-label="{{#str}}insertresourceoractivitybefore, core, { "activityname": {{#quote}} {{activityname}} {{/quote}} } {{/str}}"
tabindex="0"
title="{{#str}}addresourceoractivity, core{{/str}}"
>
{{#pix}} t/add, core {{/pix}}
</button>
@@ -0,0 +1,64 @@
{{!
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 core_course/activityinstance
Activity completion selector.
Example context (json):
{
"activities": [{
"cmid": "4",
"modname": "Test activity",
"icon": "https://raw.githubusercontent.com/moodle/moodle/master/mod/feedback/pix/monologo.svg",
"completionstatus": {
"string": "Manual",
"icon": "https://raw.githubusercontent.com/moodle/moodle/master/pix/i/completion-manual-enabled.png"
}
}]
}
}}
{{#activities}}
<div class="row mb-1">
<div class="activityinstance col-6">
<div class="mod-indent-outer"></div>
<div>
{{#canmanage}}
<label class="accesshide" for="selectactivity_{{cmid}}">{{#str}}select, completion{{/str}} {{modname}}</label>
<input type="checkbox" id="selectactivity_{{cmid}}" class="mr-1" name="cmid[]" data-section="{{sectionnumber}}" value="{{cmid}}" aria-label="{{#str}}checkactivity, completion, {{{modname}}}{{/str}}">
{{/canmanage}}
<a href="{{url}}">
<img src="{{icon}}" class="iconlarge activityicon" alt="">
<span class="instancename">{{{modname}}}</span>
</a>
</div>
</div>
<div class="activity-completionstatus col-6" id="completionstatus_{{cmid}}">
<div class="col-sm-1 pl-0">
{{#completionstatus.icon}}
{{{completionstatus.icon}}}
{{/completionstatus.icon}}
{{^completionstatus.icon}}
<span class="mr-3"></span>
{{/completionstatus.icon}}
</div>
<div class="col-sm-11 pl-0">
<span class="text-muted muted">{{{completionstatus.string}}}</span>
</div>
</div>
</div>
{{/activities}}
@@ -0,0 +1,126 @@
{{!
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 core_course/bulkactivitycompletion
Activity completion selector.
Example context (json):
{
"courseid": "2",
"sesskey": "AAAAAA",
"sections": [{
"sectionnumber": "0",
"name": "General",
"activities": [{
"cmid": "4",
"modname": "Test activity",
"icon": "https://raw.githubusercontent.com/moodle/moodle/master/mod/feedback/pix/monologo.svg",
"completionstatus": {
"string": "Manual",
"icon": "https://raw.githubusercontent.com/moodle/moodle/master/pix/i/completion-manual-enabled.png"
}
}]
}]
}
}}
<div class="container-fluid">
<div class="row mb-2">
<div class="col">{{#str}}bulkactivitydetail, core_completion{{/str}}</div>
</div>
<form method="post" action="editbulkcompletion.php" class="mform" id="theform">
<div class="row mb-2">
<div class="col">
<input type="submit" value="{{#str}}edit{{/str}}" class="btn btn-primary" name="submitbutton" aria-label="{{#str}}updateactivities, completion{{/str}}" disabled/>
</div>
</div>
<div class="row mb-1">
<div class="col-6">
<input type="checkbox" class="mastercheck mr-1" aria-label="{{#str}}checkall, completion{{/str}}">
<label class="font-weight-bold">{{#str}}activitieslabel, core_completion{{/str}}</label>
</div>
<div class="col-6">
<label class="font-weight-bold">{{#str}}completion, core_completion{{/str}}</label>
<span>{{{helpicon}}}</span>
</div>
</div>
<hr class="row">
<div class="topics">
{{#sections}}
<div class="mb-1">
<div class="row mb-1">
<div class="col-sm-12">
<input type="checkbox" data-section-master="{{sectionnumber}}" class="mr-1" aria-label="{{#str}}checkallsection, completion, {{{name}}}{{/str}}">
<h3 class="d-inline-block">{{{name}}}</h3>
</div>
</div>
{{> core_course/activityinstance}}
</div>
<hr class="row">
{{/sections}}
</div>
<input type="hidden" name="id" value="{{courseid}}" />
<input type="hidden" name="sesskey" value="{{sesskey}}" />
<div class="row">
<div class="col">
<input type="submit" value="{{#str}}edit{{/str}}" class="btn btn-primary" name="submitbutton" disabled/>
</div>
</div>
</form>
</div>
{{#js}}
require([
'jquery',
], function($) {
$('.mastercheck').click(function() {
var checked = $('.mastercheck').is(':checked');
$('input[type=checkbox]').each(function() {
$(this).prop('checked', checked);
$(this).trigger('change'); // Hmmm. Could be smarter about this and only trigger once for the first checkbox.
});
});
var mastersection = $('input[data-section-master]');
mastersection.click(function() {
var checked = $(this).is(':checked');
var dataid = $(this).attr('data-section-master');
$('input[type=checkbox][data-section=\'' + dataid + '\']').each(function() {
$(this).prop('checked', checked);
$(this).trigger('change'); // Hmmm. Could be smarter about this and only trigger once for the first checkbox.
});
});
$('input[type=checkbox][id^=selectactivity_]').change(function() {
if ($(this).is(':checked')) {
$('[name=submitbutton]').removeAttr('disabled');
} else {
// Is this the last activity checkbox to be un-checked? If so, disable the edit button.
var somechecked = false;
$('input[type=checkbox][id^=selectactivity_]').each(function() {
if ($(this).is(':checked')) {
somechecked = true;
return false;
}
return true;
});
if (!somechecked) {
$('[name=submitbutton]').attr('disabled', 'disabled');
}
}
});
});
{{/js}}
@@ -0,0 +1,117 @@
{{!
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 core_course/category_actionbar
Displays the tertiary nav for the category page
Context variables required for this template:
* urlselect Object - The content to be rendered within the url_select
* renderedcontent String - Any additional content/actions to be displayed inline with the select box
Example context (json):
{
"categoryselect" : {
"formid": "url_select_f61834256d7754158",
"classes": "urlselect",
"label": "",
"disabled": false,
"title":null,
"id":"url_select61834256d7754159",
"sesskey":"LWILINyZMH",
"action":"http:\/\/localhost\/stable_master\/course\/jumpto.php",
"showbutton":null,
"options": [
{
"name":"Category 1",
"value":"\/course\/index.php\/?categoryid=279"
},
{
"name":"Category 2",
"value":"\/course\/index.php\/?categoryid=280"
},
{
"name":"Category 3",
"value":"\/course\/index.php\/?categoryid=281"
}
],
"labelattributes":[],
"helpicon":false,
"attributes":[]
},
"search": {
"action": "https://moodle.local/admin/search.php",
"extraclasses": "my-2",
"inputname": "search",
"inform": false,
"searchstring": "Search settings",
"value": "policy",
"btnclass": "primary",
"query": "themedesigner",
"hiddenfields": [
{
"name": "context",
"value": "11"
}
]
},
"additionaloptions": {
"options": [
{
"url": "\/course\/index.php\/?categoryid=281",
"string": "Action 1",
"attributes": [
{
"name": "data-id",
"value": "1"
},
{
"name": "data-action",
"value": "test"
}
]
}
]
}
}
}}
<div class="container-fluid tertiary-navigation" id="action_bar">
<div class="row">
{{#categoryselect}}
<div class="navitem">
{{> core/url_select }}
</div>
{{/categoryselect}}
{{#search}}
<div class="navitem">
{{> core/search_input }}
</div>
{{/search}}
{{#additionaloptions}}
<div class="ml-auto d-flex">
<div class="navitem dropdown">
<button aria-label="{{#str}}moreactions{{/str}}" class="btn btn-secondary dropdown-toggle" id="dropdown-actions" data-toggle="dropdown" aria-haspopup="true" aria-controls="moreactionsmenu">
{{#str}}moremenu{{/str}}
</button>
<div id="moreactionsmenu" class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdown-actions" role="menu">
{{#options}}
<a role="menuitem" class="dropdown-item" {{#attributes}}{{name}}="{{value}}" {{/attributes}} href="{{url}}" tabindex="-1">{{string}}</a>
{{/options}}
</div>
</div>
</div>
{{/additionaloptions}}
</div>
</div>
@@ -0,0 +1,55 @@
{{!
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 core_course/completion_action_bar
Actions bar in the course completion pages.
Context variables required for this template:
* navigation - The data object containing the required properties to render core/tertiary_navigation_selector.
Example context (json):
{
"navigation": {
"name":"coursecompletionnavigation",
"label": "Course completion tertiary navigation",
"value": "\/course\/completion.php?id=4",
"baseid": "select-menu64a40e3ea86ed8",
"selectedoption": "Grader report",
"options": [
{
"id": "select-menu-option1",
"name": "Course completion settings",
"value": "/course/completion.php?id=4",
"selected": true
}
],
"labelattributes":[
{
"name":"class",
"value":"sr-only"
}
]
}
}
}}
<div class="container-fluid tertiary-navigation border-bottom" id="tertiary-navigation">
<div class="row">
{{#navigation}}
<div class="navitem">
{{>core/tertiary_navigation_selector}}
</div>
{{/navigation}}
</div>
</div>
@@ -0,0 +1,65 @@
{{!
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 core_course/completion_automatic
Template for displaying an automatic completion rule and its status.
Example context (json):
{
"statuscomplete": 1,
"description": "View",
"istrackeduser": true,
"accessibledescription": "Done: View (Set by Admin User)"
}
}}
{{#istrackeduser}}
{{#statuscomplete}}
<div class="badge rounded-pill alert-success icon-no-margin" role="listitem" {{!
}}{{#accessibledescription}}{{!
}}title="{{.}}" {{!
}}aria-label="{{.}}" {{!
}}{{/accessibledescription}}>
{{#pix}}i/checked{{/pix}}
<strong>{{#str}}completion_automatic:done, core_course{{/str}}</strong> <span class="font-weight-normal">{{description}}</span>
</div>
{{/statuscomplete}}
{{#statuscompletefail}}
<div class="badge rounded-pill alert-danger icon-no-margin" role="listitem" {{!
}}{{#accessibledescription}}{{!
}}title="{{.}}" {{!
}}aria-label="{{.}}" {{!
}}{{/accessibledescription}}>
{{#pix}}e/cancel{{/pix}}
<strong>{{#str}}completion_automatic:failed, core_course{{/str}}</strong> <span class="font-weight-normal">{{description}}</span>
</div>
{{/statuscompletefail}}
{{#statusincomplete}}
<div class="badge rounded-pill bg-light text-dark" role="listitem" {{!
}}{{#accessibledescription}}{{!
}}title="{{.}}" {{!
}}aria-label="{{.}}" {{!
}}{{/accessibledescription}}>
<strong>{{#str}}completion_automatic:todo, core_course{{/str}}</strong> <span class="font-weight-normal">{{description}}</span>
</div>
{{/statusincomplete}}
{{/istrackeduser}}
{{^istrackeduser}}
<div class="badge rounded-pill bg-light text-dark" role="listitem">
<span class="font-weight-normal">{{description}}</span>
</div>
{{/istrackeduser}}
@@ -0,0 +1,67 @@
{{!
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 core_course/completion_manual
Template for displaying the manual completion button.
Example context (json):
{
"cmid": 0,
"overallcomplete": true,
"overallincomplete": false
}
}}
{{#istrackeduser}}
{{#overallcomplete}}
<button class="btn btn-success btn-sm text-nowrap" data-action="toggle-manual-completion" data-toggletype="manual:undo" data-cmid="{{cmid}}" data-activityname="{{activityname}}" data-withavailability="{{withavailability}}" {{!
}}{{#accessibledescription}}{{!
}}title="{{.}}" {{!
}}aria-label="{{.}}" {{!
}}{{/accessibledescription}}{{!
}}{{^accessibledescription}}{{!
}}title="{{#str}}completion_manual:aria:done, course, {{activityname}} {{/str}}" {{!
}}aria-label="{{#str}}completion_manual:aria:done, course, {{activityname}} {{/str}}" {{!
}}{{/accessibledescription}}>
<i class="fa fa-check" aria-hidden="true"></i> {{#str}} completion_manual:done, core_course {{/str}}
</button>
{{/overallcomplete}}
{{#overallincomplete}}
<button class="btn btn-outline-secondary btn-sm text-nowrap" data-action="toggle-manual-completion" data-toggletype="manual:mark-done" data-cmid="{{cmid}}" data-activityname="{{activityname}}" data-withavailability="{{withavailability}}" {{!
}}{{#accessibledescription}}{{!
}}title="{{.}}" {{!
}}aria-label="{{.}}" {{!
}}{{/accessibledescription}}{{!
}}{{^accessibledescription}}{{!
}}title="{{#str}}completion_manual:aria:markdone, course, {{activityname}} {{/str}}" {{!
}}aria-label="{{#str}}completion_manual:aria:markdone, course, {{activityname}} {{/str}}" {{!
}}{{/accessibledescription}}>
{{#str}} completion_manual:markdone, core_course {{/str}}
</button>
{{/overallincomplete}}
{{/istrackeduser}}
{{^istrackeduser}}
<button class="btn btn-outline-secondary btn-sm text-nowrap" disabled>
{{#str}} completion_manual:markdone, core_course {{/str}}
</button>
{{/istrackeduser}}
{{#js}}
require(['core_course/manual_completion_toggle'], toggle => {
toggle.init()
});
{{/js}}
+80
View File
@@ -0,0 +1,80 @@
{{!
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 core_course/coursecard
This template renders the a card for the course cards.
Example context (json):
{
"courses": [
{
"name": "Assignment due 1",
"viewurl": "https://moodlesite/course/view.php?id=2",
"courseimage": "https://moodlesite/pluginfile/123/course/overviewfiles/123.jpg",
"fullname": "course 3",
"hasprogress": true,
"progress": 10,
"visible": true
}
]
}
}}
<div class="card course-card mx-1" role="listitem"
data-region="course-content"
data-course-id="{{{id}}}">
<a href="{{viewurl}}" tabindex="-1">
<div class="card-img-top" style='background-image: url("{{{courseimage}}}");'>
<span class="sr-only">{{fullname}}</span>
</div>
</a>
<div class="card-body pr-1 course-info-container" id="course-info-container-{{id}}-{{uniqid}}">
<div class="d-flex align-items-start">
<div class="w-100 text-truncate">
{{#showshortname}}
<div class="text-muted muted d-flex mb-1 flex-wrap">
<span class="sr-only">
{{#str}}aria:courseshortname, core_course{{/str}}
</span>
<div>
{{{shortname}}}
</div>
</div>
{{/showshortname}}
<a href="{{viewurl}}" class="aalink coursename mr-2 mb-1">
{{> core_course/favouriteicon }}
<span class="sr-only">
{{#str}}aria:coursename, core_course{{/str}}
</span>
{{$coursename}}{{/coursename}}
</a>
<div class="text-muted muted d-flex flex-wrap">
{{$coursecategory}}{{/coursecategory}}
</div>
{{^visible}}
<div class="d-flex flex-wrap">
<span class="badge bg-info text-white">{{#str}} hiddenfromstudents {{/str}}</span>
</div>
{{/visible}}
</div>
</div>
</div>
<div class="d-flex align-items-start">
{{$progress}}{{/progress}}
{{$menu}}{{/menu}}
</div>
</div>
+44
View File
@@ -0,0 +1,44 @@
{{!
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 core_course/coursecards
This template renders the cards view for the myoverview block.
Example context (json):
{
"courses": [
{
"name": "Assignment due 1",
"viewurl": "https://moodlesite/course/view.php?id=2",
"courseimage": "https://moodlesite/pluginfile/123/course/overviewfiles/123.jpg",
"fullname": "course 3",
"hasprogress": true,
"progress": 10,
"coursecategory": "Category 1"
}
]
}
}}
<div class="card-grid mx-0 row row-cols-1 row-cols-sm-2 row-cols-lg-3 {{$classes}}{{/classes}}" data-region="card-deck" role="list">
{{#courses}}
<div class="col d-flex px-0 mb-2">
{{> core_course/coursecard }}
</div>
{{/courses}}
</div>
@@ -0,0 +1,88 @@
{{!
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 core_course/defaultactivitycompletion
Activity completion selector.
Example context (json):
{
"courseid": "2",
"sesskey": "AAAAAA",
"modules": [{
"id": "10",
"formattedname": "Assignment",
"canmanage": true,
"icon": "https://raw.githubusercontent.com/moodle/moodle/master/mod/assign/pix/monologo.svg",
"completionstatus": {
"string": "Manual",
"icon": "https://raw.githubusercontent.com/moodle/moodle/master/pix/i/completion-manual-enabled.png"
}
}],
"issite": true
}
}}
<div class="container-fluid">
<div class="row my-5 defaultactivitycompletion-header">
<div class="col">
{{#issite}}{{#str}}defaultactivitycompletionsite, core_completion{{/str}}{{/issite}}
{{^issite}}{{#str}}defaultactivitycompletioncourse, core_completion{{/str}}{{/issite}}
</div>
</div>
<div class="modules pt-3">
{{#modules}}
{{#canmanage}}
<div class="defaultactivitycompletion-item d-flex"
id="activitycompletion-{{id}}"
>
<a data-toggle="collapse"
href="#activitycompletioncollapse-{{id}}"
class="icons-collapse-expand {{#modulecollapsed}}collapsed{{/modulecollapsed}}"
aria-expanded="{{^modulecollapsed}}true{{/modulecollapsed}}{{#modulecollapsed}}false{{/modulecollapsed}}"
role="button"
>
<span class="collapsed-icon icon-no-margin mr-1"
title="{{#str}} expandcategory, core, {{formattedname}} {{/str}}">
<span class="dir-rtl-hide">{{#pix}} t/collapsedchevron, core {{/pix}}</span>
<span class="dir-ltr-hide">{{#pix}} t/collapsedchevron_rtl, core {{/pix}}</span>
<span class="sr-only">{{#str}} expandcategory, core, {{formattedname}} {{/str}}</span>
</span>
<span class="expanded-icon icon-no-margin mr-1"
title="{{#str}} collapsecategory, core, {{formattedname}} {{/str}}">
{{#pix}} t/expandedchevron, core {{/pix}}
<span class="sr-only">{{#str}} collapsecategory, core, {{formatedname}} {{/str}}</span>
</span>
<img class="iconlarge activityicon ml-4" src="{{icon}}" alt="" aria-hidden="true">
<h2 class="activityname ml-3 mb-0">{{{formattedname}}}</h2>
</a>
</div>
<div id="activitycompletioncollapse-{{id}}"
class="defaultactivitycompletion-item-content collapse multi-collapse {{^modulecollapsed}}show{{/modulecollapsed}}"
aria-labelledby="activitycompletion-{{id}}" role="group"
data-region="activitycompletion-{{name}}"
>
<hr class="row">
<div class="py-3">{{{formhtml}}}</div>
</div>
<hr class="row">
{{/canmanage}}
{{/modules}}
</div>
</div>
@@ -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 core_course/editbulkactivitycompletion
Edit default module completion screen
Example context (json):
{
"form": "<form><p>Placeholder for the form</p></form>",
"activitiescount": 1,
"activities": [{
"cmid": "4",
"modname": "Test activity",
"icon": "https://raw.githubusercontent.com/moodle/moodle/master/mod/feedback/pix/monologo.svg"
}]
}
}}
<p>{{#str}}modifybulkactions, completion{{/str}}</p>
{{{form}}}
<div class="container-fluid">
<p>{{#str}}affectedactivities, completion, {{activitiescount}}{{/str}}</p>
<div class="activities">
{{> core_course/activityinstance}}
</div>
</div>
@@ -0,0 +1,47 @@
{{!
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 core_course/editdefaultcompletion
Edit default module completion screen
Example context (json):
{
"form": "<form><p>Placeholder for the form</p></form>",
"modulescount": 1,
"modules": [{
"id": "10",
"formattedname": "Assignment",
"icon": "https://raw.githubusercontent.com/moodle/moodle/master/mod/assign/pix/monologo.svg"
}]
}
}}
<p>{{#str}}modifybulkactions, completion{{/str}}</p>
{{{form}}}
<p>{{#str}}affectedactivities, completion, {{modulescount}}{{/str}}</p>
<div class="container-fluid">
<div class="modules mb-1">
<div class="row mb-1">
{{#modules}}
<div class="col-sm-2">
<img src="{{icon}}" class="mr-1 mb-1" alt="">
<span>{{{formattedname}}}</span>
</div>
{{/modules}}
</div>
</div>
</div>
+40
View File
@@ -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 core_course/favouriteicon
This template renders the favourite icon for a course.
Example context (json):
{
"id": 3,
"isfavourite": true
}
}}
<span id="favorite-icon-{{ id }}-{{ uniqid }}"
data-region="favourite-icon"
data-course-id="{{id}}"
>
<span
class="text-primary {{^isfavourite}}hidden{{/isfavourite}}"
data-region="is-favourite"
aria-hidden="{{^isfavourite}}true{{/isfavourite}}{{#isfavourite}}false{{/isfavourite}}"
>
{{#pix}} i/star, core, {{#str}} favourite, core_course {{/str}} {{/pix}}
<span class="sr-only">{{#str}} aria:favourite, core_course {{/str}}</span>
</span>
</span>
@@ -0,0 +1,39 @@
{{!
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 core_course/local/activitychooser/error
Chooser error template.
Variables required for this template:
* errormessage - The error message
Example context (json):
{
"errormessage": "Error"
}
}}
<div class="p-2 px-sm-5 py-sm-4">
<div class="alert alert-danger" role="alert">
<h5 class="alert-heading">
<i class="fa fa-exclamation-circle fa-fw text-danger"></i>
{{#str}} error, error {{/str}}
</h5>
<hr>
<p class="text-break">{{{errormessage}}}</p>
</div>
</div>
@@ -0,0 +1,36 @@
{{!
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 core_course/local/activitychooser/favourites
Chooser favourite template partial.
Example context (json):
{
"favourites": {
"label": "Option name",
"description": "Option description",
"urls": {
"addoption": "http://addoptionurl.com"
},
"icon": "<img class='icon' src='http://urltooptionicon'>"
}
}
}}
{{#favourites}}
{{>core_course/local/activitychooser/item}}
{{/favourites}}
@@ -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 core_course/local/activitychooser/footer_partial
Chooser favourite template partial.
Example context (json):
{
}
}}
<div class="w-100 d-flex justify-content-between" data-region="chooser-option-summary-actions-container">
<button data-action="close-chooser-option-summary" class="closeoptionsummary btn btn-secondary" tabindex="0" data-modname="{{componentname}}_{{link}}">
{{#str}} back {{/str}}
</button>
<a href="{{link}}" title="{{#str}} addnew, moodle, {{title}} {{/str}}" data-action="add-chooser-option" class="addoption btn btn-primary" tabindex="0">
{{#str}} add {{/str}}
</a>
</div>
@@ -0,0 +1,58 @@
{{!
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 core_course/local/activitychooser/help
Chooser help / more information template.
Example context (json):
{
"id": 125,
"name": "assign",
"title": "Assignment",
"link": "http://yourmoodle/modedit.php?id=x&itemtype=y",
"icon": "<img class='icon' src='http://urltooptionicon' alt='Icon'>",
"help": "This is a description of the assignment activity",
"archetype": 0,
"componentname": "mod_assign",
"favourite": 1
}
}}
<div
class="optionsummary d-flex flex-column rounded-bottom"
tabindex="-1"
data-region="chooser-option-summary-container"
aria-labelledby="optionsummary_label-{{uniqid}}"
aria-describedby="optionsumary_desc-{{uniqid}}"
>
<div class="content flex-grow-1 text-left p-2 px-sm-5 py-sm-4" data-region="chooser-option-summary-content-container">
<div class="heading mb-4">
<h5 id="optionsummary_label-{{uniqid}}" data-region="summary-header" tabindex="0">
{{{icon}}}
{{title}}
</h5>
</div>
<div id="optionsumary_desc-{{uniqid}}" class="description" tabindex="0">
{{{help}}}
</div>
</div>
{{^showFooter}}
<div class="modal-footer">
{{>core_course/local/activitychooser/footer_partial}}
</div>
{{/showFooter}}
</div>
@@ -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 core_course/local/activitychooser/item
Chooser item template.
Example context (json):
{
"label": "Option name",
"description": "Option description",
"urls": {
"addoption": "http://addoptionurl.com"
},
"icon": "<img class='icon' src='http://urltooptionicon' alt='icon'>",
"purpose": "content",
"branded": 0
}
}}
<div role="menuitem" tabindex="-1" aria-label="{{title}}" class="option border-0 card m-1 bg-white" data-region="chooser-option-container" data-internal="{{name}}" data-modname="{{componentname}}_{{link}}">
<div class="optioninfo card-body d-flex flex-column text-center p-1" data-region="chooser-option-info-container">
<a class="d-flex flex-column justify-content-between flex-fill" href="{{link}}" title="{{#str}} addnew, moodle, {{title}} {{/str}}" tabindex="-1" data-action="add-chooser-option">
<div class="optionicon mt-2 mb-1 mx-auto icon-no-margin modicon_{{name}} activityiconcontainer smaller
{{purpose}} {{#branded}}isbranded{{/branded}}">
{{{icon}}}
</div>
<div class="optionname clamp-2">{{title}}</div>
</a>
<div class="optionactions d-flex justify-content-center" role="group" data-region="chooser-option-actions-container">
{{^legacyitem}}
<button class="btn btn-icon icon-no-margin icon-size-3 m-0 optionaction {{#favourite}}text-primary{{/favourite}}{{^favourite}}text-muted{{/favourite}}"
data-action="manage-module-favourite"
data-favourited="{{favourite}}"
data-id="{{id}}"
data-name="{{componentname}}"
data-internal="{{name}}"
{{^favourite}}
aria-pressed="false"
{{/favourite}}
{{#favourite}}
aria-pressed="true"
{{/favourite}}
aria-label="{{#str}} aria:modulefavourite, core_course, {{title}} {{/str}}"
tabindex="-1"
>
{{#favourite}}
{{#pix}} i/star, core {{/pix}}
{{/favourite}}
{{^favourite}}
{{#pix}} i/star-o, core {{/pix}}
{{/favourite}}
</button>
{{/legacyitem}}
<button class="btn btn-icon icon-no-margin icon-size-3 m-0 optionaction" data-action="show-option-summary" tabindex="-1">
<span aria-hidden="true">{{#pix}} docs, core {{/pix}}</span>
<span class="sr-only">{{#str}} informationformodule, core_course, {{title}} {{/str}}</span>
</button>
</div>
</div>
</div>
@@ -0,0 +1,35 @@
{{!
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 core_course/local/activitychooser/search
Chooser search template.
Example context (json):
{}
}}
{{< core/search_input_auto }}
{{$label}}{{#str}}
searchactivities, core
{{/str}}{{/label}}
{{$placeholder}}{{#str}}
search, core
{{/str}}{{/placeholder}}
{{/ core/search_input_auto }}
<div class="searchresultscontainer" data-region="search-results-container" hidden="hidden" aria-live="polite">
</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 core_course/local/activitychooser/search_results
Chooser search results template.
Example context (json):
{
"searchresultsnumber": "10",
"searchresults": {
"label": "Option name",
"description": "Option description",
"urls": {
"addoption": "http://addoptionurl.com"
},
"icon": "<img class='icon' src='http://urltooptionicon'>"
}
}
}}
<p class="mt-4 px-3 pb-1">{{#str}} resultsfound, core, {{searchresultsnumber}} {{/str}}</p>
<div class="bg-light searchresultitemscontainer-wrapper border">
<div class="searchresultitemscontainer d-flex flex-wrap h-100 mh-100 mw-100 position-relative p-1"
role="menubar"
data-region="search-result-items-container"
>
{{#searchresults}}
{{>core_course/local/activitychooser/item}}
{{/searchresults}}
</div>
</div>
@@ -0,0 +1,119 @@
{{!
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 core_course/manage_category_actionbar
Displays the tertiary nav for the category page
Context variables required for this template:
* urlselect Object - The content to be rendered within the url_select
* renderedcontent String - Any additional content/actions to be displayed inline with the select box
Example context (json):
{
"urlselect" : {
"formid": "url_select_f61834256d7754158",
"classes": "urlselect",
"label": "",
"disabled": false,
"title":null,
"id":"url_select61834256d7754159",
"sesskey":"LWILINyZMH",
"action":"http:\/\/localhost\/stable_master\/course\/jumpto.php",
"showbutton":null,
"options": [
{
"name":"Course and categories",
"value":"\/course\/index.php\/?categoryid=279"
},
{
"name":"Courses",
"value":"\/course\/index.php\/?categoryid=280"
},
{
"name":"Categories",
"value":"\/course\/index.php\/?categoryid=281"
}
],
"labelattributes":[],
"helpicon":false,
"attributes":[]
},
"categoryselect" : {
"formid": "url_select_f61834256d7754158",
"classes": "urlselect",
"label": "",
"disabled": false,
"title":null,
"id":"url_select61834256d7754159",
"sesskey":"LWILINyZMH",
"action":"http:\/\/localhost\/stable_master\/course\/jumpto.php",
"showbutton":null,
"options": [
{
"name":"Category 1",
"value":"\/course\/index.php\/?categoryid=279"
},
{
"name":"Category 2",
"value":"\/course\/index.php\/?categoryid=280"
},
{
"name":"Category 3",
"value":"\/course\/index.php\/?categoryid=281"
}
],
"labelattributes":[],
"helpicon":false,
"attributes":[]
},
"search": {
"action": "https://moodle.local/admin/search.php",
"extraclasses": "my-2",
"inputname": "search",
"inform": false,
"searchstring": "Search settings",
"value": "policy",
"btnclass": "primary",
"query": "themedesigner",
"hiddenfields": [
{
"name": "context",
"value": "11"
}
]
},
"heading": "Heading of page"
}
}}
<div class="container-fluid tertiary-navigation" id="action_bar">
<div class="row">
{{#urlselect}}
<div class="navitem">
{{> core/url_select }}
</div>
{{/urlselect}}
{{#categoryselect}}
<div class="navitem">
{{> core/url_select }}
</div>
{{/categoryselect}}
{{#search}}
<div class="navitem">
{{> core/search_input }}
</div>
{{/search}}
</div>
</div>
<h2>{{heading}}</h2>
+36
View File
@@ -0,0 +1,36 @@
{{!
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 core_course/no-courses
This template renders the no courses message.
Example context (json):
{
"nocoursesimgurl": "https://moodlesite/theme/image.php/boost/block_recentlyaccessedcourses/1535727318/courses",
"newcourseurl": "https://moodlesite/course/edit.php"
}
}}
<div class="text-xs-center text-center mt-3" data-region="empty-message">
<img class="empty-placeholder-image-lg mt-1"
src="{{nocoursesimg}}"
alt="">
<p class="text-muted mt-3">{{$nocoursestring}}{{#str}} nocourses, core {{/str}}{{/nocoursestring}}</p>
{{#newcourseurl}}
<a href="{{{newcourseurl}}}" class="nocourseslink">{{#str}} createnewcourse, core {{/str}}</a>
{{/newcourseurl}}
</div>
@@ -0,0 +1,114 @@
{{!
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 core_course/participants_actionbar
Displays the tertiary nav for the participants page
Context variables required for this template:
* urlselect Object - The content to be rendered within the url_select
* renderedcontent String - Any additional content/actions to be displayed inline with the select box
Example context (json):
{
"navigation" : {
"baseid": "select-menuf61834256d7754158",
"label": "Participant navigation",
"options": [
{
"name":"Enrolments",
"isgroup":true,
"options": [
{
"name":"Enrolled users",
"value":"\/user\/index.php?id=4",
"selected":true
},
{
"name":"Enrolment methods",
"value":"\/enrol\/instances.php?id=4",
"selected":false
}
]
},
{
"name":"Groups",
"isgroup":true,
"options": [
{
"name":"Groups",
"value":"\/group\/index.php?id=4",
"selected":false
},
{
"name":"Groupings",
"value":"\/group\/groupings.php?id=4",
"selected":false
},
{
"name":"Overview",
"value":"\/group\/overview.php?id=4",
"selected":false
}
]
},
{
"name":"Permissions",
"isgroup":true,
"options": [
{
"name":"Permissions",
"value":"\/admin\/roles\/permissions.php?contextid=279",
"selected":false
},
{
"name":"Other users",
"value":"\/enrol\/otherusers.php?id=4",
"selected":false
},
{
"name":"Check permissions",
"value":"\/admin\/roles\/check.php?contextid=279",
"selected":false
}
]
}
],
"selectedoption":"Enrolled users",
"name":"participantsnavigation",
"value":"\/user\/index.php?id=4",
"labelattributes":[
{
"name":"class",
"value":"sr-only"
}
]
},
"renderedcontent":"<div data-region=\"wrapper\" data-table-uniqueid=\"user-index-participants-4\"><\/div>"
}
}}
<div class="container-fluid tertiary-navigation" id="action_bar">
<div class="row">
{{#navigation}}
<div class="navitem">
{{> core/tertiary_navigation_selector}}
</div>
{{/navigation}}
{{#renderedcontent}}
<div class="navitem">
{{{renderedcontent}}}
</div>
{{/renderedcontent}}
</div>
</div>
@@ -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 core_course/placeholder-course
This template renders an course card item loading placeholder for multiple blocks.
Example context (json):
{}
}}
<div class="card border-0 px-1">
<div class="card-img-top bg-pulse-grey w-100" style="height: 7rem">
</div>
<div class="card-body pr-1 course-info-container">
<div class="bg-pulse-grey w-100" style="height: 1rem"></div>
</div>
</div>
+54
View File
@@ -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 Licensebllsdsadfasfd
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template core_course/view-cards
This template renders the carousel for the starredcourses block.
Example context (json):
{
"courses": [
{
"name": "Assignment due 1",
"viewurl": "https://moodlesite/course/view.php?id=2",
"courseimageurl": "https://moodlesite/pluginfile/123/course/overviewfiles/123.jpg",
"fullname": "course 3",
"isfavourite": true,
"coursecategory": "Category 1"
}
]
}
}}
{{< core_course/coursecards }}
{{$classes}}flex-nowrap overflow-auto{{/classes}}
{{$coursename}} {{{fullname}}} {{/coursename}}
{{$coursecategory}}
{{#showcoursecategory}}
<span class="sr-only">
{{#str}}aria:coursecategory, core_course{{/str}}
</span>
<div class="text-truncate">{{{coursecategory}}}</div>
{{/showcoursecategory}}
{{/coursecategory}}
{{$divider}}
{{#showcoursecategory}}
<div class="pl-1 pr-1">|</div>
{{/showcoursecategory}}
{{/divider}}
{{/ core_course/coursecards }}