Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/17/2011 05:39:42 AM (13 years ago)
Author:
johnjamesjacoby
Message:

Tweak the activity stream styling - remove faux-buttons and replace with links. Fix bp_dtheme_new_activity_comment() so that it uses the activity/comment.php template rather than being hardcoded into the function.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-themes/bp-default/activity/entry.php

    r4632 r4668  
    3232        </div>
    3333
     34        <?php if ( 'activity_comment' == bp_get_activity_type() ) : ?>
     35
     36            <div class="activity-inreplyto">
     37                <strong><?php _e( 'In reply to', 'buddypress' ); ?></strong> - <?php bp_activity_parent_content(); ?> &middot;
     38                <a href="<?php bp_activity_thread_permalink(); ?>" class="view" title="<?php _e( 'View Thread / Permalink', 'buddypress' ); ?>"><?php _e( 'View', 'buddypress' ); ?></a>
     39            </div>
     40
     41        <?php endif; ?>
     42
    3443        <?php if ( bp_activity_has_content() ) : ?>
    3544
     
    4453        <?php do_action( 'bp_activity_entry_content' ); ?>
    4554
    46         <div class="activity-meta">
    47             <?php
    48                 // Add the delete link if the user has permission on this item
    49                 if ( bp_activity_user_can_delete() )
    50                     bp_activity_delete_link();
    51             ?>
     55        <?php if ( is_user_logged_in() ) : ?>
    5256
    53             <?php if ( is_user_logged_in() && bp_activity_can_favorite() ) : ?>
    54                 <?php if ( !bp_get_activity_is_favorite() ) : ?>
    55                     <a href="<?php bp_activity_favorite_link(); ?>" class="fav bp-secondary-action" title="<?php esc_attr_e( 'Mark as Favorite', 'buddypress' ); ?>"><?php _e( 'Favorite', 'buddypress' ) ?></a>
    56                 <?php else : ?>
    57                     <a href="<?php bp_activity_unfavorite_link(); ?>" class="unfav bp-secondary-action" title="<?php esc_attr_e( 'Remove Favorite', 'buddypress' ); ?>"><?php _e( 'Remove Favorite', 'buddypress' ) ?></a>
     57            <div class="activity-meta">
     58
     59                <?php if ( bp_activity_can_comment() ) : ?>
     60
     61                    <a href="<?php bp_get_activity_comment_link(); ?>" class="acomment-reply bp-primary-action" id="acomment-comment-<?php bp_activity_id(); ?>"><?php printf( __( 'Comment (<span>%s</span>)', 'buddypress' ), bp_activity_get_comment_count() ); ?></a>
     62
    5863                <?php endif; ?>
    59             <?php endif; ?>
    6064
    61             <?php do_action( 'bp_activity_entry_meta' ); ?>
    62         </div>
     65                <?php if ( bp_activity_can_favorite() ) : ?>
     66
     67                    <?php if ( !bp_get_activity_is_favorite() ) : ?>
     68
     69                        <a href="<?php bp_activity_favorite_link(); ?>" class="fav bp-secondary-action" title="<?php esc_attr_e( 'Mark as Favorite', 'buddypress' ); ?>"><?php _e( 'Favorite', 'buddypress' ) ?></a>
     70
     71                    <?php else : ?>
     72
     73                        <a href="<?php bp_activity_unfavorite_link(); ?>" class="unfav bp-secondary-action" title="<?php esc_attr_e( 'Remove Favorite', 'buddypress' ); ?>"><?php _e( 'Remove Favorite', 'buddypress' ) ?></a>
     74
     75                    <?php endif; ?>
     76
     77                <?php endif; ?>
     78
     79                <?php if ( bp_activity_user_can_delete() ) bp_activity_delete_link(); ?>
     80
     81                <?php do_action( 'bp_activity_entry_meta' ); ?>
     82
     83            </div>
     84
     85        <?php endif; ?>
     86
    6387    </div>
    64 
    65     <?php if ( 'activity_comment' == bp_get_activity_type() ) : ?>
    66 
    67         <div class="activity-inreplyto">
    68             <strong><?php _e( 'In reply to', 'buddypress' ); ?></strong> - <?php bp_activity_parent_content(); ?> &middot;
    69             <a href="<?php bp_activity_thread_permalink(); ?>" class="view" title="<?php _e( 'View Thread / Permalink', 'buddypress' ); ?>"><?php _e( 'View', 'buddypress' ); ?></a>
    70         </div>
    71 
    72     <?php endif; ?>
    7388
    7489    <?php do_action( 'bp_before_activity_entry_comments' ); ?>
    7590
    7691    <?php if ( bp_activity_can_comment() ) : ?>
     92
    7793        <div class="activity-comments">
    7894           
     
    8197            <?php if ( is_user_logged_in() ) : ?>
    8298
    83             <form action="<?php bp_activity_comment_form_action(); ?>" method="post" id="ac-form-<?php bp_activity_id(); ?>" class="ac-form"<?php bp_activity_comment_form_nojs_display(); ?>>
    84                 <div class="ac-reply-avatar"><?php bp_loggedin_user_avatar( 'width=' . bp_core_avatar_thumb_width() . '&height=' . bp_core_avatar_thumb_height() ); ?></div>
    85                 <div class="ac-reply-content">
    86                     <div class="ac-textarea">
    87                         <textarea id="ac-input-<?php bp_activity_id(); ?>" class="ac-input" name="ac_input_<?php bp_activity_id(); ?>"></textarea>
     99                <form action="<?php bp_activity_comment_form_action(); ?>" method="post" id="ac-form-<?php bp_activity_id(); ?>" class="ac-form"<?php bp_activity_comment_form_nojs_display(); ?>>
     100                    <div class="ac-reply-avatar"><?php bp_loggedin_user_avatar( 'width=' . BP_AVATAR_THUMB_WIDTH . '&height=' . BP_AVATAR_THUMB_HEIGHT ); ?></div>
     101                    <div class="ac-reply-content">
     102                        <div class="ac-textarea">
     103                            <textarea id="ac-input-<?php bp_activity_id(); ?>" class="ac-input" name="ac_input_<?php bp_activity_id(); ?>"></textarea>
     104                        </div>
     105                        <input type="submit" name="ac_form_submit" value="<?php _e( 'Post', 'buddypress' ); ?> &rarr;" /> &nbsp; <?php _e( 'or press esc to cancel.', 'buddypress' ); ?>
     106                        <input type="hidden" name="comment_form_id" value="<?php bp_activity_id(); ?>" />
    88107                    </div>
    89                     <input type="submit" name="ac_form_submit" value="<?php _e( 'Post', 'buddypress' ); ?> &rarr;" /> &nbsp; <?php _e( 'or press esc to cancel.', 'buddypress' ); ?>
    90                     <input type="hidden" name="comment_form_id" value="<?php bp_activity_id(); ?>" />
    91                 </div>
    92108
    93                 <?php do_action( 'bp_activity_entry_comments' ); ?>
    94                 <?php wp_nonce_field( 'new_activity_comment', '_wpnonce_new_activity_comment' ); ?>
     109                    <?php do_action( 'bp_activity_entry_comments' ); ?>
    95110
    96             </form>
     111                    <?php wp_nonce_field( 'new_activity_comment', '_wpnonce_new_activity_comment' ); ?>
     112
     113                </form>
    97114
    98115            <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.