From 20401784608dc9d0c38ed77da0323f90c851036a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sun, 8 Sep 2019 14:32:44 +0200 Subject: [PATCH] Fixed missing templates for part lists. --- src/Controller/PartListsController.php | 14 ++++++++++---- templates/Parts/lists/all_list.html.twig | 11 +++++++++++ templates/Parts/lists/search_list.html.twig | 11 +++++++++++ templates/Parts/lists/tags_list.html.twig | 11 +++++++++++ 4 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 templates/Parts/lists/all_list.html.twig create mode 100644 templates/Parts/lists/search_list.html.twig create mode 100644 templates/Parts/lists/tags_list.html.twig diff --git a/src/Controller/PartListsController.php b/src/Controller/PartListsController.php index 77a01a48..a52c15b8 100644 --- a/src/Controller/PartListsController.php +++ b/src/Controller/PartListsController.php @@ -50,7 +50,7 @@ class PartListsController extends AbstractController public function showCategory(Category $category, Request $request, DataTableFactory $dataTable) { $table = $dataTable->createFromType(PartsDataTable::class, ['category' => $category]) - ->handleRequest($request); + ->handleRequest($request); if ($table->isCallback()) { return $table->getResponse(); @@ -122,7 +122,10 @@ class PartListsController extends AbstractController return $table->getResponse(); } - return $this->render('parts_list.html.twig', ['datatable' => $table]); + return $this->render('Parts/lists/tags_list.html.twig', [ + 'tag' => $tag, + 'datatable' => $table + ]); } /** @@ -139,7 +142,10 @@ class PartListsController extends AbstractController return $table->getResponse(); } - return $this->render('parts_list.html.twig', ['datatable' => $table]); + return $this->render('Parts/lists/search_list.html.twig', [ + 'datatable' => $table, + 'keyword' => $keyword + ]); } /** @@ -159,6 +165,6 @@ class PartListsController extends AbstractController return $table->getResponse(); } - return $this->render('parts_list.html.twig', ['datatable' => $table]); + return $this->render('Parts/lists/all_list.html.twig', ['datatable' => $table]); } } diff --git a/templates/Parts/lists/all_list.html.twig b/templates/Parts/lists/all_list.html.twig new file mode 100644 index 00000000..82e45487 --- /dev/null +++ b/templates/Parts/lists/all_list.html.twig @@ -0,0 +1,11 @@ +{% extends "base.html.twig" %} + +{% block title %} +{% trans %}parts_list.all.title{% endtrans %} +{% endblock %} + +{% block content %} + + {% include "Parts/lists/_parts_list.html.twig" %} + +{% endblock %} diff --git a/templates/Parts/lists/search_list.html.twig b/templates/Parts/lists/search_list.html.twig new file mode 100644 index 00000000..9d548360 --- /dev/null +++ b/templates/Parts/lists/search_list.html.twig @@ -0,0 +1,11 @@ +{% extends "base.html.twig" %} + +{% block title %} +{% trans %}parts_list.search.title{% endtrans %} {{ keyword }} +{% endblock %} + +{% block content %} + + {% include "Parts/lists/_parts_list.html.twig" %} + +{% endblock %} diff --git a/templates/Parts/lists/tags_list.html.twig b/templates/Parts/lists/tags_list.html.twig new file mode 100644 index 00000000..dac3d63b --- /dev/null +++ b/templates/Parts/lists/tags_list.html.twig @@ -0,0 +1,11 @@ +{% extends "base.html.twig" %} + +{% block title %} +{% trans %}parts_list.tags.title{% endtrans %} {{ tag }} +{% endblock %} + +{% block content %} + + {% include "Parts/lists/_parts_list.html.twig" %} + +{% endblock %}