From d580463977d31c1d259960091879cfc9eb9e80b8 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Mon, 24 Jan 2022 20:58:15 +0100 Subject: [PATCH] Add reset company color button so that the color can be easily switched back to the original state. --- .../language/arabic/translations_lang.php | 1 + .../language/bulgarian/translations_lang.php | 1 + .../language/catalan/translations_lang.php | 1 + .../language/chinese/translations_lang.php | 1 + .../language/czech/translations_lang.php | 1 + .../language/danish/translations_lang.php | 1 + .../language/dutch/translations_lang.php | 1 + .../language/english/translations_lang.php | 1 + .../language/finnish/translations_lang.php | 1 + .../language/french/translations_lang.php | 1 + .../language/greek/translations_lang.php | 1 + .../language/hebrew/translations_lang.php | 1 + .../language/hindi/translations_lang.php | 1 + .../language/hungarian/translations_lang.php | 1 + .../language/italian/translations_lang.php | 1 + .../language/japanese/translations_lang.php | 1 + .../luxembourgish/translations_lang.php | 1 + .../language/marathi/translations_lang.php | 1 + .../language/polish/translations_lang.php | 1 + .../portuguese-br/translations_lang.php | 1 + .../language/portuguese/translations_lang.php | 1 + .../language/romanian/translations_lang.php | 1 + .../language/russian/translations_lang.php | 1 + .../language/slovak/translations_lang.php | 1 + .../language/spanish/translations_lang.php | 1 + .../language/swedish/translations_lang.php | 1 + .../language/turkish/translations_lang.php | 1 + application/views/pages/general_settings.php | 34 +++++++++++++------ application/views/pages/providers.php | 2 +- assets/js/pages/general_settings.js | 33 +++++++++++++++--- 30 files changed, 81 insertions(+), 15 deletions(-) diff --git a/application/language/arabic/translations_lang.php b/application/language/arabic/translations_lang.php index 629a1687..bf0c0d78 100755 --- a/application/language/arabic/translations_lang.php +++ b/application/language/arabic/translations_lang.php @@ -359,4 +359,5 @@ $lang['login_button'] = 'Login Button'; $lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; $lang['private'] = 'Private'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; +$lang['reset'] = 'Reset'; // End diff --git a/application/language/bulgarian/translations_lang.php b/application/language/bulgarian/translations_lang.php index 05f944a5..08f68ba8 100755 --- a/application/language/bulgarian/translations_lang.php +++ b/application/language/bulgarian/translations_lang.php @@ -359,4 +359,5 @@ $lang['login_button'] = 'Login Button'; $lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; $lang['private'] = 'Private'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; +$lang['reset'] = 'Reset'; // End diff --git a/application/language/catalan/translations_lang.php b/application/language/catalan/translations_lang.php index 16bbf54c..16831f76 100644 --- a/application/language/catalan/translations_lang.php +++ b/application/language/catalan/translations_lang.php @@ -359,4 +359,5 @@ $lang['login_button'] = 'Login Button'; $lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; $lang['private'] = 'Private'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; +$lang['reset'] = 'Reset'; // End diff --git a/application/language/chinese/translations_lang.php b/application/language/chinese/translations_lang.php index 77889dfb..8cb2958f 100755 --- a/application/language/chinese/translations_lang.php +++ b/application/language/chinese/translations_lang.php @@ -359,4 +359,5 @@ $lang['login_button'] = 'Login Button'; $lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; $lang['private'] = 'Private'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; +$lang['reset'] = 'Reset'; // End diff --git a/application/language/czech/translations_lang.php b/application/language/czech/translations_lang.php index 122b9d9a..2f402492 100644 --- a/application/language/czech/translations_lang.php +++ b/application/language/czech/translations_lang.php @@ -359,4 +359,5 @@ $lang['login_button'] = 'Login Button'; $lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; $lang['private'] = 'Private'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; +$lang['reset'] = 'Reset'; // End diff --git a/application/language/danish/translations_lang.php b/application/language/danish/translations_lang.php index 8efe2d00..45a3cd5d 100755 --- a/application/language/danish/translations_lang.php +++ b/application/language/danish/translations_lang.php @@ -359,4 +359,5 @@ $lang['login_button'] = 'Login Button'; $lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; $lang['private'] = 'Private'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; +$lang['reset'] = 'Reset'; // End diff --git a/application/language/dutch/translations_lang.php b/application/language/dutch/translations_lang.php index 58d57e4b..d0378c1f 100755 --- a/application/language/dutch/translations_lang.php +++ b/application/language/dutch/translations_lang.php @@ -359,4 +359,5 @@ $lang['login_button'] = 'Login Button'; $lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; $lang['private'] = 'Private'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; +$lang['reset'] = 'Reset'; // End diff --git a/application/language/english/translations_lang.php b/application/language/english/translations_lang.php index 97d31f83..b385c09f 100755 --- a/application/language/english/translations_lang.php +++ b/application/language/english/translations_lang.php @@ -359,4 +359,5 @@ $lang['login_button'] = 'Login Button'; $lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; $lang['private'] = 'Private'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; +$lang['reset'] = 'Reset'; // End diff --git a/application/language/finnish/translations_lang.php b/application/language/finnish/translations_lang.php index 5a3a2bbe..9623750b 100755 --- a/application/language/finnish/translations_lang.php +++ b/application/language/finnish/translations_lang.php @@ -359,4 +359,5 @@ $lang['login_button'] = 'Login Button'; $lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; $lang['private'] = 'Private'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; +$lang['reset'] = 'Reset'; // End diff --git a/application/language/french/translations_lang.php b/application/language/french/translations_lang.php index fa7e7174..82b8b289 100755 --- a/application/language/french/translations_lang.php +++ b/application/language/french/translations_lang.php @@ -359,4 +359,5 @@ $lang['login_button'] = 'Login Button'; $lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; $lang['private'] = 'Private'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; +$lang['reset'] = 'Reset'; // End diff --git a/application/language/greek/translations_lang.php b/application/language/greek/translations_lang.php index d9755299..d8613a8c 100755 --- a/application/language/greek/translations_lang.php +++ b/application/language/greek/translations_lang.php @@ -359,4 +359,5 @@ $lang['login_button'] = 'Login Button'; $lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; $lang['private'] = 'Private'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; +$lang['reset'] = 'Reset'; // End diff --git a/application/language/hebrew/translations_lang.php b/application/language/hebrew/translations_lang.php index f9d96d44..5405fca7 100644 --- a/application/language/hebrew/translations_lang.php +++ b/application/language/hebrew/translations_lang.php @@ -359,4 +359,5 @@ $lang['login_button'] = 'Login Button'; $lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; $lang['private'] = 'Private'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; +$lang['reset'] = 'Reset'; // End diff --git a/application/language/hindi/translations_lang.php b/application/language/hindi/translations_lang.php index af7ce8f3..dc070d4b 100755 --- a/application/language/hindi/translations_lang.php +++ b/application/language/hindi/translations_lang.php @@ -359,4 +359,5 @@ $lang['login_button'] = 'Login Button'; $lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; $lang['private'] = 'Private'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; +$lang['reset'] = 'Reset'; // End diff --git a/application/language/hungarian/translations_lang.php b/application/language/hungarian/translations_lang.php index 5543b130..0c6f9ab3 100755 --- a/application/language/hungarian/translations_lang.php +++ b/application/language/hungarian/translations_lang.php @@ -359,4 +359,5 @@ $lang['login_button'] = 'Login Button'; $lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; $lang['private'] = 'Private'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; +$lang['reset'] = 'Reset'; // End diff --git a/application/language/italian/translations_lang.php b/application/language/italian/translations_lang.php index 4b85c7c0..593ef852 100755 --- a/application/language/italian/translations_lang.php +++ b/application/language/italian/translations_lang.php @@ -359,4 +359,5 @@ $lang['login_button'] = 'Login Button'; $lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; $lang['private'] = 'Private'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; +$lang['reset'] = 'Reset'; // End diff --git a/application/language/japanese/translations_lang.php b/application/language/japanese/translations_lang.php index 13ba4e73..e646d8d9 100755 --- a/application/language/japanese/translations_lang.php +++ b/application/language/japanese/translations_lang.php @@ -359,4 +359,5 @@ $lang['login_button'] = 'Login Button'; $lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; $lang['private'] = 'Private'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; +$lang['reset'] = 'Reset'; // End diff --git a/application/language/luxembourgish/translations_lang.php b/application/language/luxembourgish/translations_lang.php index a5ca853c..abd6e1d8 100755 --- a/application/language/luxembourgish/translations_lang.php +++ b/application/language/luxembourgish/translations_lang.php @@ -359,4 +359,5 @@ $lang['login_button'] = 'Login Button'; $lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; $lang['private'] = 'Private'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; +$lang['reset'] = 'Reset'; // End diff --git a/application/language/marathi/translations_lang.php b/application/language/marathi/translations_lang.php index dbe559f0..5f0659d5 100644 --- a/application/language/marathi/translations_lang.php +++ b/application/language/marathi/translations_lang.php @@ -359,4 +359,5 @@ $lang['login_button'] = 'Login Button'; $lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; $lang['private'] = 'Private'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; +$lang['reset'] = 'Reset'; // End diff --git a/application/language/polish/translations_lang.php b/application/language/polish/translations_lang.php index 7c4df1a0..76a91aea 100755 --- a/application/language/polish/translations_lang.php +++ b/application/language/polish/translations_lang.php @@ -359,4 +359,5 @@ $lang['login_button'] = 'Login Button'; $lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; $lang['private'] = 'Private'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; +$lang['reset'] = 'Reset'; // End diff --git a/application/language/portuguese-br/translations_lang.php b/application/language/portuguese-br/translations_lang.php index 07e4e824..69c0de1c 100755 --- a/application/language/portuguese-br/translations_lang.php +++ b/application/language/portuguese-br/translations_lang.php @@ -358,4 +358,5 @@ $lang['login_button'] = 'Login Button'; $lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; $lang['private'] = 'Private'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; +$lang['reset'] = 'Reset'; // End diff --git a/application/language/portuguese/translations_lang.php b/application/language/portuguese/translations_lang.php index 9ea406b5..53a10a61 100755 --- a/application/language/portuguese/translations_lang.php +++ b/application/language/portuguese/translations_lang.php @@ -359,4 +359,5 @@ $lang['login_button'] = 'Login Button'; $lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; $lang['private'] = 'Private'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; +$lang['reset'] = 'Reset'; // End diff --git a/application/language/romanian/translations_lang.php b/application/language/romanian/translations_lang.php index 49a56f3a..753d4fa0 100755 --- a/application/language/romanian/translations_lang.php +++ b/application/language/romanian/translations_lang.php @@ -359,4 +359,5 @@ $lang['login_button'] = 'Login Button'; $lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; $lang['private'] = 'Private'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; +$lang['reset'] = 'Reset'; // End diff --git a/application/language/russian/translations_lang.php b/application/language/russian/translations_lang.php index a8863a35..57c7fe8d 100755 --- a/application/language/russian/translations_lang.php +++ b/application/language/russian/translations_lang.php @@ -359,4 +359,5 @@ $lang['login_button'] = 'Login Button'; $lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; $lang['private'] = 'Private'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; +$lang['reset'] = 'Reset'; // End diff --git a/application/language/slovak/translations_lang.php b/application/language/slovak/translations_lang.php index 03080cf6..34ec399b 100755 --- a/application/language/slovak/translations_lang.php +++ b/application/language/slovak/translations_lang.php @@ -359,4 +359,5 @@ $lang['login_button'] = 'Login Button'; $lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; $lang['private'] = 'Private'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; +$lang['reset'] = 'Reset'; // End diff --git a/application/language/spanish/translations_lang.php b/application/language/spanish/translations_lang.php index 65c5288f..afa7dd8d 100755 --- a/application/language/spanish/translations_lang.php +++ b/application/language/spanish/translations_lang.php @@ -359,4 +359,5 @@ $lang['login_button'] = 'Login Button'; $lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; $lang['private'] = 'Private'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; +$lang['reset'] = 'Reset'; // End diff --git a/application/language/swedish/translations_lang.php b/application/language/swedish/translations_lang.php index 04faf037..075ac2b8 100644 --- a/application/language/swedish/translations_lang.php +++ b/application/language/swedish/translations_lang.php @@ -359,4 +359,5 @@ $lang['login_button'] = 'Login Button'; $lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; $lang['private'] = 'Private'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; +$lang['reset'] = 'Reset'; // End diff --git a/application/language/turkish/translations_lang.php b/application/language/turkish/translations_lang.php index 67546992..29a4f877 100755 --- a/application/language/turkish/translations_lang.php +++ b/application/language/turkish/translations_lang.php @@ -359,4 +359,5 @@ $lang['login_button'] = 'Login Button'; $lang['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.'; $lang['private'] = 'Private'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; +$lang['reset'] = 'Reset'; // End diff --git a/application/views/pages/general_settings.php b/application/views/pages/general_settings.php index 27fb795a..07cec2d8 100755 --- a/application/views/pages/general_settings.php +++ b/application/views/pages/general_settings.php @@ -10,7 +10,7 @@
- + @@ -89,16 +92,27 @@ - + + +
+ +
+ +
- +

@@ -157,7 +171,7 @@

- +
- +
diff --git a/application/views/pages/providers.php b/application/views/pages/providers.php index b0fea678..22a049a0 100755 --- a/application/views/pages/providers.php +++ b/application/views/pages/providers.php @@ -239,7 +239,7 @@

diff --git a/assets/js/pages/general_settings.js b/assets/js/pages/general_settings.js index 0fc223a6..8226dde7 100644 --- a/assets/js/pages/general_settings.js +++ b/assets/js/pages/general_settings.js @@ -19,6 +19,8 @@ App.Pages.GeneralSettings = (function () { const $companyLogo = $('#company-logo'); const $companyLogoPreview = $('#company-logo-preview'); const $removeCompanyLogo = $('#remove-company-logo'); + const $companyColor = $('#company-color'); + const $resetCompanyColor = $('#reset-company-color'); let companyLogoBase64 = ''; /** @@ -64,6 +66,11 @@ App.Pages.GeneralSettings = (function () { return; } + if (generalSetting.name === 'company_color' && generalSetting.value !== '#ffffff') { + $resetCompanyColor.prop('hidden', false); + return; + } + $('[data-field="' + generalSetting.name + '"]').val(generalSetting.value); }); } @@ -135,20 +142,38 @@ App.Pages.GeneralSettings = (function () { $removeCompanyLogo.prop('hidden', true); } + /** + * Toggle the reset company color button. + */ + function onCompanyColorChange() { + $resetCompanyColor.prop('hidden', $companyColor.val() !== '#ffffff'); + } + + /** + * Set the company color value to "#ffffff" which is the default one. + */ + function onResetCompanyColorClick() { + $companyColor.val('#ffffff'); + } + /** * Initialize the module. */ function initialize() { - const generalSettings = vars('general_settings'); - - deserialize(generalSettings); - $saveSettings.on('click', onSaveSettingsClick); $companyLogo.on('change', onCompanyLogoChange); $removeCompanyLogo.on('click', onRemoveCompanyLogoClick); + $companyColor.on('change', onCompanyColorChange); + + $resetCompanyColor.on('click', onResetCompanyColorClick); + + const generalSettings = vars('general_settings'); + + deserialize(generalSettings); + App.Layouts.Backend.placeFooterToBottom(); }