Changeset 12073
- Timestamp:
- 05/10/2018 06:23:58 AM (8 years ago)
- Location:
- trunk/src/bp-templates/bp-nouveau
- Files:
-
- 6 edited
-
buddypress/common/js-templates/messages/index.php (modified) (1 diff)
-
css/buddypress-rtl.css (modified) (5 diffs)
-
css/buddypress.css (modified) (5 diffs)
-
includes/messages/functions.php (modified) (1 diff)
-
js/buddypress-messages.js (modified) (7 diffs)
-
sass/_nouveau_messages.scss (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-templates/bp-nouveau/buddypress/common/js-templates/messages/index.php
r12067 r12073 123 123 <div class="thread-cb"> 124 124 <input class="message-check" type="checkbox" name="message_ids[]" id="bp-message-thread-{{data.id}}" value="{{data.id}}"> 125 <label for="bp-message-thread-{{data.id}}" class="bp-screen-reader-text"><?php esc_html_e( 'Select this message', 'buddypress' ); ?></label> 126 </div> 127 <div class="thread-from"> 128 <a class="user-link" href="{{data.sender_link}}"> 129 <img class="avatar" src="{{data.sender_avatar}}" alt="" /> 130 <span class="user-name">{{data.sender_name}}</span> 131 </a> 132 </div> 125 <label for="bp-message-thread-{{data.id}}" class="bp-screen-reader-text"><?php esc_html_e( 'Select message:', 'buddypress' ); ?> {{data.subject}}</label> 126 </div> 127 128 <# if ( ! data.recipientsCount ) { #> 129 <div class="thread-from"> 130 <a class="user-link" href="{{data.sender_link}}"> 131 <img class="avatar" src="{{data.sender_avatar}}" alt="" /> 132 <span class="bp-screen-reader-text"><?php esc_html_e( 'From:', 'buddypress' ); ?></span> 133 <span class="user-name">{{data.sender_name}}</span> 134 </a> 135 </div> 136 <# } else { 137 var recipient = _.first( data.recipients ); 138 #> 139 <div class="thread-to"> 140 <a class="user-link" href="{{recipient.user_link}}"> 141 <img class="avatar" src="{{recipient.avatar}}" alt="" /> 142 <span class="bp-screen-reader-text"><?php esc_html_e( 'To:', 'buddypress' ); ?></span> 143 <span class="user-name">{{recipient.user_name}}</span> 144 </a> 145 146 <# if ( data.toOthers ) { #> 147 <span class="num-recipients">{{data.toOthers}}</span> 148 <# } #> 149 </div> 150 <# } #> 151 133 152 <div class="thread-content" data-thread-id="{{data.id}}"> 134 153 <div class="thread-subject"> 135 154 <span class="thread-count">({{data.count}})</span> 136 < span class="subject"><# print( data.subject ); #></span>137 </div> 138 <p class="excerpt"> <# print( data.excerpt ); #></p>155 <a class="subject" href="#view/{{data.id}}">{{data.subject}}</a> 156 </div> 157 <p class="excerpt">{{data.excerpt}}</p> 139 158 </div> 140 159 <div class="thread-date"> -
trunk/src/bp-templates/bp-nouveau/css/buddypress-rtl.css
r12069 r12073 2964 2964 } 2965 2965 2966 #message-threads li .thread-from { 2966 #message-threads li .thread-from, 2967 #message-threads li .thread-to { 2967 2968 -webkit-flex: 1 2 20%; 2968 2969 -moz-flex: 1 2 20%; … … 2972 2973 } 2973 2974 2974 #message-threads li .thread-from img.avatar { 2975 #message-threads li .thread-from img.avatar, 2976 #message-threads li .thread-to img.avatar { 2975 2977 float: right; 2976 2978 margin: 0 0 0 10px; 2977 2979 } 2978 2980 2979 #message-threads li .thread-from .user-name { 2981 #message-threads li .thread-from .user-name, 2982 #message-threads li .thread-to .user-name { 2980 2983 display: inline-block; 2981 2984 line-height: 1.1; 2985 } 2986 2987 #message-threads li .thread-from .num-recipients, 2988 #message-threads li .thread-to .num-recipients { 2989 color: #737373; 2990 font-weight: 400; 2991 font-size: 12px; 2992 margin: 0; 2982 2993 } 2983 2994 … … 3006 3017 } 3007 3018 3008 #message-threads li .thread-content{3009 cursor: pointer;3019 #message-threads li.unread { 3020 font-weight: 700; 3010 3021 } 3011 3022 … … 3017 3028 3018 3029 #message-threads li .thread-content .thread-from, 3030 #message-threads li .thread-content .thread-to, 3019 3031 #message-threads li .thread-content .thread-subject { 3020 3032 font-size: 13px; … … 3023 3035 @media screen and (min-width: 46.8em) { 3024 3036 #message-threads li .thread-content .thread-from, 3037 #message-threads li .thread-content .thread-to, 3025 3038 #message-threads li .thread-content .thread-subject { 3026 3039 font-size: 16px; -
trunk/src/bp-templates/bp-nouveau/css/buddypress.css
r12069 r12073 2964 2964 } 2965 2965 2966 #message-threads li .thread-from { 2966 #message-threads li .thread-from, 2967 #message-threads li .thread-to { 2967 2968 -webkit-flex: 1 2 20%; 2968 2969 -moz-flex: 1 2 20%; … … 2972 2973 } 2973 2974 2974 #message-threads li .thread-from img.avatar { 2975 #message-threads li .thread-from img.avatar, 2976 #message-threads li .thread-to img.avatar { 2975 2977 float: left; 2976 2978 margin: 0 10px 0 0; 2977 2979 } 2978 2980 2979 #message-threads li .thread-from .user-name { 2981 #message-threads li .thread-from .user-name, 2982 #message-threads li .thread-to .user-name { 2980 2983 display: inline-block; 2981 2984 line-height: 1.1; 2985 } 2986 2987 #message-threads li .thread-from .num-recipients, 2988 #message-threads li .thread-to .num-recipients { 2989 color: #737373; 2990 font-weight: 400; 2991 font-size: 12px; 2992 margin: 0; 2982 2993 } 2983 2994 … … 3006 3017 } 3007 3018 3008 #message-threads li .thread-content{3009 cursor: pointer;3019 #message-threads li.unread { 3020 font-weight: 700; 3010 3021 } 3011 3022 … … 3017 3028 3018 3029 #message-threads li .thread-content .thread-from, 3030 #message-threads li .thread-content .thread-to, 3019 3031 #message-threads li .thread-content .thread-subject { 3020 3032 font-size: 13px; … … 3023 3035 @media screen and (min-width: 46.8em) { 3024 3036 #message-threads li .thread-content .thread-from, 3037 #message-threads li .thread-content .thread-to, 3025 3038 #message-threads li .thread-content .thread-subject { 3026 3039 font-size: 16px; -
trunk/src/bp-templates/bp-nouveau/includes/messages/functions.php
r12071 r12073 108 108 ), 109 109 'bulk_actions' => bp_nouveau_messages_get_bulk_actions(), 110 'howto' => __( 'Click on the message title to preview it in the Active conversation box below.', 'buddypress' ), 111 'howtoBulk' => __( 'Use the select box to define your bulk action and click on the ✓ button to apply.', 'buddypress' ), 112 'toOthers' => array( 113 'one' => __( '(and 1 other)', 'buddypress' ), 114 'more' => __( '(and %d others)', 'buddypress' ), 115 ), 110 116 ); 111 117 -
trunk/src/bp-templates/bp-nouveau/js/buddypress-messages.js
r12071 r12073 635 635 636 636 events: { 637 'click .thread-content' : 'changePreview', 638 'dblclick .thread-content' : 'loadSingleView' 637 'click .subject' : 'changePreview' 639 638 }, 640 639 … … 667 666 threadsFetched: function() { 668 667 bp.Nouveau.Messages.removeFeedback(); 668 669 // Inform the user about how to use the UI. 670 bp.Nouveau.Messages.displayFeedback( BP_Nouveau.messages.howto, 'info' ); 669 671 }, 670 672 … … 689 691 }, 690 692 691 changePreview: function( event ) { 692 var target = $( event.currentTarget ); 693 694 if ( ! target.hasClass( 'thread-content' ) || $( event.target ).hasClass( 'user-link' ) ) { 695 return event; 696 } 697 698 event.preventDefault(); 699 700 if ( target.parent( 'li' ).hasClass( 'selected' ) ) { 693 setActiveThread: function( active ) { 694 if ( ! active ) { 701 695 return; 702 696 } 703 697 704 var selected = target.data( 'thread-id' );705 706 698 _.each( this.collection.models, function( thread ) { 707 if ( thread.id === selected) {699 if ( thread.id === active ) { 708 700 thread.set( 'active', true ); 709 701 } else { … … 713 705 }, 714 706 707 changePreview: function( event ) { 708 var target = $( event.currentTarget ); 709 710 event.preventDefault(); 711 bp.Nouveau.Messages.removeFeedback(); 712 713 // If the click is done on an active conversation, open it. 714 if ( $( event.currentTarget ).closest( '.thread-item' ).hasClass( 'selected' ) ) { 715 this.loadSingleView( event ); 716 717 // Otherwise activate the conversation and display its preview. 718 } else { 719 this.setActiveThread( target.closest( '.thread-content' ).data( 'thread-id' ) ); 720 721 $( '.message-action-view' ).focus(); 722 } 723 }, 724 715 725 loadSingleView: function( event ) { 716 var target = $( event.currentTarget );717 718 if ( ! target.hasClass( 'thread-content' ) || $( event.target ).hasClass( 'user-link' ) ) {719 return event;720 }721 722 726 event.preventDefault(); 723 727 724 var id = target.data( 'thread-id' ); 725 726 bp.Nouveau.Messages.router.navigate( 'view/' + id, { trigger: true } ); 728 bp.Nouveau.Messages.router.navigate( 729 'view/' + $( event.currentTarget ).closest( '.thread-content' ).data( 'thread-id' ), 730 { trigger: true } 731 ); 727 732 } 728 733 } ); … … 744 749 if ( this.model.get( 'unread' ) ) { 745 750 this.el.className += ' unread'; 751 } 752 753 if ( 'sentbox' === bp.Nouveau.Messages.box ) { 754 var recipientsCount = this.model.get( 'recipients' ).length, toOthers = ''; 755 756 if ( 2 === recipientsCount ) { 757 toOthers = BP_Nouveau.messages.toOthers.one; 758 } else if ( 2 < recipientsCount ) { 759 toOthers = BP_Nouveau.messages.toOthers.more.replace( '%d', Number( recipientsCount - 1 ) ); 760 } 761 762 this.model.set( { 763 recipientsCount: recipientsCount, 764 toOthers: toOthers 765 }, { silent: true } ); 766 } else if ( this.model.get( 'recipientsCount' ) ) { 767 this.model.unset( 'recipientsCount', { silent: true } ); 746 768 } 747 769 … … 790 812 if ( hasChecked ) { 791 813 $( '#user-messages-bulk-actions' ).closest( '.bulk-actions-wrap' ).removeClass( 'bp-hide' ); 814 815 // Inform the user about how to use the bulk actions. 816 bp.Nouveau.Messages.displayFeedback( BP_Nouveau.messages.howtoBulk, 'info' ); 792 817 } else { 793 818 $( '#user-messages-bulk-actions' ).closest( '.bulk-actions-wrap' ).addClass( 'bp-hide' ); 819 820 bp.Nouveau.Messages.removeFeedback(); 794 821 } 795 822 }, … … 932 959 if ( isChecked ) { 933 960 $( this.el ).find( '.bulk-actions-wrap' ).removeClass( 'bp-hide' ).addClass( 'bp-show' ); 961 962 // Inform the user about how to use the bulk actions. 963 bp.Nouveau.Messages.displayFeedback( BP_Nouveau.messages.howtoBulk, 'info' ); 934 964 } else { 935 965 $( this.el ).find( '.bulk-actions-wrap' ).addClass( 'bp-hide' ); 966 967 bp.Nouveau.Messages.removeFeedback(); 936 968 } 937 969 -
trunk/src/bp-templates/bp-nouveau/sass/_nouveau_messages.scss
r12067 r12073 97 97 } 98 98 99 .thread-from { 99 .thread-from, 100 .thread-to { 100 101 101 102 @include box-item-size(1, 2, 20%); … … 110 111 line-height: 1.1; 111 112 } 113 114 .num-recipients { 115 color: $meta-text; 116 font-weight: 400; 117 118 @include font-size(12); 119 margin: 0; 120 } 112 121 } 113 122 … … 134 143 } 135 144 145 // the unread parent li 146 &.unread { 147 font-weight: 700; 148 } 149 136 150 .thread-content { 137 cursor: pointer;138 151 139 152 .excerpt { … … 145 158 146 159 .thread-from, 160 .thread-to, 147 161 .thread-subject { 148 162
Note: See TracChangeset
for help on using the changeset viewer.