Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PROD-8291] [PROD-8327] Profile popup cards #4570

Open
wants to merge 44 commits into
base: release
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
ac1b7f4
[PROD-8291] Profile popup cards
annrra Dec 3, 2024
83d711f
[PROD-8291] Retrieve necessary data and improve logic to hide/show pr…
annrra Dec 3, 2024
761ce8d
[PROD-8291] Updated profile card template
annrra Dec 6, 2024
055fc4f
[PROD-8291] Refactor profilePopupCard to use REST API
annrra Dec 9, 2024
cf901cd
[PROD-8291] Add localized site_rest_url parameter for profile popup card
annrra Dec 10, 2024
74d0304
[PROD-8291] Update profile card template and populate with dynamic da…
annrra Dec 10, 2024
8c3658a
[PROD-8291] Update profile card template and populate with dynamic data
annrra Dec 10, 2024
e737a50
[PROD-8291] Refactor code and update card popup data
annrra Dec 10, 2024
4269b0b
[PROD-8291] Add data-bp-profile-card attribute to be used for activit…
annrra Dec 10, 2024
395a133
[PROD-8291] Update profile card footer template and action buttons
annrra Dec 11, 2024
0d8169c
[PROD-8291] Updates in follow/unfollow button
annrra Dec 11, 2024
4eeea21
[PROD-8291] Update event delegation for action buttons within profile…
annrra Dec 11, 2024
210fcc9
[PROD-8291] code cleanup
annrra Dec 12, 2024
b0697c8
[PROD-8291] code cleanup
annrra Dec 12, 2024
f48d9af
[PROD-8291] Updates in profile card friendship button
annrra Dec 12, 2024
0c5c4f9
[PROD-8291] code cleanup
annrra Dec 12, 2024
7830aaa
[PROD-8291] Prevent card popup data reload and improve hover transition
annrra Dec 12, 2024
78b9634
PROD-8291: Added nonce for rest endpoint to fix the current user session
surajkrsingh Dec 13, 2024
613c691
[PROD-8291] Updated connect/follow buttons and UI improvements for ac…
annrra Dec 13, 2024
2878048
[PROD-8291] Group popup cards
annrra Dec 16, 2024
7766c34
[PROD-8291] Add group members data
annrra Dec 17, 2024
83fd0ab
[PROD-8291] Cancel ongoing AJAX requests when switching quick between…
annrra Dec 17, 2024
6cb23c2
[PROD-8291] uglify buddypress-nouveau
annrra Dec 17, 2024
40d2db5
[PROD-8291] Update group cards template and populate with data
annrra Dec 18, 2024
852b371
[PROD-8291] Overall UI updates - updates in group action buttons
annrra Dec 19, 2024
1f2adfa
[PROD-8291] Cache fetched profile/group data to reduce unnecessary re…
annrra Dec 20, 2024
f877568
[PROD-8291] Update action buttons icons and clear part of profile/gro…
annrra Dec 23, 2024
363a0cc
[PROD-8291] Position card popups above media modal container
annrra Dec 23, 2024
ac7335f
[PROD-8291] Use custom colors for member type labels
annrra Dec 23, 2024
63a5dc6
[PROD-8291] Reset custom colors for member type labels
annrra Dec 23, 2024
73b2d3f
[PROD-8291] Implemented additional breakpoints for screen widths
annrra Dec 26, 2024
fe7ffc2
[PROD-8291] Group/author cards + updated logic to show/hide popups
annrra Dec 26, 2024
5f19782
[PROD-8291] Temporarily remove author avatar selector from event binding
annrra Dec 26, 2024
03a029e
[PROD-8291] Improved logic to switch between group/profile popup
annrra Dec 27, 2024
e831851
[PROD-8291] Style profile card action buttons for smaller screens
annrra Dec 27, 2024
7ffe63e
[PROD-8291] Refactor code for consistency, security and clarity
annrra Jan 7, 2025
a762152
[PROD-8291] grunt uglify
annrra Jan 7, 2025
ac31974
[PROD-8291] Pass profile card attributes in activity entry template a…
annrra Jan 7, 2025
a2702f6
[PROD-8291] Code cleanup
annrra Jan 7, 2025
24c7bf1
PROD-8291 - Optimize code to display profile/group card
jitendrabanjara1991 Jan 9, 2025
e8b8e7f
PROD-8291 - Code alignment fix
jitendrabanjara1991 Jan 9, 2025
c7f96ee
PROD-8291 - Formatting js
jitendrabanjara1991 Jan 9, 2025
dcaafac
PROD-8291 - Prevent to call API if not found group id and user id and…
jitendrabanjara1991 Jan 9, 2025
7843205
[PROD-8291] Skip showing profile card for currently logged in user
annrra Jan 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/bp-activity/bp-activity-filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,18 @@
add_action( 'bp_after_directory_activity_list', 'bb_activity_add_modal_template' );
add_action( 'bp_after_group_activity_content', 'bb_activity_add_modal_template' );
add_action( 'bp_after_member_activity_content', 'bb_activity_add_modal_template' );

// Profile card template for activity.
add_action( 'bp_after_directory_activity_list', 'bb_activity_add_profile_card_template' );
add_action( 'bp_after_single_activity_content', 'bb_activity_add_profile_card_template' );
add_action( 'bp_after_group_activity_content', 'bb_activity_add_profile_card_template' );
add_action( 'bp_after_member_activity_content', 'bb_activity_add_profile_card_template' );

// Group card template for activity.
add_action( 'bp_after_directory_activity_list', 'bb_activity_add_group_card_template' );
add_action( 'bp_after_group_activity_content', 'bb_activity_add_group_card_template' );
add_action( 'bp_after_member_activity_content', 'bb_activity_add_group_card_template' );

add_action( 'bp_after_directory_activity_list', 'bb_gifpicker_add_popup_template' );
add_action( 'bp_after_group_activity_content', 'bb_gifpicker_add_popup_template' );
add_action( 'bp_after_member_activity_content', 'bb_gifpicker_add_popup_template' );
Expand Down Expand Up @@ -3795,3 +3807,21 @@ function bb_activity_directory_set_pagination( $querystring, $object ) {

return http_build_query( $querystring );
}

/**
* Add profile hover card template.
*
* @since BuddyBoss [BBVERSION]
*/
function bb_activity_add_profile_card_template() {
bp_get_template_part( 'activity/profile-card' );
}

/**
* Add group hover card template.
*
* @since BuddyBoss [BBVERSION]
*/
function bb_activity_add_group_card_template() {
bp_get_template_part( 'activity/group-card' );
}
4 changes: 4 additions & 0 deletions src/bp-templates/bp-nouveau/buddypress-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,10 @@ public function localize_scripts() {
),
'wpTime' => current_time( 'Y-m-d H:i:s' ),
'wpTimezone' => bp_get_option( 'timezone_string' ),
'rest_url' => home_url( 'wp-json/buddyboss/v1' ),
'rest_nonce' => wp_create_nonce( 'wp_rest' ),
'member_label' => __( 'member', 'buddyboss' ),
'members_label' => __( 'members', 'buddyboss' ),
);

// If the Object/Item nav are in the sidebar.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
$activity_comment_id = bp_get_activity_comment_id();
?>

<li id="acomment-<?php echo esc_attr( $activity_comment_id ); ?>" class="<?php bp_activity_comment_css_class(); ?>" data-bp-activity-comment-id="<?php echo esc_attr( $activity_comment_id ); ?>" data-bp-timestamp="<?php bb_nouveau_activity_comment_timestamp(); ?>" data-bp-activity-comment="<?php bb_nouveau_edit_activity_comment_data(); ?>">
<li id="acomment-<?php echo esc_attr( $activity_comment_id ); ?>" class="<?php bp_activity_comment_css_class(); ?>" data-bp-activity-comment-id="<?php echo esc_attr( $activity_comment_id ); ?>" data-bp-timestamp="<?php bb_nouveau_activity_comment_timestamp(); ?>" data-bp-activity-comment="<?php bb_nouveau_edit_activity_comment_data(); ?>" data-bb-profile-card="<?php echo bp_get_activity_comment_user_id(); ?>">

<div id="acomment-display-<?php echo esc_attr( $activity_comment_id ); ?>" class="acomment-display">

Expand Down
2 changes: 1 addition & 1 deletion src/bp-templates/bp-nouveau/buddypress/activity/entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

?>

<li class="<?php bp_activity_css_class(); ?>" id="activity-<?php echo esc_attr( $activity_id ); ?>" data-bp-activity-id="<?php echo esc_attr( $activity_id ); ?>" data-bp-timestamp="<?php bp_nouveau_activity_timestamp(); ?>" data-bp-activity="<?php bp_nouveau_edit_activity_data(); ?>" data-link-preview='<?php echo $link_preview_string; ?>' data-link-url='<?php echo empty( $link_url ) ? '' : esc_url( $link_url ); ?>' data-activity-popup-title='<?php echo empty( $activity_popup_title ) ? '' : esc_html( $activity_popup_title ); ?>'>
<li class="<?php bp_activity_css_class(); ?>" id="activity-<?php echo esc_attr( $activity_id ); ?>" data-bp-activity-id="<?php echo esc_attr( $activity_id ); ?>" data-bp-timestamp="<?php bp_nouveau_activity_timestamp(); ?>" data-bp-activity="<?php bp_nouveau_edit_activity_data(); ?>" data-link-preview='<?php echo $link_preview_string; ?>' data-link-url='<?php echo empty( $link_url ) ? '' : esc_url( $link_url ); ?>' data-activity-popup-title='<?php echo empty( $activity_popup_title ) ? '' : esc_html( $activity_popup_title ); ?>' data-bb-profile-card="<?php echo bp_get_activity_user_id(); ?>">

<?php bb_nouveau_activity_entry_bubble_buttons(); ?>

Expand Down
58 changes: 58 additions & 0 deletions src/bp-templates/bp-nouveau/buddypress/activity/group-card.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php
/**
* The template for groups card.
*
* This template can be overridden by copying it to yourtheme/buddypress/activity/group-card.php.
*
* @since BuddyBoss [BBVERSION]
* @version 1.0.0
*/

?>
<div id="group-card" class="bb-group-card bb-popup-card" data-bp-item-id="" data-bp-item-component="groups">

<div class="skeleton-card">
<div class="skeleton-card-body">
<div class="skeleton-card-avatar bb-loading-bg"></div>
<div class="skeleton-card-entity">
<div class="skeleton-card-heading bb-loading-bg"></div>
<div class="skeleton-card-meta bb-loading-bg"></div>
</div>
</div>
<?php $plain_class = ! is_user_logged_in() ? 'skeleton-footer-plain' : ''; ?>
<div class="skeleton-card-footer <?php echo esc_attr( $plain_class ); ?>">
<div class="skeleton-card-button bb-loading-bg"></div>
<div class="skeleton-card-button bb-loading-bg"></div>
</div>
</div>

<div class="bb-card-content">
<div class="bb-card-body">
<div class="bb-card-avatar">
<img src="" alt="">
</div>
<div class="bb-card-entity">
<h4 class="bb-card-heading"></h4>
<div class="bb-card-meta">
<span class="card-meta-item card-meta-status"></span>
<span class="card-meta-item card-meta-type"></span>
<span class="card-meta-item card-meta-last-active"></span>
</div>
<div class="card-group-members">
<span class="bs-group-members"></span>
</div>
</div>
</div>
<div class="bb-card-footer">
<?php if ( is_user_logged_in() ) : ?>
<?php if ( bp_is_active( 'groups' ) ) : ?>
<div class="bb-card-action bb-card-action-join bb-card-action-primary"></div>
<?php endif; ?>
<?php endif; ?>
<div class="bb-card-action bb-card-action-outline">
<a href="" class="card-button card-button-group"><?php esc_html_e( 'View Group', 'buddyboss' ); ?></a>
</div>
</div>
</div>

</div>
69 changes: 69 additions & 0 deletions src/bp-templates/bp-nouveau/buddypress/activity/profile-card.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?php
/**
* The template for profile card.
*
* This template can be overridden by copying it to yourtheme/buddypress/activity/profile-card.php.
*
* @since BuddyBoss [BBVERSION]
* @version 1.0.0
*/

?>
<div id="profile-card" class="bb-profile-card bb-popup-card" data-bp-item-id="" data-bp-item-component="members">

<div class="skeleton-card">
<div class="skeleton-card-body">
<div class="skeleton-card-avatar bb-loading-bg"></div>
<div class="skeleton-card-entity">
<div class="skeleton-card-type bb-loading-bg"></div>
<div class="skeleton-card-heading bb-loading-bg"></div>
<div class="skeleton-card-meta bb-loading-bg"></div>
</div>
</div>
<?php $plain_class = ! is_user_logged_in() ? 'skeleton-footer-plain' : ''; ?>
<div class="skeleton-card-footer <?php echo esc_attr( $plain_class ); ?>">
<div class="skeleton-card-button bb-loading-bg"></div>
<div class="skeleton-card-button bb-loading-bg"></div>
<div class="skeleton-card-button bb-loading-bg"></div>
</div>
</div>

<div class="bb-card-content">
<div class="bb-card-body">
<div class="bb-card-avatar">
<span class="card-profile-status"></span>
<img src="" alt="">
</div>
<div class="bb-card-entity">
<div class="bb-card-profile-type"></div>
<h4 class="bb-card-heading"></h4>
<div class="bb-card-meta">
<span class="card-meta-item card-meta-joined"><?php esc_html_e( 'Joined', 'buddyboss' ); ?> <span></span></span>
<span class="card-meta-item card-meta-last-active"></span>
<span class="card-meta-item card-meta-followers"></span>
</div>
</div>
</div>
<div class="bb-card-footer">
<?php if ( is_user_logged_in() ) : ?>
<?php if ( bp_is_active( 'messages' ) ) : ?>
<div class="bb-card-action bb-card-action-primary">
<a href="" class="card-button send-message">
<i class="bb-icon-l bb-icon-comment"></i>
<?php esc_html_e( 'Message', 'buddyboss' ); ?>
</a>
</div>
<?php else : ?>
<?php if ( bp_is_active( 'friends' ) ) : ?>
<div class="bb-card-action bb-card-action-connect bb-card-action-primary"></div>
<?php endif; ?>
<?php endif; ?>
<div class="bb-card-action bb-card-action-follow bb-card-action-secondary"></div>
<?php endif; ?>
<div class="bb-card-action bb-card-action-outline">
<a href="" class="card-button card-button-profile"><?php esc_html_e( 'View Profile', 'buddyboss' ); ?></a>
</div>
</div>
</div>

</div>
53 changes: 29 additions & 24 deletions src/bp-templates/bp-nouveau/common-styles/_bp_lists.scss
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,34 @@

}

.footer-button-wrap {

@include dis-flex;

.action {
width: 100%;

.generic-button {
float: left;
}

}

}

@media screen and (max-width: 375px) {

> li {
min-width: 280px;
}

}

}

.buddypress-wrap ul.bp-list.groups-dir-list,
.bb-group-card {

.bs-group-members {

@include dis-flex;
Expand All @@ -506,6 +534,7 @@
margin-right: 5px;

.bs-group-member {
display: block;
max-width: 28px;
float: left;
margin-right: -9px;
Expand Down Expand Up @@ -555,30 +584,6 @@
.group-footer-wrap:not(.group-join-button-hidden) .bs-group-members {
margin-left: -4px;
}

.footer-button-wrap {

@include dis-flex;

.action {
width: 100%;

.generic-button {
float: left;
}

}

}

@media screen and (max-width: 375px) {

> li {
min-width: 280px;
}

}

}

// Ensure there's space between parent act list wrapper and filters bar
Expand Down
Loading