mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 18:06:51 +02:00
Merge branch 'MDL-68550-master' of https://github.com/rezaies/moodle
This commit is contained in:
commit
76c68e2146
10 changed files with 151 additions and 48 deletions
|
@ -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;
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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">«</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">…</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">…</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">»</span>
|
||||
<span class="sr-only">{{#str}}nextpage, moodle{{/str}}</span>
|
||||
</a>
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue