From dfc1dc0ec132d36e02b7c80ffa4878202e47d7b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Arag=C3=B3n?= Date: Tue, 2 Oct 2018 17:30:46 -0500 Subject: [PATCH] update macro panel box.html.twig - refs #2681 --- assets/css/scss/_base.scss | 6 ++- .../user_portal/course_categories.html.twig | 4 +- .../grid_courses_without_category.html.twig | 2 +- .../default/layout/hot_course_item.html.twig | 2 +- .../Resources/views/Macros/box.html.twig | 42 ++++++++++++++++--- 5 files changed, 46 insertions(+), 10 deletions(-) diff --git a/assets/css/scss/_base.scss b/assets/css/scss/_base.scss index ca2927fe07..066d24d307 100644 --- a/assets/css/scss/_base.scss +++ b/assets/css/scss/_base.scss @@ -260,7 +260,6 @@ footer { } .card{ - border: none; transform: perspective(1px) translateZ(0); transition-property: box-shadow; transition-duration: 0.3s; @@ -269,6 +268,11 @@ footer { &:focus{ box-shadow: 0 15px 10px -10px rgba(0, 0, 0, 0.20); } + &.card-category{ + .card-subtitle{ + font-size: 12px; + } + } /*&.card-line{ &:hover{ &:before{ diff --git a/main/template/default/user_portal/course_categories.html.twig b/main/template/default/user_portal/course_categories.html.twig index 724fd7de20..bc3ffbd762 100644 --- a/main/template/default/user_portal/course_categories.html.twig +++ b/main/template/default/user_portal/course_categories.html.twig @@ -11,7 +11,7 @@ {% set image %} {{ category.name }} + alt="{{ category.name }}" class="img-fluid mb-1"> {% endset %} @@ -36,7 +36,7 @@ {% endset %} - {{ macro.rowpanel('category', title, subtitle, content, image) }} + {{ macro.panel_row('category', title, subtitle, content, image) }} {% endif %} diff --git a/main/template/default/user_portal/grid_courses_without_category.html.twig b/main/template/default/user_portal/grid_courses_without_category.html.twig index 95dd7053c9..53bb6c499b 100644 --- a/main/template/default/user_portal/grid_courses_without_category.html.twig +++ b/main/template/default/user_portal/grid_courses_without_category.html.twig @@ -65,7 +65,7 @@
{{ item.notifications }}
{% endif %} {% endset %} - {{ macro.panel('', content, '', '', '', image) }} + {{ macro.panel_course('course', '', content, '', '', '', image) }} {% endif %} {% endfor %} diff --git a/src/CoreBundle/Resources/views/default/layout/hot_course_item.html.twig b/src/CoreBundle/Resources/views/default/layout/hot_course_item.html.twig index 0c63010828..a8773fe7ac 100644 --- a/src/CoreBundle/Resources/views/default/layout/hot_course_item.html.twig +++ b/src/CoreBundle/Resources/views/default/layout/hot_course_item.html.twig @@ -67,7 +67,7 @@ --> {% endset %} - {{ macro.panel('', content, '', '', '', image) }} + {{ macro.panel_course('course', '', content, '', '', '', image) }} {% endif %} {% endfor %} diff --git a/src/ThemeBundle/Resources/views/Macros/box.html.twig b/src/ThemeBundle/Resources/views/Macros/box.html.twig index 1c8af67390..0950a63dc0 100644 --- a/src/ThemeBundle/Resources/views/Macros/box.html.twig +++ b/src/ThemeBundle/Resources/views/Macros/box.html.twig @@ -154,14 +154,43 @@ {% macro panel(header, content, title, footer, subtitle, top_image) %} {% autoescape false %} -
+
{% if header %}
{{ header }}
{% endif %} {% if top_image %} {{ top_image }} {% endif %} -
+
+ {% if title %} +
{{ title }}
+ {% endif %} + {% if subtitle %} +
{{ subtitle }}
+ {% endif %} + + {{ content }} + +
+ {% if footer %} + + {% endif %} +
+ {% endautoescape %} +{% endmacro %} + +{% macro panel_course(id, header, content, title, footer, subtitle, top_image) %} + {% autoescape false %} +
+ {% if header %} +
{{ header }}
+ {% endif %} + {% if top_image %} + {{ top_image }} + {% endif %} +
{% if title %}
{{ title }}
{% endif %} @@ -181,9 +210,9 @@ {% endautoescape %} {% endmacro %} -{% macro rowpanel(id, title, subtitle, content, image) %} +{% macro panel_row(id, title, subtitle, content, image) %} {% autoescape false %} -
+
@@ -196,7 +225,10 @@
{{ title }}
{% endif %} {% if subtitle %} -

{{ subtitle }}

+

+ {{ 'Code'|get_lang }} : + {{ subtitle }} +

{% endif %} {% if content %}