Skip to content

Commit

Permalink
PRJ-55 - Initial setup for Activity
Browse files Browse the repository at this point in the history
  • Loading branch information
jitendrabanjara1991 committed Jan 21, 2025
1 parent 660b1ad commit b12cb20
Show file tree
Hide file tree
Showing 24 changed files with 1,051 additions and 0 deletions.
79 changes: 79 additions & 0 deletions src/bp-templates/bp-nouveau/readylaunch/activity/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?php
/**
* The ReadyLaunch template for BuddyBoss Activity templates.
*
* @since BuddyBoss [BBVERSION]
* @version 1.0.0
*/

$is_send_ajax_request = bb_is_send_ajax_request();

bp_nouveau_before_activity_directory_content();

if ( is_user_logged_in() ) :
bp_get_template_part( 'activity/post-form' );
endif;

bp_nouveau_template_notices();

if ( ! bp_nouveau_is_object_nav_in_sidebar() ) :
bp_get_template_part( 'common/nav/directory-nav' );
endif;
?>
<div class="bb-rl-screen-content">
<?php
bp_get_template_part( 'common/search-and-filters-bar' );
bp_nouveau_activity_hook( 'before_directory', 'list' );
?>

<div id="bb-rl-activity-stream" class="bb-rl-activity" data-bp-list="activity" data-ajax="<?php echo esc_attr( $is_send_ajax_request ? 'true' : 'false' ); ?>">
<?php
if ( $is_send_ajax_request ) {
echo '<div id="bb-rl-bp-ajax-loader">';
?>
<div class="bb-rl-activity-placeholder">
<div class="bb-rl-activity-placeholder_head">
<div class="bb-rl-activity-placeholder_avatar bb-rl-bg-animation bb-rl-loading-bg"></div>
<div class="bb-rl-activity-placeholder_details">
<div class="bb-rl-activity-placeholder_title bb-rl-bg-animation bb-rl-loading-bg"></div>
<div class="bb-rl-activity-placeholder_description bb-rl-bg-animation bb-rl-loading-bg"></div>
</div>
</div>
<div class="bb-rl-activity-placeholder_content">
<div class="bb-rl-activity-placeholder_title bb-rl-bg-animation bb-rl-loading-bg"></div>
<div class="bb-rl-activity-placeholder_title bb-rl-bg-animation bb-rl-loading-bg"></div>
</div>
<div class="bb-rl-activity-placeholder_actions">
<div class="bb-rl-activity-placeholder_description bb-rl-bg-animation bb-rl-loading-bg"></div>
<div class="bb-rl-activity-placeholder_description bb-rl-bg-animation bb-rl-loading-bg"></div>
<div class="bb-rl-activity-placeholder_description bb-rl-bg-animation bb-rl-loading-bg"></div>
</div>
</div>
<div class="bb-rl-activity-placeholder">
<div class="bb-rl-activity-placeholder_head">
<div class="bb-rl-activity-placeholder_avatar bb-rl-bg-animation bb-rl-loading-bg"></div>
<div class="bb-rl-activity-placeholder_details">
<div class="bb-rl-activity-placeholder_title bb-rl-bg-animation bb-rl-loading-bg"></div>
<div class="bb-rl-activity-placeholder_description bb-rl-bg-animation bb-rl-loading-bg"></div>
</div>
</div>
<div class="bb-rl-activity-placeholder_content">
<div class="bb-rl-activity-placeholder_title bb-rl-bg-animation bb-rl-loading-bg"></div>
<div class="bb-rl-activity-placeholder_title bb-rl-bg-animation bb-rl-loading-bg"></div>
</div>
<div class="bb-rl-activity-placeholder_actions">
<div class="bb-rl-activity-placeholder_description bb-rl-bg-animation bb-rl-loading-bg"></div>
<div class="bb-rl-activity-placeholder_description bb-rl-bg-animation bb-rl-loading-bg"></div>
<div class="bb-rl-activity-placeholder_description bb-rl-bg-animation bb-rl-loading-bg"></div>
</div>
</div>
<?php
echo '</div>';
} else {
bp_get_template_part( 'activity/activity-loop' );
}
?>
</div><!-- .activity -->

<?php bp_nouveau_after_activity_directory_content(); ?>
</div><!-- // .screen-content -->
46 changes: 46 additions & 0 deletions src/bp-templates/bp-nouveau/readylaunch/activity/post-form.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php
/**
* The ReadyLaunch template for BuddyBoss - Activity Post Form.
*
* @since BuddyBoss [BBVERSION]
* @version 1.0.0
*/

/*
* Template tag to prepare the activity post form checks capability and enqueue needed scripts.
*/
bp_nouveau_before_activity_post_form();

$current_action = bp_current_action();

if ( bp_is_user_activity() && ! bp_is_activity_tabs_active() && ! empty( $current_action ) ) {
$current_action = explode( ',', $current_action );
}

$bp_hide_class = (
(
! bb_user_can_create_activity() &&
! bp_is_group_activity()
) ||
(
! empty( $current_action ) &&
! is_array( $current_action ) &&
'just-me' !== $current_action &&
'activity' !== $current_action
)
) ? ' bp-hide is-bp-hide' : '';

// Added media off class.
$media_enabled_class = '';
if ( ! bp_is_active( 'media' ) ) {
$media_enabled_class = ' media-off';
}
?>
<h2 class="bb-rl-screen-reader-text"><?php esc_html_e( 'Post Update', 'buddyboss' ); ?></h2>
<div id="bb-rl-nouveau-activity-form-placeholder" class="bb-rl-nouveau-activity-form-placeholder-<?php echo esc_attr( $media_enabled_class . $bp_hide_class ); ?>"></div>
<div id="bb-rl-nouveau-activity-form" class="bb-rlactivity-update-form<?php echo esc_attr( $media_enabled_class . $bp_hide_class ); ?>"></div>
<?php
/*
* Template tag to load the JavaScript templates of the Post form UI.
*/
bp_nouveau_after_activity_post_form();
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php
/**
* Activity Post form JS Templates for ReadyLaunch.
*
* @since BuddyBoss [BBVERSION]
* @version 1.0.0
*/

/**
* Split each js template to its own file. Easier for child theme to
* overwrite individual parts.
*
* @version BuddyBoss [BBVERSION]
*/
$template_parts = apply_filters(
'bp_messages_js_template_parts',
array(
'parts/bp-activity-attached-gif',
'parts/bp-activity-link-preview',
'parts/bp-activity-media',
'parts/bp-activity-document',
'parts/bp-activity-video',
'parts/bp-activity-post-case-avatar',
'parts/bp-activity-post-case-heading',
'parts/bp-activity-post-case-privacy',
'parts/bp-activity-post-form-buttons',
'parts/bp-activity-post-form-feedback',
'parts/bp-activity-post-form-options',
'parts/bp-activity-header',
'parts/bp-activity-target-item',
'parts/bp-gif-media-search-dropdown',
'parts/bp-gif-result-item',
'parts/bp-whats-new-toolbar',
'parts/bp-editor-toolbar',
'parts/bp-activity-post-form-privacy',
'parts/bp-activity-edit-postin',
'parts/bp-activity-post-privacy-stage-footer',
)
);

foreach ( $template_parts as $template_part ) {
bp_get_template_part( 'common/js-templates/activity/' . $template_part );
}
Loading

0 comments on commit b12cb20

Please sign in to comment.