Browse Source

countdown

amic 1 năm trước cách đây
mục cha
commit
867266f9a1

+ 5 - 5
modules/manager/views/layouts/sidebar.php

@@ -99,7 +99,7 @@ $profile = Yii::$app->user->identity->profile;
                             ['label' => 'Меню', 'url' => ['/manager/tagsfilter/index'], 'iconStyle' => 'far', 'iconClass'=>'nav-icon fas fa-th-list']
                         ]
                     ],
-                    ['label' => 'Опросы', 'icon' => 'th', 'url' => ['/manager/inquirer/'],
+                    ['label' => 'Опросы', 'icon' => 'thumbs-up', 'url' => ['/manager/inquirer/'],
 						'badge' => '<span class="right badge badge-danger">New</span>',
                         'items' => [
                             ['label' => 'Список опросов', 'url' => ['/manager/inquirer/index'], 'iconStyle' => 'far'],
@@ -107,11 +107,11 @@ $profile = Yii::$app->user->identity->profile;
                         ]
                     ],
 
-                    ['label' => 'Статистика', 'icon' => 'th', 'url' => ['/manager/stats/index'],
+                    ['label' => 'Статистика', 'icon' => 'chart-pie', 'url' => ['/manager/stats/index'],
                         'items' => [
-                            ['label' => 'доска', 'url' => ['/manager/stats/index'], 'iconStyle' => 'far'],
-                            ['label' => 'Авторы', 'url' => ['/manager/stats/authors'], 'iconStyle' => 'far'],
-                            ['label' => 'Автор по дням', 'url' => ['/manager/stats/authorsd'], 'iconStyle' => 'far']
+                            ['label' => 'доска', 'url' => ['/manager/stats/index'], 'iconStyle' => 'fas', 'icon'=>'tachometer-alt'],
+                            ['label' => 'Авторы', 'url' => ['/manager/stats/authors'], 'iconStyle' => 'far', 'icon'=>'user-circle'],
+                            ['label' => 'Автор по дням', 'url' => ['/manager/stats/authorsd'], 'iconStyle' => 'far', 'icon'=>'user']
                         ]
                     ],
                     ['label' => 'Персоны','icon' => 'user', 'url' => ['/manager/person/']

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 8 - 0
modules/manager/views/stats/chartjs.php


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 157 - 785
modules/manager/views/stats/index.php


+ 46 - 0
views/layouts/lenta/countdown.php

@@ -0,0 +1,46 @@
+<?php
+
+$this->registerJs(
+<<<JS
+const deadline = new Date(2023, 9, 12);
+  // id таймера
+  let timerId = null;
+  // склонение числительных
+  function declensionNum(num, words) {
+    return words[(num % 100 > 4 && num % 100 < 20) ? 2 : [2, 0, 1, 1, 1, 2][(num % 10 < 5) ? num % 10 : 5]];
+  }
+  // вычисляем разницу дат и устанавливаем оставшееся времени в качестве содержимого элементов
+  function countdownTimer() {
+    const diff = deadline - new Date();
+    if (diff <= 0) {
+      clearInterval(timerId);
+    }
+    const days = diff > 0 ? Math.floor(diff / 1000 / 60 / 60 / 24) : 0;
+    const hours = diff > 0 ? Math.floor(diff / 1000 / 60 / 60) % 24 : 0;
+    const minutes = diff > 0 ? Math.floor(diff / 1000 / 60) % 60 : 0;
+    const seconds = diff > 0 ? Math.floor(diff / 1000) % 60 : 0;
+    _days.dataset.title = declensionNum(days, ['день', 'дня', 'дней']);
+    _hours.dataset.title = declensionNum(hours, ['час', 'часа', 'часов']);
+    _minutes.dataset.title = declensionNum(minutes, ['минута', 'минуты', 'минут']);
+//    _seconds.dataset.title = declensionNum(seconds, ['секунда', 'секунды', 'секунд']);
+
+	_days.textContent = days + ' ' + _days.dataset.title;
+    _hours.textContent = hours + ' ' + _hours.dataset.title;
+    _minutes.textContent = minutes + ' ' + _minutes.dataset.title;
+//    _seconds.textContent = seconds < 10 ? '0' + seconds : seconds;
+//	_seconds.textContent = _seconds.textContent + ' ' + _seconds.dataset.title;
+}
+  // получаем элементы, содержащие компоненты даты
+  const _days = document.querySelector('.timer__days');
+  const _hours = document.querySelector('.timer__hours');
+  const _minutes = document.querySelector('.timer__minutes');
+  const _seconds = document.querySelector('.timer__seconds');
+  // вызываем функцию countdownTimer
+  countdownTimer();
+  // вызываем функцию countdownTimer каждую секунду
+  timerId = setInterval(countdownTimer, 1000);
+JS
+    ,
+    yii\web\View::POS_END,
+    'counter'
+);

+ 6 - 2
views/layouts/lenta/lenta.php

@@ -20,10 +20,12 @@ $keyadd = News::keyFilter();
 </h3>
 </div>
 ';
+<br><span class="timer__seconds"></span>
 */
 $lenta .= '<style>.lenta .list-wrapper .lenta_fix:hover{background:#60b740;}</style>
-<div class="lenta_fix"><h3>
-    <a href="https://%D0%BD%D0%B0%D1%80%D0%BE%D0%B4%D0%BD%D1%8B%D0%B9%D0%B7%D0%BD%D0%B0%D0%BA%D0%BA%D0%B0%D1%87%D0%B5%D1%81%D1%82%D0%B2%D0%B0.%D1%80%D1%84" title="Народный знак качества"><img src="/img/nzk_button.png" width="275px" height="80px" alt="Народный знак качества"></a><div class="published_at"></div>
+<div class="lenta_fix"><div style="text-align: center;font-weight: 600;">До окончания номинирования</div><h3>
+    <a href="https://%D0%BD%D0%B0%D1%80%D0%BE%D0%B4%D0%BD%D1%8B%D0%B9%D0%B7%D0%BD%D0%B0%D0%BA%D0%BA%D0%B0%D1%87%D0%B5%D1%81%D1%82%D0%B2%D0%B0.%D1%80%D1%84" title="Народный знак качества"><img src="/img/nzk_button.png" width="275px" height="80px" alt="Народный знак качества" style="margin-left: -20px;"></a>
+    <div class="count" style="font-size:20px;width:130px;line-height: 24px;"><span class="timer__days"></span><br><span class="timer__hours"></span><br><span class="timer__minutes"></span></div>
 </h3>
 </div>
 ';
@@ -48,3 +50,5 @@ $lenta .= '<style>.lenta .list-wrapper .lenta_fix:hover{background:#60b740;}</st
         <a href="/news">Все новости</a>
     </div>
 </div>
+<?
+	$this->render('countdown');

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác