From 04fe35c82295b645039b597a44326f66262679d7 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Fri, 24 Apr 2020 18:08:09 +0200 Subject: [PATCH] Added /design path to show template elements --- config/routes.php | 3 + resources/assets/themes/base.less | 8 +- resources/views/macros/form.twig | 12 +- resources/views/pages/design.twig | 226 ++++++++++++++++++ src/Controllers/DesignController.php | 54 +++++ .../Unit/Controllers/DesignControllerTest.php | 30 +++ 6 files changed, 329 insertions(+), 4 deletions(-) create mode 100644 resources/views/pages/design.twig create mode 100644 src/Controllers/DesignController.php create mode 100644 tests/Unit/Controllers/DesignControllerTest.php diff --git a/config/routes.php b/config/routes.php index f4c6c183..7cc2823d 100644 --- a/config/routes.php +++ b/config/routes.php @@ -32,6 +32,9 @@ $route->post('/news/{id:\d+}', 'NewsController@comment'); // API $route->get('/api[/{resource:.+}]', 'ApiController@index'); +// Design +$route->get('/design', 'DesignController@index'); + // Administration $route->addGroup( '/admin', diff --git a/resources/assets/themes/base.less b/resources/assets/themes/base.less index da505685..d0751180 100644 --- a/resources/assets/themes/base.less +++ b/resources/assets/themes/base.less @@ -217,6 +217,12 @@ table a > .icon-icon_angel { text-align: right; } +h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { + code { + background-color: inherit; + } +} + .messages { &:focus { outline: none; @@ -387,7 +393,7 @@ table a > .icon-icon_angel { left: 10%; display: block; overflow-y: auto; - box-shadow: -5px 20px 20px 0px rgba(0, 0, 0, 0.5), 5px 0 5px -5px rgba(0, 0, 0, 0.5); + box-shadow: -5px 20px 20px 0 rgba(0, 0, 0, 0.5), 5px 0 5px -5px rgba(0, 0, 0, 0.5); } // Hide current page in nav. diff --git a/resources/views/macros/form.twig b/resources/views/macros/form.twig index 8965e92a..66780db8 100644 --- a/resources/views/macros/form.twig +++ b/resources/views/macros/form.twig @@ -7,7 +7,13 @@ id="{{ name }}" name="{{ name }}" value="{{ opt.value|default('') }}" {%- if opt.required|default(false) %} - required="required" + required + {%- endif -%} + {%- if opt.disabled|default(false) %} + disabled + {%- endif -%} + {%- if opt.readonly|default(false) %} + readonly {%- endif -%} > @@ -20,7 +26,7 @@ {%- endif %}