diff --git wordcamp.org/public_html/wp-content/plugins/camptix-admin-flags/addons/admin-flags.php wordcamp.org/public_html/wp-content/plugins/camptix-admin-flags/addons/admin-flags.php
index 89165594..71bd0f48 100644
|
|
|
class CampTix_Admin_Flags_Addon extends CampTix_Addon { |
| 325 | 401 | data-command="{{data.command}}" |
| 326 | 402 | class="tix-toggle-flag"> |
| 327 | 403 | |
| 328 | | {{data.command}} <?php // todo use i18n var ?> |
| | 404 | {{data.command_label}} |
| 329 | 405 | </a> |
| 330 | 406 | </script> |
| 331 | 407 | |
| … |
… |
class CampTix_Admin_Flags_Addon extends CampTix_Addon { |
| 382 | 458 | ( function( $ ) { |
| 383 | 459 | $( '#posts-filter' ).on( 'click', 'a.tix-toggle-flag', function( event ) { |
| 384 | 460 | var itemTemplate, |
| 385 | | item = $( this ).parent(), |
| 386 | | attendeeID = $( this ).data( 'attendee-id' ), |
| 387 | | key = $( this ).data( 'key' ), |
| 388 | | command = $( this ).data( 'command' ), |
| 389 | | label = $( item ).find( '.tix-admin-flag-label' ).text(), |
| 390 | | nonce = $( this ).data( 'nonce' ); |
| | 461 | item = $( this ).parent(), |
| | 462 | attendeeID = $( this ).data( 'attendee-id' ), |
| | 463 | key = $( this ).data( 'key' ), |
| | 464 | command = $( this ).data( 'command' ), |
| | 465 | command_label = $( this ).text().trim(), |
| | 466 | label = $( item ).find( '.tix-admin-flag-label' ).text(), |
| | 467 | nonce = $( this ).data( 'nonce' ); |
| 391 | 468 | |
| 392 | 469 | event.preventDefault(); |
| 393 | 470 | |
| … |
… |
class CampTix_Admin_Flags_Addon extends CampTix_Addon { |
| 411 | 488 | if ( response.hasOwnProperty( 'success' ) && true === response.success ) { |
| 412 | 489 | if ( 'enable' == command ) { |
| 413 | 490 | command = 'disable'; |
| | 491 | command_label = <?php echo wp_json_encode( __( 'Disable', 'camptix' ) ); ?>; |
| 414 | 492 | } else if ( 'disable' == command ) { |
| 415 | 493 | command = 'enable'; |
| | 494 | command_label = <?php echo wp_json_encode( __( 'Enable', 'camptix' ) ); ?>; |
| 416 | 495 | } |
| 417 | 496 | } |
| 418 | 497 | |
| 419 | 498 | itemTemplate = _.template( $( '#tmpl-tix-admin-flag-toggle' ).html(), null, camptix.template_options ); |
| 420 | 499 | item.html( itemTemplate( { |
| 421 | 500 | attendee_id: attendeeID, |
| 422 | | key: key, |
| 423 | | command: command, |
| 424 | | label: label, |
| 425 | | nonce: nonce |
| | 501 | key: key, |
| | 502 | command: command, |
| | 503 | command_label: command_label, |
| | 504 | label: label, |
| | 505 | nonce: nonce |
| 426 | 506 | } ) ); |
| 427 | 507 | } |
| 428 | 508 | ); |