Skip to:
Content

BuddyPress.org

Changeset 10128


Ignore:
Timestamp:
09/23/2015 01:01:42 AM (4 years ago)
Author:
mercime
Message:

Accessibility fix for Group Manage > Settings page.

This changeset:

  • unwrap labels from uls for valid markups
  • add 'id' attributes to radio inputs
  • add 'aria-describedby' attributes to radio inputs
  • add 'id' attributes to uls to bind to 'aria-describedby' in radio inputs
  • add 'for' attributes to labels
  • remove <strong> tags surrounding label text

See #6618.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-legacy/buddypress/groups/single/admin.php

    r10106 r10128  
    9292
    9393    <div class="radio">
    94         <label>
    95             <input type="radio" name="group-status" value="public"<?php bp_group_show_status_setting( 'public' ); ?> />
    96             <strong><?php _e( 'This is a public group', 'buddypress' ); ?></strong>
    97             <ul>
    98                 <li><?php _e( 'Any site member can join this group.', 'buddypress' ); ?></li>
    99                 <li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ); ?></li>
    100                 <li><?php _e( 'Group content and activity will be visible to any site member.', 'buddypress' ); ?></li>
    101             </ul>
    102         </label>
    103 
    104         <label>
    105             <input type="radio" name="group-status" value="private"<?php bp_group_show_status_setting( 'private' ); ?> />
    106             <strong><?php _e( 'This is a private group', 'buddypress' ); ?></strong>
    107             <ul>
    108                 <li><?php _e( 'Only users who request membership and are accepted can join the group.', 'buddypress' ); ?></li>
    109                 <li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ); ?></li>
    110                 <li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ); ?></li>
    111             </ul>
    112         </label>
    113 
    114         <label>
    115             <input type="radio" name="group-status" value="hidden"<?php bp_group_show_status_setting( 'hidden' ); ?> />
    116             <strong><?php _e( 'This is a hidden group', 'buddypress' ); ?></strong>
    117             <ul>
    118                 <li><?php _e( 'Only users who are invited can join the group.', 'buddypress' ); ?></li>
    119                 <li><?php _e( 'This group will not be listed in the groups directory or search results.', 'buddypress' ); ?></li>
    120                 <li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ); ?></li>
    121             </ul>
    122         </label>
     94
     95        <label for="group-status-public"><input type="radio" name="group-status" id="group-status-public" value="public"<?php if ( 'public' == bp_get_new_group_status() || !bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> aria-describedby="public-group-description" /> <?php _e( 'This is a public group', 'buddypress' ); ?></label>
     96
     97        <ul id="public-group-description">
     98            <li><?php _e( 'Any site member can join this group.', 'buddypress' ); ?></li>
     99            <li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ); ?></li>
     100            <li><?php _e( 'Group content and activity will be visible to any site member.', 'buddypress' ); ?></li>
     101        </ul>
     102
     103        <label for="group-status-private"><input type="radio" name="group-status" id="group-status-private" value="private"<?php if ( 'private' == bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> aria-describedby="private-group-description" /> <?php _e( 'This is a private group', 'buddypress' ); ?></label>
     104
     105        <ul id="private-group-description">
     106            <li><?php _e( 'Only users who request membership and are accepted can join the group.', 'buddypress' ); ?></li>
     107            <li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ); ?></li>
     108            <li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ); ?></li>
     109        </ul>
     110
     111        <label for="group-status-hidden"><input type="radio" name="group-status" id="group-status-hidden" value="hidden"<?php if ( 'hidden' == bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> aria-describedby="hidden-group-description" /> <?php _e('This is a hidden group', 'buddypress' ); ?></label>
     112
     113        <ul id="hidden-group-description">
     114            <li><?php _e( 'Only users who are invited can join the group.', 'buddypress' ); ?></li>
     115            <li><?php _e( 'This group will not be listed in the groups directory or search results.', 'buddypress' ); ?></li>
     116            <li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ); ?></li>
     117        </ul>
     118
    123119    </div>
    124120
     
    130126
    131127    <div class="radio">
    132         <label>
    133             <input type="radio" name="group-invite-status" value="members"<?php bp_group_show_invite_status_setting( 'members' ); ?> />
    134             <strong><?php _e( 'All group members', 'buddypress' ); ?></strong>
    135         </label>
    136 
    137         <label>
    138             <input type="radio" name="group-invite-status" value="mods"<?php bp_group_show_invite_status_setting( 'mods' ); ?> />
    139             <strong><?php _e( 'Group admins and mods only', 'buddypress' ); ?></strong>
    140         </label>
    141 
    142         <label>
    143             <input type="radio" name="group-invite-status" value="admins"<?php bp_group_show_invite_status_setting( 'admins' ); ?> />
    144             <strong><?php _e( 'Group admins only', 'buddypress' ); ?></strong>
    145         </label>
     128
     129        <label for="group-invite-status-members"><input type="radio" name="group-invite-status" id="group-invite-status-members" value="members"<?php bp_group_show_invite_status_setting( 'members' ); ?> /> <?php _e( 'All group members', 'buddypress' ); ?></label>
     130
     131        <label for="group-invite-status-mods"><input type="radio" name="group-invite-status" id="group-invite-status-mods" value="mods"<?php bp_group_show_invite_status_setting( 'mods' ); ?> /> <?php _e( 'Group admins and mods only', 'buddypress' ); ?></label>
     132
     133        <label for="group-invite-status-admins"><input type="radio" name="group-invite-status" id="group-invite-status-admins" value="admins"<?php bp_group_show_invite_status_setting( 'admins' ); ?> /> <?php _e( 'Group admins only', 'buddypress' ); ?></label>
     134
    146135    </div>
    147136
Note: See TracChangeset for help on using the changeset viewer.