Merge branch 'MDL-68550-master' of https://github.com/rezaies/moodle

This commit is contained in:
Paul Holden 2022-11-10 11:59:35 +00:00
commit 76c68e2146
10 changed files with 151 additions and 48 deletions

View File

@ -1232,20 +1232,26 @@ class flexible_table {
$ariacontrols = trim($ariacontrols);
if (!empty($this->prefs['collapse'][$column])) {
$linkattributes = array('title' => get_string('show') . ' ' . strip_tags($this->headers[$index]),
'aria-expanded' => 'false',
'aria-controls' => $ariacontrols,
'data-action' => 'show',
'data-column' => $column);
$linkattributes = [
'title' => get_string('show') . ' ' . strip_tags($this->headers[$index]),
'aria-expanded' => 'false',
'aria-controls' => $ariacontrols,
'data-action' => 'show',
'data-column' => $column,
'role' => 'button',
];
return html_writer::link($this->baseurl->out(false, array($this->request[TABLE_VAR_SHOW] => $column)),
$OUTPUT->pix_icon('t/switch_plus', null), $linkattributes);
} else if ($this->headers[$index] !== NULL) {
$linkattributes = array('title' => get_string('hide') . ' ' . strip_tags($this->headers[$index]),
'aria-expanded' => 'true',
'aria-controls' => $ariacontrols,
'data-action' => 'hide',
'data-column' => $column);
$linkattributes = [
'title' => get_string('hide') . ' ' . strip_tags($this->headers[$index]),
'aria-expanded' => 'true',
'aria-controls' => $ariacontrols,
'data-action' => 'hide',
'data-column' => $column,
'role' => 'button',
];
return html_writer::link($this->baseurl->out(false, array($this->request[TABLE_VAR_HIDE] => $column)),
$OUTPUT->pix_icon('t/switch_minus', null), $linkattributes);
}
@ -1664,6 +1670,7 @@ class flexible_table {
'data-sortable' => $this->is_sortable($column),
'data-sortby' => $column,
'data-sortorder' => $sortorder,
'role' => 'button',
]) . ' ' . $this->sort_icon($isprimary, $order);
}
@ -1861,7 +1868,7 @@ class flexible_table {
$url = $this->baseurl->out(false, array($this->request[TABLE_VAR_RESET] => 1));
$html = html_writer::start_div('resettable mdl-right');
$html .= html_writer::link($url, get_string('resettable'));
$html .= html_writer::link($url, get_string('resettable'), ['role' => 'button']);
$html .= html_writer::end_div();
return $html;

View File

@ -76,31 +76,20 @@
<div class="initialbar {{class}} d-flex flex-wrap justify-content-center justify-content-md-start">
<span class="initialbarlabel mr-2">{{title}}</span>
<div class="initialbargroups d-flex flex-wrap justify-content-center justify-content-md-start">
<nav class="initialbargroups d-flex flex-wrap justify-content-center justify-content-md-start">
<ul class="pagination pagination-sm">
{{#current}}
<li class="initialbarall page-item">
<a data-initial="" class="page-link" href="{{url}}">{{all}}</a>
<li class="initialbarall page-item{{^current}} active{{/current}}">
<a data-initial="" class="page-link" href="{{url}}"{{^current}} aria-current="true"{{/current}}>{{all}}</a>
</li>
{{/current}}
{{^current}}
<li class="initialbarall page-item active">
<a data-initial="" class="page-link">{{all}}</a>
</li>
{{/current}}
</ul>
{{#group}}
<ul class="pagination pagination-sm">
{{#letter}}
{{#selected}}
<li data-initial="{{name}}" class="page-item active {{name}}"><span class="page-link">{{name}}</span></li>
{{/selected}}
{{^selected}}
<li data-initial="{{name}}" class="page-item {{name}}"><a class="page-link" href="{{url}}">{{name}}</a></li>
{{/selected}}
<li data-initial="{{name}}" class="page-item {{name}}{{#selected}} active{{/selected}}">
<a class="page-link" href="{{url}}"{{#selected}} aria-current="true"{{/selected}}>{{name}}</a>
</li>
{{/letter}}
</ul>
{{/group}}
</div>
</nav>
</div>

View File

@ -54,7 +54,7 @@
<ul class="mt-1 pagination " data-page-size="{{pagesize}}">
{{#previous}}
<li class="page-item" data-page-number="{{page}}">
<a href="{{url}}" class="page-link" aria-label="{{# str }} previouspage, moodle {{/ str }}">
<a href="{{url}}" class="page-link">
<span aria-hidden="true">&laquo;</span>
<span class="sr-only">{{#str}}previouspage, moodle{{/str}}</span>
</a>
@ -62,7 +62,10 @@
{{/previous}}
{{#first}}
<li class="page-item" data-page-number="{{page}}">
<a href="{{url}}" class="page-link">{{page}}</a>
<a href="{{url}}" class="page-link">
<span aria-hidden="true">{{page}}</span>
<span class="sr-only">{{#str}}pagea, moodle, {{page}}{{/str}}</span>
</a>
</li>
<li class="page-item disabled" data-page-number="{{page}}">
<span class="page-link">&hellip;</span>
@ -70,11 +73,9 @@
{{/first}}
{{#pages}}
<li class="page-item {{#active}}active{{/active}}" data-page-number="{{page}}">
<a href="{{#url}}{{.}}{{/url}}{{^url}}#{{/url}}" class="page-link">
{{page}}
{{#active}}
<span class="sr-only">{{#str}}currentinparentheses, theme_boost{{/str}}</span>
{{/active}}
<a href="{{#url}}{{.}}{{/url}}{{^url}}#{{/url}}" class="page-link" {{#active}}aria-current="page"{{/active}}>
<span aria-hidden="true">{{page}}</span>
<span class="sr-only">{{#str}}pagea, moodle, {{page}}{{/str}}</span>
</a>
</li>
{{/pages}}
@ -83,12 +84,15 @@
<span class="page-link">&hellip;</span>
</li>
<li class="page-item" data-page-number="{{page}}">
<a href="{{url}}" class="page-link">{{page}}</a>
<a href="{{url}}" class="page-link">
<span aria-hidden="true">{{page}}</span>
<span class="sr-only">{{#str}}pagea, moodle, {{page}}{{/str}}</span>
</a>
</li>
{{/last}}
{{#next}}
<li class="page-item" data-page-number="{{page}}">
<a href="{{url}}" class="page-link" aria-label="{{# str }} nextpage, moodle {{/ str }}">
<a href="{{url}}" class="page-link">
<span aria-hidden="true">&raquo;</span>
<span class="sr-only">{{#str}}nextpage, moodle{{/str}}</span>
</a>

View File

@ -77,7 +77,7 @@ Feature: Initials bar
And I should see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should see "Cstudent Cstudent"
And I click on "A" "link" in the ".initialbar.lastinitial" "css_element"
And I click on "A" "link" in the ".initialbar.lastinitial .page-item.A" "css_element"
And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
And ".page-item.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
@ -85,7 +85,7 @@ Feature: Initials bar
And I should see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should not see "Cstudent Cstudent"
And I click on "B" "link" in the ".initialbar.firstinitial" "css_element"
And I click on "B" "link" in the ".initialbar.firstinitial .page-item.B" "css_element"
And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
And ".page-item.active.B" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
@ -133,7 +133,7 @@ Feature: Initials bar
And I should see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should see "Cstudent Cstudent"
And I click on "A" "link" in the ".initialbar.lastinitial" "css_element"
And I click on "A" "link" in the ".initialbar.lastinitial .page-item.A" "css_element"
And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
And ".page-item.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
@ -141,7 +141,7 @@ Feature: Initials bar
And I should see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should not see "Cstudent Cstudent"
And I click on "B" "link" in the ".initialbar.firstinitial" "css_element"
And I click on "B" "link" in the ".initialbar.firstinitial .page-item.B" "css_element"
And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
And ".page-item.active.B" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
@ -193,7 +193,7 @@ Feature: Initials bar
And I should see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should see "Cstudent Cstudent"
And I click on "A" "link" in the ".initialbar.lastinitial" "css_element"
And I click on "A" "link" in the ".initialbar.lastinitial .page-item.A" "css_element"
And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
And ".page-item.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
@ -201,7 +201,7 @@ Feature: Initials bar
And I should see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should not see "Cstudent Cstudent"
And I click on "B" "link" in the ".initialbar.firstinitial" "css_element"
And I click on "B" "link" in the ".initialbar.firstinitial .page-item.B" "css_element"
And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
And ".page-item.active.B" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
@ -259,7 +259,7 @@ Feature: Initials bar
And I should see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should see "Cstudent Cstudent"
And I click on "A" "link" in the ".initialbar.lastinitial" "css_element"
And I click on "A" "link" in the ".initialbar.lastinitial .page-item.A" "css_element"
And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
And ".page-item.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
@ -267,7 +267,7 @@ Feature: Initials bar
And I should see "Astudent Astudent"
And I should see "Bstudent Astudent"
And I should not see "Cstudent Cstudent"
And I click on "B" "link" in the ".initialbar.firstinitial" "css_element"
And I click on "B" "link" in the ".initialbar.firstinitial .page-item.B" "css_element"
And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
And ".page-item.active.B" "css_element" should exist in the ".initialbar.firstinitial" "css_element"

View File

@ -138,7 +138,7 @@ class tablelib_test extends \advanced_testcase {
$headers = $this->generate_headers(2);
// Search for pagination controls containing 'page-link"\saria-label="Next"'.
$this->expectOutputRegex('/page-link"\saria-label="Next page"/');
$this->expectOutputRegex('/Next page/');
$this->run_table_test(
$columns,

View File

@ -1,3 +1,4 @@
totop,theme_boost
privacy:drawernavclosed,theme_boost
privacy:drawernavopen,theme_boost
currentinparentheses,theme_boost

View File

@ -32,7 +32,6 @@ $string['brandcolor_desc'] = 'The accent colour.';
$string['bootswatch'] = 'Bootswatch';
$string['bootswatch_desc'] = 'A bootswatch is a set of Bootstrap variables and css to style Bootstrap';
$string['choosereadme'] = 'Boost is a modern highly-customisable theme. This theme is intended to be used directly, or as a parent theme when creating new themes utilising Bootstrap 4.';
$string['currentinparentheses'] = '(current)';
$string['configtitle'] = 'Boost';
$string['generalsettings'] = 'General settings';
$string['loginbackgroundimage'] = 'Login page background image';
@ -64,5 +63,6 @@ $string['privacy:drawerblockopen'] = 'The current preference for the block drawe
$string['totop'] = 'Go to top';
// Deprecated since Moodle 4.1.
$string['currentinparentheses'] = '(current)';
$string['privacy:drawernavclosed'] = 'The current preference for the navigation drawer is closed.';
$string['privacy:drawernavopen'] = 'The current preference for the navigation drawer is open.';

View File

@ -2976,3 +2976,39 @@ body.dragging {
}
}
}
.initialbargroups ul {
-webkit-margin-start: 0; /* stylelint-disable-line */
margin-right: -1px;
}
.page-item {
&:first-child {
.page-link {
.initialbargroups & {
@include border-left-radius(0);
@include border-right-radius(0);
}
.initialbargroups .pagination-lg:first-child & {
@include border-left-radius($pagination-border-radius-lg);
}
.initialbargroups .pagination-sm:first-child & {
@include border-left-radius($pagination-border-radius-sm);
}
}
}
&:last-child {
.page-link {
.initialbargroups & {
@include border-left-radius(0);
@include border-right-radius(0);
}
.initialbargroups .pagination-lg:last-child & {
@include border-right-radius($pagination-border-radius-lg);
}
.initialbargroups .pagination-sm:last-child & {
@include border-right-radius($pagination-border-radius-sm);
}
}
}
}

View File

@ -12280,6 +12280,39 @@ body.dragging .dragging {
.select-menu .dropdown-item[aria-selected="true"] {
font-weight: bold; }
.initialbargroups ul {
-webkit-margin-start: 0;
/* stylelint-disable-line */
margin-right: -1px; }
.initialbargroups .page-item:first-child .page-link {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-top-right-radius: 0;
border-bottom-right-radius: 0; }
.initialbargroups .pagination-lg:first-child .page-item:first-child .page-link {
border-top-left-radius: 0.6rem;
border-bottom-left-radius: 0.6rem; }
.initialbargroups .pagination-sm:first-child .page-item:first-child .page-link {
border-top-left-radius: 0.2rem;
border-bottom-left-radius: 0.2rem; }
.initialbargroups .page-item:last-child .page-link {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-top-right-radius: 0;
border-bottom-right-radius: 0; }
.initialbargroups .pagination-lg:last-child .page-item:last-child .page-link {
border-top-right-radius: 0.6rem;
border-bottom-right-radius: 0.6rem; }
.initialbargroups .pagination-sm:last-child .page-item:last-child .page-link {
border-top-right-radius: 0.2rem;
border-bottom-right-radius: 0.2rem; }
.icon {
font-size: 16px;
width: 16px;

View File

@ -12280,6 +12280,39 @@ body.dragging .dragging {
.select-menu .dropdown-item[aria-selected="true"] {
font-weight: bold; }
.initialbargroups ul {
-webkit-margin-start: 0;
/* stylelint-disable-line */
margin-right: -1px; }
.initialbargroups .page-item:first-child .page-link {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-top-right-radius: 0;
border-bottom-right-radius: 0; }
.initialbargroups .pagination-lg:first-child .page-item:first-child .page-link {
border-top-left-radius: 0.3rem;
border-bottom-left-radius: 0.3rem; }
.initialbargroups .pagination-sm:first-child .page-item:first-child .page-link {
border-top-left-radius: 0.2rem;
border-bottom-left-radius: 0.2rem; }
.initialbargroups .page-item:last-child .page-link {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-top-right-radius: 0;
border-bottom-right-radius: 0; }
.initialbargroups .pagination-lg:last-child .page-item:last-child .page-link {
border-top-right-radius: 0.3rem;
border-bottom-right-radius: 0.3rem; }
.initialbargroups .pagination-sm:last-child .page-item:last-child .page-link {
border-top-right-radius: 0.2rem;
border-bottom-right-radius: 0.2rem; }
.icon {
font-size: 16px;
width: 16px;