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
@@ -0,0 +1,202 @@
{{!
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_forum/big_search_form
Big search form.
Example context (json):
{
"actionurl": "https://example.com/mod/forum/search.php",
"courseid": "2",
"words": "apples",
"phrase": "Lorem ipsum dolor",
"notwords": "Not these words",
"showfullwords": [
{
"fullwords": "Exactly"
}
],
"datefromchecked": 1,
"datetochecked": "",
"forumoptions": [
{
"name": "Forum One",
"value": "23"
},
{
"name": "Forum Two",
"value": "34"
}
],
"subject": "Help me please",
"user": "Helpy McUser"
}
}}
<div id="intro" class="box searchbox boxaligncenter">
{{#str}}searchforumintro, forum{{/str}}
</div>
<div class="box generalbox boxaligncenter">
<form id="searchform" class="mform" action="{{actionurl}}" method="get">
<table class="searchbox table table-striped" id="form">
<tr>
<td class="c0 text-xs-right align-bottom">
<label for="words">{{#str}}searchwords, forum{{/str}}</label>
<input type="hidden" value="{{courseid}}" name="id">
</td>
<td class="c1">
<input type="text" class="form-control" name="words" id="words" value="{{words}}">
</td>
</tr>
<tr>
<td class="c0 text-xs-right align-bottom">
<label for="phrase">{{#str}}searchphrase, forum{{/str}}</label>
</td>
<td class="c1">
<input type="text" class="form-control" name="phrase" id="phrase" value="{{phrase}}">
</td>
</tr>
<tr>
<td class="c0 text-xs-right align-bottom">
<label for="notwords">{{#str}}searchnotwords, forum{{/str}}</label>
</td>
<td class="c1">
<input type="text" class="form-control" name="notwords" id="notwords" value="{{notwords}}">
</td>
</tr>
{{#showfullwords}}
<tr>
<td class="c0 text-xs-right align-bottom">
<label for="fullwords">{{#str}}searchfullwords, forum{{/str}}</label>
</td>
<td class="c1">
<input type="text" class="form-control" name="fullwords" id="fullwords" value="{{fullwords}}">
</td>
</tr>
{{/showfullwords}}
<tr>
<td class="c0 text-xs-right align-bottom">
<label for="timefromrestrict">{{#str}}searchdatefrom, forum{{/str}}</label>
</td>
<td class="c1 text-nowrap d-flex flex-wrap align-items-center">
<div class="fdate_time_selector d-flex flex-wrap align-items-center">
<input type="checkbox" name="timefromrestrict" value="1" {{#datefromchecked}}checked{{/datefromchecked}}>
{{{datefromfields}}}
</div>
<input type="hidden" name="hfromday" value="0">
<input type="hidden" name="hfrommonth" value="0">
<input type="hidden" name="hfromyear" value="0">
<input type="hidden" name="hfromhour" value="0">
<input type="hidden" name="hfromminute" value="0">
</td>
</tr>
<tr>
<td class="c0 text-xs-right align-bottom">
<label for="timetorestrict">{{#str}}searchdateto, forum{{/str}}</label>
</td>
<td class="c1 text-nowrap d-flex flex-wrap align-items-center">
<div class="fdate_time_selector d-flex flex-wrap align-items-center">
<input type="checkbox" name="timetorestrict" value="1" {{#datetochecked}}checked{{/datetochecked}}>
{{{datetofields}}}
</div>
<input type="hidden" name="htoday" value="0">
<input type="hidden" name="htomonth" value="0">
<input type="hidden" name="htoyear" value="0">
<input type="hidden" name="htohour" value="0">
<input type="hidden" name="htominute" value="0">
</td>
</tr>
<tr>
<td class="c0 text-xs-right align-bottom">
<label for="menuforumid">{{#str}}searchwhichforums, forum{{/str}}</label>
</td>
<td class="c1">
<select name="forumid" id="menuforumid" class="form-control custom-select">
{{#forumoptions}}
<option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
{{/forumoptions}}
</select>
</td>
</tr>
<tr>
<td class="c0 text-xs-right align-bottom">
<label for="subject">{{#str}}searchsubject, forum{{/str}}</label>
</td>
<td class="c1">
<input type="text" class="form-control" name="subject" id="subject" value="{{subject}}">
</td>
</tr>
<tr>
<td class="c0 text-xs-right align-bottom">
<label for="user">{{#str}}searchuser, forum{{/str}}</label>
</td>
<td class="c1">
<input type="text" class="form-control" name="user" id="user" value="{{user}}">
</td>
</tr>
{{^guestuser}}
<tr>
<td class="c0 text-xs-right align-bottom">
<label for="starredonly">{{#str}}starredonly, forum{{/str}}</label>
</td>
<td class="c1 align-middle d-flex flex-wrap align-items-center">
<input type="checkbox" class="form-control" name="starredonly" id="starredonly" value="1" {{#starredonly}}checked{{/starredonly}} />
</td>
</tr>
{{/guestuser}}
{{#tagsenabled}}
<tr>
<td class="c0">
<label for="tags" class="mt-1">{{#str}}searchtags, forum{{/str}}</label>
</td>
<td class="c1">
<select class="custom-select" name="tags[]"
id="tags" multiple>
{{#tagoptions}}
<option value="{{value}}" {{#selected}}selected{{/selected}}>{{{text}}}</option>
{{/tagoptions}}
</select>
</td>
</tr>
{{/tagsenabled}}
<tr>
<td> </td>
<td class="submit">
<button type="submit" class="btn btn-primary">{{#str}}searchforums, forum{{/str}}</button>
</td>
</tr>
</table>
</form>
</div>
{{#js}}
require(['jquery'], function($) {
var toggleDateFields = function(prefix, disabled) {
$('#searchform select[name^=' + prefix + ']').prop('disabled', disabled);
$('#searchform input[name^=h' + prefix + ']').val(disabled ? 1 : 0);
};
toggleDateFields('from', !$("#searchform input[name='timefromrestrict']").prop('checked'));
$("#searchform input[name='timefromrestrict']").click(function() {
toggleDateFields('from', !this.checked);
});
toggleDateFields('to', !$("#searchform input[name='timetorestrict']").prop('checked'));
$("#searchform input[name='timetorestrict']").click(function() {
toggleDateFields('to', !this.checked);
});
});
{{/js}}
@@ -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 mod_forum/blog_discussion_list
Template which defines a forum post for sending in a single-post HTML email.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
{{< mod_forum/social_discussion_list }}
{{$discussion_create_text}}
{{#str}}addanewtopic, forum{{/str}}
{{/discussion_create_text}}
{{/ mod_forum/social_discussion_list }}
@@ -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 mod_forum/discussion_favourite_toggle
Template to display the discussion subscription toggle.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* TODO
Example context (json):
{
}
}}
{{#capabilities.favourite}}
<a
class="{{$classes}}dropdown-item menu-action{{/classes}}"
role="{{$role}}menuitem{{/role}}"
data-type="favorite-toggle"
data-action="toggle"
data-discussionid="{{id}}"
data-forumid="{{forumid}}"
tabindex="-1"
href=""
{{#userstate.favourited}}
data-targetstate="0"
title="{{#str}}removefromfavourites, mod_forum{{/str}}"
{{/userstate.favourited}}
{{^userstate.favourited}}
data-targetstate="1"
title="{{#str}}addtofavourites, mod_forum{{/str}}"
{{/userstate.favourited}}
>
<span class="menu-action-text">
{{$favouritecontent}}
{{#userstate.favourited}}
{{#str}}removefromfavourites, mod_forum{{/str}}
{{/userstate.favourited}}
{{^userstate.favourited}}
{{#str}}addtofavourites, mod_forum{{/str}}
{{/userstate.favourited}}
{{/favouritecontent}}
</span>
</a>
{{/capabilities.favourite}}
@@ -0,0 +1,386 @@
{{!
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_forum/discussion_list
Template to display the list of forum discussions.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* TODO
Example context (json):
{
}
}}
<div id="discussion-list-{{uniqid}}" {{!
}}data-contextid="{{contextid}}" {{!
}}data-cmid="{{cmid}}" {{!
}}data-name="{{forum.name}}" {{!
}}data-group="{{forum.groupid}}" {{!
}}data-grading-component="{{gradingcomponent}}" {{!
}}data-grading-component-subtype="{{gradingcomponentsubtype}}" {{!
}}data-gradable-itemtype="forum" {{!
}}{{#firstgradeduserid}}data-initialuserid="{{firstgradeduserid}}" {{/firstgradeduserid}}{{!
}}>
{{#notifications}}
{{> core/notification}}
{{/notifications}}
{{{groupchangemenu}}}
<div class="py-3">
{{#forum.capabilities.create}}
{{#enablediscussioncreation}}
<a class="btn btn-primary" data-toggle="collapse" href="#collapseAddForm">
{{$discussion_create_text}}
{{#str}}addanewdiscussion, forum{{/str}}
{{/discussion_create_text}}
</a>
{{/enablediscussioncreation}}
{{/forum.capabilities.create}}
{{^forum.capabilities.create}}
{{#forum.capabilities.selfenrol}}
{{#enablediscussioncreation}}
<a class="btn btn-primary" href="{{forum.urls.create}}">
{{$discussion_create_text}}
{{#str}}addanewdiscussion, forum{{/str}}
{{/discussion_create_text}}
</a>
{{/enablediscussioncreation}}
{{/forum.capabilities.selfenrol}}
{{/forum.capabilities.create}}
{{#forum.capabilities.grade}}
{{#forum.state.gradingenabled}}
{{> mod_forum/grades/grade_button }}
{{/forum.state.gradingenabled}}
{{/forum.capabilities.grade}}
{{^forum.capabilities.grade}}
{{#forum.state.gradingenabled}}
{{> mod_forum/grades/view_grade_button }}
{{/forum.state.gradingenabled}}
{{/forum.capabilities.grade}}
</div>
{{#forum.capabilities.create}}
<div class="collapse mt-3 pb-3" id="collapseAddForm">
{{{newdiscussionhtml}}}
</div>
{{/forum.capabilities.create}}
{{#state.hasdiscussions}}
{{$discussion_top_pagination}}
{{{ pagination }}}
{{/discussion_top_pagination}}
{{$discussion_list_output}}
<div class="position-relative">
<div class="no-overflow">
<table class="table discussion-list generaltable">
<caption id="discussion-table-description-{{uniqid}}" class="sr-only">
{{#str}} showingcountoftotaldiscussions, mod_forum, {"count": "{{visiblediscussioncount}}", "total":"{{totaldiscussioncount}}"} {{/str}}
</caption>
{{$discussion_list_header}}
<thead>
<tr>
<th scope="col">
<span class="accesshide">{{#str}}status{{/str}}</span>
</th>
<th scope="col" class="pl-0">
{{#state.sortorder.isdiscussiondesc}}
<a href="{{{forum.urls.sortdiscussionasc}}}" aria-label="{{#str}}discussionlistsortbydiscussionasc, mod_forum{{/str}}">{{#str}}discussion, mod_forum{{/str}}</a> <span class="text-primary">{{#pix}}t/downlong, core, {{#str}}desc, core{{/str}}{{/pix}}</span>
{{/state.sortorder.isdiscussiondesc}}
{{#state.sortorder.isdiscussionasc}}
<a href="{{{forum.urls.sortdiscussiondesc}}}" aria-label="{{#str}}discussionlistsortbydiscussiondesc, mod_forum{{/str}}">{{#str}}discussion, mod_forum{{/str}}</a> <span class="text-primary">{{#pix}}t/uplong, core, {{#str}}asc, core{{/str}}{{/pix}}</span>
{{/state.sortorder.isdiscussionasc}}
{{^state.sortorder.isdiscussiondesc}}
{{^state.sortorder.isdiscussionasc}}
<a href="{{{forum.urls.sortdiscussiondesc}}}" aria-label="{{#str}}discussionlistsortbydiscussiondesc, mod_forum{{/str}}">{{#str}}discussion, mod_forum{{/str}}</a>
{{/state.sortorder.isdiscussionasc}}
{{/state.sortorder.isdiscussiondesc}}
</th>
{{#forum.state.groupmode}}
<th scope="col" class="group px-3">
{{#state.sortorder.isgroupdesc}}
<a href="{{{forum.urls.sortgroupasc}}}" aria-label="{{#str}}discussionlistsortbygroupasc, mod_forum{{/str}}">{{#str}}group{{/str}}</a> <span class="text-primary">{{#pix}}t/downlong, core, {{#str}}desc, core{{/str}}{{/pix}}</span>
{{/state.sortorder.isgroupdesc}}
{{#state.sortorder.isgroupasc}}
<a href="{{{forum.urls.sortgroupdesc}}}" aria-label="{{#str}}discussionlistsortbygroupdesc, mod_forum{{/str}}">{{#str}}group{{/str}}</a> <span class="text-primary">{{#pix}}t/uplong, core, {{#str}}asc, core{{/str}}{{/pix}}</span>
{{/state.sortorder.isgroupasc}}
{{^state.sortorder.isgroupdesc}}
{{^state.sortorder.isgroupasc}}
<a href="{{{forum.urls.sortgroupdesc}}}" aria-label="{{#str}}discussionlistsortbygroupdesc, mod_forum{{/str}}">{{#str}}group{{/str}}</a>
{{/state.sortorder.isgroupasc}}
{{/state.sortorder.isgroupdesc}}
</th>
{{/forum.state.groupmode}}
<th scope="col" class="author px-3">
{{#state.sortorder.isstarterdesc}}
<a href="{{{forum.urls.sortstarterasc}}}" aria-label="{{#str}}discussionlistsortbystarterasc, mod_forum{{/str}}">{{#str}}startedby, mod_forum{{/str}}</a> <span class="text-primary">{{#pix}}t/downlong, core, {{#str}}desc, core{{/str}}{{/pix}}</span>
{{/state.sortorder.isstarterdesc}}
{{#state.sortorder.isstarterasc}}
<a href="{{{forum.urls.sortstarterdesc}}}" aria-label="{{#str}}discussionlistsortbystarterdesc, mod_forum{{/str}}">{{#str}}startedby, mod_forum{{/str}}</a> <span class="text-primary">{{#pix}}t/uplong, core, {{#str}}asc, core{{/str}}{{/pix}}</span>
{{/state.sortorder.isstarterasc}}
{{^state.sortorder.isstarterdesc}}
{{^state.sortorder.isstarterasc}}
<a href="{{{forum.urls.sortstarterdesc}}}" aria-label="{{#str}}discussionlistsortbystarterdesc, mod_forum{{/str}}">{{#str}}startedby, mod_forum{{/str}}</a>
{{/state.sortorder.isstarterasc}}
{{/state.sortorder.isstarterdesc}}
</th>
<th scope="col" class="lastpost px-3">
{{#state.sortorder.islastpostdesc}}
<a href="{{{forum.urls.sortlastpostasc}}}" aria-label="{{#str}}discussionlistsortbylastpostasc, mod_forum{{/str}}">{{#str}}lastpost, mod_forum{{/str}}</a> <span class="text-primary">{{#pix}}t/downlong, core, {{#str}}desc, core{{/str}}{{/pix}}</span>
{{/state.sortorder.islastpostdesc}}
{{#state.sortorder.islastpostasc}}
<a href="{{{forum.urls.sortlastpostdesc}}}" aria-label="{{#str}}discussionlistsortbylastpostdesc, mod_forum{{/str}}">{{#str}}lastpost, mod_forum{{/str}}</a> <span class="text-primary">{{#pix}}t/uplong, core, {{#str}}asc, core{{/str}}{{/pix}}</span>
{{/state.sortorder.islastpostasc}}
{{^state.sortorder.islastpostdesc}}
{{^state.sortorder.islastpostasc}}
<a href="{{{forum.urls.sortlastpostdesc}}}" aria-label="{{#str}}discussionlistsortbylastpostdesc, mod_forum{{/str}}">{{#str}}lastpost, mod_forum{{/str}}</a>
{{/state.sortorder.islastpostasc}}
{{/state.sortorder.islastpostdesc}}
</th>
{{#forum.capabilities.viewdiscussions}}
<th scope="col" class="text-center px-2">
{{#state.sortorder.isrepliesdesc}}
<a href="{{{forum.urls.sortrepliesasc}}}" aria-label="{{#str}}discussionlistsortbyrepliesasc, mod_forum{{/str}}">{{#str}}replies, mod_forum{{/str}}</a> <span class="text-primary">{{#pix}}t/downlong, core, {{#str}}desc, core{{/str}}{{/pix}}</span>
{{/state.sortorder.isrepliesdesc}}
{{#state.sortorder.isrepliesasc}}
<a href="{{{forum.urls.sortrepliesdesc}}}" aria-label="{{#str}}discussionlistsortbyrepliesdesc, mod_forum{{/str}}">{{#str}}replies, mod_forum{{/str}}</a> <span class="text-primary">{{#pix}}t/uplong, core, {{#str}}asc, core{{/str}}{{/pix}}</span>
{{/state.sortorder.isrepliesasc}}
{{^state.sortorder.isrepliesdesc}}
{{^state.sortorder.isrepliesasc}}
<a href="{{{forum.urls.sortrepliesdesc}}}" aria-label="{{#str}}discussionlistsortbyrepliesdesc, mod_forum{{/str}}">{{#str}}replies, mod_forum{{/str}}</a>
{{/state.sortorder.isrepliesasc}}
{{/state.sortorder.isrepliesdesc}}
{{#forum.userstate.tracked}}
<a href="{{{forum.urls.markasread}}}">{{#pix}}t/markasread, core, {{#str}}markallread, mod_forum{{/str}}{{/pix}}</a>
{{/forum.userstate.tracked}}
</th>
{{/forum.capabilities.viewdiscussions}}
{{#forum.capabilities.subscribe}}
<th scope="col" class="text-center px-2">{{#str}} notsubscribed, mod_forum {{/str}}</th>
{{/forum.capabilities.subscribe}}
<th scope="col" class="discussionsubscription">
<span class="accesshide">{{#str}}actions{{/str}}</span>
</th>
</tr>
</thead>
{{/discussion_list_header}}
{{$discussion_list_body}}
<tbody>
{{#summaries}}
{{! The discussion class is only required for behat tests to identify the row. }}
<tr class="discussion{{!
}}{{#discussion.pinned}} pinned{{/discussion.pinned}}{{!
}}{{#discussion.userstate.favourited}} favourited{{/discussion.userstate.favourited}}{{!
}}{{#discussion.userstate.subscribed}} subscribed{{/discussion.userstate.subscribed}}{{!
}}{{#unread}} hasunread{{/unread}}{{!
}}{{#discussion.timed}}{{#istimed}}{{^visible}} dimmed_text{{/visible}}{{/istimed}}{{/discussion.timed}}"
data-region="discussion-list-item"
data-discussionid="{{id}}"
data-forumid="{{forumid}}">
<td class="p-0 text-center align-middle icon-no-margin" style="width: 1px;">
{{#discussion}}
{{> mod_forum/forum_discussion_favourite_toggle}}
{{/discussion}}
</td>
<th scope="row" class="topic p-0 align-middle">
<div class="p-3 pl-0">
<div class="d-flex">
{{#discussion.pinned}}
{{#pix}}i/pinned, mod_forum, {{#str}}discussionpinned, mod_forum{{/str}}{{/pix}}
{{/discussion.pinned}}
<a class="w-100 h-100 d-block" href="{{discussion.urls.view}}" title="{{discussion.name}}" aria-label="{{discussion.name}}">
{{#shortentext}}100, {{{discussion.name}}}{{/shortentext}}
</a>
</div>
<div>
<span class="badge bg-danger text-white rounded" data-region="locked-label" {{^discussion.locked}}hidden{{/discussion.locked}}>
{{#str}}locked, forum{{/str}}
</span>
{{#discussion.timed.istimed}}
<span>
<button class="btn badge bg-primary text-white rounded border-0" data-region="timed-label"
data-toggle="popover" data-container="body" data-placement="right" data-html="true"
data-content="{{#discussion.timed}}{{#discussion.times}}{{> mod_forum/discussion_times}}{{/discussion.times}}{{/discussion.timed}}"
data-trigger="click" aria-label="{{#str}}timeddiscussion, forum{{/str}}" title="{{#str}}timeddiscussion, forum{{/str}}">
{{#str}}timed, forum{{/str}}
</button>
</span>
{{/discussion.timed.istimed}}
</div>
</div>
</th>
{{#forum.state.groupmode}}
<td class="group align-middle fit-content limit-width px-3">
{{#discussion.group}}
<img alt="{{#str}} pictureof, core, {{name}} {{/str}}"
class="border rounded h-auto rounded-circle grouppicture"
src="{{{urls.picture}}}"
title="{{#str}} pictureof, core, {{name}} {{/str}}">
{{#urls.userlist}}
<a href="{{{urls.userlist}}}" aria-label='{{#str}} memberofgroup, group, {{name}}{{/str}}'
title='{{#str}} memberofgroup, group, {{name}}{{/str}}'>
{{#shortentext}}30, {{name}}{{/shortentext}}
</a>
{{/urls.userlist}}
{{^urls.userlist}}
<span>{{name}}</span>
{{/urls.userlist}}
{{/discussion.group}}
</td>
{{/forum.state.groupmode}}
<td class="author align-middle fit-content limit-width px-3">
{{#firstpostauthor}}
<div class="d-flex">
<div class="align-middle p-0">
<img class="rounded-circle userpicture" src="{{urls.profileimage}}"
alt="{{#str}}pictureof, moodle, {{fullname}}{{/str}}"
title="{{#str}}pictureof, moodle, {{fullname}}{{/str}}" >
</div>
<div class="author-info align-middle">
<div class="mb-1 line-height-3 text-truncate">{{fullname}}</div>
<div class="line-height-3">
{{< core/time_element }}
{{$elementid}}created-{{discussion.id}}{{/elementid}}
{{$timestampval}}{{discussion.times.created}}{{/timestampval}}
{{$userdateformatval}}{{#str}}strftimedatemonthabbr, langconfig{{/str}}{{/userdateformatval}}
{{/core/time_element}}
</div>
</div>
</div>
{{/firstpostauthor}}
</td>
<td class="text-left align-middle fit-content limit-width px-3">
{{! TODO Check q&a, eachuser }}
{{#latestpostauthor}}
<div class="d-flex">
<div class="align-middle p-0">
<img class="rounded-circle userpicture" src="{{urls.profileimage}}"
alt="{{#str}}pictureof, moodle, {{fullname}}{{/str}}"
title="{{#str}}pictureof, moodle, {{fullname}}{{/str}}" >
</div>
<div class="author-info align-middle">
<div class="mb-1 line-height-3 text-truncate">{{fullname}}</div>
<div class="line-height-3">
{{#latestpostid}}
<a href="{{{discussion.urls.viewlatest}}}" title="{{#userdate}}{{discussion.times.modified}},{{#str}}strftimerecentfull{{/str}}{{/userdate}}">
{{< core/time_element }}
{{$elementid}}modified-{{discussion.id}}{{/elementid}}
{{$timestampval}}{{discussion.times.modified}}{{/timestampval}}
{{$userdateformatval}}{{#str}}strftimedatemonthabbr, langconfig{{/str}}{{/userdateformatval}}
{{/ core/time_element }}
</a>
{{/latestpostid}}
</div>
</div>
</div>
{{/latestpostauthor}}
</td>
{{#forum.capabilities.viewdiscussions}}
<td class="p-0 text-center align-middle fit-content px-2">
<span>{{replies}}</span>
{{#forum.userstate.tracked}}
{{#unread}}
{{! TODO Rewrite as AJAX}}
<span class="lead">
<a href="{{{discussion.urls.viewfirstunread}}}" class="badge bg-primary text-white rounded-pill font-weight-normal"
title="{{#str}}unreadpostsnumber, mod_forum, {{unread}}{{/str}}" aria-label="{{#str}}unreadpostsnumber, mod_forum, {{unread}}{{/str}}">
{{unread}}
</a>
</span>
{{/unread}}
{{/forum.userstate.tracked}}
</td>
{{/forum.capabilities.viewdiscussions}}
{{#forum.capabilities.subscribe}}
<td class="text-center align-middle fit-content px-2">
{{#discussion}}
<div class="d-inline custom-control custom-switch mb-1">
<input
type="checkbox"
class="custom-control-input"
id="subscription-toggle-{{id}}"
data-type="subscription-toggle"
data-action="toggle"
data-discussionid="{{id}}"
data-forumid="{{forumid}}"
{{#userstate.subscribed}}data-targetstate="0" checked{{/userstate.subscribed}}
{{^userstate.subscribed}}data-targetstate="1"{{/userstate.subscribed}}>
<label class="custom-control-label" for="subscription-toggle-{{id}}">
<span class="sr-only">
{{#userstate.subscribed}}
{{#str}}unsubscribediscussion, forum{{/str}}
{{/userstate.subscribed}}
{{^userstate.subscribed}}
{{#str}}subscribediscussion, forum{{/str}}
{{/userstate.subscribed}}
</span>
</label>
</div>
{{/discussion}}
</td>
{{/forum.capabilities.subscribe}}
<td class="p-0 align-middle fit-content" data-container="discussion-summary-actions">
{{#discussion}}
<div class="d-flex flex-wrap justify-content-end icon-no-margin">
{{#hasanyactions}}
<div data-container='discussion-tools'>
{{> mod_forum/forum_action_menu}}
</div>
{{/hasanyactions}}
</div>
{{/discussion}}
</td>
</tr>
{{/summaries}}
</tbody>
{{/discussion_list_body}}
</table>
</div>
</div>
{{/discussion_list_output}}
{{$discussion_bottom_pagination}}
{{{ pagination }}}
{{/discussion_bottom_pagination}}
{{#can_create_discussion}}
<div class="forumaddnew">
<a href="{{create_discussion_link}}" class="btn btn-primary">{{create_discussion_link_text}}</a>
</div>
{{/can_create_discussion}}
{{/state.hasdiscussions}}
{{^state.hasdiscussions}}
<div class="forumnodiscuss alert alert-info">
{{$no_discussions_text}}
{{#str}}nodiscussions, forum{{/str}}
{{/no_discussions_text}}
</div>
{{/state.hasdiscussions}}
</div>
{{#js}}
require(['jquery', 'mod_forum/discussion_list'], function($, View) {
var root = $('#discussion-list-{{uniqid}}');
View.init(root);
});
{{/js}}
@@ -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_forum/discussion_lock_toggle
Template to display the discussion subscription toggle.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* none
Example context (json):
{
"id": 0,
"locked": 1
}
}}
<a
class="dropdown-item menu-action"
role="menuitem"
data-type="lock-toggle"
data-action="toggle"
data-discussionid="{{id}}"
data-forumid="{{forumid}}"
data-state="{{times.locked}}"
href="#"
{{#locked}}
title="{{#str}}clicktounlockdiscussion, forum{{/str}}"
{{/locked}}
{{^locked}}
title="{{#str}}clicktolockdiscussion, forum{{/str}}"
{{/locked}}
>
<span class="menu-action-text">
{{#locked}}
{{#str}}unlockdiscussion, forum{{/str}}
{{/locked}}
{{^locked}}
{{#str}}lockdiscussion, forum{{/str}}
{{/locked}}
</span>
</a>
@@ -0,0 +1,63 @@
{{!
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_forum/discussion_pin_toggle
Template to display the discussion subscription toggle.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* TODO
Example context (json):
{
}
}}
{{#capabilities.pin}}
<a
class="dropdown-item menu-action"
role="menuitem"
data-type="pin-toggle"
data-action="toggle"
data-discussionid="{{id}}"
data-forumid="{{forumid}}"
href="{{urls.pin}}"
tabindex="-1"
{{#pinned}}
data-targetstate="0"
title="{{#str}}unpindiscussion, mod_forum{{/str}}"
{{/pinned}}
{{^pinned}}
data-targetstate="1"
title="{{#str}}pindiscussion, mod_forum{{/str}}"
{{/pinned}}
>
<span class="menu-action-text">
{{#pinned}}
{{#str}}unpindiscussion, mod_forum{{/str}}
{{/pinned}}
{{^pinned}}
{{#str}}pindiscussion, mod_forum{{/str}}
{{/pinned}}
</span>
</a>
{{/capabilities.pin}}
@@ -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 mod_forum/discussion_settings_body_content
This template will render the content for the body of the settings page in the message drawer.
Classes required for JS:
* none
Data attributes required for JS:
* All data attributes are required
Context variables required for this template:
* userid The logged in user id
* urls The URLs for the popover
Example context (json):
{}
}}
<div class="p-2 discussion-settings-container" data-container="discussion-tools">
<h3 class="mb-2 mt-2 h6 font-weight-bold">{{#str}} general, core {{/str}}</h3>
{{#capabilities.subscribe}}
{{< mod_forum/setting_switch}}
{{$switchid}}subscription-toggle-{{uniqid}}{{/switchid}}
{{$type}}subscription-toggle{{/type}}
{{$otherattributes}}
data-discussionid="{{id}}"
data-forumid="{{forumid}}"
{{#userstate.subscribed}}data-targetstate="0" checked{{/userstate.subscribed}}
{{^userstate.subscribed}}data-targetstate="1"{{/userstate.subscribed}}
{{/otherattributes}}
{{$labeltext}}
{{#str}} subscribediscussion, mod_forum {{/str}}
{{/labeltext}}
{{/mod_forum/setting_switch}}
{{/capabilities.subscribe}}
{{#capabilities.favourite}}
{{< mod_forum/setting_switch}}
{{$switchid}}favorite-toggle-{{uniqid}}{{/switchid}}
{{$type}}favorite-toggle{{/type}}
{{$otherattributes}}
data-discussionid="{{id}}"
data-forumid="{{forumid}}"
{{#userstate.favourited}}data-targetstate="0" checked{{/userstate.favourited}}
{{^userstate.favourited}}data-targetstate="1"{{/userstate.favourited}}
{{/otherattributes}}
{{$labeltext}}
{{#str}} addtofavourites, mod_forum {{/str}}
{{/labeltext}}
{{/mod_forum/setting_switch}}
{{/capabilities.favourite}}
{{#capabilities.pin}}
{{< mod_forum/setting_switch}}
{{$switchid}}pin-toggle-{{uniqid}}{{/switchid}}
{{$type}}pin-toggle{{/type}}
{{$otherattributes}}
data-discussionid="{{id}}"
data-forumid="{{forumid}}"
{{#pinned}}data-targetstate="0" checked{{/pinned}}
{{^pinned}}data-targetstate="1"{{/pinned}}
{{/otherattributes}}
{{$labeltext}}
{{#str}} pindiscussion, mod_forum {{/str}}
{{/labeltext}}
{{/mod_forum/setting_switch}}
{{/capabilities.pin}}
{{#capabilities.manage}}
{{^istimelocked}}
{{< mod_forum/setting_switch}}
{{$switchid}}lock-toggle-{{uniqid}}{{/switchid}}
{{$type}}lock-toggle{{/type}}
{{$otherattributes}}
data-discussionid="{{id}}"
data-forumid="{{forumid}}"
data-state="{{times.locked}}"
{{#locked}}checked{{/locked}}
{{/otherattributes}}
{{$labeltext}}
{{#str}} lockdiscussion, mod_forum {{/str}}
{{/labeltext}}
{{/mod_forum/setting_switch}}
{{/istimelocked}}
{{/capabilities.manage}}
{{#movediscussion}}
<h3 class="h6 mt-4 font-weight-bold">{{#str}} move, core {{/str}}</h3>
{{{.}}}
{{/movediscussion}}
{{#exportdiscussion}}
<h3 class="h6 mt-4 font-weight-bold">{{#str}} portfolio, portfolio {{/str}}</h3>
{{{.}}}
{{/exportdiscussion}}
</div>
@@ -0,0 +1,46 @@
{{!
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_forum/discussion_settings_drawer
This template will render the discussion settings drawer.
Classes required for JS:
* none
Data attributes required for JS:
* All data attributes are required
Context variables required for this template:
* userid The logged in user id
* urls The URLs for the popover
Example context (json):
{}
}}
{{<core/drawer}}
{{$drawerid}}discussion-settings-drawer{{/drawerid}}
{{$drawercontent}}
<div class="h-100 w-100 bg-white d-flex flex-column p-2">
{{> mod_forum/settings_header}}
<div class="body-container position-relative" data-region="body-container">
{{> mod_forum/discussion_settings_body_content}}
</div>
</div>
{{/drawercontent}}
{{/core/drawer}}
@@ -0,0 +1,69 @@
{{!
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_forum/discussion_subscription_toggle
Template to display the discussion subscription toggle.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* capabilities Object - Uses the "subscribe" attribute to determine whether to render the subscribe action.
* urls Object - Uses the "subscribe" attribute for the subscription URl.
* id int - The discussion ID.
* forumid int - The forum ID.
* userstate Object - Uses the "subscribed" attribute to determine the action that will be performed upon toggling.
Example context (json):
{
"capabilities": { "subscribe": true },
"urls": { "subscribe": "#" },
"id": 1,
"forumid": 1,
"userstate": { "subscribed": true }
}
}}
{{#capabilities.subscribe}}
<a
href="{{{urls.subscribe}}}"
class="dropdown-item"
role="menuitem"
data-type="subscription-toggle"
data-action="toggle"
data-discussionid="{{id}}"
data-forumid="{{forumid}}"
{{#userstate.subscribed}}
title="{{#str}}clicktounsubscribe, mod_forum{{/str}}"
data-targetstate="0"
{{/userstate.subscribed}}
{{^userstate.subscribed}}
title="{{#str}}clicktosubscribe, mod_forum{{/str}}"
data-targetstate="1"
{{/userstate.subscribed}}
>
{{#userstate.subscribed}}
{{#str}}unsubscribediscussion, forum{{/str}}
{{/userstate.subscribed}}
{{^userstate.subscribed}}
{{#str}}subscribediscussion, forum{{/str}}
{{/userstate.subscribed}}
</a>
{{/capabilities.subscribe}}
@@ -0,0 +1,60 @@
{{!
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_forum/discussion_times
Template to display the discussion times. Note that this template is used only as a partial from within discussion_list, which
requires the language strings be passed through the cleanstr helper
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* start int - The discussion start timestamp
* end int - The discussion end timestamp
* visible boolean - Whether the discussion is visible to students or not.
Example context (json):
{
"start": 1,
"end": 1,
"visible": true
}
}}
<ul>
{{#start}}
<li>
{{#cleanstr}} displaystartdate, mod_forum, {{#userdate}}{{.}}, {{#str}}strftimerecentfull {{/str}}{{/userdate}} {{/cleanstr}}
</li>
{{/start}}
{{#end}}
<li>
{{#cleanstr}} displayenddate, mod_forum, {{#userdate}}{{.}}, {{#str}}strftimerecentfull {{/str}}{{/userdate}} {{/cleanstr}}
</li>
{{/end}}
<li>
{{#visible}}
{{#cleanstr}} timedvisible, mod_forum {{/cleanstr}}
{{/visible}}
{{^visible}}
{{#cleanstr}} timedhidden, mod_forum {{/cleanstr}}
{{/visible}}
</li>
</ul>
@@ -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_forum/form-user-selector-suggestion
Moodle template for the list of valid options in an autocomplate form element.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* fullname string Users full name
* email string user email field
Example context (json):
{
"fullname": "Admin User",
"extrafields": [
{
"name": "email",
"value": "admin@example.com"
},
{
"name": "phone1",
"value": "0123456789"
}
]
}
}}
<span>
<span>{{fullname}}</span>
{{#extrafields}}
<span><small>{{value}}</small></span>
{{/extrafields}}
</span>
@@ -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_forum/forum_action_menu
This template renders action menu for a forum discussion.
Context variables required for this template:
* capabilities Object - Uses the following attributes:
* manage boolean - Whether to render the lock action.
* favourite boolean - Whether to render the star/unstar action.
* pin boolean - Whether to render the star/unstar action.
* subscribe boolean - Whether to render the subscribe action.
* id int - The discussion ID.
* forumid int - The forum ID.
* istimelocked boolean - Whether this forum is time locked.
* settings Object - Uses the following attributes:
* excludetext boolean - Whether to show an icon only.
* togglemoreicon - Whether to show a toggle-more icon or not.
Example context (json):
{
"capabilities": {
"manage": true,
"favourite": true,
"pin": true,
"subscribe": true
},
"id": 1,
"forumid": 1,
"istimelocked": false,
"settingsselector": true,
"settings": {
"excludetext": false,
"togglemoreicon": false
}
}
}}
<div class="ml-auto dropdown">
{{#settingsselector}}
<button class="dropdown-toggle btn btn-outline-secondary"
data-toggle="dropdown"
aria-haspopup="true"
tabindex="0"
aria-controls="forum-action-menu-{{id}}-menu"
aria-label="{{#str}}togglediscussionmenu, mod_forum{{/str}}"
aria-expanded="false">
{{#str}} settings, mod_forum {{/str}}
</button>
{{/settingsselector}}
{{^settingsselector}}
<a href="#" class="{{^settings.excludetext}}dropdown-toggle{{/settings.excludetext}} btn btn-link {{#settings.togglemoreicon}}btn-icon colour-inherit text-decoration-none d-flex align-items-center justify-content-center{{/settings.togglemoreicon}}"
role="button"
data-toggle="dropdown"
data-boundary="window"
aria-haspopup="true"
tabindex="0"
aria-controls="forum-action-menu-{{id}}-menu"
aria-label="{{#str}}togglediscussionmenu, mod_forum{{/str}}"
aria-expanded="false">
{{#settings.togglemoreicon}}
{{#pix}} i/menu, core{{/pix}}
{{/settings.togglemoreicon}}
{{^settings.togglemoreicon}}
{{#pix}} i/settings, core{{/pix}}
{{/settings.togglemoreicon}}
{{^settings.excludetext}}
{{#str}} settings, mod_forum {{/str}}
{{/settings.excludetext}}
</a>
{{/settingsselector}}
<div class="dropdown-menu dropdown-menu-right"
aria-labelledby="forum-action-menu-{{id}}-menu"
data-rel="menu-content"
role="menu"
id="forum-action-menu-{{id}}-menu">
{{#capabilities.favourite}}
{{> mod_forum/discussion_favourite_toggle}}
{{/capabilities.favourite}}
{{#capabilities.pin}}
{{> mod_forum/discussion_pin_toggle}}
{{/capabilities.pin}}
{{#capabilities.manage}}
{{^istimelocked}}
{{> forum/discussion_lock_toggle }}
{{/istimelocked}}
{{/capabilities.manage}}
{{^settings.excludesubscription}}
{{> forum/discussion_subscription_toggle }}
{{/settings.excludesubscription}}
{{#unread}}
{{> forum/mark_as_read }}
{{/unread}}
</div>
</div>
@@ -0,0 +1,69 @@
{{!
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_forum/forum_actionbar
Simple search input.
Context variables required for this template:
* see mod/forum/classes/output/forum_actionbar.php
Example context (json):
{
"action": "https://moodle.local/mod/forum/search.php",
"inputname": "search",
"searchstring": "Search settings",
"query": "themedesigner",
"hiddenfields": [{
"name": "id",
"value": "11"
}],
"helpicon": {
"heading": "Search",
"text": "<div class='no-overflow'><p>For basic searching .</p></div>",
"alt": "Help with search",
"icon": [{
"attributes": [{
"name": "alt",
"value": "Help with Search"
}, {
"name": "src",
"value": "http://localhost/theme/image.php?theme=boost&component=core&image=help"
}]
}]
},
"newdiscussionbtn": "<a class='btn btn-primary'>Add discussion topic</a>",
"subscribetoforum": "http://localhost/moodle/mod/forum/subscribe.php?id=7&sesskey=abcd&returnurl=http//localhost/moodle/mod/forum/view.php?id=4",
"unsubscribefromforum": "http://localhost/moodle/mod/forum/subscribe.php?id=7&sesskey=abcd&returnurl=http//localhost/moodle/mod/forum/view.php?id=4"
}
}}
<div class="container-fluid tertiary-navigation">
<div class="row">
<div class="navitem">
{{> mod_forum/quick_search_form }}
</div>
<div class="navitem">
{{{newdiscussionbtn}}}
</div>
<div class="ml-sm-auto navitem">
{{#subscribetoforum}}
<a class="btn btn-secondary" href="{{ subscribetoforum }}">{{#str}}subscribe, mod_forum {{/str}}</a>
{{/subscribetoforum}}
{{#unsubscribefromforum}}
<a class="btn btn-secondary" href="{{ unsubscribefromforum }}">{{#str}}unsubscribe, mod_forum {{/str}}</a>
{{/unsubscribefromforum}}
</div>
</div>
</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 mod_forum/forum_discussion
Template for displaying a single forum discussion.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
"html": {
"hasanyactions": true,
"posts": "<article id='p33' class='forum-post-container mb-2' data-post-id='33'></article>",
"modeselectorform": "<div class='singleselect d-inline-block'> <form method='get' action='http://localhost/m/pg_stable_master/mod/forum/discuss.php' class='d-flex flex-wrap' id='mode'></div>",
"subscribe": null,
"movediscussion": null,
"pindiscussion": null,
"neighbourlinks": "<div class='discussion-nav clearfix'></div>",
"exportdiscussion": null
},
"throttlingwarningmsg": "You are approaching the posting threshold. You have posted 3 times in the last 1 week and the limit is 4 posts."
}
}}
<div id="discussion-container-{{uniqid}}" data-content="forum-discussion">
{{#html}}
{{{neighbourlinks}}}
<div class="d-flex flex-column flex-sm-row mb-1">
<div>{{{exportdiscussion}}}</div>
<div class="{{#exportdiscussion}}ml-2{{/exportdiscussion}}">{{{modeselectorform}}}</div>
<div class="ml-2">{{{movediscussion}}}</div>
{{#hasanyactions}}
<div class="drop-down ml-auto" data-container="discussion-tools">
{{> mod_forum/forum_action_menu}}
</div>
{{/hasanyactions}}
</div>
{{/html}}
{{#notifications}}
{{> core/notification}}
{{/notifications}}
{{{html.posts}}}
{{#html.neighbourlinks}}{{{.}}}{{/html.neighbourlinks}}
</div>
{{#js}}
require(
[
'jquery',
'core/templates',
'mod_forum/discussion',
'mod_forum/posts_list',
'mod_forum/lock_toggle',
'mod_forum/favourite_toggle',
'mod_forum/pin_toggle',
'mod_forum/subscription_toggle'
],
function(
$,
Templates,
Discussion,
PostsList,
LockToggle,
FavouriteToggle,
Pin,
SubscribeToggle
) {
var root = $("[data-content='forum-discussion']");
Discussion.init(root);
PostsList.init(root, {{#quote}}{{throttlingwarningmsg}}{{/quote}});
root = $('[data-container="discussion-tools"]');
LockToggle.init(root, true);
FavouriteToggle.init(root, true, function(toggleElement, context) {
return Templates.render('mod_forum/discussion_favourite_toggle', context)
.then(function(html, js) {
return Templates.replaceNode(toggleElement, html, js);
});
});
Pin.init(root, true, function(toggleElement, context) {
return Templates.render('mod_forum/discussion_pin_toggle', context)
.then(function(html, js) {
return Templates.replaceNode(toggleElement, html, js);
});
});
SubscribeToggle.init(root, true, function(toggleElement, context) {
return Templates.render('mod_forum/discussion_subscription_toggle', context)
.then(function(html, js) {
return Templates.replaceNode(toggleElement, html, js);
});
});
});
{{/js}}
@@ -0,0 +1,43 @@
{{!
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_forum/forum_discussion_favourite_toggle
Template which defines a forum post for sending in a single-post HTML email.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
{{< mod_forum/discussion_favourite_toggle }}
{{$classes}}btn btn-link{{/classes}}
{{$role}}button{{/role}}
{{$favouritecontent}}
{{#userstate.favourited}}
{{#pix}}t/star, mod_forum, {{#str}}removefromfavourites, mod_forum{{/str}}{{/pix}}
{{/userstate.favourited}}
{{^userstate.favourited}}
{{#pix}}t/emptystar, core, {{#str}}addtofavourites, mod_forum{{/str}}{{/pix}}
{{/userstate.favourited}}
{{/favouritecontent}}
{{/ mod_forum/discussion_favourite_toggle }}
@@ -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_forum/forum_discussion_nested_post
Template to render a post in a nested format.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
{{< mod_forum/forum_discussion_post }}
{{$replies}}
<div class="indent" data-region="replies-container">
{{#replies}}
{{> mod_forum/forum_discussion_nested_post }}
{{/replies}}
</div>
{{/replies}}
{{/ mod_forum/forum_discussion_post }}
@@ -0,0 +1,34 @@
{{!
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_forum/forum_discussion_nested_posts
Template to render a list of posts in a nested format.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
{{#posts}}
{{> mod_forum/forum_discussion_nested_post }}
{{/posts}}
@@ -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_forum/forum_discussion_nested_v2
Template for displaying a single forum discussion.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
"html": {
"hasanyactions": true,
"posts": "<article id='p33' class='forum-post-container mb-2' data-post-id='33'></article>",
"modeselectorform": "<div class='singleselect d-inline-block'> <form method='get' action='http://localhost/m/pg_stable_master/mod/forum/discuss.php' class='d-flex flex-wrap' id='mode'></div>",
"subscribe": null,
"movediscussion": null,
"pindiscussion": null,
"neighbourlinks": "<div class='discussion-nav clearfix'></div>",
"exportdiscussion": null
},
"throttlingwarningmsg": "You are approaching the posting threshold. You have posted 3 times in the last 1 week and the limit is 4 posts."
}
}}
<div id="discussion-container-{{uniqid}}" data-content="forum-discussion">
{{#html}}
{{> mod_forum/discussion_settings_drawer}}
{{/html}}
{{#notifications}}
{{> core/notification}}
{{/notifications}}
<div class="mb-5">{{{html.modeselectorform}}}</div>
{{{html.posts}}}
</div>
{{#js}}
require(['jquery', 'mod_forum/discussion_nested_v2'], function($, Discussion) {
var root = $('#discussion-container-{{uniqid}}');
Discussion.init(root, {
{{#throttlingwarningmsg}}
throttlingwarningmsg: {{#quote}}{{throttlingwarningmsg}}{{/quote}},
{{/throttlingwarningmsg}}
{{#loggedinuser}}
loggedinuser: {
profileimageurl: '{{{profileimageurl}}}',
fullname: '{{fullname}}',
firstname: '{{firstname}}'
}
{{/loggedinuser}}
});
});
{{/js}}
@@ -0,0 +1,366 @@
{{!
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_forum/forum_discussion_nested_v2_first_post
Template to render a single post from a discussion.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
<article
id="p{{id}}"
class="forum-post-container"
data-post-id="{{id}}"
data-region="post"
data-target="{{id}}-target"
tabindex="0"
aria-labelledby="post-header-{{id}}-{{uniqid}}"
aria-describedby="post-content-{{id}}"
>
{{! The firstpost and starter classes below aren't used for anything other than to identify the first post in behat. }}
<div
class="d-flex focus-target mb-4 {{#firstpost}}firstpost starter{{/firstpost}}"
aria-label='{{#str}} postbyuser, mod_forum, {"post": "{{subject}}", "user": "{{author.fullname}}"} {{/str}}'
data-post-id="{{id}}" data-content="forum-post"
>
{{#isfirstunread}}<a id="unread" aria-hidden="true"></a>{{/isfirstunread}}
<div class="author-image-container d-inline-block text-center">
{{^isdeleted}}
{{#author}}
{{#urls.profileimage}}
<img
class="rounded-circle w-100"
src="{{{.}}}"
alt="{{#str}} pictureof, core, {{author.fullname}} {{/str}}"
aria-hidden="true"
>
{{/urls.profileimage}}
{{/author}}
{{/isdeleted}}
{{#unread}}
<div class="icon-size-4 text-info text-center mt-3 icon-no-margin">
<span
data-toggle="tooltip"
data-placement="left"
title="{{#str}} unreadpost, mod_forum {{/str}}"
tabindex="0"
>{{#pix}} i/flagged, core {{/pix}}</span>
</div>
{{/unread}}
</div>
<div class="forum-post-core d-flex flex-column w-100" data-region-content="forum-post-core">
<header id="post-header-{{id}}-{{uniqid}}">
{{^isdeleted}}
<div class="d-flex flex-wrap align-items-center mb-1">
<div class="mr-2" tabindex="-1">
{{#author}}
<h4 class="h6 d-lg-inline-block mb-0 author-header mr-1">
{{#parentauthorname}}
{{#isprivatereply}}
<span class="text-danger">
{{#str}}
authorreplyingprivatelytoauthor, mod_forum, {
"respondant":"<a class='font-weight-bold author-name' data-region='author-name' href='{{{urls.profile}}}'>{{fullname}}</a>",
"author":"{{parentauthorname}}"
}
{{/str}}
</span>
{{/isprivatereply}}
{{^isprivatereply}}
{{#str}}
authorreplyingtoauthor, mod_forum, {
"respondant":"<a class='font-weight-bold author-name' data-region='author-name' href='{{{urls.profile}}}'>{{fullname}}</a>",
"author":"{{parentauthorname}}"
}
{{/str}}
{{/isprivatereply}}
{{/parentauthorname}}
{{^parentauthorname}}
<a class='font-weight-bold author-name' data-region='author-name' href="{{{urls.profile}}}">{{fullname}}</a>
{{/parentauthorname}}
</h4>
{{/author}}
{{< core/time_element }}
{{$elementid}}created-{{id}}-{{uniqid}}{{/elementid}}
{{$elementclass}}text-muted{{/elementclass}}
{{$timestampval}}{{timecreated}}{{/timestampval}}
{{$userdateformatval}}{{#str}} strftimerecentfull, core_langconfig {{/str}}{{/userdateformatval}}
{{/core/time_element}}
</div>
<div class="d-flex align-items-center ml-auto">
{{#author.groups}}
{{#urls.image}}
<div class="mr-2">
{{#urls.group}}
<a href="{{urls.group}}" aria-label='{{#str}} memberofgroup, group, {{name}}{{/str}}'>
<img
class="rounded-circle group-image"
src="{{{urls.image}}}"
alt="{{#str}} pictureof, core, {{name}} {{/str}}"
aria-hidden="true"
title="{{#str}} pictureof, core, {{name}} {{/str}}"
>
</a>
{{/urls.group}}
{{^urls.group}}
<img class="rounded-circle group-image"
src="{{{urls.image}}}"
alt="{{#str}} pictureof, core, {{name}} {{/str}}"
title="{{#str}} pictureof, core, {{name}} {{/str}}"
>
{{/urls.group}}
</div>
{{/urls.image}}
{{/author.groups}}
{{^readonly}}
{{#showactionmenu}}
<div class="dropdown">
<button
class="btn btn-icon text-muted icon-no-margin icon-size-3"
type="button"
id="post-actions-menu-{{id}}-{{uniqid}}"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
aria-label="{{#str}} actionsforpost, mod_forum {{/str}}"
>
{{#pix}} i/moremenu {{/pix}}
</button>
<!-- inline style to fix RTL placement bug -->
<div class="dropdown-menu dropdown-menu-right rounded-lg shadow border-0" aria-labelledby="post-actions-menu-{{id}}-{{uniqid}}" style="right: auto" role="menubar">
{{#capabilities}}
{{#view}}
<a
href="{{{urls.view}}}"
class="dropdown-item"
role="menuitem"
>
{{#str}} permalink, mod_forum {{/str}}
</a>
{{/view}}
{{#controlreadstatus}}
{{#unread}}
<a
href="{{{urls.markasread}}}"
class="dropdown-item"
role="menuitem"
>
{{#str}} markread, mod_forum {{/str}}
</a>
{{/unread}}
{{^unread}}
<a
href="{{{urls.markasunread}}}"
class="dropdown-item"
role="menuitem"
>
{{#str}} markunread, mod_forum {{/str}}
</a>
{{/unread}}
{{/controlreadstatus}}
{{#urls.viewparent}}
<a
href="{{{.}}}"
class="dropdown-item"
title="{{#str}} permanentlinktoparentpost, mod_forum {{/str}}"
role="menuitem"
>
{{#str}} parent, mod_forum {{/str}}
</a>
{{/urls.viewparent}}
{{#edit}}
<a
href="{{{urls.edit}}}"
class="dropdown-item"
role="menuitem"
>
{{#str}} edit, mod_forum {{/str}}
</a>
{{/edit}}
{{#split}}
<a
href="{{{urls.split}}}"
class="dropdown-item"
role="menuitem"
>
{{#str}} prune, mod_forum {{/str}}
</a>
{{/split}}
{{#delete}}
<a
href="{{{urls.delete}}}"
class="dropdown-item"
role="menuitem"
>
{{#str}} delete, mod_forum {{/str}}
</a>
{{/delete}}
{{#export}}
<a
href="{{{urls.export}}}"
class="dropdown-item"
role="menuitem"
>
{{#str}} addtoportfolio, core_portfolio {{/str}}
</a>
{{/export}}
{{/capabilities}}
</div>
</div>
{{/showactionmenu}}
{{/readonly}}
</div>
</div>
{{/isdeleted}}
{{$subject}}
<h2
class="h1 font-weight-bold post-subject mt-n2"
data-region-content="forum-post-core-subject"
data-reply-subject="{{replysubject}}"
>{{{subject}}}</h2>
{{/subject}}
{{#hasreplycount}}
<span class="sr-only">{{#str}} numberofreplies, mod_forum, {{replycount}} {{/str}}</span>
{{/hasreplycount}}
</header>
<div class="post-message pr-md-5" id="post-content-{{id}}">
{{{message}}}
</div>
{{^isdeleted}}
{{#attachments}}
{{#isimage}}
<div class="attachedimages">
<img
src="{{{url}}}"
alt="{{#str}} attachmentname, mod_forum, {{filename}} {{/str}}"
style="max-width: 100%"
>
{{#urls.export}}
<a href="{{{.}}}" title="{{#str}} addtoportfolio, core_portfolio {{/str}}">
{{#pix}} t/portfolioadd, core {{/pix}}
</a>
{{/urls.export}}
{{#html.plagiarism}}
<div>{{{.}}}</div>
{{/html.plagiarism}}
</div>
{{/isimage}}
{{/attachments}}
{{#attachments}}
{{^isimage}}
<div class="mt-3">
<span class="icon-size-6">{{#pix}} {{icon}}, core {{/pix}}</span>
<div class="align-bottom d-inline-block">
<a
href="{{{url}}}"
aria-label="{{#str}} attachmentname, mod_forum, {{filename}} {{/str}}"
class="font-weight-bold"
>
{{#str}} attachmentnameandfilesize, mod_forum, {"name": "{{filename}}", "size": "{{filesizeformatted}}"} {{/str}}
</a>
{{#urls.export}}
<a class="icon-no-margin" href="{{{.}}}" title="{{#str}} exportattachmentname, mod_forum, {{filename}} {{/str}}">
{{#pix}} t/portfolioadd, core {{/pix}}
</a>
{{/urls.export}}
{{#html.plagiarism}}
<div>{{{.}}}</div>
{{/html.plagiarism}}
</div>
</div>
{{/isimage}}
{{/attachments}}
<div class="d-flex mt-3 align-items-center">
{{^readonly}}
{{#html.rating}}
<div>{{{.}}}</div>
{{/html.rating}}
{{/readonly}}
<div class="ml-auto d-flex flex-column">
{{#haswordcount}}
<span class="ml-auto badge bg-light text-dark">
{{#str}} numwords, core, {{wordcount}} {{/str}}
</span>
{{/haswordcount}}
{{#html.taglist}}
<div class="d-inline-block ml-auto {{#haswordcount}}mt-2{{/haswordcount}}">{{{.}}}</div>
{{/html.taglist}}
</div>
</div>
{{/isdeleted}}
{{$footer}}
{{^isdeleted}}
{{^readonly}}
<div class="d-flex mt-3">
{{#capabilities.reply}}
<button
class="btn btn-primary btn-lg font-weight-bold px-4"
data-href="{{{urls.reply}}}"
data-post-id="{{id}}"
data-action="create-inpage-reply"
data-can-reply-privately="{{capabilities.canreplyprivately}}"
>
{{#str}} reply, mod_forum {{/str}}
</button>
{{/capabilities.reply}}
{{^capabilities.reply}}
{{#discussionlocked}}
<button class="btn btn-secondary btn-lg disabled" disabled>
{{#str}} reply, mod_forum {{/str}}
</button>
{{/discussionlocked}}
{{/capabilities.reply}}
</div>
{{/readonly}}
{{/isdeleted}}
{{#discussionlocked}}
<div><span class="badge bg-danger text-white mt-2">{{#str}} locked, mod_forum {{/str}}</span></div>
{{/discussionlocked}}
{{/footer}}
</div>
</div>
{{$replies}}
<div class="indent inline-reply-container" data-region="inpage-reply-container"></div>
<div class="indent replies-container" data-region="replies-container">
{{#hasreplies}}
{{#replies}}
{{> mod_forum/forum_discussion_nested_v2_post_reply }}
{{/replies}}
{{/hasreplies}}
</div>
{{/replies}}
</article>
@@ -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 mod_forum/forum_discussion_nested_v2_post_reply
Template to render a single post from a discussion.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
{{< mod_forum/forum_discussion_nested_v2_first_post }}
{{$subject}}
<h3
{{#isdeleted}}class="h6 font-weight-bold"{{/isdeleted}}
{{^isdeleted}}class="sr-only"{{/isdeleted}}
data-region-content="forum-post-core-subject"
>{{{subject}}}</h3>
{{/subject}}
{{$footer}}
{{^isdeleted}}
{{^readonly}}
{{#capabilities.reply}}
<div class="d-flex mt-1">
<button
class="font-weight-bold btn btn-link px-0"
data-href="{{{urls.reply}}}"
data-post-id="{{id}}"
data-action="create-inpage-reply"
data-can-reply-privately="{{capabilities.canreplyprivately}}"
>
{{#str}} reply, mod_forum {{/str}}
</button>
</div>
{{/capabilities.reply}}
{{/readonly}}
{{/isdeleted}}
{{/footer}}
{{$replies}}
<div class="indent my-4" data-region="replies-visibility-toggle-container" style="display: none">
<button class="btn btn-link pl-0" data-action="show-replies">
{{#str}}
showpreviousrepliescount,
mod_forum,
<span data-region="reply-count">{{#totalreplycount}}{{.}}{{/totalreplycount}}{{^totalreplycount}}0{{/totalreplycount}}</span>
{{/str}}
</button>
<button class="btn btn-link hidden pl-0" data-action="hide-replies">
{{#str}}
hidepreviousrepliescount,
mod_forum,
<span data-region="reply-count">{{#totalreplycount}}{{.}}{{/totalreplycount}}{{^totalreplycount}}0{{/totalreplycount}}</span>
{{/str}}
</button>
</div>
<div class="indent replies-container" data-region="replies-container">
{{#hasreplies}}
{{#replies}}
{{> mod_forum/forum_discussion_nested_v2_post_reply }}
{{/replies}}
{{/hasreplies}}
</div>
<div class="indent inline-reply-container" data-region="inpage-reply-container"></div>
{{/replies}}
{{/ mod_forum/forum_discussion_nested_v2_first_post }}
@@ -0,0 +1,34 @@
{{!
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_forum/forum_discussion_nested_v2_posts
Template to render a list of posts for a discussion.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
{{#posts}}
{{> mod_forum/forum_discussion_nested_v2_first_post }}
{{/posts}}
@@ -0,0 +1,340 @@
{{!
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_forum/forum_discussion_post
Template to render a single post from a discussion.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
<article
id="p{{id}}"
class="forum-post-container mb-2"
data-post-id="{{id}}"
data-region="post"
data-target="{{id}}-target"
tabindex="0"
aria-labelledby="post-header-{{id}}-{{uniqid}}"
aria-describedby="post-content-{{id}}"
>
{{! The firstpost and starter classes below aren't used for anything other than to identify the first post in behat. }}
<div
class="d-flex border p-2 mb-2 forumpost focus-target {{#unread}}unread{{/unread}} {{#firstpost}}firstpost starter{{/firstpost}}"
aria-label='{{#str}} postbyuser, mod_forum, {"post": "{{subject}}", "user": "{{author.fullname}}"} {{/str}}'
data-post-id="{{id}}" data-content="forum-post"
>
{{#isfirstunread}}<a id="unread" aria-hidden="true"></a>{{/isfirstunread}}
<div class="d-flex flex-column w-100" data-region-content="forum-post-core">
<header id="post-header-{{id}}-{{uniqid}}" class="mb-2 header row d-flex">
{{^isdeleted}}
{{#author}}
<div class="mr-2" style="width: 45px;">
{{#urls.profileimage}}
<img
class="rounded-circle w-100"
src="{{{.}}}"
alt="{{#str}} pictureof, core, {{author.fullname}} {{/str}}"
aria-hidden="true"
title="{{#str}} pictureof, core, {{author.fullname}} {{/str}}"
>
{{/urls.profileimage}}
</div>
{{/author}}
{{/isdeleted}}
<div class="d-flex flex-column">
{{#parentauthorname}}
<span class="sr-only">{{#str}} inreplyto, mod_forum, {{.}} {{/str}}</span>
{{/parentauthorname}}
{{$subjectheading}}
<h3 {{!
}}class="h6 font-weight-bold mb-0" {{!
}}data-region-content="forum-post-core-subject" {{!
}}data-reply-subject="{{replysubject}}" {{!
}}>{{$subject}}{{{subject}}}{{/subject}}</h3>
{{/subjectheading}}
{{^isdeleted}}
<div class="mb-3" tabindex="-1">
{{#html.authorsubheading}}{{{.}}}{{/html.authorsubheading}}
{{^html.authorsubheading}}
{{< core/time_element }}
{{$elementid}}created-{{id}}-{{uniqid}}{{/elementid}}
{{$timestampval}}{{timecreated}}{{/timestampval}}
{{$userdateformatval}}{{#str}} strftimedaydatetime, core_langconfig {{/str}}{{/userdateformatval}}
{{/core/time_element}}
{{/html.authorsubheading}}
</div>
{{/isdeleted}}
{{#isprivatereply}}
<div class="privatereplyinfo">
{{#str}}postisprivatereply, forum{{/str}}
</div>
{{/isprivatereply}}
{{#hasreplycount}}
<span class="sr-only">{{#str}} numberofreplies, mod_forum, {{replycount}} {{/str}}</span>
{{/hasreplycount}}
</div>
</header>
<div class="d-flex body-content-container">
{{^isdeleted}}
{{#author}}
<div class="mr-2 author-groups-container" style="width: 45px; flex-shrink: 0">
{{#groups}}
{{#urls.group}}
{{#urls.image}}
<a href="{{urls.group}}" role="button" aria-label='{{#str}} memberofgroup, group, {{name}}{{/str}}'>
<img
class="rounded-circle w-100"
src="{{{.}}}"
alt="{{#str}} pictureof, core, {{name}} {{/str}}"
aria-hidden="true"
title="{{#str}} pictureof, core, {{name}} {{/str}}"
>
</a>
{{/urls.image}}
{{/urls.group}}
{{^urls.group}}
{{#urls.image}}
<img class="rounded-circle w-100"
src="{{{.}}}"
alt="{{#str}} pictureof, core, {{name}} {{/str}}"
title="{{#str}} pictureof, core, {{name}} {{/str}}"
>
{{/urls.image}}
{{/urls.group}}
{{/groups}}
</div>
{{/author}}
{{/isdeleted}}
<div class="no-overflow w-100 content-alignment-container">
<div id="post-content-{{id}}" class="post-content-container">
{{{message}}}
</div>
{{^isdeleted}}
{{#haswordcount}}
<p class="font-italic mb-0"><small>{{#str}} numwords, core, {{wordcount}} {{/str}}</small></p>
{{/haswordcount}}
{{#attachments}}
{{#isimage}}
<div class="attachedimages">
<img
src="{{{url}}}"
alt="{{#str}} attachmentname, mod_forum, {{filename}} {{/str}}"
style="max-width: 100%"
>
{{#urls.export}}
<a href="{{{.}}}" title="{{#str}} addtoportfolio, core_portfolio {{/str}}">
{{#pix}} t/portfolioadd, core {{/pix}}
</a>
{{/urls.export}}
{{#html.plagiarism}}
<div>{{{.}}}</div>
{{/html.plagiarism}}
</div>
{{/isimage}}
{{/attachments}}
{{{html.taglist}}}
{{#attachments}}
{{^isimage}}
<div>
<a
href="{{{url}}}"
aria-label="{{#str}} attachmentname, mod_forum, {{filename}} {{/str}}"
>
{{#pix}} {{icon}}, core {{/pix}} {{filename}}
</a>
{{#urls.export}}
<a href="{{{.}}}" title="{{#str}} exportattachmentname, mod_forum, {{filename}} {{/str}}">
{{#pix}} t/portfolioadd, core {{/pix}}
</a>
{{/urls.export}}
{{#html.plagiarism}}
<div>{{{.}}}</div>
{{/html.plagiarism}}
</div>
{{/isimage}}
{{/attachments}}
{{^readonly}}
<div class="d-flex flex-wrap">
{{#html.rating}}
<div class="mt-2">{{{.}}}</div>
{{/html.rating}}
{{$actions}}
<div
class="post-actions d-flex align-self-end justify-content-end flex-wrap ml-auto"
data-region="post-actions-container"
role="menubar"
aria-label='{{#str}} postbyuser, mod_forum, {"post": "{{subject}}", "user": "{{author.fullname}}"} {{/str}}'
aria-controls="p{{id}}"
>
{{#capabilities}}
{{#view}}
<a
data-region="post-action"
href="{{{urls.view}}}"
class="btn btn-link"
title="{{#str}} permanentlinktopost, mod_forum {{/str}}"
aria-label="{{#str}} permanentlinktopost, mod_forum {{/str}}"
role="menuitem"
>
{{#str}} permalink, mod_forum {{/str}}
</a>
{{/view}}
{{#controlreadstatus}}
{{#unread}}
<a
data-region="post-action"
href="{{{urls.markasread}}}"
class="btn btn-link"
role="menuitem"
>
{{#str}} markread, mod_forum {{/str}}
</a>
{{/unread}}
{{^unread}}
<a
data-region="post-action"
href="{{{urls.markasunread}}}"
class="btn btn-link"
role="menuitem"
>
{{#str}} markunread, mod_forum {{/str}}
</a>
{{/unread}}
{{/controlreadstatus}}
{{#urls.viewparent}}
<a
data-region="post-action"
href="{{{.}}}"
class="btn btn-link"
title="{{#str}} permanentlinktoparentpost, mod_forum {{/str}}"
aria-label="{{#str}} permanentlinktoparentpost, mod_forum {{/str}}"
role="menuitem"
>
{{#str}} parent, mod_forum {{/str}}
</a>
{{/urls.viewparent}}
{{#edit}}
<a
data-region="post-action"
href="{{{urls.edit}}}"
class="btn btn-link"
role="menuitem"
>
{{#str}} edit, mod_forum {{/str}}
</a>
{{/edit}}
{{#split}}
<a
data-region="post-action"
href="{{{urls.split}}}"
class="btn btn-link"
role="menuitem"
>
{{#str}} prune, mod_forum {{/str}}
</a>
{{/split}}
{{#delete}}
<a
data-region="post-action"
href="{{{urls.delete}}}"
class="btn btn-link"
role="menuitem"
>
{{#str}} delete, mod_forum {{/str}}
</a>
{{/delete}}
{{#reply}}
{{$replyoutput}}
<a
data-region="post-action"
href="{{{urls.reply}}}"
class="btn btn-link"
data-post-id="{{id}}"
data-action="collapsible-link"
data-can-reply-privately="{{canreplyprivately}}"
title="{{#str}} reply, mod_forum {{/str}}"
role="menuitem"
>
{{#str}} reply, mod_forum {{/str}}
</a>
{{/replyoutput}}
{{/reply}}
{{^reply}}
{{#selfenrol}}
{{$replyoutput}}
<a
href="{{{urls.reply}}}"
class="btn btn-link"
data-post-id="{{id}}"
data-can-reply-privately="{{canreplyprivately}}"
title="{{#str}} reply, mod_forum {{/str}}"
role="menuitem"
>
{{#str}} reply, mod_forum {{/str}}
</a>
{{/replyoutput}}
{{/selfenrol}}
{{/reply}}
{{#export}}
<a
data-region="post-action"
href="{{{urls.export}}}"
class="btn btn-link"
role="menuitem"
>
{{#str}} addtoportfolio, core_portfolio {{/str}}
</a>
{{/export}}
{{/capabilities}}
</div>
{{/actions}}
</div>
{{/readonly}}
{{$footer}}{{/footer}}
{{/isdeleted}}
</div>
</div>
</div>
</div>
{{$replies}}
<div data-region="replies-container">
{{#hasreplies}}
{{#replies}}
{{> mod_forum/forum_discussion_post }}
{{/replies}}
{{/hasreplies}}
</div>
{{/replies}}
</article>
@@ -0,0 +1,34 @@
{{!
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_forum/forum_discussion_posts
Template to render a list of posts for a discussion.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
{{#posts}}
{{> mod_forum/forum_discussion_post }}
{{/posts}}
@@ -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_forum/forum_discussion_threaded_post
Template to render a single post from a discussion in a threaded format.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
<div
class="mb-2"
data-post-id="{{id}}"
data-region="post"
data-target="{{id}}-target"
tabindex="-1"
>
<a href="{{{urls.viewisolated}}}">{{subject}}</a>
{{^isdeleted}}
{{{html.authorsubheading}}}
{{/isdeleted}}
<div data-region="replies-container">
<div class="indent">
{{#replies}}
{{> mod_forum/forum_discussion_threaded_post }}
{{/replies}}
</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 mod_forum/forum_discussion_threaded_posts
Template to render a list of posts in a threaded format.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
{{#posts}}
{{< mod_forum/forum_discussion_post }}
{{$replies}}
{{! The forumthread class is only added for behat. }}
<div class="indent forumthread post-replies" data-region="replies-container">
{{#replies}}
{{> mod_forum/forum_discussion_threaded_post }}
{{/replies}}
</div>
{{/replies}}
{{/ mod_forum/forum_discussion_post }}
{{/posts}}
@@ -0,0 +1,56 @@
{{!
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_forum/forum_new_discussion_actionbar
Add button to create a new discussion in the forum activity.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* see mod/forum/classes/output/activity_actionbar.php
Example context (json):
{
"forum": {
"id": 3,
"name": "Forum test",
"state": [],
"userstate": "",
"capabilities": [{
"viewdiscussions": true,
"create": true,
"selfenrol": false
}],
"urls": [{
"create": "http://localhost/mod/forum/post.php?forum=11"
}]
}
}
}}
{{#forum.capabilities.create}}
<a class="btn btn-primary" data-toggle="collapse" href="#collapseAddForm">
{{#str}}addanewdiscussion, forum{{/str}}
</a>
{{/forum.capabilities.create}}
{{^forum.capabilities.create}}
{{#forum.capabilities.selfenrol}}
<a class="btn btn-primary" href="{{forum.urls.create}}">
{{#str}}addanewdiscussion, forum{{/str}}
</a>
{{/forum.capabilities.selfenrol}}
{{/forum.capabilities.create}}
@@ -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_forum/forum_post_email_htmlemail
Template which defines a forum post for sending in a single-post HTML email.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* courselink
* coursename
* forumindexlink
* forumviewlink
* forumname
* discussionlink
* discussionname
* showdiscussionname
* firstpost
* subject
* authorlink
* authorpicture
* authorfullname
* postdate
* grouppicture
* attachments
* message
* parentpostlink
* canreply
* replylink
* permalink
* unsubscribeforumlink
* unsubscribediscussionlink
Example context (json):
{
"courselink": "https://example.com/course/view.php?id=2",
"coursename": "Example course",
"forumindexlink": "https://example.com/mod/forum/index.php?id=2",
"forumviewlink": "https://example.com/mod/forum/view.php?f=2",
"forumname": "Lorem ipsum dolor",
"discussionlink": "https://example.com/mod/forum/discuss.php?d=70",
"discussionname": "Is Lorem ipsum Latin?",
"showdiscussionname": 1,
"firstpost": 1,
"subject": "Is Lorem ipsum Latin?",
"authorlink": "https://example.com/user/view.php?id=2&course=2",
"authorpicture": "<a href=\"https://example.com/user/view.php?id=2&amp;course=6\"><img src=\"https://example.com/theme/image.php?theme=clean&amp;component=core&amp;image=u%2Ff2&amp;svg=0\" alt=\"Picture of Admin User\" title=\"Picture of Admin User\" class=\"userpicture defaultuserpic\" width=\"35\" height=\"35\" /></a>",
"authorfullname": "Lucius Caecilius lucundus",
"postdate": "Sunday, 13 September 2015, 2:22 pm",
"grouppicture": "",
"attachments": "",
"message": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum et auctor libero. Quisque porta egestas neque, et bibendum libero dignissim at. Nulla facilisi. Morbi eget accumsan felis. Nunc et vulputate odio, vel venenatis nisl. Nunc maximus ipsum sed tincidunt mollis. Integer nunc erat, luctus sit amet arcu tincidunt, volutpat dignissim mi. Sed ut magna quam. Mauris accumsan porta turpis sed aliquam. Etiam at justo tristique, imperdiet augue quis, consectetur sapien. Ut nec erat malesuada sem suscipit lobortis. Vivamus posuere nibh eu ipsum porta fringilla. Sed vitae dapibus ipsum, ac condimentum enim. Sed dignissim ante at elit mollis, ac tempor lacus iaculis. Etiam nec lectus vitae nibh vulputate volutpat. Nulla quis tellus aliquam, commodo nisi et, dictum est.</p><p><br /></p>",
"parentpostlink": "",
"canreply": 1,
"replylink": "https://example.com/mod/forum/post.php?reply=2",
"permalink": "https://example.com/mod/forum/discuss.php?d=2#2",
"unsubscribeforumlink": "https://example.com/mod/forum/subscribe.php?id=2",
"unsubscribediscussionlink": "https://example.com/mod/discussion/subscribe.php?id=2&d=2"
}
}}
<div class="navbar">
<div class="container-fluid p-0">
<a target="_blank" href="{{{ courselink }}}">{{{ coursename }}}</a>
&raquo;
<a target="_blank" href="{{{ forumindexlink }}}">{{# str }} forums, forum {{/ str }}</a>
&raquo;
<a target="_blank" href="{{{ forumviewlink }}}">{{{ forumname }}}</a>
{{# showdiscussionname }}
&raquo;
<a target="_blank" href="{{{ discussionlink }}}">{{{ discussionname }}}</a>
{{/ showdiscussionname }}
</div>
</div>
{{> mod_forum/forum_post_email_htmlemail_body }}
<hr />
<div class="mdl-align unsubscribelink">
{{# unsubscribeforumlink }}
<a href="{{{ unsubscribeforumlink }}}">{{# str }} unsubscribe, forum {{/ str }}</a>&nbsp;
{{/ unsubscribeforumlink }}
{{# unsubscribediscussionlink }}
<a href="{{{ unsubscribediscussionlink }}}">{{# str }} unsubscribediscussion, forum {{/ str }}</a>&nbsp;
{{/ unsubscribediscussionlink }}
<a href="{{{ forumindexlink }}}">{{# str }} digestmailpost, forum {{/ str }}</a>
</div>
@@ -0,0 +1,147 @@
{{!
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_forum/forum_post_email_htmlemail_body
Template which defines the body component of a forum post for sending in a single-post HTML email.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* courselink
* coursename
* forumindexlink
* forumviewlink
* forumname
* discussionlink
* discussionname
* showdiscussionname
* firstpost
* subject
* authorlink
* authorpicture
* authorfullname
* postdate
* grouppicture
* attachments
* message
* parentpostlink
* canreply
* replylink
* permalink
* unsubscribeforumlink
* unsubscribediscussionlink
* isprivatereply
Example context (json):
{
"courselink": "https://example.com/course/view.php?id=2",
"coursename": "Example course",
"forumindexlink": "https://example.com/mod/forum/index.php?id=2",
"forumviewlink": "https://example.com/mod/forum/view.php?f=2",
"forumname": "Lorem ipsum dolor",
"discussionlink": "https://example.com/mod/forum/discuss.php?d=70",
"discussionname": "Is Lorem ipsum Latin?",
"showdiscussionname": 1,
"firstpost": 1,
"subject": "Is Lorem ipsum Latin?",
"authorlink": "https://example.com/user/view.php?id=2&course=2",
"authorpicture": "<a href=\"https://example.com/user/view.php?id=2&amp;course=6\"><img src=\"https://example.com/theme/image.php?theme=clean&amp;component=core&amp;image=u%2Ff2&amp;svg=0\" alt=\"Picture of Admin User\" title=\"Picture of Admin User\" class=\"userpicture defaultuserpic\" width=\"35\" height=\"35\" /></a>",
"authorfullname": "Lucius Caecilius lucundus",
"postdate": "Sunday, 13 September 2015, 2:22 pm",
"grouppicture": "",
"attachments": "",
"message": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum et auctor libero. Quisque porta egestas neque, et bibendum libero dignissim at. Nulla facilisi. Morbi eget accumsan felis. Nunc et vulputate odio, vel venenatis nisl. Nunc maximus ipsum sed tincidunt mollis. Integer nunc erat, luctus sit amet arcu tincidunt, volutpat dignissim mi. Sed ut magna quam. Mauris accumsan porta turpis sed aliquam. Etiam at justo tristique, imperdiet augue quis, consectetur sapien. Ut nec erat malesuada sem suscipit lobortis. Vivamus posuere nibh eu ipsum porta fringilla. Sed vitae dapibus ipsum, ac condimentum enim. Sed dignissim ante at elit mollis, ac tempor lacus iaculis. Etiam nec lectus vitae nibh vulputate volutpat. Nulla quis tellus aliquam, commodo nisi et, dictum est.</p><p><br /></p>",
"parentpostlink": "",
"canreply": 1,
"replylink": "https://example.com/mod/forum/post.php?reply=2",
"permalink": "https://example.com/mod/forum/discuss.php?d=2#2",
"unsubscribeforumlink": "https://example.com/mod/forum/subscribe.php?id=2",
"unsubscribediscussionlink": "https://example.com/mod/discussion/subscribe.php?id=2&d=2"
}
}}
<table border="0" cellpadding="3" cellspacing="0" class="forumpost">
<tr class="header">
<td width="35" valign="top" class="picture left">
{{{ authorpicture }}}
</td>
<td class="topic {{# firstpost }}starter{{/ firstpost }}">
<div class="subject">
{{{ subject }}}
</div>
<div class="author">
{{# str }} bynameondate, forum, {
"name": {{# quote }}<a target='_blank' href='{{{ authorlink }}}'>{{ authorfullname }}</a>{{/ quote }},
"date": {{# quote }}{{ postdate }}{{/ quote }}
} {{/ str }}
</div>
{{# isprivatereply }}
<div class="privatereplyinfo">
{{# str }} postisprivatereply, forum {{/ str }}
</div>
{{/ isprivatereply }}
</td>
</tr>
<tr>
<td class="left side" valign="top">
{{# grouppicture }}
{{{ grouppicture }}}
{{/ grouppicture }}
{{^ grouppicture }}
&nbsp;
{{/ grouppicture }}
</td>
<td class="content">
{{# attachments }}
<div class="attachments">
{{{ attachments }}}
</div>
{{/ attachments }}
{{{ message }}}
<div class="commands">
{{^ firstpost }}
<a target="_blank" href="{{{ parentpostlink }}}">
{{# str }} parent, forum {{/ str }}
</a>
{{# canreply }}
{{^ isprivatereply }}
|
{{/ isprivatereply }}
{{/ canreply }}
{{/ firstpost }}
{{# canreply }}
{{^ isprivatereply }}
<a target="_blank" href="{{{ replylink }}}">
{{# str }} reply, forum {{/ str }}
</a>
{{/ isprivatereply }}
{{/ canreply }}
</div>
<div class="link">
<a target="_blank" href="{{{ permalink }}}">
{{# str }} postincontext, forum {{/ str }}
</a>
</div>
</td>
</tr>
</table>
@@ -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_forum/forum_post_email_textemail
Template which defines a forum post for sending in a single-post text email.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* coursename
* forumname
* showdiscussionname
* discussionname
* permalink
* subject
* authorfullname
* postdate
* message
* attachments
* canreply
* replylink
* unsubscribeforumlink
* unsubscribediscussionlink
* forumindexlink
* isprivatereply
}}
{{{ coursename }}} -> {{# str }} forums, forum {{/ str }} -> {{{ forumname }}}{{# showdiscussionname }} -> {{{ discussionname }}} {{/ showdiscussionname }}
{{ permalink }}
{{{ subject }}}
{{# str }} bynameondate, forum, {
"name": {{# quote }}{{{ authorfullname }}}{{/ quote }},
"date": {{# quote}}{{ postdate }}{{/ quote }}
} {{/ str }}
{{# isprivatereply }}
{{# str }} postisprivatereply, forum {{/ str }}
{{/ isprivatereply }}
---------------------------------------------------------------------
{{{ message }}}
{{{ attachments }}}
---------------------------------------------------------------------
{{# str }} postmailinfo, forum, {{{ coursename }}} {{/ str }}
{{# canreply }}
{{^ isprivatereply }}
{{# str }} postmailreply, forum, {{{ replylink }}} {{/ str }}
{{/ isprivatereply }}
{{/ canreply }}
{{# unsubscribeforumlink }}
{{# str }} unsubscribelink, forum, {{{ unsubscribeforumlink }}} {{/ str }}
{{/ unsubscribeforumlink }}
{{# unsubscribediscussionlink }}
{{# str }} unsubscribediscussionlink, forum, {{{ unsubscribediscussionlink }}} {{/ str }}
{{/ unsubscribediscussionlink }}
{{# str }} digestmailpostlink, forum, {{{ forumindexlink }}} {{/ str }}
@@ -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_forum/forum_post_emaildigestbasic_htmlemail
Template which defines a forum post for sending in a single-post HTML email.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* permalink
* subject
* authorlink
* authorfullname
* postdate
Example context (json):
{
"permalink": "https://example.com/mod/forum/discuss.php?d=2#2",
"subject": "Is Lorem ipsum Latin?",
"authorlink": "https://example.com/user/view.php?id=2&course=2",
"authorfullname": "Lucius Caecilius lucundus",
"postdate": "Sunday, 13 September 2015, 2:22 pm"
}
}}
<div>
<a target="_blank" href="{{{ permalink }}}">{{{ subject }}}</a>
{{# str }} bynameondate, forum, {
"name": {{# quote }}<a target="_blank" href="{{{ authorlink }}}">{{ authorfullname }}</a>{{/ quote }},
"date": {{# quote }}{{ postdate }}{{/ quote }}
} {{/ str }}
</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 mod_forum/forum_post_emaildigestbasic_textemail
Template which defines a forum post for sending in a single-post text email.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* discussionlink
* subject
* authorfullname
* postdate
}}
{{ discussionlink }}
{{{ subject }}} {{# str }} bynameondate, forum, {
"name": {{# quote }}{{{ authorfullname }}}{{/ quote }},
"date": {{# quote }}{{ postdate }}{{/ quote }}
} {{/ str }}
---------------------------------------------------------------------
@@ -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 mod_forum/forum_post_emaildigestfull_htmlemail
Template which defines a forum post for sending in a single-post HTML email.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* courselink
* coursename
* forumindexlink
* forumviewlink
* forumname
* discussionlink
* discussionname
* showdiscussionname
* firstpost
* subject
* authorlink
* authorpicture
* authorfullname
* postdate
* grouppicture
* attachments
* message
* parentpostlink
* canreply
* replylink
* permalink
* unsubscribeforumlink
* unsubscribediscussionlink
Example context (json):
{
"courselink": "https://example.com/course/view.php?id=2",
"coursename": "Example course",
"forumindexlink": "https://example.com/mod/forum/index.php?id=2",
"forumviewlink": "https://example.com/mod/forum/view.php?f=2",
"forumname": "Lorem ipsum dolor",
"discussionlink": "https://example.com/mod/forum/discuss.php?d=70",
"discussionname": "Is Lorem ipsum Latin?",
"showdiscussionname": 1,
"firstpost": 1,
"subject": "Is Lorem ipsum Latin?",
"authorlink": "https://example.com/user/view.php?id=2&course=2",
"authorpicture": "<a href=\"https://example.com/user/view.php?id=2&amp;course=6\"><img src=\"https://example.com/theme/image.php?theme=clean&amp;component=core&amp;image=u%2Ff2&amp;svg=0\" alt=\"Picture of Admin User\" title=\"Picture of Admin User\" class=\"userpicture defaultuserpic\" width=\"35\" height=\"35\" /></a>",
"authorfullname": "Lucius Caecilius lucundus",
"postdate": "Sunday, 13 September 2015, 2:22 pm",
"grouppicture": "",
"attachments": "",
"message": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum et auctor libero. Quisque porta egestas neque, et bibendum libero dignissim at. Nulla facilisi. Morbi eget accumsan felis. Nunc et vulputate odio, vel venenatis nisl. Nunc maximus ipsum sed tincidunt mollis. Integer nunc erat, luctus sit amet arcu tincidunt, volutpat dignissim mi. Sed ut magna quam. Mauris accumsan porta turpis sed aliquam. Etiam at justo tristique, imperdiet augue quis, consectetur sapien. Ut nec erat malesuada sem suscipit lobortis. Vivamus posuere nibh eu ipsum porta fringilla. Sed vitae dapibus ipsum, ac condimentum enim. Sed dignissim ante at elit mollis, ac tempor lacus iaculis. Etiam nec lectus vitae nibh vulputate volutpat. Nulla quis tellus aliquam, commodo nisi et, dictum est.</p><p><br /></p>",
"parentpostlink": "",
"canreply": 1,
"replylink": "https://example.com/mod/forum/post.php?reply=2",
"permalink": "https://example.com/mod/forum/discuss.php?d=2#2",
"unsubscribeforumlink": "https://example.com/mod/forum/subscribe.php?id=2",
"unsubscribediscussionlink": "https://example.com/mod/discussion/subscribe.php?id=2&d=2"
}
}}
{{> mod_forum/forum_post_email_htmlemail_body }}
@@ -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_forum/forum_post_emaildigestfull_textemail
Template which defines a forum post for sending in a single-post text email.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* discussionlink
* subject
* permalink
* authorfullname
* postdate
* message
* attachments
* forumindexlink
}}
{{ discussionlink }}
{{{ subject }}} ({{{ permalink }}})
{{# str }} bynameondate, forum, {
"name": {{# quote }}{{{ authorfullname }}}{{/ quote }},
"date": {{# quote }}{{ postdate }}{{/ quote }}
} {{/ str }}
---------------------------------------------------------------------
{{{ message }}}
{{# attachments }}
{{{ attachments }}}
{{/ attachments }}
---------------------------------------------------------------------
{{# str }} digestmailpostlink, forum, {{{ forumindexlink }}} {{/ str }}
@@ -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_forum/forum_post_subject_with_context_links
Template to render a breadcrumb-style subject.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
"coursename": "Test course",
"forumname": "Test forum",
"discussionname": "Test discussion",
"subject": "Test post subject",
"urls": {
"viewcourse": "#",
"viewforum": "#",
"viewdiscussion": "#",
"viewparent": "#"
},
"showdiscussionname": true,
"hasparent": true
}
}}
{{#coursename}}
{{#urls.viewcourse}}
<a href="{{{urls.viewcourse}}}">{{{coursename}}}</a> ->
{{/urls.viewcourse}}
{{^urls.viewcourse}}
{{coursename}} ->
{{/urls.viewcourse}}
{{/coursename}}
{{#urls.viewforum}}
<a href="{{{urls.viewforum}}}">{{{forumname}}}</a>
{{/urls.viewforum}}
{{^urls.viewforum}}
{{{forumname}}}
{{/urls.viewforum}}
{{#showdiscussionname}}
{{#urls.viewdiscussion}}
-> <a href="{{{urls.viewdiscussion}}}">{{{discussionname}}}</a>
{{/urls.viewdiscussion}}
{{^urls.viewdiscussion}}
{{{discussionname}}}
{{/urls.viewdiscussion}}
{{#hasparent}}
{{#urls.viewparent}}
-> <a href="{{{urls.viewparent}}}">{{{subject}}}</a>
{{/urls.viewparent}}
{{^urls.viewparent}}
{{{subject}}}
{{/urls.viewparent}}
{{/hasparent}}
{{/showdiscussionname}}
@@ -0,0 +1,43 @@
{{!
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_forum/forum_posts_with_context_links
Template to render a list of posts with breadcrumb style subject and a link
in the footer to the full discussion.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
{{#posts}}
{{< mod_forum/forum_discussion_post }}
{{$subject}}
{{> mod_forum/forum_post_subject_with_context_links }}
{{/subject}}
{{$replies}}{{/replies}}
{{$footer}}
<div><a href="{{{urls.view}}}">{{#str}} postincontext, mod_forum {{/str}}</a></div>
{{/footer}}
{{/ mod_forum/forum_discussion_post }}
{{/posts}}
@@ -0,0 +1,69 @@
{{!
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_forum/forum_search_results
Template to render results for the forum post search.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
"posts": [
{
"id": 1,
"subject": "Re: Test discussion",
"message": "Reply to post by Sam Student",
"author": {
"id": 2,
"fullname": "Sam Student"
},
"discussionid": 3,
"capabilities": {
"view": true,
"edit": true,
"delete": true,
"split": true,
"reply": true
},
"html": {
"authorsubheading": "by <a href=\"#\">Sam Student<\/a> - <time>Friday, 7 February 2020, 11:55 AM<\/time>"
},
"forumname": "Forum",
"discussionname": "<span class=\"highlight\">Test<\/span> discussion",
"showdiscussionname": true
}
]
}
}}
{{< mod_forum/forum_posts_with_context_links}}
{{$subjectheading}}
<h4 {{!
}}class="h6 font-weight-bold mb-0" {{!
}}data-region-content="forum-post-core-subject" {{!
}}data-reply-subject="{{replysubject}}" {{!
}}>
{{$subject}}
{{> mod_forum/forum_post_subject_with_context_links }}
{{/subject}}
</h4>
{{/subjectheading}}
{{/ mod_forum/forum_posts_with_context_links}}
@@ -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_forum/forum_subscription_action
Actions bar for the subscribers page UI.
Classes required for JS:
* none
Data attributes required for JS:
* data-region
Context variables required for this template:
* see mod/forum/classes/output/subscription_actionbar.php
Example context (json):
{
"subscriptionoptions": {
"formid": "selectsubscriptions",
"classes": "urlselect float-right",
"disabled": false,
"sesskey": "abcdef",
"action": "http://localhost/course/jumpto.php",
"helpicon": false,
"options": [
{
"name": "Subscription disabled",
"value": ""
},
{
"name": "Optional subscrition",
"value": "/mod/forum/subscribe.php?id=3&mode=0&sesskey=abc123"
}
]
},
"viewandmanageselect": {
"formid": "selectviewandmanagesubscribers",
"classes": "urlselect",
"label": "Subscribers",
"disabled": false,
"sesskey": "abcdef",
"action": "http://localhost/course/jumpto.php",
"options": [
{
"name": "View subscribers",
"value": "/mod/forum/subscribers.php?id=3&edit=off",
"selected": true
},
{
"name": "Manage subscribers",
"value": "/mod/forum/subscribers.php?id=3&edit=on",
"selected": false
}
]
}
}
}}
<div class="container-fluid tertiary-navigation">
<div class="row">
{{#viewandmanageselect}}
<div class="navitem">
{{>core/url_select}}
</div>
{{/viewandmanageselect}}
{{#subscriptionoptions}}
<div class="navitem ml-sm-auto">
{{>core/url_select}}
</div>
{{/subscriptionoptions}}
</div>
</div>
<br>
@@ -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 mod_forum/frontpage_news_discussion_list
Template which defines a forum post for sending in a single-post HTML email.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
{{< mod_forum/news_discussion_list }}
{{$discussion_create_text}}
{{#str}}addanewtopic, forum{{/str}}
{{/discussion_create_text}}
{{/ mod_forum/news_discussion_list }}
@@ -0,0 +1,42 @@
{{!
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_forum/frontpage_social_discussion_list
Template which defines a forum post for sending in a single-post HTML email.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
{{< mod_forum/social_discussion_list }}
{{$discussion_create_text}}
{{#str}}addanewtopic, forum{{/str}}
{{/discussion_create_text}}
{{$discussion_top_pagination}}{{/discussion_top_pagination}}
{{$discussion_bottom_pagination}}
{{#hasmore}}
<a href="{{{forum.urls.view}}}">{{#str}}oldertopics, mod_forum{{/str}}...</a>
{{/hasmore}}
{{/discussion_bottom_pagination}}
{{/ mod_forum/social_discussion_list }}
@@ -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 mod_forum/grades/grade_button
Template which defines a forum post for sending in a single-post HTML email.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
<button
class="btn btn-secondary"
type="button"
data-grade-action="launch"
data-contextid="{{contextid}}"
data-cmid="{{cmid}}"
data-name="{{name}}"
data-course-id="{{courseid}}"
data-course-name="{{coursename}}"
data-experimental-display-mode="{{experimentaldisplaymode}}"
data-group="{{groupid}}"
data-grading-component="{{gradingcomponent}}"
data-grading-component-subtype="{{gradingcomponentsubtype}}"
data-gradable-itemtype="forum"
data-grade-only-active-users="{{gradeonlyactiveusers}}"
{{#sendstudentnotifications}}data-send-student-notifications="1" {{/sendstudentnotifications}}
>
{{#str}}gradeusers, forum{{/str}}
</button>
{{#js}}
require(['mod_forum/grades/grader'], function(Grader) {
Grader.registerLaunchListeners();
});
{{/js}}
@@ -0,0 +1,37 @@
{{!
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_forum/grades/grader/discussion/post_modal
Template to render a single post from a discussion.
Classes required for JS:
* none
Data attributes required for JS:
* data-region="posts-modal"
Example context (json):
{
}
}}
<div class="{{#experimentaldisplaymode}}nested-v2-display-mode{{/experimentaldisplaymode}}" data-region="posts-modal">
{{#posts}}
{{#experimentaldisplaymode}}{{> mod_forum/forum_discussion_nested_v2_first_post }}{{/experimentaldisplaymode}}
{{^experimentaldisplaymode}}{{> mod_forum/forum_discussion_nested_post }}{{/experimentaldisplaymode}}
{{/posts}}
</div>
@@ -0,0 +1,100 @@
{{!
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_forum/grades/grader/discussion/posts
Template to render a list of posts for a discussion.
Classes required for JS:
* none
Data attributes required for JS:
* data-region="posts"
Example context (json):
{
}
}}
<div
class="{{#experimentaldisplaymode}}nested-v2-display-mode{{/experimentaldisplaymode}}"
data-region="posts"
id="post-region-{{uniqid}}"
>
{{#discussions}}
<div class="discussion-container">
<div class="p-4">
<h3 class="d-inline-block m-0 h6 font-weight-bold">{{#str}} discussionstartedby, mod_forum, {{authorfullname}} {{/str}}</h3>
<p class="d-inline-block m-0 h6 font-weight-normal text-muted ml-1">
{{#userdate}} {{timecreated}}, {{#str}} strftimedate, core_langconfig {{/str}} {{/userdate}}
</p>
<h2 class="mb-4 font-weight-bold">{{name}}</h2>
{{#posts}}
<div class="posts-container">
{{#parent}}
<div class="parent-container">
<button
class="btn btn-link show-content-button collapsed"
data-target="#parent-post-content-{{id}}"
aria-expanded="false"
aria-controls="parent-post-content-{{id}}"
data-toggle="collapse"
>
{{#str}} viewparentpost, mod_forum {{/str}}
</button>
<div id="parent-post-content-{{id}}" class="content collapse">
{{#experimentaldisplaymode}}{{> mod_forum/forum_discussion_nested_v2_first_post }}{{/experimentaldisplaymode}}
{{^experimentaldisplaymode}}{{> mod_forum/forum_discussion_nested_post }}{{/experimentaldisplaymode}}
</div>
</div>
{{/parent}}
{{#post}}
<div class="post-container">
{{#experimentaldisplaymode}}{{> mod_forum/forum_discussion_nested_v2_first_post }}{{/experimentaldisplaymode}}
{{^experimentaldisplaymode}}{{> mod_forum/forum_discussion_nested_post }}{{/experimentaldisplaymode}}
</div>
<button
class="view-context-button btn btn-link border"
type="button"
data-action="view-context"
data-discussionid="{{discussionid}}"
data-postid="{{id}}"
data-name="{{name}}"
data-experimental-display-mode="{{experimentaldisplaymode}}"
>
{{#str}} viewconversation, forum {{/str}}
</button>
{{/post}}
<hr class="w-75 mx-auto my-5">
</div>
{{/posts}}
</div>
<hr>
</div>
{{/discussions}}
{{^discussions}}
<div class="no-post-container text-center p-5">
{{#pix}} no-posts, mod_forum {{/pix}}
<h2 class="mt-3 font-weight-bold">{{#str}} noposts, mod_forum {{/str}}</h2>
</div>
{{/discussions}}
</div>
{{#js}}
require(['mod_forum/grades/expandconversation'], function(Conversation) {
Conversation.registerEventListeners(document.querySelector('#post-region-{{uniqid}}'));
});
{{/js}}
@@ -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_forum/grades/view_grade_button
Template which defines a forum post for sending in a single-post HTML email.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
<button
class="btn btn-secondary"
data-grade-action="view"
data-contextid="{{contextid}}"
data-cmid="{{cmid}}"
data-name="{{name}}"
data-group="{{groupid}}"
data-userid="{{userid}}"
data-grading-component="{{gradingcomponent}}"
data-grading-component-subtype="{{gradingcomponentsubtype}}"
data-gradable-itemtype="forum"
>
{{#str}}viewgrades, forum{{/str}}
</button>
{{#js}}
require(['mod_forum/grades/grader'], function(Grader) {
Grader.registerLaunchListeners();
});
{{/js}}
+74
View File
@@ -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_forum/inpage_reply
Template which defines a forum post for sending in a single-post HTML email.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
"postid": 0,
"reply_url": "",
"sesskey": "",
"parentsubject": "",
"throttlingwarningmsg": "You are approaching the posting threshold. You have posted 3 times in the last 1 week and the limit is 4 posts."
}
}}
<div class="row" data-content="inpage-reply-content" style="display: none;">
<div class="card card-body">
{{#throttlingwarningmsg}}
<div class="alert alert-danger alert-block fade in " role="alert">
{{throttlingwarningmsg}}
</div>
{{/throttlingwarningmsg}}
<form data-post-id="{{postid}}" id="inpage-reply-{{postid}}" data-content="inpage-reply-form" action="{{{reply_url}}}">
<div class="row pb-1">
<span>
<textarea rows="5" name="post" title="{{#str}} message, mod_forum {{/str}}" class="form-control" placeholder="{{#str}} replyplaceholder, forum {{/str}}"></textarea>
<input type="hidden" name="postformat" value="{{postformat}}"/>
</span>
<input type="hidden" name="subject" value="{{parentsubject}}"/>
<input type="hidden" name="reply" value="{{postid}}"/>
<input type="hidden" name="sesskey" value="{{sesskey}}"/>
</div>
<div class="row">
<button class="btn btn-primary" data-action="forum-inpage-submit">
<span data-region="submit-text">{{#str}} posttoforum, mod_forum {{/str}}</span>
<span data-region="loading-icon-container" class="hidden">{{> core/loading }}</span>
</button>
<button class="btn btn-secondary" data-action="collapsible-link" name="cancelbtn">
{{#str}} cancel, core {{/str}}
</button>
{{#canreplyprivately}}
<div class="form-check form-check-inline">
<input type="checkbox" class="form-check-input" id="private-reply-checkbox-{{uniqid}}" title="{{#str}} privatereply, forum {{/str}}" name="privatereply"/>
<label class="form-check-label" for="private-reply-checkbox-{{uniqid}}">{{#str}} privatereply, forum {{/str}}</label>
</div>
{{/canreplyprivately}}
<button data-action="forum-advanced-reply" class="btn btn-link float-right" type="submit">
{{#str}} advanced, core {{/str}}
</button>
</div>
</form>
</div>
</div>
@@ -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_forum/inpage_reply_v2
In page reply HTML for the nested v2 discussion display mode.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
"postid": 0,
"reply_url": "",
"sesskey": "",
"parentsubject": ""
}
}}
<div
class="mt-4 mb-4"
data-content="inpage-reply-content"
style="display: none;"
>
<div class="d-flex">
<div class="author-image-container">
{{#loggedinuser}}
<img
class="rounded-circle w-100"
src="{{{profileimageurl}}}"
alt="{{#str}} pictureof, core, {{fullname}} {{/str}}"
aria-hidden="true"
>
{{/loggedinuser}}
</div>
<div class="w-100">
{{#loggedinuser}}
<h4 class="h5 font-weight-bold reply-author">{{#str}} replyauthorself, mod_forum, {{firstname}}{{/str}}</h4>
{{/loggedinuser}}
{{#throttlingwarningmsg}}
<div class="alert alert-danger alert-block fade in " role="alert">
{{throttlingwarningmsg}}
</div>
{{/throttlingwarningmsg}}
<form data-post-id="{{postid}}" data-content="inpage-reply-form" action="{{{reply_url}}}">
<textarea
name="post"
rows="3"
class="w-100"
{{#parentauthorname}}
placeholder="{{#str}} replyingtoauthor, forum, {{.}} {{/str}}"
{{/parentauthorname}}
{{^parentauthorname}}
placeholder="{{#str}} replyplaceholder, forum {{/str}}"
{{/parentauthorname}}
data-auto-rows
data-min-rows="3"
data-max-rows="10"
></textarea>
<input type="hidden" name="postformat" value="{{postformat}}"/>
<input type="hidden" name="subject" value="{{parentsubject}}"/>
<input type="hidden" name="reply" value="{{postid}}"/>
<input type="hidden" name="sesskey" value="{{sesskey}}"/>
<div class="d-flex mt-3 align-items-center flex-wrap">
<button class="btn btn-primary font-weight-bold px-3" data-action="forum-inpage-submit">
<span data-region="submit-text">{{#str}} posttoforum, mod_forum {{/str}}</span>
<span data-region="loading-icon-container" class="hidden">{{> core/loading }}</span>
</button>
<button data-action="forum-advanced-reply" class="btn btn-link mr-auto" type="submit">
{{#str}} advanced, core {{/str}}
</button>
{{#canreplyprivately}}
<div class="form-check form-check-inline">
<div class="custom-control custom-switch">
<input name="privatereply" type="checkbox" class="custom-control-input" id="private-reply-checkbox-{{uniqid}}">
<label class="custom-control-label" for="private-reply-checkbox-{{uniqid}}">
{{#str}} privatereply, forum {{/str}}
</label>
</div>
</div>
{{/canreplyprivately}}
<button
class="btn btn-icon icon-no-margin icon-size-4 text-muted"
title="{{#str}} cancelreply, mod_forum {{/str}}"
data-action="cancel-inpage-reply"
>
{{#pix}} i/delete, core {{/pix}}
</button>
</div>
</form>
</div>
</div>
</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 mod_forum/local/grades/grader
Classes required for JS:
* TODO
Data attributes required for JS:
* data-first-userid="350"
* data-cmid="1337"
Context variables required for this template:
* userid: ID of the first user to jump to
* cmid: ID of the course module we want to grade
Example context (json):
{
"userid": 350,
"cmid": 1337
}
}}
<div
id="grader-container-{{uniqid}}"
class="d-flex flex-column h-100 unified-grader"
data-region="unified-grader"
{{#userid}}data-first-userid="{{.}}"{{/userid}}
data-cmid="{{cmid}}"
>
{{> mod_forum/local/grades/local/grader/navigation }}
<div class="d-flex flex-grow-1 overflow-hidden position-relative">
{{> mod_forum/local/grades/local/grader/content }}
{{#drawer}}{{> mod_forum/local/grades/local/grader/grading }}{{/drawer}}
</div>
</div>
{{#js}}
require(['jquery', 'core/drawer'], function($, Drawer) {
var root = $('#grader-container-{{uniqid}}');
var drawer = root.find('[data-region="right-hand-drawer"]');
var expandButtons = root.find('[data-action="expand-grading-drawer"]');
var collapseButtons = root.find('[data-action="collapse-grading-drawer"]');
expandButtons.click(function() {
collapseButtons.removeClass('active');
expandButtons.addClass('active');
collapseButtons.attr('aria-expanded', true);
expandButtons.attr('aria-expanded', true);
Drawer.show(drawer);
});
collapseButtons.click(function() {
expandButtons.removeClass('active');
collapseButtons.addClass('active');
collapseButtons.attr('aria-expanded', false);
expandButtons.attr('aria-expanded', false);
Drawer.hide(drawer);
});
});
{{/js}}
@@ -0,0 +1,37 @@
{{!
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_forum/local/grades/local/grader/content
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* none
Example context (json):
{
}
}}
<div class="grader-module-content w-100" data-region="module_content_container" role="region" aria-label="{{#str}} usersforumposts, mod_forum {{/str}}">
<div data-region="module_content" class="grader-module-content-display">
{{> mod_forum/local/grades/local/grader/module_content_placeholder }}
</div>
</div>
@@ -0,0 +1,256 @@
{{!
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_forum/local/grades/local/grader/grade_placeholder
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* none
Example context (json):
{
}
}}
<div class="d-flex flex-column mb-3">
<div class="d-flex align-items-center mb-2" style="height: 36px">
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto mr-2" style="height: 16px; width: 16px"></div>
</div>
<div class="d-flex flex-column">
<div class="d-flex align-items-center mb-2" style="height: 22px">
<div class="bg-pulse-grey rounded-circle mr-1" style="height: 16px; width: 16px"></div>
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto" style="height: 19px; width: 50px"></div>
</div>
<div class="d-flex align-items-center mb-2" style="height: 22px">
<div class="bg-pulse-grey rounded-circle mr-1" style="height: 16px; width: 16px"></div>
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto" style="height: 19px; width: 50px"></div>
</div>
<div class="d-flex align-items-center mb-2" style="height: 22px">
<div class="bg-pulse-grey rounded-circle mr-1" style="height: 16px; width: 16px"></div>
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto" style="height: 19px; width: 50px"></div>
</div>
<div class="d-flex align-items-center mb-2" style="height: 22px">
<div class="bg-pulse-grey rounded-circle mr-1" style="height: 16px; width: 16px"></div>
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto" style="height: 19px; width: 50px"></div>
</div>
<div>
<div class="bg-pulse-grey mb-2" style="height: 22px; width: 150px"></div>
<div class="bg-pulse-grey" style="height: 36px; width: 100%"></div>
</div>
</div>
</div>
<div class="d-flex flex-column mb-3">
<div class="d-flex align-items-center mb-2" style="height: 36px">
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto mr-2" style="height: 16px; width: 16px"></div>
</div>
<div class="d-flex flex-column">
<div class="d-flex align-items-center mb-2" style="height: 22px">
<div class="bg-pulse-grey rounded-circle mr-1" style="height: 16px; width: 16px"></div>
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto" style="height: 19px; width: 50px"></div>
</div>
<div class="d-flex align-items-center mb-2" style="height: 22px">
<div class="bg-pulse-grey rounded-circle mr-1" style="height: 16px; width: 16px"></div>
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto" style="height: 19px; width: 50px"></div>
</div>
<div class="d-flex align-items-center mb-2" style="height: 22px">
<div class="bg-pulse-grey rounded-circle mr-1" style="height: 16px; width: 16px"></div>
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto" style="height: 19px; width: 50px"></div>
</div>
<div class="d-flex align-items-center mb-2" style="height: 22px">
<div class="bg-pulse-grey rounded-circle mr-1" style="height: 16px; width: 16px"></div>
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto" style="height: 19px; width: 50px"></div>
</div>
<div>
<div class="bg-pulse-grey mb-2" style="height: 22px; width: 150px"></div>
<div class="bg-pulse-grey" style="height: 36px; width: 100%"></div>
</div>
</div>
</div>
<div class="d-flex flex-column mb-3">
<div class="d-flex align-items-center mb-2" style="height: 36px">
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto mr-2" style="height: 16px; width: 16px"></div>
</div>
<div class="d-flex flex-column">
<div class="d-flex align-items-center mb-2" style="height: 22px">
<div class="bg-pulse-grey rounded-circle mr-1" style="height: 16px; width: 16px"></div>
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto" style="height: 19px; width: 50px"></div>
</div>
<div class="d-flex align-items-center mb-2" style="height: 22px">
<div class="bg-pulse-grey rounded-circle mr-1" style="height: 16px; width: 16px"></div>
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto" style="height: 19px; width: 50px"></div>
</div>
<div class="d-flex align-items-center mb-2" style="height: 22px">
<div class="bg-pulse-grey rounded-circle mr-1" style="height: 16px; width: 16px"></div>
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto" style="height: 19px; width: 50px"></div>
</div>
<div class="d-flex align-items-center mb-2" style="height: 22px">
<div class="bg-pulse-grey rounded-circle mr-1" style="height: 16px; width: 16px"></div>
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto" style="height: 19px; width: 50px"></div>
</div>
<div>
<div class="bg-pulse-grey mb-2" style="height: 22px; width: 150px"></div>
<div class="bg-pulse-grey" style="height: 36px; width: 100%"></div>
</div>
</div>
</div>
<div class="d-flex flex-column mb-3">
<div class="d-flex align-items-center mb-2" style="height: 36px">
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto mr-2" style="height: 16px; width: 16px"></div>
</div>
<div class="d-flex flex-column">
<div class="d-flex align-items-center mb-2" style="height: 22px">
<div class="bg-pulse-grey rounded-circle mr-1" style="height: 16px; width: 16px"></div>
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto" style="height: 19px; width: 50px"></div>
</div>
<div class="d-flex align-items-center mb-2" style="height: 22px">
<div class="bg-pulse-grey rounded-circle mr-1" style="height: 16px; width: 16px"></div>
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto" style="height: 19px; width: 50px"></div>
</div>
<div class="d-flex align-items-center mb-2" style="height: 22px">
<div class="bg-pulse-grey rounded-circle mr-1" style="height: 16px; width: 16px"></div>
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto" style="height: 19px; width: 50px"></div>
</div>
<div class="d-flex align-items-center mb-2" style="height: 22px">
<div class="bg-pulse-grey rounded-circle mr-1" style="height: 16px; width: 16px"></div>
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto" style="height: 19px; width: 50px"></div>
</div>
<div>
<div class="bg-pulse-grey mb-2" style="height: 22px; width: 150px"></div>
<div class="bg-pulse-grey" style="height: 36px; width: 100%"></div>
</div>
</div>
</div>
<div class="d-flex flex-column mb-3">
<div class="d-flex align-items-center mb-2" style="height: 36px">
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto mr-2" style="height: 16px; width: 16px"></div>
</div>
<div class="d-flex flex-column">
<div class="d-flex align-items-center mb-2" style="height: 22px">
<div class="bg-pulse-grey rounded-circle mr-1" style="height: 16px; width: 16px"></div>
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto" style="height: 19px; width: 50px"></div>
</div>
<div class="d-flex align-items-center mb-2" style="height: 22px">
<div class="bg-pulse-grey rounded-circle mr-1" style="height: 16px; width: 16px"></div>
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto" style="height: 19px; width: 50px"></div>
</div>
<div class="d-flex align-items-center mb-2" style="height: 22px">
<div class="bg-pulse-grey rounded-circle mr-1" style="height: 16px; width: 16px"></div>
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto" style="height: 19px; width: 50px"></div>
</div>
<div class="d-flex align-items-center mb-2" style="height: 22px">
<div class="bg-pulse-grey rounded-circle mr-1" style="height: 16px; width: 16px"></div>
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto" style="height: 19px; width: 50px"></div>
</div>
<div>
<div class="bg-pulse-grey mb-2" style="height: 22px; width: 150px"></div>
<div class="bg-pulse-grey" style="height: 36px; width: 100%"></div>
</div>
</div>
</div>
<div class="d-flex flex-column mb-3">
<div class="d-flex align-items-center mb-2" style="height: 36px">
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto mr-2" style="height: 16px; width: 16px"></div>
</div>
<div class="d-flex flex-column">
<div class="d-flex align-items-center mb-2" style="height: 22px">
<div class="bg-pulse-grey rounded-circle mr-1" style="height: 16px; width: 16px"></div>
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto" style="height: 19px; width: 50px"></div>
</div>
<div class="d-flex align-items-center mb-2" style="height: 22px">
<div class="bg-pulse-grey rounded-circle mr-1" style="height: 16px; width: 16px"></div>
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto" style="height: 19px; width: 50px"></div>
</div>
<div class="d-flex align-items-center mb-2" style="height: 22px">
<div class="bg-pulse-grey rounded-circle mr-1" style="height: 16px; width: 16px"></div>
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto" style="height: 19px; width: 50px"></div>
</div>
<div class="d-flex align-items-center mb-2" style="height: 22px">
<div class="bg-pulse-grey rounded-circle mr-1" style="height: 16px; width: 16px"></div>
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto" style="height: 19px; width: 50px"></div>
</div>
<div>
<div class="bg-pulse-grey mb-2" style="height: 22px; width: 150px"></div>
<div class="bg-pulse-grey" style="height: 36px; width: 100%"></div>
</div>
</div>
</div>
<div class="d-flex flex-column mb-3">
<div class="d-flex align-items-center mb-2" style="height: 36px">
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto mr-2" style="height: 16px; width: 16px"></div>
</div>
<div class="d-flex flex-column">
<div class="d-flex align-items-center mb-2" style="height: 22px">
<div class="bg-pulse-grey rounded-circle mr-1" style="height: 16px; width: 16px"></div>
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto" style="height: 19px; width: 50px"></div>
</div>
<div class="d-flex align-items-center mb-2" style="height: 22px">
<div class="bg-pulse-grey rounded-circle mr-1" style="height: 16px; width: 16px"></div>
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto" style="height: 19px; width: 50px"></div>
</div>
<div class="d-flex align-items-center mb-2" style="height: 22px">
<div class="bg-pulse-grey rounded-circle mr-1" style="height: 16px; width: 16px"></div>
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto" style="height: 19px; width: 50px"></div>
</div>
<div class="d-flex align-items-center mb-2" style="height: 22px">
<div class="bg-pulse-grey rounded-circle mr-1" style="height: 16px; width: 16px"></div>
<div class="bg-pulse-grey" style="height: 19px; width: 100px"></div>
<div class="bg-pulse-grey ml-auto" style="height: 19px; width: 50px"></div>
</div>
<div>
<div class="bg-pulse-grey mb-2" style="height: 22px; width: 150px"></div>
<div class="bg-pulse-grey" style="height: 36px; width: 100%"></div>
</div>
</div>
</div>
@@ -0,0 +1,127 @@
{{!
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_forum/local/grades/local/grader/grading
Classes required for JS:
* none
Data attributes required for JS:
* data-region="user_picker"
* data-region="grade"
* data-region="grade-errors"
Context variables required for this template:
* none
Example context (json):
{
}
}}
{{<core/drawer}}
{{$drawerid}}grading-drawer-{{uniqid}}{{/drawerid}}
{{$drawerclasses}}grader-grading-panel flex-shrink-0{{/drawerclasses}}
{{$drawercontent}}
<div class="h-100 w-100 bg-white d-flex flex-column" role="region" aria-label="{{#str}} forumgradingpanel, mod_forum {{/str}}">
<div class="flex-shrink-0 d-flex flex-column">
<div class="header-container bg-light">
<div class="info-container d-flex align-items-center" data-region="grading-info-container">
<button
class="btn btn-icon icon-size-3 icon-no-margin colour-inherit"
data-action="collapse-grading-drawer"
aria-controls="grading-drawer-{{uniqid}}"
aria-expanded="true"
title="{{#str}} closebuttontitle, core {{/str}}"
aria-label="{{#str}} hidegraderpanel, mod_forum {{/str}}"
>
<span class="dir-ltr-hide">{{#pix}} t/left, core {{/pix}}</span>
<span class="dir-rtl-hide">{{#pix}} t/right, core {{/pix}}</span>
</button>
<div class="ml-auto mr-auto text-center" data-region="status-container">
{{> mod_forum/local/grades/local/grader/status_placeholder }}
</div>
</div>
<div
id="searchbox-{{uniqid}}"
class="user-search-container d-flex flex-grow-1 align-items-center collapsed"
data-region="user-search-container"
>
<div class="search-input-container w-100">
<span class="search-icon icon-no-margin d-flex align-items-center justify-content-center">
{{#pix}} i/search, core {{/pix}}
</span>
<input
type="text"
data-region="user-search-input"
class="form-control form-control-lg"
placeholder="{{#str}} searchusers, mod_forum {{/str}}"
aria-labelledby="user-search-input-{{uniqid}}-label"
>
<span id="user-search-input-{{uniqid}}-label" class="sr-only">{{#str}}searchusers, mod_forum{{/str}}</span>
<button
class="toggle-search-button btn btn-icon icon-no-margin"
aria-expanded="false"
aria-controls="searchbox-{{uniqid}}"
data-action="toggle-search"
>
<div class="expanded-icon" data-region="user-search-icon-hide">
<span>{{#pix}} e/cancel, core, {{#str}} hideusersearch, mod_forum {{/str}} {{/pix}}</span>
</div>
<div class="collapsed-icon" data-region="user-search-icon-show">
<span>{{#pix}} i/search, core, {{#str}} showusersearch, mod_forum {{/str}} {{/pix}}</span>
</div>
</button>
</div>
</div>
</div>
<div class="border-bottom px-3 pt-2" data-region="user_picker">
{{> mod_forum/local/grades/local/grader/user_picker_placeholder }}
</div>
</div>
<div class="body-container position-relative d-flex flex-column" data-region="body-container">
<div class="grader-grading-panel-display pt-3" data-region="grading-panel-container">
<h4 class="mb-0 h5 px-3 font-weight-normal">
{{#pix}} i/grading, core {{/pix}}{{#str}} gradingmodulename, core_grades, {{moduleName}} {{/str}}
</h4>
<div data-region="grade" class="pt-3 px-3">
{{> mod_forum/local/grades/local/grader/grade_placeholder }}
</div>
<h4 id="send-student-notifications-setting" class="mb-0 h5 px-3 font-weight-normal">
{{#pix}} i/gradingnotifications, core {{/pix}}{{#str}}notifications, core{{/str}}
</h4>
<div data-region="notification" class="pt-3 px-3" role="radiogroup" aria-labelledby="send-student-notifications-setting">
<label class="form-check">
<input class="form-check-input" type="radio" name="sendstudentnotifications" value="1"{{#defaultsendnotifications}} checked{{/defaultsendnotifications}}/>
{{#str}}sendstudentnotificationsyes, mod_forum{{/str}}
</label>
<label class="form-check">
<input class="form-check-input" type="radio" name="sendstudentnotifications" value="0"{{^defaultsendnotifications}} checked{{/defaultsendnotifications}}/>
{{#str}}sendstudentnotificationsno, mod_forum{{/str}}
</label>
{{#helpicon}}
{{>core/help_icon}}
{{/helpicon}}
</div>
<div data-region="grade-errors" role="alert" aria-live="assertive"></div>
</div>
</div>
<div class="hidden overflow-auto" data-region="search-results-container"></div>
</div>
<div data-region="grade-errors" role="alert" aria-live="assertive"></div>
<hr/>
{{/drawercontent}}
{{/core/drawer}}
@@ -0,0 +1,38 @@
{{!
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_forum/local/grades/local/grader/gradingpanel/error
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* error.message: The returned message on error
Example context (json):
{
"error": {
"message": "The item (Safe) in (magic school bus trips) does not exist"
}
}
}}
<div class="col-md-12 bg-danger text-white rounded pt-3 pb-3" id="gradingpanel-error-{{uniqid}}">
{{{error.message}}}
</div>
@@ -0,0 +1,170 @@
{{!
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_forum/local/grades/local/grader/module_content_placeholder
Classes required for JS:
* none
Data attributes required for JS:
*
Context variables required for this template:
*
Example context (json):
{}
}}
<div class="p-4">
<div class="d-inline-block bg-pulse-grey mb-1" style="height: 18px; width: 200px"></div>
<div class="d-inline-block bg-pulse-grey ml-1 mb-1" style="height: 18px; width: 100px"></div>
<div class="bg-pulse-grey mb-4" style="height: 36px; width: 500px"></div>
<div class="d-flex align-items-center mb-2 p-2" style="height: 63px">
<div class="bg-pulse-grey rounded-circle mr-2" style="height: 45px; width: 45px"></div>
<div class="bg-pulse-grey" style="height: 15px; width: 150px"></div>
</div>
<div class="mb-2 p-2">
<div class="d-flex mb-2">
<div class="bg-pulse-grey rounded-circle mr-2" style="height: 45px; width: 45px"></div>
<div class="mb-3">
<div class="bg-pulse-grey mb-1" style="height: 18px; width: 200px"></div>
<div class="bg-pulse-grey mb-1" style="height: 18px; width: 350px"></div>
</div>
</div>
<div class="d-flex w-100">
<div class="flex-shrink-0 mr-2" style="height: 45px; width: 45px"></div>
<div class="flex-grow-1">
<div class="bg-pulse-grey mb-1" style="height: 15px; width: 95%"></div>
<div class="bg-pulse-grey mb-1" style="height: 15px; width: 100%"></div>
<div class="bg-pulse-grey mb-1" style="height: 15px; width: 97%"></div>
<div class="bg-pulse-grey mb-1" style="height: 15px; width: 93%"></div>
<div class="bg-pulse-grey mb-1" style="height: 15px; width: 100%"></div>
<div class="bg-pulse-grey mb-1" style="height: 15px; width: 75%"></div>
</div>
</div>
</div>
<div class="bg-pulse-grey" style="height: 36px; width: 150px"></div>
<hr class="w-75 mx-auto my-5">
<div class="d-flex align-items-center mb-2 p-2" style="height: 63px">
<div class="bg-pulse-grey rounded-circle mr-2" style="height: 45px; width: 45px"></div>
<div class="bg-pulse-grey" style="height: 15px; width: 150px"></div>
</div>
<div class="mb-2 p-2">
<div class="d-flex mb-2">
<div class="bg-pulse-grey rounded-circle mr-2" style="height: 45px; width: 45px"></div>
<div class="mb-3">
<div class="bg-pulse-grey mb-1" style="height: 18px; width: 200px"></div>
<div class="bg-pulse-grey mb-1" style="height: 18px; width: 350px"></div>
</div>
</div>
<div class="d-flex w-100">
<div class="flex-shrink-0 mr-2" style="height: 45px; width: 45px"></div>
<div class="flex-grow-1">
<div class="bg-pulse-grey mb-1" style="height: 15px; width: 95%"></div>
<div class="bg-pulse-grey mb-1" style="height: 15px; width: 100%"></div>
<div class="bg-pulse-grey mb-1" style="height: 15px; width: 97%"></div>
<div class="bg-pulse-grey mb-1" style="height: 15px; width: 93%"></div>
<div class="bg-pulse-grey mb-1" style="height: 15px; width: 100%"></div>
<div class="bg-pulse-grey mb-1" style="height: 15px; width: 75%"></div>
</div>
</div>
</div>
<div class="bg-pulse-grey" style="height: 36px; width: 150px"></div>
<hr class="w-75 mx-auto my-5">
<div class="d-flex align-items-center mb-2 p-2" style="height: 63px">
<div class="bg-pulse-grey rounded-circle mr-2" style="height: 45px; width: 45px"></div>
<div class="bg-pulse-grey" style="height: 15px; width: 150px"></div>
</div>
<div class="mb-2 p-2">
<div class="d-flex mb-2">
<div class="bg-pulse-grey rounded-circle mr-2" style="height: 45px; width: 45px"></div>
<div class="mb-3">
<div class="bg-pulse-grey mb-1" style="height: 18px; width: 200px"></div>
<div class="bg-pulse-grey mb-1" style="height: 18px; width: 350px"></div>
</div>
</div>
<div class="d-flex w-100">
<div class="flex-shrink-0 mr-2" style="height: 45px; width: 45px"></div>
<div class="flex-grow-1">
<div class="bg-pulse-grey mb-1" style="height: 15px; width: 95%"></div>
<div class="bg-pulse-grey mb-1" style="height: 15px; width: 100%"></div>
<div class="bg-pulse-grey mb-1" style="height: 15px; width: 97%"></div>
<div class="bg-pulse-grey mb-1" style="height: 15px; width: 93%"></div>
<div class="bg-pulse-grey mb-1" style="height: 15px; width: 100%"></div>
<div class="bg-pulse-grey mb-1" style="height: 15px; width: 75%"></div>
</div>
</div>
</div>
<div class="bg-pulse-grey" style="height: 36px; width: 150px"></div>
<hr class="w-75 mx-auto my-5">
<div class="d-flex align-items-center mb-2 p-2" style="height: 63px">
<div class="bg-pulse-grey rounded-circle mr-2" style="height: 45px; width: 45px"></div>
<div class="bg-pulse-grey" style="height: 15px; width: 150px"></div>
</div>
<div class="mb-2 p-2">
<div class="d-flex mb-2">
<div class="bg-pulse-grey rounded-circle mr-2" style="height: 45px; width: 45px"></div>
<div class="mb-3">
<div class="bg-pulse-grey mb-1" style="height: 18px; width: 200px"></div>
<div class="bg-pulse-grey mb-1" style="height: 18px; width: 350px"></div>
</div>
</div>
<div class="d-flex w-100">
<div class="flex-shrink-0 mr-2" style="height: 45px; width: 45px"></div>
<div class="flex-grow-1">
<div class="bg-pulse-grey mb-1" style="height: 15px; width: 95%"></div>
<div class="bg-pulse-grey mb-1" style="height: 15px; width: 100%"></div>
<div class="bg-pulse-grey mb-1" style="height: 15px; width: 97%"></div>
<div class="bg-pulse-grey mb-1" style="height: 15px; width: 93%"></div>
<div class="bg-pulse-grey mb-1" style="height: 15px; width: 100%"></div>
<div class="bg-pulse-grey mb-1" style="height: 15px; width: 75%"></div>
</div>
</div>
</div>
<div class="bg-pulse-grey" style="height: 36px; width: 150px"></div>
<hr class="w-75 mx-auto my-5">
<div class="d-flex align-items-center mb-2 p-2" style="height: 63px">
<div class="bg-pulse-grey rounded-circle mr-2" style="height: 45px; width: 45px"></div>
<div class="bg-pulse-grey" style="height: 15px; width: 150px"></div>
</div>
<div class="mb-2 p-2">
<div class="d-flex mb-2">
<div class="bg-pulse-grey rounded-circle mr-2" style="height: 45px; width: 45px"></div>
<div class="mb-3">
<div class="bg-pulse-grey mb-1" style="height: 18px; width: 200px"></div>
<div class="bg-pulse-grey mb-1" style="height: 18px; width: 350px"></div>
</div>
</div>
<div class="d-flex w-100">
<div class="flex-shrink-0 mr-2" style="height: 45px; width: 45px"></div>
<div class="flex-grow-1">
<div class="bg-pulse-grey mb-1" style="height: 15px; width: 95%"></div>
<div class="bg-pulse-grey mb-1" style="height: 15px; width: 100%"></div>
<div class="bg-pulse-grey mb-1" style="height: 15px; width: 97%"></div>
<div class="bg-pulse-grey mb-1" style="height: 15px; width: 93%"></div>
<div class="bg-pulse-grey mb-1" style="height: 15px; width: 100%"></div>
<div class="bg-pulse-grey mb-1" style="height: 15px; width: 75%"></div>
</div>
</div>
</div>
<div class="bg-pulse-grey" style="height: 36px; width: 150px"></div>
</div>
@@ -0,0 +1,113 @@
{{!
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_forum/local/grades/local/grader/navigation
Classes required for JS:
* none
Data attributes required for JS:
* data-action="togglefullscreen"
* data-action="closegrader"
* data-action="savegrade"
* data-action="expandgrader"
Context variables required for this template:
* moduleName: The name of the module this grading interface is for i.e. "Chef the Forum"
Example context (json):
{
"moduleName": "Chef the Forum"
}
}}
<nav id="nav-container-{{uniqid}}" class="grader-grading_navigation navbar px-0 px-sm-3" aria-label="{{#str}} forumgradingnavigation, mod_forum {{/str}}">
<div class="container-fluid p-0">
<div class="d-none d-sm-flex align-items-center">
<a href="{{{courseUrl}}}" class="btn btn-link px-2 colour-inherit">
<h5 class="d-inline px-0 mb-0">{{courseName}}</h5>
</a>
<span class="text-muted icon-no-margin">{{#pix}} i/breadcrumbdivider, core {{/pix}}</span>
<button class="btn btn-link px-2 colour-inherit" data-action="closegrader">
<h5 class="d-inline px-0 mb-0">{{moduleName}}</h5>
</button>
<span class="text-muted icon-no-margin">{{#pix}} i/breadcrumbdivider, core {{/pix}}</span>
<h5 class="d-inline px-2 mb-0 font-weight-bold">{{#str}}grading, forum{{/str}}</h5>
</div>
<div class="ml-1 ml-sm-auto">
<button
class="btn btn-icon icon-no-margin drawer-button mr-1 active"
data-action="expand-grading-drawer"
aria-controls="grading-drawer-{{uniqid}}"
aria-expanded="true"
type="button"
title="{{#str}} showgraderpanel, mod_forum {{/str}}"
>
<span class="dir-ltr-hide" aria-hidden="true">{{#pix}} show-grader-panel-rtl, mod_forum, {{#str}} showgraderpanel, mod_forum {{/str}} {{/pix}}</span>
<span class="dir-rtl-hide" aria-hidden="true">{{#pix}} show-grader-panel, mod_forum, {{#str}} showgraderpanel, mod_forum {{/str}} {{/pix}}</span>
</button>
<button
class="btn btn-icon icon-no-margin drawer-button mr-1 d-none d-sm-inline-block"
aria-label="{{#str}} hidegraderpanel, mod_forum {{/str}}"
data-action="collapse-grading-drawer"
aria-controls="grading-drawer-{{uniqid}}"
aria-expanded="true"
type="button"
title="{{#str}} hidegraderpanel, mod_forum {{/str}}"
>
<span aria-hidden="true">{{#pix}} hide-grader-panel, mod_forum, {{#str}} hidegraderpanel, mod_forum {{/str}} {{/pix}}</span>
</button>
<button
class="btn btn-primary font-weight-bold ml-sm-2 px-4"
data-action="savegrade"
>
{{#str}} save {{/str}}
</button>
<button
class="btn btn-secondary font-weight-bold ml-1 ml-sm-2 px-4"
aria-label="{{#str}} closegrader, mod_forum {{/str}}"
data-action="closegrader"
type="button"
>
{{#str}} close, mod_forum {{/str}}
</button>
<div class="btn-group d-none d-sm-inline-block">
<button
class="btn btn-icon text-muted icon-no-margin icon-size-3 ml-2"
type="button"
id="grader-actions-menu-{{uniqid}}"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
aria-label="{{#str}} actionsforgraderinterface, mod_forum {{/str}}"
>
{{#pix}} i/menu, core {{/pix}}
</button>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="grader-actions-menu-{{uniqid}}">
<button
class="dropdown-item"
type="button"
data-action="togglefullscreen"
type="button"
>
{{#str}} togglefullscreen, mod_forum {{/str}}
</button>
</div>
</div>
</div>
</div>
</nav>
@@ -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 mod_forum/local/grades/local/grader/status
Classes required for JS:
* none
Data attributes required for JS:
*
Context variables required for this template:
*
Example context (json):
{
"status": "Graded",
"index": 1,
"total": 10
}
}}
<h2 class="font-weight-bold h5 mb-0">
{{#status}}
{{#str}}graded, forum{{/str}}
{{/status}}
{{^status}}
{{#str}}notgraded, forum{{/str}}
{{/status}}
</h2>
<div>{{#str}} indexoutoftotal, mod_forum, {"index": "{{index}}", "total":"{{total}}"}{{/str}}</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_forum/local/grades/local/grader/status_placeholder
Classes required for JS:
* none
Data attributes required for JS:
*
Context variables required for this template:
*
Example context (json):
{}
}}
<div class="bg-pulse-grey mb-1" style="height: 22px; width: 75px"></div>
<div class="bg-pulse-grey ml-auto mr-auto" style="height: 19px; width: 60px"></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_forum/local/grades/local/grader/user_picker
Classes required for JS:
* none
Data attributes required for JS:
* data-region="user_picker/user"
* data-action="change-user"
* data-direction="-1"
* data-direction="1"
* data-action="search-user"
Context variables required for this template:
* none
Example context (json):
{
}
}}
<div class="d-flex align-items-center user-picker-container mb-2 py-2">
<div aria-live="polite" data-region="user_picker/current_user" class="sr-only"></div>
<div class="d-flex align-items-center overflow-hidden" data-region="user_picker/user"></div>
<div class="ml-auto flex-shrink-0">
<nav aria-label="{{#str}} usernavigation, mod_forum {{/str}}">
<ul class="pagination mb-0">
<li class="page-item">
<button
class="page-link icon-no-margin p-0 text-reset icon-size-3"
href="#"
aria-label="{{#str}} previoususer, mod_forum {{/str}}"
data-action="change-user"
data-direction="-1"
title="{{#str}} previoususer, mod_forum {{/str}}"
>
<span class="dir-ltr-hide">{{#pix}} i/next, core {{/pix}}</span>
<span class="dir-rtl-hide">{{#pix}} i/previous, core {{/pix}}</span>
</button>
</li>
<li class="page-item">
<button
class="page-link icon-no-margin p-0 text-reset icon-size-3 ml-2"
href="#"
aria-label="{{#str}} nextuser, mod_forum {{/str}}"
data-action="change-user"
data-direction="1"
title="{{#str}} nextuser, mod_forum {{/str}}"
>
<span class="dir-ltr-hide">{{#pix}} i/previous, core {{/pix}}</span>
<span class="dir-rtl-hide">{{#pix}} i/next, core {{/pix}}</span>
</button>
</li>
</ul>
</nav>
</div>
</div>
@@ -0,0 +1,57 @@
{{!
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_forum/local/grades/local/grader/user_picker/user
Classes required for JS:
* none
Data attributes required for JS:
* data-userid="42"
* data-region="index"
Context variables required for this template:
* id: The ID of the user
* fullname: The user's full name
* displayIndex: The index of the user in the userpicker array + 1
* total: The length of the user array in the userpicker
Example context (json):
{
"id": 4,
"fullname": "Phillip J. Fry",
"displayIndex": 3,
"total": 7
}
}}
{{#profileimageurl}}
<img
class="rounded-circle userpicture mr-2"
src="{{.}}"
aria-hidden="true"
>
{{/profileimageurl}}
<div class="overflow-hidden">
<h5
class="mb-0 font-weight-bold user-full-name text-truncate"
data-region="name"
data-userid="{{id}}"
>
{{fullname}}
</h5>
</div>
@@ -0,0 +1,75 @@
{{!
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_forum/local/grades/local/grader/user_picker/user_search
Classes required for JS:
* none
Data attributes required for JS:
* data-action="select-user"
Context variables required for this template:
* expandedUsers: Array of users to show, limited to 10
* profileimage: Profile image for the user
* fullname: User's full name
* id: User's ID
* hasCollapsed: T/F if there are more users to show
* collapsedUsers: Array of users after index 9
Example context (json):
{
"expandedUsers": [
{
"id": 4,
"fullname": "Phillip J. Fry",
"profileimage": "/pluginfile.php/4/user/icon/boost/f1?rev=58"
},
{
"id": 5,
"fullname": "Turanga Leela",
"profileimage": "/pluginfile.php/5/user/icon/boost/f1?rev=58"
}
],
"hasCollapsed": true,
"collapsedUsers": [
{
"id": 14,
"fullname": "Bender B. Rodriguez",
"profileimage": "/pluginfile.php/14/user/icon/boost/f1?rev=58"
}
]
}
}}
<div class="d-flex flex-column px-3 py-2" data-action="search-user-box">
{{#users}}
<button
class="btn btn-link text-reset p-0 mb-2 d-flex align-items-center"
data-action="select-user"
data-userid="{{id}}"
>
{{> mod_forum/local/grades/local/grader/user_picker/user }}
</button>
{{/users}}
{{^users}}
<div class="no-search-results-container text-center">
{{#pix}} no-search-results, mod_forum {{/pix}}
<h5 class="font-weight-bold mt-3">{{#str}}nousersmatch, mod_forum{{/str}}</h5>
</div>
{{/users}}
</div>
@@ -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_forum/local/grades/local/grader/user_picker_placeholder
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* none
Example context (json):
{
}
}}
<div class="d-flex align-items-center user-picker-container mb-2 py-2">
<div class="d-flex align-items-center">
<div class="bg-pulse-grey rounded-circle d-inline-block flex-shrink-0 userpicture mr-2"></div>
<div class="bg-pulse-grey d-inline-block" style="height: 22px; width: 150px"></div>
</div>
<div class="ml-auto flex-shrink-0">
<nav>
<ul class="pagination mb-0">
<li class="page-item">
<a class="bg-pulse-grey border-0 page-link icon-no-margin p-0 icon-size-3" href="#"></a>
</li>
<li class="page-item">
<a class="bg-pulse-grey border-0 page-link icon-no-margin p-0 icon-size-3 ml-2" href="#"></a>
</li>
</ul>
</nav>
</div>
</div>
@@ -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 mod_forum/local/grades/view_grade
Classes required for JS:
* none
Data attributes required for JS:
* data-region="grade-template"
Context variables required for this template:
* none
Example context (json):
{
"templatename": "core_grades/grades/grader/gradingpanel/point",
"grade": {
"usergrade": 55,
"maxgrade": 100,
"timemodified": 1573543598
},
"hasgrade": true
}
}}
<div class="container-fluid grade-display" data-region="view-grade">
{{#grade}}
<div class="row px-3">
<h5 class="font-weight-bold description">{{#str}}gradenoun{{/str}}:</h5>
<p class="ml-auto">{{usergrade}}</p>
</div>
<div class="row px-3">
<h5 class="font-weight-bold description">{{#str}}gradedby, forum{{/str}}:</h5>
<p class="ml-auto">
{{#gradedby}}
{{gradedby}}
{{/gradedby}}
{{^gradedby}}
-
{{/gradedby}}
</p>
</div>
<div class="row px-3">
<h5 class="font-weight-bold description">{{#str}}date{{/str}}:</h5>
<p class="ml-auto">{{#userdate}}{{timemodified}}, {{#str}} strftimedate, langconfig {{/str}}{{/userdate}}</p>
</div>
{{/grade}}
<div class="row px-3">
<h5 class="font-weight-bold description">
{{#str}}gradingstatus, forum{{/str}}
</h5>
<p class="ml-auto">
{{#hasgrade}}
{{#str}}graded, forum{{/str}}
{{/hasgrade}}
{{^hasgrade}}
{{#str}}notgraded, forum{{/str}}
{{/hasgrade}}
</p>
</div>
<div class="row p-3">
<fieldset class="w-100" disabled="disabled">
<div class="w-100" data-region="grade-template"></div>
</fieldset>
</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 mod_forum/mark_as_read
Template to mark as read menu item.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* urls Object - Uses the 'markasread' attribute for the URL.
Example context (json):
{
"urls": {
"markasread": "#"
}
}
}}
<a class="dropdown-item menu-action" role="menuitem" href="{{{urls.markasread}}}">
<span class="menu-action-text">{{#str}}markasread, mod_forum{{/str}}</span>
</a>
@@ -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 mod_forum/news_discussion_list
Template to render a list of discussions for a news forum
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
{{< mod_forum/discussion_list }}
{{$discussion_create_text}}
{{#str}}addanewtopic, forum{{/str}}
{{/discussion_create_text}}
{{$no_discussions_text}}
({{#str}}nonews, forum{{/str}})
{{/no_discussions_text}}
{{/ mod_forum/discussion_list }}
@@ -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 mod_forum/qanda_discussion_list
Template which defines a forum post for sending in a single-post HTML email.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
{{< mod_forum/discussion_list }}
{{$discussion_create_text}}
{{#str}}addanewquestion, forum{{/str}}
{{/discussion_create_text}}
{{$no_discussions_text}}
({{#str}}noquestions, forum{{/str}})
{{/no_discussions_text}}
{{/ mod_forum/discussion_list }}
@@ -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_forum/quick_search_form
This template renders the search form within forums.
Example context (json):
{
"action": "https://domain.example/mod/forum/search.php",
"helpicon": "<a class='btn'><i class='icon fa fa-question-circle'></i></a>",
"query": "find this post",
"inputname": "search"
}
}}
{{#helpicon}}
{{>core/help_icon}}
{{/helpicon}}
{{>core/search_input}}
@@ -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 mod_forum/setting_switch
This template will render a toggle switch, which can be used for the forum settings drawer.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* none
Example context (json):
{}
}}
<div>
<div class="custom-control custom-switch mb-1">
<input type="checkbox" class="custom-control-input" id="{{$switchid}}{{uniqid}}{{/switchid}}"
data-type="{{$type}}toggle-switch{{/type}}" data-action="toggle"
{{$otherattributes}}{{/otherattributes}}>
<label class="custom-control-label" for="{{$switchid}}{{uniqid}}{{/switchid}}">
{{$labeltext}}{{/labeltext}}
</label>
</div>
</div>
@@ -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_forum/settings_drawer_trigger
This template will render the discussion settings drawer.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* none
Example context (json):
{}
}}
<button
id="toggle-discussion-settings-drawer-{{uniqid}}"
class="btn btn-icon icon-size-4 icon-no-margin colour-inherit"
aria-controls="discussion-settings-drawer"
aria-expanded="false"
title="{{#str}} togglesettingsdrawer, mod_forum {{/str}}"
>
{{#pix}} i/settings, core, {{#str}} togglesettingsdrawer, mod_forum {{/str}} {{/pix}}
</button>
{{#js}}
require(['jquery', 'core/drawer'], function($, Drawer) {
var drawer = $('#discussion-settings-drawer');
var toggles = drawer.find('[data-action="toggle-settings-drawer"]');
toggles = toggles.add('#toggle-discussion-settings-drawer-{{uniqid}}');
Drawer.registerToggles(drawer, toggles);
});
{{/js}}
@@ -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_forum/settings_header
This template will render the header for the discussion/forum settings drawer.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* none
Example context (json):
{}
}}
<div class="d-flex align-items-center mb-2">
<button
class="btn btn-icon icon-size-3 icon-no-margin mr-1 colour-inherit"
data-action="toggle-settings-drawer"
aria-controls="discussion-settings-drawer"
aria-expanded="false"
title="{{#str}} closebuttontitle, core {{/str}}"
>
<span class="dir-ltr-hide">{{#pix}} t/left, core {{/pix}}</span>
<span class="dir-rtl-hide">{{#pix}} t/right, core {{/pix}}</span>
</button>
<h2 class="font-weight-bold h4 mb-0">
{{#str}} settings, core {{/str}}
</h2>
</div>
@@ -0,0 +1,42 @@
{{!
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_forum/single_discussion_list
Template to render a discussion for a single discussion forum.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
{{< mod_forum/discussion_list }}
{{$discussion_create_text}}
{{#str}}addanewtopic, forum{{/str}}
{{/discussion_create_text}}
{{$discussion_list_output}}
{{#posts}}
{{> mod_forum/forum_discussion_post }}
{{/posts}}
{{/discussion_list_output}}
{{/ mod_forum/discussion_list }}
@@ -0,0 +1,53 @@
{{!
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_forum/social_discussion_list
Template which defines a forum post for sending in a single-post HTML email.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
{{< mod_forum/discussion_list }}
{{$discussion_create_text}}
{{#str}}addanewdiscussion, forum{{/str}}
{{/discussion_create_text}}
{{$discussion_list_output}}
{{#posts}}
{{< mod_forum/forum_discussion_post }}
{{$footer}}
<div class="link text-right">
<a href="{{urls.discuss}}"
aria-label="{{#str}} discusstopicname, forum, {{subject}} {{/str}}">
{{#str}}discussthistopic, forum{{/str}}
</a>&nbsp;({{#isreplyplural}}{{#str}} repliesmany, forum, {{discussionrepliescount}} {{/str}}{{/isreplyplural}}{{^isreplyplural}}{{#str}} repliesone, forum, {{discussionrepliescount}} {{/str}}{{/isreplyplural}}{{#discussionunreadscount}}
<span class="sep">/</span>
<span class="unread"><a href="{{urls.discuss}}#unread">{{#isunreadplural}}{{#str}} unreadpostsnumber, mod_forum, {{discussionunreadscount}} {{/str}}{{/isunreadplural}}{{^isunreadplural}}{{#str}} unreadpostsone, mod_forum {{/str}}{{/isunreadplural}}</a></span>{{/discussionunreadscount}})
</div>
{{/footer}}
{{$replyoutput}}{{/replyoutput}}
{{/ mod_forum/forum_discussion_post }}
{{/posts}}
{{/discussion_list_output}}
{{/ mod_forum/discussion_list }}