Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/10/2019 07:57:41 PM (7 years ago)
Author:
boonebgorges
Message:

Nouveau: Fixes for the Friends Request page.

The Friends Request page was introduced in Nouveau with the same dropdown
filter as on other member directories, but the functionality was never
fully implemented. In this changeset, we make the following changes:

  • Ensure that the AJAX request distinguishes between friend request queries and other membership queries, so that the members returned are limited to friend requests.
  • Break the friend request loop logic into its own template, so that the outer template information (title, pagination, etc) doesn't appear twice after an AJAX filter.
  • Modify the logic in the friend-request template so that it uses bp_ajax_querystring(), which lets the filters affect the returned results.

Props imath.
Fixes #8035.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-nouveau/buddypress/members/single/friends/requests.php

    r12082 r12322  
    44 *
    55 * @since 3.0.0
    6  * @version 3.0.0
     6 * @version 5.0.0
    77 */
    88?>
     
    1212<?php bp_nouveau_member_hook( 'before', 'friend_requests_content' ); ?>
    1313
    14 <?php if ( bp_has_members( 'type=alphabetical&include=' . bp_get_friendship_requests() ) ) : ?>
     14<div data-bp-list="friendship_requests">
     15    <?php bp_get_template_part( 'members/single/friends/requests-loop' ); ?>
     16</div>
    1517
    16     <?php bp_nouveau_pagination( 'top' ); ?>
    17 
    18     <ul id="friend-list" class="<?php bp_nouveau_loop_classes(); ?>" data-bp-list="friendship_requests">
    19         <?php
    20         while ( bp_members() ) :
    21             bp_the_member();
    22         ?>
    23 
    24             <li id="friendship-<?php bp_friend_friendship_id(); ?>" <?php bp_member_class( array( 'item-entry' ) ); ?> data-bp-item-id="<?php bp_friend_friendship_id(); ?>" data-bp-item-component="members">
    25                 <div class="item-avatar">
    26                     <a href="<?php bp_member_link(); ?>"><?php bp_member_avatar( array( 'type' => 'full' ) ); ?></a>
    27                 </div>
    28 
    29                 <div class="item">
    30                     <div class="item-title"><a href="<?php bp_member_link(); ?>"><?php bp_member_name(); ?></a></div>
    31                     <div class="item-meta"><span class="activity"><?php bp_member_last_active(); ?></span></div>
    32 
    33                     <?php bp_nouveau_friend_hook( 'requests_item' ); ?>
    34                 </div>
    35 
    36                 <?php bp_nouveau_members_loop_buttons(); ?>
    37             </li>
    38 
    39         <?php endwhile; ?>
    40     </ul>
    41 
    42     <?php bp_nouveau_friend_hook( 'requests_content' ); ?>
    43 
    44     <?php bp_nouveau_pagination( 'bottom' ); ?>
    45 
    46 <?php else : ?>
    47 
    48     <?php bp_nouveau_user_feedback( 'member-requests-none' ); ?>
    49 
    50 <?php endif; ?>
    51 
    52 <?php
    53 bp_nouveau_member_hook( 'after', 'friend_requests_content' );
     18<?php bp_nouveau_member_hook( 'after', 'friend_requests_content' );
Note: See TracChangeset for help on using the changeset viewer.