mirrored from git://git.moodle.org/moodle.git
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-64821 mod_forum: add templates for modern display mode
- Loading branch information
1 parent
b7c27c2
commit 7255378
Showing
13 changed files
with
1,105 additions
and
9 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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/>. | ||
|
||
/** | ||
* Module for viewing a discussion. | ||
* | ||
* @module mod_forum/discussion_new | ||
* @package mod_forum | ||
* @copyright 2019 Ryan Wyllie <ryan@moodle.com> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
import $ from 'jquery'; | ||
import Discussion from 'mod_forum/discussion'; | ||
import LockToggle from 'mod_forum/lock_toggle'; | ||
import FavouriteToggle from 'mod_forum/favourite_toggle'; | ||
import Pin from 'mod_forum/pin_toggle'; | ||
|
||
export const init = (root) => { | ||
Discussion.init(root); | ||
|
||
var discussionToolsContainer = $('[data-container="discussion-tools"]'); | ||
LockToggle.init(discussionToolsContainer); | ||
FavouriteToggle.init(discussionToolsContainer); | ||
Pin.init(discussionToolsContainer); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{{! | ||
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_modern | ||
Template for displaying a single forum discussion. | ||
Classes required for JS: | ||
* none | ||
Data attributes required for JS: | ||
* none | ||
Example context (json): | ||
{ | ||
} | ||
}} | ||
|
||
<div id="discussion-container-{{uniqid}}" data-content="forum-discussion"> | ||
{{#html}} | ||
<div class="mb-5"> | ||
<div class="d-flex flex-wrap"> | ||
<div>{{{modeselectorform}}}</div> | ||
<div class="ml-auto d-flex align-items-middle" data-container="discussion-tools"> | ||
<div>{{{subscribe}}}</div> | ||
<div class="pl-1">{{> mod_forum/forum_action_menu}}</div> | ||
</div> | ||
</div> | ||
|
||
<div class="d-flex mt-2"> | ||
<div>{{{movediscussion}}}</div> | ||
<div {{#movediscussion}}class="ml-2"{{/movediscussion}}>{{{exportdiscussion}}}</div> | ||
</div> | ||
</div> | ||
{{/html}} | ||
|
||
{{#notifications}} | ||
{{> core/notification}} | ||
{{/notifications}} | ||
|
||
{{{html.posts}}} | ||
</div> | ||
{{#js}} | ||
require(['jquery', 'mod_forum/discussion_modern'], function($, Discussion) { | ||
var root = $('#discussion-container-{{uniqid}}'); | ||
Discussion.init(root); | ||
}); | ||
{{/js}} |
Oops, something went wrong.