Ticket #6290: 6290.ux.02.patch
File 6290.ux.02.patch, 7.0 KB (added by , 10 years ago) |
---|
-
src/bp-core/css/avatar.css
1 div.bp-uploader-window { 2 clear: both; 3 } 4 1 5 div.bp-avatar-status { 2 6 clear: both; 3 7 margin: 1em 0; -
src/bp-core/js/avatar.js
61 61 $( '#avatar-upload' ).remove(); 62 62 $( '#avatar-upload-form p' ).remove(); 63 63 64 $('.profile .button:first-child').on('click', function(e) { 65 e.preventDefault(); 66 67 bp.Avatar.manualDeleteAvatar(); 68 69 // remove previous paragraphs and older delete button 70 $( "#avatar-upload-form" ).prevUntil( $('.profile'), 'p' ).fadeOut(600); 71 }); 72 64 73 // Group Manage 65 74 } else if ( $( '#group-settings-form' ).length ) { 66 $( '#group-settings-form p' ).each( function( i ) { 67 if ( 0 !== i ) { 68 $( this ).remove(); 69 } 75 $( 'p input' ).each( function( i ) { 76 $( this ).remove(); 70 77 } ); 71 78 72 if ( $( '#delete-group-avatar-button' ).length ) { 73 $( '#delete-group-avatar-button' ).remove(); 74 } 79 $('#delete-group-avatar-button').on('click', function(e) { 80 e.preventDefault(); 81 82 bp.Avatar.manualDeleteAvatar(); 83 84 // remove previous paragraphs and older delete button 85 $( ".bp-avatar-nav" ).prevUntil( $('#group-settings-form'), 'p' ).fadeOut(600); 86 $(this).fadeOut(600); 87 }); 75 88 76 89 // Group Create 77 90 } else if ( $( '#group-create-body' ).length ) { … … 349 362 350 363 avatarStatus.inject( '.bp-avatar-status' ); 351 364 } ); 365 }, 366 367 manualDeleteAvatar: function() { 368 // Reset to the delete view 369 bp.Avatar.nav.trigger( 'bp-avatar-view:changed', 'delete' ); 370 371 // Reset to the delete nav 372 _.each( bp.Avatar.navItems.models, function( model ) { 373 if ( model.id === 'delete' ) { 374 model.set( { active: 1 } ); 375 } else { 376 model.set( { active: 0 } ); 377 } 378 } ); 379 380 // Create the delete model 381 var delete_model = new Backbone.Model( _.pick( BP_Uploader.settings.defaults.multipart_params.bp_params, 382 'object', 383 'item_id', 384 'nonces' 385 ) ); 386 387 // manually call deleteAvatar function 388 bp.Avatar.deleteAvatar(delete_model); 352 389 } 353 390 }; 354 391 -
src/bp-templates/bp-legacy/buddypress/groups/single/admin.php
166 166 167 167 <?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?> 168 168 169 <p><?php _e("Upload an image to use as a profile photo for this group. The image will be shown on the main group page, and in search results.", 'buddypress' ); ?></p>170 171 <p>172 <input type="file" name="file" id="file" />173 <input type="submit" name="upload" id="upload" value="<?php esc_attr_e( 'Upload Image', 'buddypress' ); ?>" />174 <input type="hidden" name="action" id="action" value="bp_avatar_upload" />175 </p>176 177 169 <?php if ( bp_get_group_has_avatar() ) : ?> 178 170 179 171 <p><?php _e( "If you'd like to remove the existing group profile photo but not upload a new one, please use the delete group profile photo button.", 'buddypress' ); ?></p> 180 172 181 173 <?php bp_button( array( 'id' => 'delete_group_avatar', 'component' => 'groups', 'wrapper_id' => 'delete-group-avatar-button', 'link_class' => 'edit', 'link_href' => bp_get_group_avatar_delete_link(), 'link_title' => __( 'Delete Group Profile Photo', 'buddypress' ), 'link_text' => __( 'Delete Group Profile Photo', 'buddypress' ) ) ); ?> 182 174 175 <p><?php _e( 'Or:', 'buddypress' ); ?></p> 176 183 177 <?php endif; ?> 184 178 179 180 <p><?php _e("Upload an image to use as a profile photo for this group. The image will be shown on the main group page, and in search results.", 'buddypress' ); ?></p> 181 182 <p> 183 <input type="file" name="file" id="file" /> 184 <input type="submit" name="upload" id="upload" value="<?php esc_attr_e( 'Upload Image', 'buddypress' ); ?>" /> 185 <input type="hidden" name="action" id="action" value="bp_avatar_upload" /> 186 </p> 187 185 188 <?php 186 189 /** 187 190 * Load the Avatar UI templates -
src/bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php
11 11 12 12 <?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) : ?> 13 13 14 <p><?php _e( 'Your profile photo will be used on your profile and throughout the site. If there is a <a href="http://gravatar.com">Gravatar</a> associated with your account email we will use that, or you can upload an image from your computer.', 'buddypress' ); ?></p> 14 <?php if ( bp_get_user_has_avatar() ) : ?> 15 <p><?php _e( "If you'd like to delete your current profile photo but not upload a new one, please use the delete profile photo button.", 'buddypress' ); ?></p> 16 <p><a class="button edit" href="<?php bp_avatar_delete_link(); ?>" title="<?php esc_attr_e( 'Delete Profile Photo', 'buddypress' ); ?>"><?php _e( 'Delete My Profile Photo', 'buddypress' ); ?></a></p> 17 18 <p><?php _e( 'Or you can upload a new photo:', 'buddypress' ); ?></p> 19 20 <?php else : ?> 21 22 <p><?php _e( 'Your profile photo will be used on your profile and throughout the site. If there is a <a href="http://gravatar.com">Gravatar</a> associated with your account email we will use that, or you can upload an image from your computer.', 'buddypress' ); ?></p> 23 24 <?php endif; ?> 15 25 16 26 <form action="" method="post" id="avatar-upload-form" class="standard-form" enctype="multipart/form-data"> 17 27 … … 26 36 <input type="hidden" name="action" id="action" value="bp_avatar_upload" /> 27 37 </p> 28 38 29 <?php if ( bp_get_user_has_avatar() ) : ?>30 <p><?php _e( "If you'd like to delete your current profile photo but not upload a new one, please use the delete profile photo button.", 'buddypress' ); ?></p>31 <p><a class="button edit" href="<?php bp_avatar_delete_link(); ?>" title="<?php esc_attr_e( 'Delete Profile Photo', 'buddypress' ); ?>"><?php _e( 'Delete My Profile Photo', 'buddypress' ); ?></a></p>32 <?php endif; ?>33 34 39 <?php endif; ?> 35 40 36 41 <?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?> -
src/bp-templates/bp-legacy/css/buddypress.css
841 841 position: absolute; 842 842 } 843 843 844 #delete-group-avatar-button { 845 margin-bottom: 2em; 846 } 847 844 848 /*-------------------------------------------------------------- 845 849 3.6 - Ajax Loading 846 850 --------------------------------------------------------------*/ … … 1377 1381 list-style: none; 1378 1382 } 1379 1383 1380 1381 1384 /*-------------------------------------------------------------- 1382 1385 3.9 - Private Messaging Threads 1383 1386 --------------------------------------------------------------*/