Логика работы стр. категорий

parent 58125b54
...@@ -35,6 +35,18 @@ ...@@ -35,6 +35,18 @@
url('../fonts/RalewayRegular.ttf') format('truetype'), url('../fonts/RalewayRegular.ttf') format('truetype'),
url('../fonts/RalewayRegular.svg#RalewayRegular') format('svg'); url('../fonts/RalewayRegular.svg#RalewayRegular') format('svg');
} }
@font-face {
font-family: 'RobotoCondensed-Regular';
src: url('../fonts/RobotoCondensed-Regular.ttf');
}
@font-face {
font-family: 'RobotoCondensed-Light';
src: url('../fonts/RobotoCondensed-Light.ttf');
}
@font-face {
font-family: 'RobotoCondensed-Bold';
src: url('../fonts/RobotoCondensed-Bold.ttf');
}
html { html {
font-size: 20px; font-size: 20px;
......
This diff is collapsed.
This diff is collapsed.
...@@ -26,38 +26,22 @@ ...@@ -26,38 +26,22 @@
/** @var $this \Zend\View\Renderer\PhpRenderer */ /** @var $this \Zend\View\Renderer\PhpRenderer */
$this->headScript() $this->headScript()
->appendFile('/js/jquery.cookie.js') ->appendFile('/js/feed-cats.js')
->appendFile('/js/bootstrap.min.js')
; ;
$this->headLink() $this->headLink()
->appendStylesheet('/css/styles-feeds-stat.css') ->appendStylesheet('/css/styles-feeds-stat.css')
->appendStylesheet('/css/styles-feeds-system.css')
; ;
/** @var \App\Entity\IdentityInterface $identity */
$identity = $this->identity();
$gravatar = $this->gravatar($identity->getEmail());
$gravatar->setDefaultImg(\Zend\View\Helper\Gravatar::DEFAULT_IDENTICON);
$sxml = new SimpleXMLElement(substr($gravatar, 0, -1) . '/>');
$src = $sxml['src'];
$error = $this->error; $error = $this->error;
$lang = $this->lang;
if (!$error) { $feeds_cats = $this->feeds_cats;
/*
$current_report = $this->current_report;
$report_conf = $this->report_conf;
$reports_list = $this->reports_list;
$data_request_link = $this->url('user.cabinet', ['lang' => $this->lang, 'report' => $current_report]);
$system_link = $this->url('adm.system.actions');
*/
}
?> ?>
<?php if($error): ?> <?php if($error): ?>
<section class="b-content__work"> <section class="b-content__work">
...@@ -72,7 +56,6 @@ if (!$error) { ...@@ -72,7 +56,6 @@ if (!$error) {
<div class="wrapp" style="position: relative;"> <div class="wrapp" style="position: relative;">
<div class="b-feeds-stat_controls form-group"> <div class="b-feeds-stat_controls form-group">
<?php /* Переключатель страниц */ ?> <?php /* Переключатель страниц */ ?>
<div class="b-filter__switch display"> <div class="b-filter__switch display">
<span class="b-filter__switch-item text"><a href="<?= $this->url('user.cabinet', ['lang' => $this->lang, 'report' => 'common']) ?>"><?= _t('Сводный отчет') ?></a></span> <span class="b-filter__switch-item text"><a href="<?= $this->url('user.cabinet', ['lang' => $this->lang, 'report' => 'common']) ?>"><?= _t('Сводный отчет') ?></a></span>
...@@ -81,6 +64,86 @@ if (!$error) { ...@@ -81,6 +64,86 @@ if (!$error) {
</div> </div>
</div> </div>
<?php
function render_cat($i, $cat)
{
$i++;
$symb = (count($cat['sub_cats']) > 0) ? '<span class="group"><b class="closed">+</b><b class="open">&ndash;</b></span>' : '<span class="group"></span>';
?>
<tr class="feed-cat" style="font-size: <?= 16-$i+1 ?>px;" data-id="<?= $cat['id'] ?>" data-parent="<?= $cat['parentid'] ?>">
<td>
<span class="cat-title" style="padding-left: <?= ($i-1)*40 ?>px;"><?= $symb ?><?= $cat['title'] ?> <span class="foreign-id" data-id="<?= $cat['foreignid'] ?>">[<?= $cat['foreignid'] ?>]</span></span>
</td>
<td class="percent <?= ($cat['own']) ? 'own': 'inherited' ?>" data-old-type="<?= ($cat['own']) ? 'own': 'inherited' ?>">
<span class="edited" data-old-value="<?= $cat['percent'] ?>"><span class="percent-value"><?= $cat['percent'] ?></span>&nbsp;%</span>
<span class="editing-wrap"><input class="percent-input editing" value="<?= $cat['percent'] ?>">&nbsp;%</span>
<br /><span class="old-value"><?= $cat['percent'] ?>&nbsp;%</span>
</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<?php if (count($cat['sub_cats']) > 0): ?>
<?php foreach ($cat['sub_cats'] as $sub_cat) : ?>
<?= render_cat($i, $sub_cat) ?>
<?php endforeach; ?>
<?php endif; ?>
<?php
}
?>
<?php foreach ($feeds_cats as $feeds_cat) : ?>
<div class="feed-title">категории фида <b><?= $feeds_cat['title'] ?></b>:</div>
<table class="table table-striped feeds-cats" data-content="cats" data-feed-id="<?= $feeds_cat['id'] ?>" data-feed-percent="<?= $feeds_cat['percent'] ?>">
<thead>
<tr>
<th>
<span class="cat-title-main">
<span class="group"><b class="closed">+</b><b class="open">&ndash;</b></span>Название категории</span>
<!-- Сохранить / Отмена -->
<span class="form-actions">
<a class="btn btn-primary submit-action" href="#" action="<?= $form_link ?>" method="post"><?= _t('Сохранить') ?></a>
<a class="btn btn-default cancel-action" href="<?= $link_cancel ?>"><?= _t('Отмена')?></a>
</span>
</th>
<th class="data"><span>Процент</span></th>
<th class="data"><span>Показы</span></th>
<th class="data"><span>Клики</span></th>
<th class="data"><span>Заказы</span></th>
<th class="data"><span>Стоимость</span></th>
<th class="data"><span>Комиссия</span></th>
</tr>
</thead>
<tbody>
<?php foreach ($feeds_cat['cats'] as $cat) : ?>
<?= render_cat(0, $cat) ?>
<?php endforeach; ?>
</tbody>
</table>
<?php endforeach; ?>
<!-- Сохранить / Отмена -->
<div class="form-actions">
<a class="btn btn-primary submit-action" href="#" action="<?= $form_link ?>" method="post"><?= _t('Сохранить') ?></a>
<a class="btn btn-default cancel-action" href="<?= $link_cancel ?>"><?= _t('Отмена')?></a>
</div>
</div> </div>
</section> </section>
......
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