Pārlūkot izejas kodu

[Administration] Tableau de bord administrateur

feature/souke
Guillaume Bourgeois pirms 9 mēnešiem
vecāks
revīzija
a6e9f8a277
6 mainītis faili ar 38 papildinājumiem un 7 dzēšanām
  1. +3
    -2
      backend/controllers/DashboardAdminController.php
  2. +20
    -1
      backend/views/dashboard-admin/index.php
  3. +0
    -1
      backend/views/online-admin/index.php
  4. +5
    -0
      backend/web/css/screen.css
  5. +5
    -2
      backend/web/js/backend.js
  6. +5
    -1
      backend/web/sass/dashboard-admin/_index.scss

+ 3
- 2
backend/controllers/DashboardAdminController.php Parādīt failu

@@ -74,7 +74,8 @@ class DashboardAdminController extends BackendController
'countUsersOnline' => $this->getUserModule()->getRepository()->countUsersOnline(),
'countTicketsAdminOpen' => $this->getTicketModule()->getRepository()->countTicketsAdminStatusOpen(),
'countTicketsAdminUnread' => $this->getTicketModule()->getRepository()->countTicketsAdminUnreadByUser($this->getUserCurrent()),
'statisticsCacheHtml' => \Yii::$app->cache->get('dashboard_statistics10') ?: ''
'usersWithStatusProducerOnlineArray' => $this->getUserModule()->getRepository()->findUsersWithStatusProducerAndOnline()
//'statisticsCacheHtml' => \Yii::$app->cache->get('dashboard_statistics12') ?: '',
]);
}

@@ -86,7 +87,7 @@ class DashboardAdminController extends BackendController

public function actionAjaxStatisticsHtml()
{
return \Yii::$app->cache->getOrSet('dashboard_statistics10', function () {
return \Yii::$app->cache->getOrSet('dashboard_statistics12', function () {
$producerModule = $this->getProducerModule();
$pointSaleModule = $this->getPointSaleModule();
$userModule = $this->getUserModule();

+ 20
- 1
backend/views/dashboard-admin/index.php Parādīt failu

@@ -1,8 +1,11 @@
<?php

use common\helpers\AdminLTE;
use common\helpers\Image;
use yii\helpers\Html;

$this->setTitle('Tableau de bord');
$this->setMetaRefresh(true);

?>

@@ -17,6 +20,22 @@ $this->setTitle('Tableau de bord');
Yii::$app->urlManager->createUrl('online-admin/index')
) ?>
</div>
<div class="col-lg-6 col-xs-6" id="producers-online">
<!--<h3>Producteurs en ligne :</h3>-->
<?php if($usersWithStatusProducerOnlineArray && count($usersWithStatusProducerOnlineArray) > 0): ?>
<?php foreach ($usersWithStatusProducerOnlineArray as $userWithStatusProducerOnline): ?>
<?php $producer = $userWithStatusProducerOnline->producer; ?>
<?php if($producer): ?>
<a class="btn btn-default" title="Aller sur le compte de ce producteur" href="<?= $this->getUrlManagerBackend()->createUrl(['site/switch-producer', 'id' => $producer->id]); ?>">
<?= $producer->name; ?>
</a>
<?php endif; ?>
<?php endforeach; ?>
<div class="clr"></div>
<?php else: ?>
<div class="alert alert-info">Aucun producteur en ligne actuellement.</div>
<?php endif; ?>
</div>
</div>
<div class="row">
<div class="col-lg-6 col-xs-6">
@@ -41,6 +60,6 @@ $this->setTitle('Tableau de bord');
</div>

<div id="dashboard-admin-statistics-html">
<?= $statisticsCacheHtml ?>
<a class="btn btn-default btn-load" href="javascript:void(0);">Charger les statistiques</a>
</div>
</div>

+ 0
- 1
backend/views/online-admin/index.php Parādīt failu

@@ -68,7 +68,6 @@ $this->setMetaRefresh(true);
src="<?= Yii::$app->urlManagerProducer->getHostInfo() . '/' . Yii::$app->urlManagerProducer->baseUrl; ?>/uploads/<?= $producer->logo; ?>"
alt="Logo <?= Html::encode($producer->name) ?>">
<?php endif; ?>

<h3 class="profile-username text-center">
<a title="Aller sur le compte de ce producteur" href="<?= $this->getUrlManagerBackend()->createUrl(['site/switch-producer', 'id' => $producer->id]); ?>">
<?= $producer->name; ?>

+ 5
- 0
backend/web/css/screen.css Parādīt failu

@@ -3152,6 +3152,11 @@ termes.
color: white;
}

/* line 4, ../sass/dashboard-admin/_index.scss */
.dashboard-admin-index #producers-online h3 {
margin-top: 0px;
}

/**
Copyright distrib (2018)


+ 5
- 2
backend/web/js/backend.js Parādīt failu

@@ -72,8 +72,11 @@ var UrlManager = {
function opendistrib_dashboard_admin_statistics() {
var selector = '#dashboard-admin-statistics-html';
if($(selector).length) {
$.get(UrlManager.getBaseUrl() + 'dashboard-admin/ajax-statistics-html', {}, function(result) {
$(selector).html(result);
$(selector+' .btn-load').click(function() {
$(selector).html('Chargement ...');
$.get(UrlManager.getBaseUrl() + 'dashboard-admin/ajax-statistics-html', {}, function(result) {
$(selector).html(result);
});
});
}
}

+ 5
- 1
backend/web/sass/dashboard-admin/_index.scss Parādīt failu

@@ -1,4 +1,8 @@

.dashboard-admin-index {

#producers-online {
h3 {
margin-top: 0px;
}
}
}

Notiek ielāde…
Atcelt
Saglabāt