Initial import
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* @var $data array
|
||||
* @var $actions array
|
||||
* @var $exportData array
|
||||
*/
|
||||
|
||||
use app\widgets\services\UserRight;
|
||||
|
||||
if (!empty($_GET['roletest'])) {
|
||||
$partner = \app\services\Auth::userPartner();
|
||||
if ($partner) {
|
||||
foreach ($partner->userRights as $right) {
|
||||
echo '<br> ' . $right->right_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isset($actions['new']) || isset($actions['edit']) || isset($actions['delete']) || !empty($exportData)): ?>
|
||||
<div style="margin-bottom: 10px;" class="action-buttons">
|
||||
<?php if (isset($actions['new']) && UserRight::add()): ?>
|
||||
<a id="bNew" href="?o=w<?= !empty($_GET['listtab']) ? '&listtab=' . $_GET['listtab'] : '' ?>"
|
||||
class="btn-ib btn-default ct">
|
||||
<i class="la la-plus-circle"></i> <?= $actions['new'] ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if (sizeof($data['list'])): ?>
|
||||
<?php if (isset($actions['edit']) && UserRight::edit()): ?>
|
||||
<a id="bEdit" class="btn-ib btn-default ct disabled">
|
||||
<i class="la la-edit"></i> <?= $actions['edit'] ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if (isset($actions['delete']) && UserRight::del()): ?>
|
||||
<a id="bDelete" data-model="<?= $data['model'] ?? null ?>" onclick="checkDelete(this)"
|
||||
class="btn-ib btn-default ct disabled">
|
||||
<i class="la la-trash-o"></i> <?= $actions['delete'] ?> <span id="delCount">(0)</span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($exportData)): ?>
|
||||
<a id="exportDate" href="<?= !empty($_GET['q']) ? '?q=' . $_GET['q'] . '&export=1' : '?export=1' ?>"
|
||||
class="btn-ib btn-default ct">
|
||||
<i class="la la-file-export"></i> <?= !empty($actions['export']) ? $actions['export'] : 'Export' ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* @var string $list_url
|
||||
*/
|
||||
|
||||
use app\widgets\services\UserRight;
|
||||
|
||||
$save = empty($_GET['id']) ? 'Създаване' : 'Запис';
|
||||
?>
|
||||
<a href="<?= Yii::$app->goTo($list_url) ?><?= isset($_GET['p']) ? '?p=' . $_GET['p'] : '' ?>"
|
||||
class="btn btn-default right10"><i class="la la-undo"></i> Назад</a>
|
||||
|
||||
<?php if(UserRight::edit() && !empty($_GET['id']) || UserRight::add() && empty($_GET['id'])): ?>
|
||||
<button onclick="saveAndBackToList(this)" class="btn btn-default right10">
|
||||
<i class="la la-check-circle"></i> Запис
|
||||
</button>
|
||||
<button id="save" class="btn btn-default">
|
||||
<i class="la la-save"></i> <?= empty($_GET['id']) ? $save : 'Актуализация' ?>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,116 @@
|
||||
<style>
|
||||
.category_search_box select {
|
||||
display: none
|
||||
}
|
||||
|
||||
.category_search_box .search-box {
|
||||
height: 15px !important;
|
||||
border-radius: 0;
|
||||
font-size: 12px;
|
||||
line-height: 15px;
|
||||
}
|
||||
|
||||
.search-box:after {
|
||||
top: 7px;
|
||||
}
|
||||
</style>
|
||||
<?php if (!empty($filter)):
|
||||
$filterGetData = Yii::$app->getFilterData();
|
||||
?>
|
||||
|
||||
<form data-type="search" method="get" autocomplete="off" autofocus="autofocus">
|
||||
<?php foreach ($filter as $row): ?>
|
||||
<div class="top-page-panel">
|
||||
<div class="toggle-filter"><i class="la <?= empty($_GET['q']) ? 'la-chevron-circle-up' : 'la-chevron-circle-down' ?>"></i> Търсене по критерии</div>
|
||||
<div class="main-filter <?= empty($_GET['q']) ? 'main-filter-closed' : '' ?> flex filter">
|
||||
<?php if (!empty($advanced_filter)): ?>
|
||||
<div class="row c1 top10">
|
||||
<label></label>
|
||||
<div class="btn-ib btn-default open-filter"><i class="la la-arrow-left"></i> Филтри</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="flex-wrap c11">
|
||||
<?php foreach ($row as $key => $filterElem): ?>
|
||||
<div class="row <?= $filterElem[1] ?? null ?> right10 top10">
|
||||
<?php if (!isset($filterElem[2])): ?>
|
||||
<label><?= $filterElem[0] ?></label>
|
||||
<input onkeyup="symbolInputProtect(this)" name="<?= $key ?>"
|
||||
placeholder="<?= $filterElem[0] ?>"
|
||||
value="<?= $filterGetData[$key] ?? null ?>">
|
||||
<?php else: ?>
|
||||
<label><?= $filterElem[0] ?></label>
|
||||
<select name="<?= $key ?>">
|
||||
<option value=""> -- без филтър --</option>
|
||||
<?php foreach ($filterElem[2] as $value => $name): ?>
|
||||
<option <?= isset($filterGetData[$key]) && $filterGetData[$key] == $value ? 'selected' : '' ?>
|
||||
value="<?= $value ?>"><?= $name ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<div class="row c3 top10">
|
||||
<label></label>
|
||||
<button class="btn-ib btn-default">
|
||||
<i class="la la-filter"></i>
|
||||
<?= Yii::t('cms', 'Search') ?></button>
|
||||
<a href="<?= Yii::$app->clearQueryUrl() ?>" class="btn-ib btn-default">
|
||||
<i class="la la-times"></i> <?= Yii::t('cms', 'Clear') ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</form>
|
||||
<div class="row-divider"></div>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($advanced_filter)): ?>
|
||||
<?= $advanced_filter ?>
|
||||
<?php endif; ?>
|
||||
<script src="/_public/plugins/air-datepicker/locales.js"></script>
|
||||
<script src="/_public/plugins/air-datepicker/air-datepicker.js"></script>
|
||||
|
||||
|
||||
<script>
|
||||
new AirDatepicker('.fDatepicker input', {
|
||||
locale: locales.bg,
|
||||
autoClose: true
|
||||
});
|
||||
all('.fDatepicker input').forEach(e => {
|
||||
e.setAttribute('readonly', true);
|
||||
})
|
||||
|
||||
const
|
||||
openFilter = one('.open-filter'),
|
||||
closeFilter = one('.close-filter'),
|
||||
af = one('.advanced-filter'),
|
||||
toggleFilter = one('.toggle-filter')
|
||||
mainFilter = one('.main-filter ')
|
||||
|
||||
if (openFilter && closeFilter && af) {
|
||||
openFilter.addEventListener('click', e => {
|
||||
if (af.classList.contains('filter-open')) {
|
||||
af.classList.remove('filter-open')
|
||||
openFilter.querySelector('i').switchClasses('la-arrow-left', 'la-arrow-right')
|
||||
} else {
|
||||
af.classList.add('filter-open')
|
||||
openFilter.querySelector('i').switchClasses('la-arrow-right', 'la-arrow-left')
|
||||
}
|
||||
})
|
||||
closeFilter.addEventListener('click', e => {
|
||||
af.classList.remove('filter-open')
|
||||
openFilter.querySelector('i').switchClasses('la-arrow-left', 'la-arrow-right')
|
||||
})
|
||||
}
|
||||
if(toggleFilter) {
|
||||
toggleFilter.addEventListener('click', e => {
|
||||
if (mainFilter.classList.contains('main-filter-closed')) {
|
||||
mainFilter.classList.remove('main-filter-closed')
|
||||
toggleFilter.querySelector('i').switchClasses('la-chevron-circle-down', 'la-chevron-circle-up')
|
||||
} else {
|
||||
mainFilter.classList.add('main-filter-closed')
|
||||
toggleFilter.querySelector('i').switchClasses('la-chevron-circle-up', 'la-chevron-circle-down')
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
$tab = $_GET['listtab'] ?? 'main';
|
||||
/**
|
||||
* @var $tabs array
|
||||
*/
|
||||
?>
|
||||
<div class="wl-switch">
|
||||
<?php foreach ($tabs as $q => $title): ?>
|
||||
<a class="<?= $q == $tab ? 'selected' : '' ?>" href="<?= Yii::$app->setQueryString(['listtab' => $q]) ?>"><?= $title ?></a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* @var $data array
|
||||
*/
|
||||
|
||||
if ($data['pages'] > 1) :
|
||||
|
||||
$q = '?' . ($_GET['q'] ?? '');
|
||||
$sgn = $q !== '?' ? $q . '&' : $q;
|
||||
if ($sgn != '' && !empty($_GET['expId'])) {
|
||||
$sgn = $sgn . 'expId=' . $_GET['expId'] . '&';
|
||||
}
|
||||
?>
|
||||
<div class="pagination">
|
||||
<?php $p = $_GET['p'] ?? 1; ?>
|
||||
<div style="margin-right: 20px; line-height: 20px; color: var(--base-background-dark)"><?= $data['info'] ?></div>
|
||||
<?php if ($data['pages'] > 15): ?>
|
||||
<?php if ($p > 1): ?>
|
||||
<a href="<?= $sgn ?>p=1"><i class="la la-angle-double-left"></i></a>
|
||||
<a href="<?= $sgn ?>p=<?= $p - 1 ?>"><i class="la la-angle-left"></i></a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
$start = $p - 5;
|
||||
$end = $p + 5;
|
||||
$start = $start > 1 ? $start : 1;
|
||||
$end = $end < $data['pages'] ? $end : $data['pages'];
|
||||
|
||||
for ($i = $start; $i <= $end; $i++):
|
||||
$selected = $p == $i ? 'class="selected"' : 'href="' . $sgn . 'p=' . $i . '"'; ?>
|
||||
<a <?= $selected ?>><?= $i ?></a>
|
||||
<?php endfor; ?>
|
||||
|
||||
<?php if ($p < $data['pages']): ?>
|
||||
<a href="<?= $sgn ?>p=<?= $p + 1 ?>"><i class="la la-angle-right"></i></a>
|
||||
<a href="<?= $sgn ?>p=<?= $data['pages'] ?>"><i class="la la-angle-double-right"></i></a>
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
<?php for ($i = 0; $i < $data['pages']; $i++): ?>
|
||||
<?php
|
||||
$pn = ($i + 1);
|
||||
$selected = $p == $pn ? 'class="selected"' : 'href="' . $sgn . 'p=' . $pn . '"';
|
||||
?>
|
||||
<a <?= $selected ?>><?= $pn ?></a>
|
||||
<?php endfor; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
$tab = $_GET['tab'] ?? 'main';
|
||||
/**
|
||||
* @var $tabs array
|
||||
*/
|
||||
?>
|
||||
<div class="wl-switch">
|
||||
<?php foreach ($tabs as $q => $title): ?>
|
||||
<a id="tab_<?= $q ?>" class="<?= $q == $tab ? 'selected' : '' ?>" href="<?= Yii::$app->setQueryString(['tab' => $q]) ?>"><?= $title ?></a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* @var $title string
|
||||
* @var $title_edit
|
||||
* @var $data array
|
||||
*/
|
||||
$controller = Yii::$app->controller->id;
|
||||
$pageTitle = isset($_GET['id']) ? $title_edit : $title;
|
||||
Yii::$app->controller->pageTitle = $pageTitle;
|
||||
?>
|
||||
<div class="flex top">
|
||||
<div class="top-title"><?= $pageTitle ?></div>
|
||||
<div class="breadcrumb p10">
|
||||
<?php foreach ($data as $url => $b): ?>
|
||||
<a href="/<?= $controller ?>/<?= $url ?>"><?= $b ?></a>
|
||||
<?php endforeach; ?>
|
||||
<span><?= $pageTitle ?></span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
$wl = $_GET['wl'] ?? 'bg';
|
||||
/**
|
||||
* @var $tabs array
|
||||
*/
|
||||
?>
|
||||
<div class="wl-switch">
|
||||
<?php foreach ($tabs as $q => $title): ?>
|
||||
<a class="<?= $q == $wl ? 'selected' : '' ?>" href="<?= Yii::$app->setQueryString(['wl' => $q]) ?>"><?= $title ?></a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
Reference in New Issue
Block a user