Removed the service categories part from the services page
This commit is contained in:
parent
54ee7ac924
commit
2a599f11b8
2 changed files with 131 additions and 254 deletions
|
@ -10,7 +10,6 @@
|
||||||
<?php section('content') ?>
|
<?php section('content') ?>
|
||||||
|
|
||||||
<script src="<?= asset_url('assets/js/backend_services_helper.js') ?>"></script>
|
<script src="<?= asset_url('assets/js/backend_services_helper.js') ?>"></script>
|
||||||
<script src="<?= asset_url('assets/js/backend_categories_helper.js') ?>"></script>
|
|
||||||
<script src="<?= asset_url('assets/js/backend_services.js') ?>"></script>
|
<script src="<?= asset_url('assets/js/backend_services.js') ?>"></script>
|
||||||
<script>
|
<script>
|
||||||
var GlobalVariables = {
|
var GlobalVariables = {
|
||||||
|
@ -34,244 +33,142 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="container-fluid backend-page" id="services-page">
|
<div class="container-fluid backend-page" id="services-page">
|
||||||
<ul class="nav nav-pills">
|
<div class="row" id="services">
|
||||||
<li class="nav-item">
|
<div id="filter-services" class="filter-records col col-12 col-md-5">
|
||||||
<a class="nav-link active" href="#services" data-toggle="tab">
|
<form class="mb-4">
|
||||||
<?= lang('services') ?>
|
<div class="input-group">
|
||||||
</a>
|
<input type="text" class="key form-control">
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="#categories" data-toggle="tab">
|
|
||||||
<?= lang('categories') ?>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="tab-content">
|
<div class="input-group-addon">
|
||||||
|
<div>
|
||||||
<!-- SERVICES TAB -->
|
<button class="filter btn btn-outline-secondary" type="submit"
|
||||||
|
data-tippy-content="<?= lang('filter') ?>">
|
||||||
<div class="tab-pane active" id="services">
|
<i class="fas fa-search"></i>
|
||||||
<div class="row">
|
|
||||||
<div id="filter-services" class="filter-records col col-12 col-md-5">
|
|
||||||
<form class="mb-4">
|
|
||||||
<div class="input-group">
|
|
||||||
<input type="text" class="key form-control">
|
|
||||||
|
|
||||||
<div class="input-group-addon">
|
|
||||||
<div>
|
|
||||||
<button class="filter btn btn-outline-secondary" type="submit"
|
|
||||||
data-tippy-content="<?= lang('filter') ?>">
|
|
||||||
<i class="fas fa-search"></i>
|
|
||||||
</button>
|
|
||||||
<button class="clear btn btn-outline-secondary" type="button"
|
|
||||||
data-tippy-content="<?= lang('clear') ?>">
|
|
||||||
<i class="fas fa-redo-alt"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<h3><?= lang('services') ?></h3>
|
|
||||||
<div class="results"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="record-details column col-12 col-md-5">
|
|
||||||
<div class="btn-toolbar mb-4">
|
|
||||||
<div class="add-edit-delete-group btn-group">
|
|
||||||
<button id="add-service" class="btn btn-primary">
|
|
||||||
<i class="fas fa-plus-square mr-2"></i>
|
|
||||||
<?= lang('add') ?>
|
|
||||||
</button>
|
</button>
|
||||||
<button id="edit-service" class="btn btn-outline-secondary" disabled="disabled">
|
<button class="clear btn btn-outline-secondary" type="button"
|
||||||
<i class="fas fa-edit mr-2"></i>
|
data-tippy-content="<?= lang('clear') ?>">
|
||||||
<?= lang('edit') ?>
|
<i class="fas fa-redo-alt"></i>
|
||||||
</button>
|
|
||||||
<button id="delete-service" class="btn btn-outline-secondary" disabled="disabled">
|
|
||||||
<i class="fas fa-trash-alt mr-2"></i>
|
|
||||||
<?= lang('delete') ?>
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="save-cancel-group btn-group" style="display:none;">
|
|
||||||
<button id="save-service" class="btn btn-primary">
|
|
||||||
<i class="fas fa-check-square mr-2"></i>
|
|
||||||
<?= lang('save') ?>
|
|
||||||
</button>
|
|
||||||
<button id="cancel-service" class="btn btn-outline-secondary">
|
|
||||||
<i class="fas fa-ban mr-2"></i>
|
|
||||||
<?= lang('cancel') ?>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h3><?= lang('details') ?></h3>
|
|
||||||
|
|
||||||
<div class="form-message alert" style="display:none;"></div>
|
|
||||||
|
|
||||||
<input type="hidden" id="service-id">
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="service-name">
|
|
||||||
<?= lang('name') ?>
|
|
||||||
<span class="text-danger">*</span>
|
|
||||||
</label>
|
|
||||||
<input id="service-name" class="form-control required" maxlength="128">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="service-duration">
|
|
||||||
<?= lang('duration_minutes') ?>
|
|
||||||
<span class="text-danger">*</span>
|
|
||||||
</label>
|
|
||||||
<input id="service-duration" class="form-control required" type="number" min="<?= EVENT_MINIMUM_DURATION ?>">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="service-price">
|
|
||||||
<?= lang('price') ?>
|
|
||||||
<span class="text-danger">*</span>
|
|
||||||
</label>
|
|
||||||
<input id="service-price" class="form-control required">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="service-currency">
|
|
||||||
<?= lang('currency') ?>
|
|
||||||
|
|
||||||
</label>
|
|
||||||
<input id="service-currency" class="form-control" maxlength="32">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="service-category">
|
|
||||||
<?= lang('category') ?>
|
|
||||||
</label>
|
|
||||||
<select id="service-category" class="form-control"></select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="service-availabilities-type">
|
|
||||||
<?= lang('availabilities_type') ?>
|
|
||||||
|
|
||||||
</label>
|
|
||||||
<select id="service-availabilities-type" class="form-control">
|
|
||||||
<option value="<?= AVAILABILITIES_TYPE_FLEXIBLE ?>">
|
|
||||||
<?= lang('flexible') ?>
|
|
||||||
</option>
|
|
||||||
<option value="<?= AVAILABILITIES_TYPE_FIXED ?>">
|
|
||||||
<?= lang('fixed') ?>
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="service-attendants-number">
|
|
||||||
<?= lang('attendants_number') ?>
|
|
||||||
<span class="text-danger">*</span>
|
|
||||||
</label>
|
|
||||||
<input id="service-attendants-number" class="form-control required" type="number" min="1">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="service-location">
|
|
||||||
<?= lang('location') ?>
|
|
||||||
|
|
||||||
</label>
|
|
||||||
<input id="service-location" class="form-control">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="service-description">
|
|
||||||
<?= lang('description') ?>
|
|
||||||
</label>
|
|
||||||
<textarea id="service-description" rows="4" class="form-control"></textarea>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</form>
|
||||||
|
|
||||||
|
<h3><?= lang('services') ?></h3>
|
||||||
|
<div class="results"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- CATEGORIES TAB -->
|
<div class="record-details column col-12 col-md-5">
|
||||||
|
<div class="btn-toolbar mb-4">
|
||||||
<div class="tab-pane" id="categories">
|
<div class="add-edit-delete-group btn-group">
|
||||||
<div class="row">
|
<button id="add-service" class="btn btn-primary">
|
||||||
<div id="filter-categories" class="filter-records column col-12 col-md-5">
|
<i class="fas fa-plus-square mr-2"></i>
|
||||||
<form class="input-append mb-4">
|
<?= lang('add') ?>
|
||||||
<div class="input-group">
|
</button>
|
||||||
<input type="text" class="key form-control">
|
<button id="edit-service" class="btn btn-outline-secondary" disabled="disabled">
|
||||||
|
<i class="fas fa-edit mr-2"></i>
|
||||||
<div class="input-group-addon">
|
<?= lang('edit') ?>
|
||||||
<div>
|
</button>
|
||||||
<button class="filter btn btn-outline-secondary" type="submit"
|
<button id="delete-service" class="btn btn-outline-secondary" disabled="disabled">
|
||||||
data-tippy-content="<?= lang('filter') ?>">
|
<i class="fas fa-trash-alt mr-2"></i>
|
||||||
<i class="fas fa-search"></i>
|
<?= lang('delete') ?>
|
||||||
</button>
|
</button>
|
||||||
<button class="clear btn btn-outline-secondary" type="button"
|
|
||||||
data-tippy-content="<?= lang('clear') ?>">
|
|
||||||
<i class="fas fa-redo-alt"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<h3><?= lang('categories') ?></h3>
|
|
||||||
<div class="results"></div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="record-details col-12 col-md-5">
|
<div class="save-cancel-group btn-group" style="display:none;">
|
||||||
<div class="btn-toolbar mb-4">
|
<button id="save-service" class="btn btn-primary">
|
||||||
<div class="add-edit-delete-group btn-group">
|
<i class="fas fa-check-square mr-2"></i>
|
||||||
<button id="add-category" class="btn btn-primary">
|
<?= lang('save') ?>
|
||||||
<i class="fas fa-plus-square mr-2"></i>
|
</button>
|
||||||
<?= lang('add') ?>
|
<button id="cancel-service" class="btn btn-outline-secondary">
|
||||||
</button>
|
<i class="fas fa-ban mr-2"></i>
|
||||||
<button id="edit-category" class="btn btn-outline-secondary" disabled="disabled">
|
<?= lang('cancel') ?>
|
||||||
<i class="fas fa-edit mr-2"></i>
|
</button>
|
||||||
<?= lang('edit') ?>
|
|
||||||
</button>
|
|
||||||
<button id="delete-category" class="btn btn-outline-secondary" disabled="disabled">
|
|
||||||
<i class="fas fa-trash-alt mr-2"></i>
|
|
||||||
<?= lang('delete') ?>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="save-cancel-group btn-group" style="display:none;">
|
|
||||||
<button id="save-category" class="btn btn-primary">
|
|
||||||
<i class="fas fa-check-square mr-2"></i>
|
|
||||||
<?= lang('save') ?>
|
|
||||||
</button>
|
|
||||||
<button id="cancel-category" class="btn btn-outline-secondary">
|
|
||||||
<i class="fas fa-ban mr-2"></i>
|
|
||||||
<?= lang('cancel') ?>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h3><?= lang('details') ?></h3>
|
|
||||||
|
|
||||||
<div class="form-message alert" style="display:none;"></div>
|
|
||||||
|
|
||||||
<input type="hidden" id="category-id">
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="category-name">
|
|
||||||
<?= lang('name') ?>
|
|
||||||
<span class="text-danger">*</span>
|
|
||||||
</label>
|
|
||||||
<input id="category-name" class="form-control required">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="category-description">
|
|
||||||
<?= lang('description') ?>
|
|
||||||
|
|
||||||
</label>
|
|
||||||
<textarea id="category-description" rows="4" class="form-control"></textarea>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<h3><?= lang('details') ?></h3>
|
||||||
|
|
||||||
|
<div class="form-message alert" style="display:none;"></div>
|
||||||
|
|
||||||
|
<input type="hidden" id="service-id">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="service-name">
|
||||||
|
<?= lang('name') ?>
|
||||||
|
<span class="text-danger">*</span>
|
||||||
|
</label>
|
||||||
|
<input id="service-name" class="form-control required" maxlength="128">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="service-duration">
|
||||||
|
<?= lang('duration_minutes') ?>
|
||||||
|
<span class="text-danger">*</span>
|
||||||
|
</label>
|
||||||
|
<input id="service-duration" class="form-control required" type="number" min="<?= EVENT_MINIMUM_DURATION ?>">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="service-price">
|
||||||
|
<?= lang('price') ?>
|
||||||
|
<span class="text-danger">*</span>
|
||||||
|
</label>
|
||||||
|
<input id="service-price" class="form-control required">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="service-currency">
|
||||||
|
<?= lang('currency') ?>
|
||||||
|
|
||||||
|
</label>
|
||||||
|
<input id="service-currency" class="form-control" maxlength="32">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="service-category">
|
||||||
|
<?= lang('category') ?>
|
||||||
|
</label>
|
||||||
|
<select id="service-category" class="form-control"></select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="service-availabilities-type">
|
||||||
|
<?= lang('availabilities_type') ?>
|
||||||
|
|
||||||
|
</label>
|
||||||
|
<select id="service-availabilities-type" class="form-control">
|
||||||
|
<option value="<?= AVAILABILITIES_TYPE_FLEXIBLE ?>">
|
||||||
|
<?= lang('flexible') ?>
|
||||||
|
</option>
|
||||||
|
<option value="<?= AVAILABILITIES_TYPE_FIXED ?>">
|
||||||
|
<?= lang('fixed') ?>
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="service-attendants-number">
|
||||||
|
<?= lang('attendants_number') ?>
|
||||||
|
<span class="text-danger">*</span>
|
||||||
|
</label>
|
||||||
|
<input id="service-attendants-number" class="form-control required" type="number" min="1">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="service-location">
|
||||||
|
<?= lang('location') ?>
|
||||||
|
|
||||||
|
</label>
|
||||||
|
<input id="service-location" class="form-control">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="service-description">
|
||||||
|
<?= lang('description') ?>
|
||||||
|
</label>
|
||||||
|
<textarea id="service-description" rows="4" class="form-control"></textarea>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -24,12 +24,11 @@ window.BackendServices = window.BackendServices || {};
|
||||||
/**
|
/**
|
||||||
* Contains the basic record methods for the page.
|
* Contains the basic record methods for the page.
|
||||||
*
|
*
|
||||||
* @type {ServicesHelper|CategoriesHelper}
|
* @type {ServicesHelper}
|
||||||
*/
|
*/
|
||||||
var helper;
|
var helper;
|
||||||
|
|
||||||
var servicesHelper = new ServicesHelper();
|
var servicesHelper = new ServicesHelper();
|
||||||
var categoriesHelper = new CategoriesHelper();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default initialize method of the page.
|
* Default initialize method of the page.
|
||||||
|
@ -48,8 +47,10 @@ window.BackendServices = window.BackendServices || {};
|
||||||
if (defaultEventHandlers) {
|
if (defaultEventHandlers) {
|
||||||
bindEventHandlers();
|
bindEventHandlers();
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.updateAvailableCategories();
|
BackendServices.updateAvailableCategories();
|
||||||
|
|
||||||
|
Backend.placeFooterToBottom();
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -58,28 +59,7 @@ window.BackendServices = window.BackendServices || {};
|
||||||
* Do not use this method if you include the "BackendServices" namespace on another page.
|
* Do not use this method if you include the "BackendServices" namespace on another page.
|
||||||
*/
|
*/
|
||||||
function bindEventHandlers() {
|
function bindEventHandlers() {
|
||||||
/**
|
//
|
||||||
* Event: Page Tab Button "Click"
|
|
||||||
*
|
|
||||||
* Changes the displayed tab.
|
|
||||||
*/
|
|
||||||
$('a[data-toggle="tab"]').on('shown.bs.tab', function () {
|
|
||||||
if (helper) {
|
|
||||||
helper.unbindEventHandlers();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($(this).attr('href') === '#services') {
|
|
||||||
helper = servicesHelper;
|
|
||||||
} else if ($(this).attr('href') === '#categories') {
|
|
||||||
helper = categoriesHelper;
|
|
||||||
}
|
|
||||||
|
|
||||||
helper.resetForm();
|
|
||||||
helper.filter('');
|
|
||||||
helper.bindEventHandlers();
|
|
||||||
$('.filter-key').val('');
|
|
||||||
Backend.placeFooterToBottom();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -88,7 +68,7 @@ window.BackendServices = window.BackendServices || {};
|
||||||
* Use this method every time a change is made to the service categories db table.
|
* Use this method every time a change is made to the service categories db table.
|
||||||
*/
|
*/
|
||||||
exports.updateAvailableCategories = function () {
|
exports.updateAvailableCategories = function () {
|
||||||
var url = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_filter_service_categories';
|
var url = GlobalVariables.baseUrl + '/index.php/service_categories/search';
|
||||||
|
|
||||||
var data = {
|
var data = {
|
||||||
csrfToken: GlobalVariables.csrfToken,
|
csrfToken: GlobalVariables.csrfToken,
|
||||||
|
|
Loading…
Reference in a new issue