diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml index 64a9475..a97d305 100644 --- a/.idea/dataSources.xml +++ b/.idea/dataSources.xml @@ -1,13 +1,13 @@ - + mariadb true true DDEV generated data source org.mariadb.jdbc.Driver - jdbc:mariadb://127.0.0.1:32794/db?user=db&password=db + jdbc:mariadb://127.0.0.1:12526/db?user=db&password=db $ProjectFileDir$ diff --git a/src/Enum/ErrorMessages.php b/src/Enum/ErrorMessages.php index 8470652..93abe60 100644 --- a/src/Enum/ErrorMessages.php +++ b/src/Enum/ErrorMessages.php @@ -1,4 +1,4 @@ -serializer->deserialize($jsonString, Printer::class, 'json'); + $this->entityManager->persist($printer); $this->entityManager->flush(); @@ -40,9 +41,9 @@ class PrinterService $jsonArray = json_decode($json, true); $printer->setName($jsonArray['name'] ?? $printer->getName()); - $printer->setPrice($jsonArray['price'] ?? $printer->getPrice()); + $printer->setPrice((float)($jsonArray['price'] ?? $printer->getPrice())); $printer->setBuildVolume($jsonArray['build_volume'] ?? $printer->getBuildVolume()); - $printer->setMaxSpeed($jsonArray['max_speed'] ?? $printer->getMaxSpeed()); + $printer->setMaxSpeed((float)($jsonArray['max_speed'] ?? $printer->getMaxSpeed())); $this->entityManager->flush(); diff --git a/templates/base.html.twig b/templates/base.html.twig index 67598ac..a9e9d71 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -4,13 +4,15 @@ {% block title %}Welcome!{% endblock %} + + {% block stylesheets %} {% endblock %} {% block javascripts %} {% endblock %} - + {% block body %}{% endblock %} diff --git a/templates/frontend/index.html.twig b/templates/frontend/index.html.twig index d8ca910..7a90719 100644 --- a/templates/frontend/index.html.twig +++ b/templates/frontend/index.html.twig @@ -2,56 +2,207 @@ {% block javascripts %} {% endblock %} {% block body %} -

Printers

- - - - - - - - - - - +
+

Printers

+ +
NamePriceBuild VolumeMax SpeedActions
+ + + + + + + + + + - -
NamePriceBuild VolumeMax SpeedActions
- + {% include "frontend/partials/_deleteModal.html.twig" %} + {% include "frontend/partials/_viewModal.html.twig" %} + {% include "frontend/partials/_createModal.html.twig" %} + {% include "frontend/partials/_editModal.html.twig" %} {% endblock %} \ No newline at end of file diff --git a/templates/frontend/partials/_createModal.html.twig b/templates/frontend/partials/_createModal.html.twig new file mode 100644 index 0000000..a86cee4 --- /dev/null +++ b/templates/frontend/partials/_createModal.html.twig @@ -0,0 +1,35 @@ + + \ No newline at end of file diff --git a/templates/frontend/partials/_deleteModal.html.twig b/templates/frontend/partials/_deleteModal.html.twig new file mode 100644 index 0000000..baeed63 --- /dev/null +++ b/templates/frontend/partials/_deleteModal.html.twig @@ -0,0 +1,17 @@ + \ No newline at end of file diff --git a/templates/frontend/partials/_editModal.html.twig b/templates/frontend/partials/_editModal.html.twig new file mode 100644 index 0000000..b565380 --- /dev/null +++ b/templates/frontend/partials/_editModal.html.twig @@ -0,0 +1,34 @@ + \ No newline at end of file diff --git a/templates/frontend/partials/_viewModal.html.twig b/templates/frontend/partials/_viewModal.html.twig new file mode 100644 index 0000000..d049888 --- /dev/null +++ b/templates/frontend/partials/_viewModal.html.twig @@ -0,0 +1,25 @@ + \ No newline at end of file