This commit is contained in:
parent
0516d6e8c4
commit
0c7922eb9b
|
@ -5,13 +5,31 @@ namespace App\Controller;
|
||||||
use App\Core\Controller\Dashboard\DashboardAdminController as Controller;
|
use App\Core\Controller\Dashboard\DashboardAdminController as Controller;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
|
use App\Repository\Blog\PostRepositoryQuery;
|
||||||
|
use App\Repository\ProjectRepositoryQuery;
|
||||||
|
|
||||||
#[Route(path: '/admin')]
|
#[Route(path: '/admin')]
|
||||||
class DashboardAdminController extends Controller
|
class DashboardAdminController extends Controller
|
||||||
{
|
{
|
||||||
#[Route(path: '/', name: 'admin_dashboard_index')]
|
#[Route(path: '/', name: 'admin_dashboard_index')]
|
||||||
public function index(): Response
|
public function index(
|
||||||
|
PostRepositoryQuery $postQuery,
|
||||||
|
ProjectRepositoryQuery $projectQuery
|
||||||
|
): Response
|
||||||
{
|
{
|
||||||
return $this->render('admin/dashboard.html.twig');
|
$posts = $postQuery->create()
|
||||||
|
->orderBy('.id', 'DESC')
|
||||||
|
->paginate(1, 4)
|
||||||
|
;
|
||||||
|
|
||||||
|
$projects = $projectQuery->create()
|
||||||
|
->orderBy('.id', 'DESC')
|
||||||
|
->paginate(1, 3)
|
||||||
|
;
|
||||||
|
|
||||||
|
return $this->render('admin/dashboard.html.twig', [
|
||||||
|
'posts' => $posts,
|
||||||
|
'projects' => $projects,
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,38 @@
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<iframe src="{{ setting('stats_umami_url') }}" class="col-12" frameborder="0" style="height: calc(100vh - 60px)"></iframe>
|
<div class="col-12 col-md-3 p-3">
|
||||||
|
<div class="list-group mb-4">
|
||||||
|
<div class="list-group-item list-group-item-action bg-dark-blue">
|
||||||
|
<a href="{{ path('admin_blog_post_index') }}" class="text-white">
|
||||||
|
<span class="fa fa-pen"></span>
|
||||||
|
{{ 'Articles'|trans }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
{% for entity in posts %}
|
||||||
|
<div class="list-group-item">
|
||||||
|
{{ include('blog/post_admin/field/title.html.twig') }}
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="list-group mb-4">
|
||||||
|
<div class="list-group-item list-group-item-action bg-dark-blue">
|
||||||
|
<a href="{{ path('admin_project_index') }}" class="text-white">
|
||||||
|
<span class="fa fa-pen"></span>
|
||||||
|
{{ 'Projets'|trans }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
{% for entity in projects %}
|
||||||
|
<div class="list-group-item">
|
||||||
|
<a href="{{ path('admin_project_edit', {entity: entity.id}) }}" class="d-block text-dark">
|
||||||
|
{{ entity.label }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<iframe src="{{ setting('stats_umami_url') }}" class="col-12 col-md-9" frameborder="0" style="height: calc(100vh - 60px)">
|
||||||
|
</iframe>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
Loading…
Reference in a new issue