Skip to content

Commit

Permalink
Merge branch 'release/2.0.1' into release/2.1
Browse files Browse the repository at this point in the history
* release/2.0.1: (47 commits)
  rename "customer_id" variables to a better fit of "donor_id"
  update phpdoc to reflect multiple possible variable types
  update phpdoc to reflect multiple possible variable types
  update phpdoc to reflect proper default value
  update phpdoc to reflect multiple possible variable types
  update phpdoc to reflect multiple possible variable types
  update phpdoc to reflect multiple possible variable types
  update phpdoc to reflect multiple possible variable types
  update phpdoc to reflect actual default value
  remove unneeded period after a variable.
  update object type variable
  Add clarity to docs
  Version bumped
  Apply posts_where clause on payment sql query
  Add __rename_meta_table_name reusable fn
  Use $meta_type to generate table name
  Fix #2683
  Fix broken unit test.
  Added icon and updated text for per form email tab - Fixes #2680
  Resolved issue with untranslatable string and incorrect variable name
  ...
  • Loading branch information
DevinWalker committed Jan 23, 2018
2 parents 7653ee6 + 067759e commit a9fd1b2
Show file tree
Hide file tree
Showing 43 changed files with 1,797 additions and 1,368 deletions.
24 changes: 24 additions & 0 deletions assets/js/admin/admin-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,30 @@ jQuery(document).ready(function ($) {
$default_gateway.html(active_payment_option_html);
});

/**
* Change currency position symbol on changing the currency
*/
var give_settings_currency = '#give-mainform #currency';
var give_settings_position = '#give-mainform #currency_position';
$( 'body' ).on( 'change', give_settings_currency, function () {
var currency_text = $( give_settings_currency + ' option:selected' ).text(),
currency_sign = currency_text.split( '(' ).pop().split( ')' ).shift();

if ( '' === currency_sign ) {
currency_sign = give_vars.currency_sign;
}

var before_text = $( give_settings_position ).data( 'before-template' );
before_text = before_text.replace( '{currency_pos}', currency_sign );
$( give_settings_position + ' option[value="before"]' ).text( before_text );


var after_text = $( give_settings_position ).data( 'after-template' );
after_text = after_text.replace( '{currency_pos}', currency_sign );
$( give_settings_position + ' option[value="after"]' ).text( after_text );

} );

/**
* Repeater setting field event.
*/
Expand Down
2 changes: 1 addition & 1 deletion assets/js/frontend/give.all.min.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions assets/js/frontend/give.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ jQuery( function( $ ) {
// Set custom validation message.
give_change_html5_form_field_validation_message();

// Disable button if it have give-disabled class init.
doc.on( 'click touchend', '.give-disabled', function ( e ) {
e.preventDefault();
return false;
} );

doc.on( 'give_gateway_loaded', function( ev, response, form_id ) {
// Trigger float-labels
give_fl_trigger();
Expand Down
2 changes: 1 addition & 1 deletion assets/js/frontend/give.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 39 additions & 38 deletions assets/scss/frontend/float-labels.scss
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
#{fl(parent)}.#{fl(prefix)}form.#{fl(prefix)}style-give {
input.#{fl(prefix)}input,
select.#{fl(prefix)}select,
textarea.#{fl(prefix)}textarea {
line-height: inherit;
padding: 12px;
}
select.#{fl(prefix)}select {
line-height: inherit;
}
.#{fl(prefix)}is-active input.#{fl(prefix)}input,
.#{fl(prefix)}is-active select.#{fl(prefix)}select,
.#{fl(prefix)}is-active textarea.#{fl(prefix)}textarea {
padding: 20px 12px 4px;
transition: padding fl(transition-speed) fl(transition-easing),
border fl(transition-speed) fl(transition-easing);
}
label.#{fl(prefix)}label {
top: fl(border-width);
left: 13px;
right: 0;
padding: 6px 0 0;
}
.#{fl(prefix)}is-required:before {
padding-top: 12px;
}
label.#{fl(prefix)}label .give-required-indicator {
display: none;
}
label.#{fl(prefix)}label .give-tooltip {
position: absolute;
top: 0;
width: 100%;
height: 100%;
margin: 0;
z-index: 1;
&::before {
content: unset;
}
input.#{fl(prefix)}input,
select.#{fl(prefix)}select,
textarea.#{fl(prefix)}textarea {
line-height: inherit;
padding: 12px;
background-color: #FFF;
}
select.#{fl(prefix)}select {
line-height: inherit;
}
.#{fl(prefix)}is-active input.#{fl(prefix)}input,
.#{fl(prefix)}is-active select.#{fl(prefix)}select,
.#{fl(prefix)}is-active textarea.#{fl(prefix)}textarea {
padding: 20px 12px 4px;
transition: padding fl(transition-speed) fl(transition-easing),
border fl(transition-speed) fl(transition-easing);
}
label.#{fl(prefix)}label {
top: fl(border-width);
left: 13px;
right: 0;
padding: 6px 0 0;
}
.#{fl(prefix)}is-required:before {
padding-top: 12px;
}
label.#{fl(prefix)}label .give-required-indicator {
display: none;
}
label.#{fl(prefix)}label .give-tooltip {
position: absolute;
top: 0;
width: 100%;
height: 100%;
margin: 0;
z-index: 1;
&::before {
content: unset;
}
}
}
2 changes: 1 addition & 1 deletion assets/sourcemaps/give.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "wordimpress/give",
"type": "wordpress-plugin",
"license": "GPL-2.0+",
"license": "GPL-2.0-or-later",
"description": "Give - a WordPress Donation Plugin and Fundraising Platform",
"homepage": "https://givewp.com/",
"require": {
Expand Down
6 changes: 3 additions & 3 deletions give.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: The most robust, flexible, and intuitive way to accept donations on WordPress.
* Author: WordImpress
* Author URI: https://wordimpress.com
* Version: 2.0.0
* Version: 2.0.1
* Text Domain: give
* Domain Path: /languages
* GitHub Plugin URI: https://github.com/WordImpress/Give
Expand Down Expand Up @@ -80,7 +80,7 @@ final class Give {
* @since 1.0
* @access public
*
* @var Give_Plugin_Settings object
* @var Give_Admin_Settings object
*/
public $give_settings;

Expand Down Expand Up @@ -365,7 +365,7 @@ private function setup_constants() {

// Plugin version
if ( ! defined( 'GIVE_VERSION' ) ) {
define( 'GIVE_VERSION', '2.0.0' );
define( 'GIVE_VERSION', '2.0.1' );
}

// Plugin Root File
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/admin-filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function __give_validate_decimal_separator_setting_field( $value ) {
*
* @since 1.8.14
*
* @param string $delimiter.
* @param string $delimiter
*
* @return string $delimiter.
*/
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/class-blank-slate.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class Give_Blank_Slate {
* The content of the blank slate panel.
*
* @since 1.8.13
* @var bool
* @var array
* @access private
*/
private $content = array();
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/donors/class-donor-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function column_default( $donor, $column_name ) {
case 'num_donations' :
$value = sprintf(
'<a href="%s">%s</a>',
admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&donor=' . absint( $donor['id'] ) ),
admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&status=publish&donor=' . absint( $donor['id'] ) ),
esc_html( $donor['num_donations'] )
);
break;
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/donors/donors.php
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ class="button info-item editable donor-edit-link"><?php _e( 'Edit Donor', 'give'
<div id="donor-stats-wrapper" class="donor-section postbox clear">
<ul>
<li>
<a href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&donor=' . absint( $donor->id ) ); ?>">
<a href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&status=publish&donor=' . absint( $donor->id ) ); ?>">
<span class="dashicons dashicons-heart"></span>
<?php
// Completed Donations.
Expand Down
12 changes: 11 additions & 1 deletion includes/admin/emails/class-donor-register-email.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Give_Donor_Register_Email extends Give_Email_Notification {
public function init() {
$this->load( array(
'id' => 'donor-register',
'label' => __( 'Donor Register', 'give' ),
'label' => __( 'User Registration Information', 'give' ),
'description' => __( 'Sent to the donor when they register for an account on the site.', 'give' ),
'notification_status' => 'enabled',
'email_tag_contex' => 'donor',
Expand Down Expand Up @@ -92,6 +92,14 @@ function get_default_email_message() {
);
}

/**
* Setup email data
*
* @since 2.0
*/
public function setup_email_data() {
Give()->emails->__set( 'heading', esc_html__( 'New User Registration', 'give' ) );
}

/**
* Setup and send new donor register notifications.
Expand All @@ -105,6 +113,8 @@ function get_default_email_message() {
* @return string
*/
public function setup_email_notification( $user_id, $user_data ) {
$this->setup_email_data();

$this->recipient_email = $user_data['user_email'];
$this->send_email_notification( array(
'user_id' => $user_id,
Expand Down
3 changes: 2 additions & 1 deletion includes/admin/emails/class-email-notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ public function add_metabox_setting_fields( $settings, $post_id ) {
// Email notification setting.
$settings['email_notification_options'] = array(
'id' => 'email_notification_options',
'title' => __( 'Email Notification', 'give' ),
'title' => __( 'Email Notifications', 'give' ),
'icon-html' => '<span class="dashicons dashicons-email-alt"></span>',
'fields' => array(
array(
'name' => __( 'Email Options', 'give' ),
Expand Down
15 changes: 13 additions & 2 deletions includes/admin/emails/class-new-donor-register-email.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class Give_New_Donor_Register_Email extends Give_Email_Notification {
public function init() {
$this->load( array(
'id' => 'new-donor-register',
'label' => __( 'New Donor Registration', 'give' ),
'description' => __( 'Sent to designated recipient(s) when a new donor registers on the site.', 'give' ),
'label' => __( 'New User Registration', 'give' ),
'description' => __( 'Sent to designated recipient(s) when a new user registers on the site via a donation form.', 'give' ),
'has_recipient_field' => true,
'notification_status' => 'enabled',
'has_preview_header' => true,
Expand Down Expand Up @@ -89,6 +89,15 @@ function get_default_email_message() {
);
}

/**
* Setup email data
*
* @since 2.0
*/
public function setup_email_data() {
Give()->emails->__set( 'heading', esc_html__( 'New User Registration', 'give' ) );
}


/**
* Send new donor register notifications.
Expand All @@ -102,6 +111,8 @@ function get_default_email_message() {
* @return string
*/
public function setup_email_notification( $user_id, $user_data ) {
$this->setup_email_data();

$this->send_email_notification( array(
'user_id' => $user_id,
) );
Expand Down
24 changes: 16 additions & 8 deletions includes/admin/settings/class-settings-general.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ public function get_settings() {
break;

case 'currency-settings' :
$currency_position_before = __( 'Before - %s&#x200e;10', 'give' );
$currency_position_after = __( 'After - 10%s&#x200f;', 'give' );

$settings = array(
// Section 2: Currency
array(
Expand All @@ -139,17 +142,21 @@ public function get_settings() {
'default' => 'USD',
),
array(
'name' => __( 'Currency Position', 'give' ),
'desc' => __( 'The position of the currency symbol.', 'give' ),
'id' => 'currency_position',
'type' => 'select',
'options' => array(
'name' => __( 'Currency Position', 'give' ),
'desc' => __( 'The position of the currency symbol.', 'give' ),
'id' => 'currency_position',
'type' => 'select',
'options' => array(
/* translators: %s: currency symbol */
'before' => sprintf( __( 'Before - %s&#x200e;10', 'give' ), give_currency_symbol( give_get_currency() ) ),
'before' => sprintf( $currency_position_before, give_currency_symbol( give_get_currency() ) ),
/* translators: %s: currency symbol */
'after' => sprintf( __( 'After - 10%s&#x200f;', 'give' ), give_currency_symbol( give_get_currency() ) ),
'after' => sprintf( $currency_position_after, give_currency_symbol( give_get_currency() ) ),
),
'default' => 'before',
'attributes' => array(
'data-before-template' => sprintf( $currency_position_before, '{currency_pos}' ),
'data-after-template' => sprintf( $currency_position_after, '{currency_pos}' ),
),
'default' => 'before',
),
array(
'name' => __( 'Thousands Separator', 'give' ),
Expand Down Expand Up @@ -187,6 +194,7 @@ public function get_settings() {
'id' => 'give_title_general_settings_2',
),
);

break;

case 'general-settings':
Expand Down

0 comments on commit a9fd1b2

Please sign in to comment.