From 7e05e7354fb139be3a5bcebe236e82cdcc7d283b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Mon, 31 Dec 2018 23:19:07 -0500 Subject: [PATCH] Well all the action is in Bulma so let's override that --- agaric/templates/block/block.html.twig | 52 +++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 6 deletions(-) diff --git a/agaric/templates/block/block.html.twig b/agaric/templates/block/block.html.twig index 029dc89..be78dc3 100644 --- a/agaric/templates/block/block.html.twig +++ b/agaric/templates/block/block.html.twig @@ -1,10 +1,50 @@ -{% extends '@bulma/block/block.html.twig' %} -{% set view_mode = configuration['view_mode'] ?? null %} -{% if view_mode is same as ('columnar') %} +{% extends "@stable/block/block.html.twig" %} +{# Child templates can override the default classes. #} +{% + set classes = classes ?? [ + 'block', + 'block-' ~ configuration.provider|clean_class, + 'block-' ~ plugin_id|clean_class, + 'clearfix', + ] +%} +{# Footer blocks display in columns. #} +{% if region == 'footer' %} {% - set classes = [ - 'column' + set classes = classes|merge([ + 'column', + 'is-narrow', + ]) + %} +{% endif %} +{% if block_panel_style %} + {% set classes = classes|merge(['panel']) %} + {% + set title_classes = title_classes ?? [] + %} + {% + set title_classes = title_classes|merge([ + 'panel-heading', + ]) + %} +{% elseif not title_classes %} + {% + set title_classes = [ + 'subtitle', + 'is-4', + 'is-uppercase' ] %} - {% set attributes = attributes.addClass(classes) %} {% endif %} +{% set attributes = attributes.addClass(classes) %} +{% set title_attributes = title_attributes.addClass(title_classes) %} +{# Override the content block to conditionally add a panel wrapper. #} +{% block content %} + {% if block_panel_style %} +
+ {% endif %} + {{ content }} + {% if block_panel_style %} +
+ {% endif %} +{% endblock %}