Add reset company color button so that the color can be easily switched back to the original state.

This commit is contained in:
Alex Tselegidis 2022-01-24 20:58:15 +01:00
parent 2f41c28786
commit d580463977
30 changed files with 81 additions and 15 deletions

View file

@ -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['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.';
$lang['private'] = 'Private'; $lang['private'] = 'Private';
$lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.';
$lang['reset'] = 'Reset';
// End // End

View file

@ -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['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.';
$lang['private'] = 'Private'; $lang['private'] = 'Private';
$lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.';
$lang['reset'] = 'Reset';
// End // End

View file

@ -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['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.';
$lang['private'] = 'Private'; $lang['private'] = 'Private';
$lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.';
$lang['reset'] = 'Reset';
// End // End

View file

@ -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['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.';
$lang['private'] = 'Private'; $lang['private'] = 'Private';
$lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.';
$lang['reset'] = 'Reset';
// End // End

View file

@ -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['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.';
$lang['private'] = 'Private'; $lang['private'] = 'Private';
$lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.';
$lang['reset'] = 'Reset';
// End // End

View file

@ -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['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.';
$lang['private'] = 'Private'; $lang['private'] = 'Private';
$lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.';
$lang['reset'] = 'Reset';
// End // End

View file

@ -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['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.';
$lang['private'] = 'Private'; $lang['private'] = 'Private';
$lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.';
$lang['reset'] = 'Reset';
// End // End

View file

@ -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['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.';
$lang['private'] = 'Private'; $lang['private'] = 'Private';
$lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.';
$lang['reset'] = 'Reset';
// End // End

View file

@ -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['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.';
$lang['private'] = 'Private'; $lang['private'] = 'Private';
$lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.';
$lang['reset'] = 'Reset';
// End // End

View file

@ -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['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.';
$lang['private'] = 'Private'; $lang['private'] = 'Private';
$lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.';
$lang['reset'] = 'Reset';
// End // End

View file

@ -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['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.';
$lang['private'] = 'Private'; $lang['private'] = 'Private';
$lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.';
$lang['reset'] = 'Reset';
// End // End

View file

@ -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['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.';
$lang['private'] = 'Private'; $lang['private'] = 'Private';
$lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.';
$lang['reset'] = 'Reset';
// End // End

View file

@ -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['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.';
$lang['private'] = 'Private'; $lang['private'] = 'Private';
$lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.';
$lang['reset'] = 'Reset';
// End // End

View file

@ -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['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.';
$lang['private'] = 'Private'; $lang['private'] = 'Private';
$lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.';
$lang['reset'] = 'Reset';
// End // End

View file

@ -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['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.';
$lang['private'] = 'Private'; $lang['private'] = 'Private';
$lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.';
$lang['reset'] = 'Reset';
// End // End

View file

@ -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['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.';
$lang['private'] = 'Private'; $lang['private'] = 'Private';
$lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.';
$lang['reset'] = 'Reset';
// End // End

View file

@ -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['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.';
$lang['private'] = 'Private'; $lang['private'] = 'Private';
$lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.';
$lang['reset'] = 'Reset';
// End // End

View file

@ -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['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.';
$lang['private'] = 'Private'; $lang['private'] = 'Private';
$lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.';
$lang['reset'] = 'Reset';
// End // End

View file

@ -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['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.';
$lang['private'] = 'Private'; $lang['private'] = 'Private';
$lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.';
$lang['reset'] = 'Reset';
// End // End

View file

@ -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['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.';
$lang['private'] = 'Private'; $lang['private'] = 'Private';
$lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.';
$lang['reset'] = 'Reset';
// End // End

View file

@ -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['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.';
$lang['private'] = 'Private'; $lang['private'] = 'Private';
$lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.';
$lang['reset'] = 'Reset';
// End // End

View file

@ -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['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.';
$lang['private'] = 'Private'; $lang['private'] = 'Private';
$lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.';
$lang['reset'] = 'Reset';
// End // End

View file

@ -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['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.';
$lang['private'] = 'Private'; $lang['private'] = 'Private';
$lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.';
$lang['reset'] = 'Reset';
// End // End

View file

@ -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['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.';
$lang['private'] = 'Private'; $lang['private'] = 'Private';
$lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.';
$lang['reset'] = 'Reset';
// End // End

View file

@ -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['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.';
$lang['private'] = 'Private'; $lang['private'] = 'Private';
$lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.';
$lang['reset'] = 'Reset';
// End // End

View file

@ -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['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.';
$lang['private'] = 'Private'; $lang['private'] = 'Private';
$lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.';
$lang['reset'] = 'Reset';
// End // End

View file

@ -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['display_login_button_hint'] = 'Defines whether the login button is being displayed in the booking page.';
$lang['private'] = 'Private'; $lang['private'] = 'Private';
$lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.'; $lang['private_hint'] = 'Private records will not be displayed or processed in public pages such as the booking page.';
$lang['reset'] = 'Reset';
// End // End

View file

@ -66,7 +66,8 @@
<label class="form-label" for="company-logo"> <label class="form-label" for="company-logo">
<?= lang('company_logo') ?> <?= lang('company_logo') ?>
</label> </label>
<input type="file" id="company-logo" data-field="company_logo" class="form-control" accept="image/*"> <input type="file" id="company-logo" data-field="company_logo" class="form-control"
accept="image/*">
<div class="form-text text-muted"> <div class="form-text text-muted">
<small> <small>
<?= lang('company_logo_hint') ?> <?= lang('company_logo_hint') ?>
@ -74,11 +75,13 @@
</div> </div>
<div class="d-flex justify-content-center"> <div class="d-flex justify-content-center">
<img src="#" alt="Company Logo Preview" id="company-logo-preview" class="img-thumbnail my-3" hidden> <img src="#" alt="Company Logo Preview" id="company-logo-preview"
class="img-thumbnail my-3" hidden>
</div> </div>
<div class="d-flex justify-content-center"> <div class="d-flex justify-content-center">
<button type="button" class="btn btn-danger btn-sm mb-3" id="remove-company-logo" hidden> <button type="button" class="btn btn-danger btn-sm mb-3"
id="remove-company-logo" hidden>
<i class="fas fa-trash me-2"></i> <i class="fas fa-trash me-2"></i>
<?= lang('remove') ?> <?= lang('remove') ?>
</button> </button>
@ -89,12 +92,23 @@
<label class="form-label" for="company-color"> <label class="form-label" for="company-color">
<?= lang('company_color') ?> <?= lang('company_color') ?>
</label> </label>
<input type="color" id="company-color" data-field="company_color" class="form-control">
<input type="color" id="company-color" data-field="company_color"
class="form-control">
<div class="form-text text-muted"> <div class="form-text text-muted">
<small> <small>
<?= lang('company_color_hint') ?> <?= lang('company_color_hint') ?>
</small> </small>
</div> </div>
<div class="d-flex justify-content-center">
<button type="button" class="btn btn-danger btn-sm my-3"
id="reset-company-color" hidden>
<i class="fas fa-undo-alt me-2"></i>
<?= lang('reset') ?>
</button>
</div>
</div> </div>
</div> </div>
</div> </div>

View file

@ -239,7 +239,7 @@
<h3><?= lang('working_plan') ?></h3> <h3><?= lang('working_plan') ?></h3>
<button id="reset-working-plan" class="btn btn-primary" <button id="reset-working-plan" class="btn btn-primary"
data-tippy-content="<?= lang('reset_working_plan') ?>"> data-tippy-content="<?= lang('reset_working_plan') ?>">
<i class="fas fa-redo-alt me-2"></i> <i class="fas fa-undo-alt me-2"></i>
<?= lang('reset_plan') ?></button> <?= lang('reset_plan') ?></button>
<table class="working-plan table table-striped mt-2"> <table class="working-plan table table-striped mt-2">
<thead> <thead>

View file

@ -19,6 +19,8 @@ App.Pages.GeneralSettings = (function () {
const $companyLogo = $('#company-logo'); const $companyLogo = $('#company-logo');
const $companyLogoPreview = $('#company-logo-preview'); const $companyLogoPreview = $('#company-logo-preview');
const $removeCompanyLogo = $('#remove-company-logo'); const $removeCompanyLogo = $('#remove-company-logo');
const $companyColor = $('#company-color');
const $resetCompanyColor = $('#reset-company-color');
let companyLogoBase64 = ''; let companyLogoBase64 = '';
/** /**
@ -64,6 +66,11 @@ App.Pages.GeneralSettings = (function () {
return; return;
} }
if (generalSetting.name === 'company_color' && generalSetting.value !== '#ffffff') {
$resetCompanyColor.prop('hidden', false);
return;
}
$('[data-field="' + generalSetting.name + '"]').val(generalSetting.value); $('[data-field="' + generalSetting.name + '"]').val(generalSetting.value);
}); });
} }
@ -135,20 +142,38 @@ App.Pages.GeneralSettings = (function () {
$removeCompanyLogo.prop('hidden', true); $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. * Initialize the module.
*/ */
function initialize() { function initialize() {
const generalSettings = vars('general_settings');
deserialize(generalSettings);
$saveSettings.on('click', onSaveSettingsClick); $saveSettings.on('click', onSaveSettingsClick);
$companyLogo.on('change', onCompanyLogoChange); $companyLogo.on('change', onCompanyLogoChange);
$removeCompanyLogo.on('click', onRemoveCompanyLogoClick); $removeCompanyLogo.on('click', onRemoveCompanyLogoClick);
$companyColor.on('change', onCompanyColorChange);
$resetCompanyColor.on('click', onResetCompanyColorClick);
const generalSettings = vars('general_settings');
deserialize(generalSettings);
App.Layouts.Backend.placeFooterToBottom(); App.Layouts.Backend.placeFooterToBottom();
} }