update dashboard
This commit is contained in:
parent
35408e7e16
commit
1619cadf64
|
@ -7,7 +7,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tr>
|
<tr>
|
||||||
<td v-for="item in week" v-bind:class="{'bg-light': !item.currentMonth}">
|
<td v-for="item, key in week" v-bind:class="{'bg-dash': !item.currentMonth, 'bg-light': item.currentMonth && [5, 6].indexOf(key) > -1}">
|
||||||
<div v-for="event in item.events" class="mb-3">
|
<div v-for="event in item.events" class="mb-3">
|
||||||
<details>
|
<details>
|
||||||
<summary>
|
<summary>
|
||||||
|
@ -40,10 +40,20 @@
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
td {
|
td {
|
||||||
height: calc((100vh - 190px) / 8);
|
height: 40px;
|
||||||
width: calc(100% / 7);
|
width: calc(100% / 7);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bg-dash {
|
||||||
|
background: repeating-linear-gradient(
|
||||||
|
45deg,
|
||||||
|
#f2f5f8,
|
||||||
|
#e9ecef 10px,
|
||||||
|
#e5e8eb 10px,
|
||||||
|
#dddfe2 20px
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
.btn-xs {
|
.btn-xs {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
padding: 3px 4px;
|
padding: 3px 4px;
|
||||||
|
|
42
src/Controller/DashboardAdminController.php
Normal file
42
src/Controller/DashboardAdminController.php
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Controller;
|
||||||
|
|
||||||
|
use App\Core\Controller\Dashboard\DashboardAdminController as BaseController;
|
||||||
|
use App\Repository\ConferenceRepositoryQuery;
|
||||||
|
use App\Repository\DebriefingRepositoryQuery;
|
||||||
|
use App\Repository\InterventionRepositoryQuery;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Route("/admin")
|
||||||
|
*/
|
||||||
|
class DashboardAdminController extends BaseController
|
||||||
|
{
|
||||||
|
protected DebriefingRepositoryQuery $debriefingQuery;
|
||||||
|
protected ConferenceRepositoryQuery $conferenceQuery;
|
||||||
|
protected InterventionRepositoryQuery $interventionQuery;
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
DebriefingRepositoryQuery $debriefingQuery,
|
||||||
|
ConferenceRepositoryQuery $conferenceQuery,
|
||||||
|
InterventionRepositoryQuery $interventionQuery
|
||||||
|
) {
|
||||||
|
$this->debriefingQuery = $debriefingQuery;
|
||||||
|
$this->conferenceQuery = $conferenceQuery;
|
||||||
|
$this->interventionQuery = $interventionQuery;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Route("/", name="admin_custom_dashboard_index")
|
||||||
|
*/
|
||||||
|
public function index(): Response
|
||||||
|
{
|
||||||
|
return $this->render('@Core/dashboard/index.html.twig', [
|
||||||
|
'conferences' => $this->conferenceQuery->create()->latest()->find(),
|
||||||
|
'debriefings' => $this->debriefingQuery->create()->latest()->find(),
|
||||||
|
'interventions' => $this->interventionQuery->create()->latest()->find(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
|
@ -34,4 +34,12 @@ class ConferenceRepositoryQuery extends RepositoryQuery
|
||||||
return $this->withThemeType($value);
|
return $this->withThemeType($value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function latest(int $max = 5)
|
||||||
|
{
|
||||||
|
return $this
|
||||||
|
->addOrderBy('.date', 'DESC')
|
||||||
|
->setMaxResults($max)
|
||||||
|
;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,4 +12,12 @@ class DebriefingRepositoryQuery extends RepositoryQuery
|
||||||
{
|
{
|
||||||
parent::__construct($repository, 'd', $paginator);
|
parent::__construct($repository, 'd', $paginator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function latest(int $max = 5)
|
||||||
|
{
|
||||||
|
return $this
|
||||||
|
->addOrderBy('.date', 'DESC')
|
||||||
|
->setMaxResults($max)
|
||||||
|
;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,4 +22,12 @@ class InterventionRepositoryQuery extends RepositoryQuery
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function latest(int $max = 5)
|
||||||
|
{
|
||||||
|
return $this
|
||||||
|
->addOrderBy('.date', 'DESC')
|
||||||
|
->setMaxResults($max)
|
||||||
|
;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,5 +7,66 @@
|
||||||
<div id="calendar"></div>
|
<div id="calendar"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="p-3">
|
||||||
|
<div class="list-group">
|
||||||
|
<div class="list-group-item list-group-item-info">
|
||||||
|
<span class="fa fa-users"></span>
|
||||||
|
Dernières interventions
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% for entity in interventions %}
|
||||||
|
<a href="{{ safe_path('admin_intervention_show', {entity: entity.id}) }}" class="list-group-item list-group-item-action">
|
||||||
|
{% for item in entity.speakers %}
|
||||||
|
<span class="btn btn-sm btn-{{ item.color }} mr-2">{{ item.name }}</span>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% for item in entity.establishments %}
|
||||||
|
<span class="btn btn-sm btn-light border mr-2">{{ item.name }}</span>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
<span class="float-right btn btn-sm btn-primary">
|
||||||
|
{{ entity.date|date('d/m/Y') }}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="p-3">
|
||||||
|
<div class="list-group">
|
||||||
|
<div class="list-group-item list-group-item-info">
|
||||||
|
<span class="fa fa-users"></span>
|
||||||
|
Dernières conférences
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% for entity in conferences %}
|
||||||
|
<a href="{{ safe_path('admin_conference_show', {entity: entity.id}) }}" class="list-group-item list-group-item-action">
|
||||||
|
{{ entity.label }}
|
||||||
|
</a>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="p-3">
|
||||||
|
<div class="list-group">
|
||||||
|
<div class="list-group-item list-group-item-info">
|
||||||
|
<span class="fa fa-list-alt"></span>
|
||||||
|
Derniers comptes-rendus
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% for entity in debriefings %}
|
||||||
|
<a href="{{ safe_path('admin_debriefing_show', {entity: entity.id}) }}" class="list-group-item list-group-item-action">
|
||||||
|
{{ entity.topic }}
|
||||||
|
</a>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
Loading…
Reference in a new issue