From 5b49dc2a3faf1c317cfa22fac0d5bbf4b440edec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sun, 24 Feb 2019 18:32:03 +0100 Subject: [PATCH] Added the base layout from the old Part-DB. --- .env | 7 + config/packages/twig.yaml | 3 + src/Controller/HomepageController.php | 2 +- templates/base.html.twig | 241 +++++++++++++++++++++++++- templates/show_part_info.html.twig | 4 +- 5 files changed, 251 insertions(+), 6 deletions(-) diff --git a/.env b/.env index 417b94b3..7800979d 100644 --- a/.env +++ b/.env @@ -33,3 +33,10 @@ DATABASE_URL=mysql://root:@127.0.0.1:3306/part-db # Delivery is disabled by default via "null://localhost" MAILER_URL=null://localhost ###< symfony/swiftmailer-bundle ### + + +### Custom vars + + + +### End custom vars \ No newline at end of file diff --git a/config/packages/twig.yaml b/config/packages/twig.yaml index d1582a23..5b910f77 100644 --- a/config/packages/twig.yaml +++ b/config/packages/twig.yaml @@ -2,3 +2,6 @@ twig: default_path: '%kernel.project_dir%/templates' debug: '%kernel.debug%' strict_variables: '%kernel.debug%' + + globals: + partdb_title: "Part-DB" diff --git a/src/Controller/HomepageController.php b/src/Controller/HomepageController.php index 321b8a4d..c77a3264 100644 --- a/src/Controller/HomepageController.php +++ b/src/Controller/HomepageController.php @@ -15,7 +15,7 @@ use Symfony\Component\Routing\Annotation\Route; class HomepageController extends AbstractController { /** - * @Route("/") + * @Route("/", name="homepage") */ function homepage() { diff --git a/templates/base.html.twig b/templates/base.html.twig index ec967d58..8658f549 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -11,11 +11,244 @@ {% block body %} +
-
- {% block content %} - {% endblock %} -
+ +
+ +
+
+ +
+ + +
+
+
+ + {# + {if isset($messages)} + {assign "alert_style" "alert-info"} + {assign "alert_icon" "fas fa-info"} + {foreach $messages as $msg} + {if isset($msg.color) && $msg.color == "red"} + {assign "alert_style" "alert-danger"} + {assign "alert_icon" "fas fa-exclamation"} + {elseif isset($msg.color) && ( $msg.color == "green" || $msg.color == "darkgreen")} + {assign "alert_style" "alert-success"} + {assign "alert_icon" "fas fa-check"} + {elseif isset($msg.color) && ($msg.color == "yellow" || $msg.color == "orange")} + {assign "alert_style" "alert-warning"} + {assign "alert_icon" "fas fa-bell"} + {/if} + {/foreach} +
+
+
+ +
+
+
+ {if !empty($messages_div_title)}

{$messages_div_title}

{/if} +
+ {foreach $messages as $msg} + {if isset($msg.text)} + {if isset($msg.strong) && $msg.strong}{/if} + {$msg.text nofilter} + {if isset($msg.strong) && $msg.strong}{/if} + {/if} + + {if isset($msg.html)} + {$msg.html nofilter} + {/if} + + {if !isset($msg.no_linebreak) || !$msg.no_linebreak}
{/if} + {/foreach} + + {if !empty($reload_link)} + +
+ +
+ {/if} +
+
+
+
+
+ #} + + {# Here will be the real content be injected#} + + {% block content %} + {% endblock %} + +
+
+
+
+
+
{% endblock %} {% block javascripts %} {{ encore_entry_script_tags('app') }} diff --git a/templates/show_part_info.html.twig b/templates/show_part_info.html.twig index b0bde4ba..7d98d995 100644 --- a/templates/show_part_info.html.twig +++ b/templates/show_part_info.html.twig @@ -42,12 +42,14 @@
- {{ part.averagePrice }} + {{ "TODO" }}
+ {% if part.comment != "" %}
{{ part.comment }}
+ {% endif %}