Skip to:
Content

Changeset 12241


Ignore:
Timestamp:
10/04/2018 06:16:38 PM (8 months ago)
Author:
boonebgorges
Message:

Groups: Improve Dashboard add-user interface for networks with many users.

When wp_is_large_network( 'users' ), the JS-driven autocomplete functionality
for the new member field should degrade gracefully.

Fixes #7980.

Location:
trunk/src/bp-groups
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/admin/js/admin.js

    r9819 r12241  
    2222
    2323        /* Replace noscript placeholder */
    24         $( '#bp-groups-new-members' ).prop( 'placeholder', BP_Group_Admin.add_member_placeholder );
     24        $( '#bp-groups-new-members.bp-suggest-user' ).prop( 'placeholder', BP_Group_Admin.add_member_placeholder );
    2525
    2626        /* Remove a member on 'x' click */
  • trunk/src/bp-groups/bp-groups-admin.php

    r11907 r12241  
    862862 */
    863863function bp_groups_admin_edit_metabox_add_new_members( $item ) {
     864    if ( wp_is_large_network( 'users' ) ) {
     865        $class  = '';
     866        $notice = __( 'Enter a comma-separated list of user logins.', 'buddypress' );
     867    } else {
     868        $class  = 'bp-suggest-user';
     869        $notice = '';
     870    }
     871
    864872    ?>
    865873
     
    868876        _e( 'Add new members', 'buddypress' );
    869877    ?></label>
    870     <input name="bp-groups-new-members" type="text" id="bp-groups-new-members" class="bp-suggest-user" placeholder="<?php esc_attr_e( 'Enter a comma-separated list of user logins.', 'buddypress' ) ?>" />
     878    <input name="bp-groups-new-members" type="text" id="bp-groups-new-members" class="<?php echo esc_attr( $class ); ?>" placeholder="" />
     879    <?php if ( $notice ) : ?>
     880        <p class="description"><?php echo esc_html( $notice ); ?></p>
     881    <?php endif; ?>
    871882    <ul id="bp-groups-new-members-list"></ul>
    872883    <?php
Note: See TracChangeset for help on using the changeset viewer.