Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/06/2014 02:50:45 PM (12 years ago)
Author:
boonebgorges
Message:

Introduce pagination for Send Invites page in single groups

For better support for up-to-date pagination, the AJAX for group invitations
now refreshes the entire invitation section, rather than simply adding single
items to/removing single items from the DOM. This change requires a new
template, groups/single/invite-loop.php, which is the item loaded by the AJAX
request. Backward compatibility with bp-default-style themes is maintained in
the JS.

Fixes #5423

Props dcavins

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-templates/bp-legacy/buddypress/groups/single/send-invites.php

    r7965 r8063  
    33<?php if ( bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
    44
     5        <?php /* 'send-invite-form' is important for AJAX support */ ?>
    56        <form action="<?php bp_group_send_invite_form_action(); ?>" method="post" id="send-invite-form" class="standard-form" role="main">
    67
    7                 <div class="left-menu">
     8                <div class="invite">
    89
    9                         <div id="invite-list">
    10                                 <ul>
    11                                         <?php bp_new_group_invite_friend_list(); ?>
    12                                 </ul>
     10                        <?php bp_get_template_part( 'groups/single/invites-loop' ); ?>
    1311
    14                                 <?php wp_nonce_field( 'groups_invite_uninvite_user', '_wpnonce_invite_uninvite_user' ); ?>
    15                         </div>
    16 
    17                 </div><!-- .left-menu -->
    18 
    19                 <div class="main-column">
    20 
    21                         <div id="message" class="info">
    22                                 <p><?php _e('Select people to invite from your friends list.', 'buddypress' ); ?></p>
    23                         </div>
    24 
    25                         <?php do_action( 'bp_before_group_send_invites_list' ); ?>
    26 
    27                         <?php /* The ID 'friend-list' is important for AJAX support. */ ?>
    28                         <ul id="friend-list" class="item-list">
    29                         <?php if ( bp_group_has_invites() ) : ?>
    30 
    31                                 <?php while ( bp_group_invites() ) : bp_group_the_invite(); ?>
    32 
    33                                         <li id="<?php bp_group_invite_item_id(); ?>">
    34                                                 <?php bp_group_invite_user_avatar(); ?>
    35 
    36                                                 <h4><?php bp_group_invite_user_link(); ?></h4>
    37                                                 <span class="activity"><?php bp_group_invite_user_last_active(); ?></span>
    38 
    39                                                 <?php do_action( 'bp_group_send_invites_item' ); ?>
    40 
    41                                                 <div class="action">
    42                                                         <a class="button remove" href="<?php bp_group_invite_user_remove_invite_url(); ?>" id="<?php bp_group_invite_item_id(); ?>"><?php _e( 'Remove Invite', 'buddypress' ); ?></a>
    43 
    44                                                         <?php do_action( 'bp_group_send_invites_item_action' ); ?>
    45                                                 </div>
    46                                         </li>
    47 
    48                                 <?php endwhile; ?>
    49 
    50                         <?php endif; ?>
    51                         </ul><!-- #friend-list -->
    52 
    53                         <?php do_action( 'bp_after_group_send_invites_list' ); ?>
    54 
    55                 </div><!-- .main-column -->
    56 
    57                 <div class="clear"></div>
    58 
    59                 <div class="submit">
    60                         <input type="submit" name="submit" id="submit" value="<?php esc_attr_e( 'Send Invites', 'buddypress' ); ?>" />
    6112                </div>
    62 
    63                 <?php wp_nonce_field( 'groups_send_invites', '_wpnonce_send_invites' ); ?>
    6413
    6514                <?php /* This is important, don't forget it */ ?>
     
    6817        </form><!-- #send-invite-form -->
    6918
    70 <?php else : ?>
    71 
    72         <div id="message" class="info" role="main">
    73                 <p><?php _e( 'Once you have built up friend connections you will be able to invite others to your group.', 'buddypress' ); ?></p>
    74         </div>
    75 
    7619<?php endif; ?>
    7720
Note: See TracChangeset for help on using the changeset viewer.