Skip to content

Commit

Permalink
Merge branch 'MDL-67544-38' of git://github.com/andrewnicols/moodle i…
Browse files Browse the repository at this point in the history
…nto MOODLE_38_STABLE
  • Loading branch information
stronk7 committed Jan 8, 2020
2 parents 022206f + 5f4250d commit 26999dd
Show file tree
Hide file tree
Showing 20 changed files with 56 additions and 36 deletions.
3 changes: 2 additions & 1 deletion lib/form/templatable_form_element.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ public function export_for_template(renderer_base $output) {
$context['type'] = $this->getType();
$context['attributes'] = implode(' ', $otherattributes);
$context['emptylabel'] = ($this->getLabel() === '');
$context['iderror'] = preg_replace('/^id_/', 'id_error_', $context['id']);
$context['iderror'] = preg_replace('/_id_/', '_id_error_', $context['id']);
$context['iderror'] = preg_replace('/^id_/', 'id_error_', $context['iderror']);

// Elements with multiple values need array syntax.
if ($this->getAttribute('multiple')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ DIALOGUE = function(config) {
// during widget instantiation, however, because we're creating it on the fly (and 'config.srcNode' isn't set yet), care must
// be taken to add it to the DOM and to properly set the value of 'config.srcNode' before calling the parent constructor.
// Note: additional classes can be added to this content node by setting the 'additionalBaseClass' config property (a string).
var id = 'moodle-dialogue-' + Y.stamp(this); // Can't use this.get('id') as it's not set at this stage.
var id = 'moodle-dialogue-' + Y.stamp(this) + '-wrap'; // Can't use this.get('id') as it's not set at this stage.
config.notificationBase =
Y.Node.create('<div class="' + CSS.BASE + '">')
.append(Y.Node.create('<div id="' + id + '" role="dialog" ' +
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ DIALOGUE = function(config) {
// during widget instantiation, however, because we're creating it on the fly (and 'config.srcNode' isn't set yet), care must
// be taken to add it to the DOM and to properly set the value of 'config.srcNode' before calling the parent constructor.
// Note: additional classes can be added to this content node by setting the 'additionalBaseClass' config property (a string).
var id = 'moodle-dialogue-' + Y.stamp(this); // Can't use this.get('id') as it's not set at this stage.
var id = 'moodle-dialogue-' + Y.stamp(this) + '-wrap'; // Can't use this.get('id') as it's not set at this stage.
config.notificationBase =
Y.Node.create('<div class="' + CSS.BASE + '">')
.append(Y.Node.create('<div id="' + id + '" role="dialog" ' +
Expand Down
2 changes: 1 addition & 1 deletion lib/yui/src/notification/js/dialogue.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ DIALOGUE = function(config) {
// during widget instantiation, however, because we're creating it on the fly (and 'config.srcNode' isn't set yet), care must
// be taken to add it to the DOM and to properly set the value of 'config.srcNode' before calling the parent constructor.
// Note: additional classes can be added to this content node by setting the 'additionalBaseClass' config property (a string).
var id = 'moodle-dialogue-' + Y.stamp(this); // Can't use this.get('id') as it's not set at this stage.
var id = 'moodle-dialogue-' + Y.stamp(this) + '-wrap'; // Can't use this.get('id') as it's not set at this stage.
config.notificationBase =
Y.Node.create('<div class="' + CSS.BASE + '">')
.append(Y.Node.create('<div id="' + id + '" role="dialog" ' +
Expand Down
2 changes: 1 addition & 1 deletion mod/forum/amd/build/local/layout/fullscreen.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mod/forum/amd/build/local/layout/fullscreen.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion mod/forum/amd/src/local/layout/fullscreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const getComposedLayout = ({
document.body.append(container);
container.classList.add('layout');
container.classList.add('fullscreen');
container.setAttribute('aria-role', 'application');
container.setAttribute('role', 'application');
addToastRegion(container);

// Lock scrolling on the document body.
Expand Down
3 changes: 3 additions & 0 deletions mod/forum/classes/local/renderers/discussion.php
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,9 @@ private function get_move_discussion_html() : ?string {
$select = new url_select($forummenu, '',
['/mod/forum/discuss.php?d=' . $discussion->get_id() => get_string("movethisdiscussionto", "forum")],
'forummenu', $movebutton);
$select->set_label(get_string('movethisdiscussionlabel', 'mod_forum'), [
'class' => 'sr-only',
]);
$html .= $this->renderer->render($select);
$html .= "</div>";
return $html;
Expand Down
2 changes: 2 additions & 0 deletions mod/forum/lang/en/forum.php
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@
$string['modulenameplural'] = 'Forums';
$string['more'] = 'more';
$string['movedmarker'] = '(Moved)';
$string['movethisdiscussionlabel'] = 'Move the current discussion to the specified forum';
$string['movethisdiscussionto'] = 'Move this discussion to ...';
$string['mustprovidediscussionorpost'] = 'You must provide either a discussion id or post id to export';
$string['myprofileownpost'] = 'My forum posts';
Expand Down Expand Up @@ -691,6 +692,7 @@
$string['timedposts'] = 'Timed posts';
$string['timedvisible'] = 'Timed status: Visible to all users';
$string['timestartenderror'] = 'Display end date cannot be earlier than the start date';
$string['togglediscussionmenu'] = 'Toggle the discussion menu';
$string['togglefullscreen'] = 'Toggle full screen';
$string['togglesettingsdrawer'] = 'Toggle settings drawer';
$string['trackforum'] = 'Track unread posts';
Expand Down
1 change: 1 addition & 0 deletions mod/forum/templates/forum_action_menu.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
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}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
}}
{{< mod_forum/discussion_favourite_toggle }}
{{$classes}}btn btn-link{{/classes}}
{{$role}}{{/role}}
{{$role}}button{{/role}}
{{$favouritecontent}}
{{#userstate.favourited}}
{{#pix}}t/star, mod_forum, {{#str}}removefromfavourites, mod_forum{{/str}}{{/pix}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
data-region="post"
data-target="{{id}}-target"
tabindex="0"
aria-labelledby="post-header-{{id}}"
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. }}
Expand Down Expand Up @@ -74,7 +74,7 @@
</div>

<div class="forum-post-core d-flex flex-column w-100" data-region-content="forum-post-core">
<header id="post-header-{{uniqid}}">
<header id="post-header-{{id}}-{{uniqid}}">
{{^isdeleted}}
<div class="d-flex flex-wrap align-items-center mb-1">
<address class="mb-0 mr-2" tabindex="-1">
Expand Down Expand Up @@ -151,7 +151,7 @@
{{#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-{{uniqid}}" style="right: auto">
<div class="dropdown-menu dropdown-menu-right rounded-lg shadow border-0" aria-labelledby="post-actions-menu-{{uniqid}}" style="right: auto" role="menubar">
{{#capabilities}}
{{#view}}
<a
Expand Down
24 changes: 17 additions & 7 deletions mod/forum/templates/forum_discussion_post.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
data-region="post"
data-target="{{id}}-target"
tabindex="0"
aria-labelledby="post-header-{{id}}"
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. }}
Expand All @@ -48,7 +48,7 @@
{{#isfirstunread}}<a id="unread" aria-hidden="true"></a>{{/isfirstunread}}

<div class="d-flex flex-column w-100" data-region-content="forum-post-core">
<header class="mb-2 header row d-flex">
<header id="post-header-{{id}}-{{uniqid}}" class="mb-2 header row d-flex">
{{^isdeleted}}
{{#author}}
<div class="mr-2" style="width: 45px;">
Expand Down Expand Up @@ -200,6 +200,7 @@
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>
Expand All @@ -210,6 +211,7 @@
data-region="post-action"
href="{{{urls.markasread}}}"
class="btn btn-link"
role="menuitem"
>
{{#str}} markread, mod_forum {{/str}}
</a>
Expand All @@ -219,6 +221,7 @@
data-region="post-action"
href="{{{urls.markasunread}}}"
class="btn btn-link"
role="menuitem"
>
{{#str}} markunread, mod_forum {{/str}}
</a>
Expand All @@ -231,6 +234,7 @@
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>
Expand All @@ -240,6 +244,7 @@
data-region="post-action"
href="{{{urls.edit}}}"
class="btn btn-link"
role="menuitem"
>
{{#str}} edit, mod_forum {{/str}}
</a>
Expand All @@ -249,6 +254,7 @@
data-region="post-action"
href="{{{urls.split}}}"
class="btn btn-link"
role="menuitem"
>
{{#str}} prune, mod_forum {{/str}}
</a>
Expand All @@ -258,6 +264,7 @@
data-region="post-action"
href="{{{urls.delete}}}"
class="btn btn-link"
role="menuitem"
>
{{#str}} delete, mod_forum {{/str}}
</a>
Expand All @@ -272,6 +279,7 @@
data-action="collapsible-link"
data-can-reply-privately="{{canreplyprivately}}"
title="{{#str}} reply, mod_forum {{/str}}"
role="menuitem"
>
{{#str}} reply, mod_forum {{/str}}
</a>
Expand All @@ -281,11 +289,12 @@
{{#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}}"
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>
Expand All @@ -297,6 +306,7 @@
data-region="post-action"
href="{{{urls.export}}}"
class="btn btn-link"
role="menuitem"
>
{{#str}} addtoportfolio, core_portfolio {{/str}}
</a>
Expand Down
Loading

0 comments on commit 26999dd

Please sign in to comment.