Commit ebae6e47 authored by Michael Iseard's avatar Michael Iseard
Browse files

Rename privacy_link to terms_link

parent d6afc91b
......@@ -79,7 +79,7 @@ class KudosModal {
// Global settings.
'vendor' => Settings::get_setting( 'payment_vendor' ),
'privacy_link' => Settings::get_setting( "privacy_link" ),
'terms_link' => Settings::get_setting( 'terms_link' ),
'subscription' => [
'enabled' => Settings::get_setting( 'subscription_enabled' ),
],
......
......@@ -115,7 +115,7 @@ class Settings {
'show_in_rest' => true,
'default' => true,
],
'privacy_link' => [
'terms_link' => [
'type' => 'string',
'show_in_rest' => true,
'default' => null,
......
......@@ -44,6 +44,15 @@ class ActivatorService {
if ( $old_version ) {
if ( version_compare( $old_version, '2.1.2', '<' ) ) {
$link = Settings::get_setting('privacy_link');
if($link) {
Settings::update_setting('terms_link', $link);
Settings::remove_setting('privacy_link');
}
}
if ( version_compare( $old_version, '2.1.1', '<' ) ) {
$logger->info( 'Upgrading to version 2.1.1', [ 'previous_version' => $old_version ] );
Settings::remove_setting('action_scheduler');
......
const {__} = wp.i18n;
const { PanelBody, TextControl} = wp.components;
const PrivacyPolicyPanel = (props ) => {
const TermsPanel = (props ) => {
return (
<PanelBody
title={ __( 'Privacy Policy', 'kudos-donations' ) }
title={ __( 'Terms and Conditions', 'kudos-donations' ) }
initialOpen={ false }
>
<TextControl
label={ __( 'URL', 'kudos-donations' ) }
type={ 'text' }
value={ props.settings._kudos_privacy_link || '' }
value={ props.settings._kudos_terms_link || '' }
placeholder={ props.placeholder }
disabled={ props.isSaving }
onChange={ ( value ) => props.handleInputChange( "_kudos_privacy_link", value ) }
onChange={ ( value ) => props.handleInputChange( '_kudos_terms_link', value ) }
/>
</PanelBody>
);
};
export { PrivacyPolicyPanel };
export { TermsPanel };
......@@ -12,7 +12,7 @@ import { TestEmailPanel } from './Components/Panels/TestEmailPanel';
import { MollieApiKeysPanel } from './Components/Panels/MollieApiKeysPanel';
import { MollieApiModePanel } from './Components/Panels/MollieApiModePanel';
import { CustomReturnPanel } from './Components/Panels/CustomReturnPanel';
import { PrivacyPolicyPanel } from './Components/Panels/PrivacyPolicyPanel';
import { TermsPanel } from './Components/Panels/TermsPanel';
import { EmailReceiptsPanel } from './Components/Panels/EmailReceiptsPanel';
import { DebugModePanel } from './Components/Panels/DebugModePanel';
import { ThemePanel } from "./Components/Panels/ThemePanel";
......@@ -294,7 +294,7 @@ class KudosAdmin extends Component {
{...this.state}
handleInputChange={this.handleInputChange}
/>
<PrivacyPolicyPanel
<TermsPanel
{...this.state}
handleInputChange={this.handleInputChange}
/>
......
......@@ -43,10 +43,9 @@ __('By clicking donate you agree to the following payment', 'kudos-donations');
__('Name', 'kudos-donations');
__('Amount', 'kudos-donations');
__('Type', 'kudos-donations');
__( 'I agree with the %s', "kudos-donations" );
__( "privacy policy","kudos-donations" );
__( 'I agree with the privacy policy.', "kudos-donations" );
__('Donate', 'kudos-donations');
__( 'I agree with the %s', 'kudos-donations' );
__( 'terms and conditions','kudos-donations' );
__( 'Donate', 'kudos-donations' );
// Template: "templates/public/modal/message.modal.html.twig"
__( 'Ok', 'kudos-donations' );
......
......@@ -111,11 +111,14 @@
<p><strong>{{ __('Type', 'kudos-donations') }}: </strong><span class="summary_frequency"></span>
</p>
</div>
{{ checkbox('avg',
__( 'I agree with the %s', "kudos-donations" ) | format(
privacy_link ? '<a class="kd-text-theme hover:kd-text-theme-dark kd-shadow-none kd-underline kd-cursor-pointer kd-ml-1" target="_blank" href=%s>%s</a>.' | format(privacy_link ,__( "privacy policy","kudos-donations" ))
: __( "privacy policy","kudos-donations" ))
) }}
{% if (terms_link) %}
{{ checkbox('avg', __( 'I agree with the %s', 'kudos-donations' ) |
format( '<a class="kd-text-theme hover:kd-text-theme-dark kd-shadow-none kd-underline kd-cursor-pointer kd-ml-1" target="_blank" href=%s>%s</a>.' |
format( terms_link ,__( 'terms and conditions', 'kudos-donations' ) )
)) }}
{% endif %}
{% endblock %}
{% block next_button %}
{{ button(__('Donate', 'kudos-donations'), 'primary', 'submit', {'class': 'kudos_submit kd-ml-3'}) }}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment