MDL-76313 forum: improve accessibility on subscribers page

- add header on table of subscribers
- remove one redundant header
This commit is contained in:
Julien Boulen 2023-01-10 11:16:31 +01:00
parent cd072308e5
commit e50831318e
3 changed files with 12 additions and 7 deletions

View File

@ -134,6 +134,13 @@ class mod_forum_renderer extends plugin_renderer_base {
$strparams->count = count($users);
$output .= $this->output->heading(get_string("subscriberstowithcount", "forum", $strparams));
$table = new html_table();
$table->id = 'subscribers-table';
$table->head = array();
$table->head[] = get_string('pictureofuser');
$table->head[] = get_string('fullname');
if ($canviewemail) {
$table->head[] = get_string('email');
}
$table->cellpadding = 5;
$table->cellspacing = 5;
$table->tablealign = 'center';

View File

@ -121,7 +121,6 @@ if ($edit === 1 && !\mod_forum\subscriptions::is_forcesubscribed($forum)) {
echo $OUTPUT->heading(get_string('managesubscriptionson', 'forum'), 2);
echo $forumoutput->subscriber_selection_form($existingselector, $subscriberselector);
} else {
echo $OUTPUT->heading(get_string('subscribers', 'forum'), 2);
$subscribers = \mod_forum\subscriptions::fetch_subscribed_users($forum, $currentgroup, $context);
if (\mod_forum\subscriptions::is_forcesubscribed($forum)) {
$subscribers = mod_forum_filter_hidden_users($cm, $context, $subscribers);

View File

@ -32,9 +32,8 @@ Feature: Changes to the subscription mode of a forum can change subcribers of a
When I select "Auto subscription" from the "Subscription mode" singleselect
Then I should not see "There are no subscribers yet for this forum"
And I navigate to "Subscriptions" in current page administration
And I should see "Student 1"
And I should see "student.1@example.com"
And I should see "Student 2"
And I should see "student.2@example.com"
And I should see "Teacher Tom"
And I should see "teacher@example.com"
And the following should exist in the "subscribers-table" table:
| Full name | Email address |
| Student 1 | student.1@example.com |
| Student 2 | student.2@example.com |
| Teacher Tom | teacher@example.com |