Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/10/2018 06:23:58 AM (8 years ago)
Author:
imath
Message:

BP Nouveau - Messages UI: Improve a11y in message boxes.

Message boxes are listing messages (inbox, starbox, sentbox). Using screen reader softwares or the keyboard, it is now a better experience to navigate in these lists. Pressing the Tab key makes you navigate from the Message Checkbox, to the sender/recipients link and finally to the Message title. Once on a Message title, pressing the enter key activates the message and updates the preview box. Pressing on the enter key another time opens the full conversation.

Huge Props mercime

Fixes #7731

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-nouveau/buddypress/common/js-templates/messages/index.php

    r12067 r12073  
    123123    <div class="thread-cb">
    124124        <input class="message-check" type="checkbox" name="message_ids[]" id="bp-message-thread-{{data.id}}" value="{{data.id}}">
    125         <label for="bp-message-thread-{{data.id}}" class="bp-screen-reader-text"><?php esc_html_e( 'Select this message', 'buddypress' ); ?></label>
    126     </div>
    127     <div class="thread-from">
    128         <a class="user-link" href="{{data.sender_link}}">
    129             <img class="avatar" src="{{data.sender_avatar}}" alt="" />
    130             <span class="user-name">{{data.sender_name}}</span>
    131         </a>
    132     </div>
     125        <label for="bp-message-thread-{{data.id}}" class="bp-screen-reader-text"><?php esc_html_e( 'Select message:', 'buddypress' ); ?> {{data.subject}}</label>
     126    </div>
     127
     128    <# if ( ! data.recipientsCount ) { #>
     129        <div class="thread-from">
     130            <a class="user-link" href="{{data.sender_link}}">
     131                <img class="avatar" src="{{data.sender_avatar}}" alt="" />
     132                <span class="bp-screen-reader-text"><?php esc_html_e( 'From:', 'buddypress' ); ?></span>
     133                <span class="user-name">{{data.sender_name}}</span>
     134            </a>
     135        </div>
     136    <# } else {
     137        var recipient = _.first( data.recipients );
     138        #>
     139        <div class="thread-to">
     140            <a class="user-link" href="{{recipient.user_link}}">
     141                <img class="avatar" src="{{recipient.avatar}}" alt="" />
     142                <span class="bp-screen-reader-text"><?php esc_html_e( 'To:', 'buddypress' ); ?></span>
     143                <span class="user-name">{{recipient.user_name}}</span>
     144            </a>
     145
     146            <# if ( data.toOthers ) { #>
     147                <span class="num-recipients">{{data.toOthers}}</span>
     148            <# } #>
     149        </div>
     150    <# } #>
     151
    133152    <div class="thread-content" data-thread-id="{{data.id}}">
    134153        <div class="thread-subject">
    135154            <span class="thread-count">({{data.count}})</span>
    136             <span class="subject"><# print( data.subject ); #></span>
    137         </div>
    138         <p class="excerpt"><# print( data.excerpt ); #></p>
     155            <a class="subject" href="#view/{{data.id}}">{{data.subject}}</a>
     156        </div>
     157        <p class="excerpt">{{data.excerpt}}</p>
    139158    </div>
    140159    <div class="thread-date">
Note: See TracChangeset for help on using the changeset viewer.