Changeset 12115
- Timestamp:
- 05/24/2018 05:13:57 AM (7 years ago)
- Location:
- trunk/src/bp-templates/bp-nouveau
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-templates/bp-nouveau/buddypress/common/js-templates/messages/index.php
r12104 r12115 155 155 <div class="thread-subject"> 156 156 <span class="thread-count">({{data.count}})</span> 157 <a class="subject" href=" #view/{{data.id}}">{{data.subject}}</a>157 <a class="subject" href="../view/{{data.id}}/">{{data.subject}}</a> 158 158 </div> 159 159 <p class="excerpt">{{data.excerpt}}</p> … … 204 204 <# } #> 205 205 206 <a href=" #view/{{data.id}}" class="message-action-view bp-tooltip bp-icons" data-bp-tooltip="<?php esc_attr_e( 'View full conversation and reply.', 'buddypress' ); ?>">206 <a href="../view/{{data.id}}/" class="message-action-view bp-tooltip bp-icons" data-bp-action="view" data-bp-tooltip="<?php esc_attr_e( 'View full conversation and reply.', 'buddypress' ); ?>"> 207 207 <span class="bp-screen-reader-text"><?php esc_html_e( 'View full conversation and reply.', 'buddypress' ); ?></span> 208 208 </a> -
trunk/src/bp-templates/bp-nouveau/includes/messages/functions.php
r12106 r12115 115 115 'more' => __( '(and %d others)', 'buddypress' ), 116 116 ), 117 'rootUrl' => trailingslashit( str_replace( home_url(), '', bp_displayed_user_domain() ) . bp_get_messages_slug() ), 117 118 ); 118 119 … … 179 180 if ( 'notices' === $secondary_nav_item->slug ) { 180 181 bp_core_remove_subnav_item( bp_get_messages_slug(), $secondary_nav_item->slug, 'members' ); 181 } else { 182 $params = array( 'link' => '#' . $secondary_nav_item->slug ); 183 184 // Make sure Admins won't write a messages from the user's account. 185 if ( 'compose' === $secondary_nav_item->slug ) { 186 $params['user_has_access'] = bp_is_my_profile(); 187 } 188 189 $bp->members->nav->edit_nav( $params, $secondary_nav_item->slug, bp_get_messages_slug() ); 182 } elseif ( 'compose' === $secondary_nav_item->slug ) { 183 $bp->members->nav->edit_nav( array( 184 'user_has_access' => bp_is_my_profile() 185 ), $secondary_nav_item->slug, bp_get_messages_slug() ); 190 186 } 191 187 } … … 205 201 $nav_id = str_replace( 'my-account-messages-', '', $nav['id'] ); 206 202 207 if ( 'my-account-messages' !== $nav_id ) { 208 if ( 'notices' === $nav_id ) { 209 $admin_nav[ $nav_iterator ]['href'] = esc_url( add_query_arg( array( 'page' => 'bp-notices' ), bp_get_admin_url( 'users.php' ) ) ); 210 } else { 211 $admin_nav[ $nav_iterator ]['href'] = $user_messages_link . '#' . trim( $nav_id ); 212 } 203 if ( 'notices' === $nav_id ) { 204 $admin_nav[ $nav_iterator ]['href'] = esc_url( add_query_arg( array( 205 'page' => 'bp-notices' 206 ), bp_get_admin_url( 'users.php' ) ) ); 213 207 } 214 208 } -
trunk/src/bp-templates/bp-nouveau/js/buddypress-messages.js
r12082 r12115 38 38 this.setupNav(); 39 39 40 Backbone.history.start(); 40 Backbone.history.start( { 41 pushState: true, 42 root: BP_Nouveau.messages.rootUrl 43 } ); 41 44 }, 42 45 … … 70 73 71 74 // Navigate back to current box 72 self.router.navigate( self.box , { trigger: true } );75 self.router.navigate( self.box + '/', { trigger: true } ); 73 76 74 77 // Otherwise load it 75 78 } else { 76 self.router.navigate( 'compose ', { trigger: true } );79 self.router.navigate( 'compose/', { trigger: true } ); 77 80 } 78 81 … … 83 86 self.clearViews(); 84 87 85 self.router.navigate( view_id , { trigger: true } );88 self.router.navigate( view_id + '/', { trigger: true } ); 86 89 } 87 90 } … … 617 620 bp.Nouveau.Messages.views.remove( { id: 'compose', view: form } ); 618 621 619 bp.Nouveau.Messages.router.navigate( 'sentbox ', { trigger: true } );622 bp.Nouveau.Messages.router.navigate( 'sentbox/', { trigger: true } ); 620 623 } ).fail( function( response ) { 621 624 if ( response.feedback ) { … … 713 716 714 717 // If the click is done on an active conversation, open it. 715 if ( $( event.currentTarget ).closest( '.thread-item' ).hasClass( 'selected' ) ) { 716 this.loadSingleView( event ); 718 if ( target.closest( '.thread-item' ).hasClass( 'selected' ) ) { 719 bp.Nouveau.Messages.router.navigate( 720 'view/' + target.closest( '.thread-content' ).data( 'thread-id' ) + '/', 721 { trigger: true } 722 ); 717 723 718 724 // Otherwise activate the conversation and display its preview. … … 722 728 $( '.message-action-view' ).focus(); 723 729 } 724 },725 726 loadSingleView: function( event ) {727 event.preventDefault();728 729 bp.Nouveau.Messages.router.navigate(730 'view/' + $( event.currentTarget ).closest( '.thread-content' ).data( 'thread-id' ),731 { trigger: true }732 );733 730 } 734 731 } ); … … 896 893 mid = model.get( 'id' ); 897 894 898 if ( 'star' === action || 'unstar' === action ) { 895 // Open the full conversation 896 if ( 'view' === action ) { 897 bp.Nouveau.Messages.router.navigate( 898 'view/' + mid + '/', 899 { trigger: true } 900 ); 901 902 return; 903 904 // Star/Unstar actions needs to use a specific id and nonce. 905 } else if ( 'star' === action || 'unstar' === action ) { 899 906 options.data = { 900 907 'star_nonce' : model.get( 'star_nonce' ) … … 1324 1331 bp.Nouveau.Messages.Router = Backbone.Router.extend( { 1325 1332 routes: { 1326 'compose ' : 'composeMessage',1327 'view/:id ': 'viewMessage',1328 'sentbox ' : 'sentboxView',1329 'starred ' : 'starredView',1330 'inbox ' : 'inboxView',1333 'compose/' : 'composeMessage', 1334 'view/:id/': 'viewMessage', 1335 'sentbox/' : 'sentboxView', 1336 'starred/' : 'starredView', 1337 'inbox/' : 'inboxView', 1331 1338 '' : 'inboxView' 1332 1339 },
Note: See TracChangeset
for help on using the changeset viewer.