Skip to content

Commit

Permalink
MDL-76313 forum: improve accessibility on subscribers page
Browse files Browse the repository at this point in the history
- add header on table of subscribers
- remove one redundant header
  • Loading branch information
jboulen committed Jan 10, 2023
1 parent b8b905c commit 5f49367
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
7 changes: 7 additions & 0 deletions mod/forum/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ public function subscriber_overview($users, $forum , $course) {
$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';
Expand Down
1 change: 0 additions & 1 deletion mod/forum/subscribers.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@
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);
Expand Down
11 changes: 5 additions & 6 deletions mod/forum/tests/behat/forum_subscriptions_mode_behaviour.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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 "[email protected]"
And I should see "Student 2"
And I should see "[email protected]"
And I should see "Teacher Tom"
And I should see "[email protected]"
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 |

0 comments on commit 5f49367

Please sign in to comment.