diff --git a/themes/custom/droopler_theme/config/install/block.block.primaryadminactions.yml b/themes/custom/droopler_theme/config/install/block.block.primaryadminactions.yml new file mode 100644 index 000000000..7e6223234 --- /dev/null +++ b/themes/custom/droopler_theme/config/install/block.block.primaryadminactions.yml @@ -0,0 +1,17 @@ +langcode: en +status: true +dependencies: + theme: + - droopler_theme +id: primaryadminactions +theme: droopler_theme +region: admin_tabs +weight: 0 +provider: null +plugin: local_actions_block +settings: + id: local_actions_block + label: 'Primary admin actions' + label_display: '0' + provider: core +visibility: { } diff --git a/themes/custom/droopler_theme/droopler_theme.theme b/themes/custom/droopler_theme/droopler_theme.theme index 6a6aa2704..52edbeb64 100755 --- a/themes/custom/droopler_theme/droopler_theme.theme +++ b/themes/custom/droopler_theme/droopler_theme.theme @@ -343,6 +343,17 @@ function droopler_theme_preprocess_block(&$variables) { } } +/** + * Implements hook_preprocess_HOOK() for menu_local_action. + */ +function droopler_theme_preprocess_menu_local_action(&$variables) { + $variables['link']['#options']['attributes']['class'] = [ + 'btn', + 'btn-outline-primary', + 'btn-sm', + ]; +} + /** * Check if current route is node with paragraphs or other defined route. * diff --git a/themes/custom/droopler_theme/scss/barrio/_actions.scss b/themes/custom/droopler_theme/scss/barrio/_actions.scss new file mode 100644 index 000000000..1a0f8b202 --- /dev/null +++ b/themes/custom/droopler_theme/scss/barrio/_actions.scss @@ -0,0 +1,11 @@ +/** + * @file + * Theme styling for actions + */ + +nav.action-links li { + list-style: none; + margin-bottom: 20px; + margin-right: 10px; + display: inline-block; +} diff --git a/themes/custom/droopler_theme/scss/style.scss b/themes/custom/droopler_theme/scss/style.scss index c3a9d899c..4728cf7ea 100644 --- a/themes/custom/droopler_theme/scss/style.scss +++ b/themes/custom/droopler_theme/scss/style.scss @@ -25,6 +25,7 @@ // // Styleguide 2.0 +@import 'barrio/actions'; @import 'barrio/breadcrumb'; @import 'barrio/contextual'; @import 'barrio/feed-icon'; diff --git a/themes/custom/droopler_theme/templates/block/block--local-actions-block.html.twig b/themes/custom/droopler_theme/templates/block/block--local-actions-block.html.twig index e96b55e9f..3822fd484 100644 --- a/themes/custom/droopler_theme/templates/block/block--local-actions-block.html.twig +++ b/themes/custom/droopler_theme/templates/block/block--local-actions-block.html.twig @@ -1,12 +1,46 @@ -{% extends "@droopler_theme/block/block.html.twig" %} {# /** * @file - * Theme override for local actions (primary admin actions.) + * Default theme implementation to display a block. + * + * Available variables: + * - plugin_id: The ID of the block implementation. + * - label: The configured label of the block if visible. + * - configuration: A list of the block's configuration values. + * - label: The configured label for the block. + * - label_display: The display settings for the label. + * - provider: The module or other provider that provided this block plugin. + * - Block plugin specific settings will also be stored here. + * - content: The content of this block. + * - attributes: array of HTML attributes populated by modules, intended to + * be added to the main container tag of this template. + * - id: A valid HTML ID and guaranteed unique. + * - title_attributes: Same as attributes, except applied to the main title + * tag that appears in the template. + * - content_attributes: Same as attributes, except applied to the main content + * tag that appears in the template. + * - title_prefix: Additional output populated by modules, intended to be + * displayed in front of the main title tag that appears in the template. + * - title_suffix: Additional output populated by modules, intended to be + * displayed after the main title tag that appears in the template. + * + * @see template_preprocess_block() + * + * @ingroup themeable */ #} -{% block content %} - {% if content %} - - {% endif %} -{% endblock %} +{% + set classes = [ + 'block', + 'block-' ~ configuration.provider|clean_class, + 'block-' ~ plugin_id|clean_class, +] +%} + +{% if content|render|trim %} + + + + + +{% endif %} diff --git a/themes/custom/droopler_theme/templates/layout/region--admin-tabs.html.twig b/themes/custom/droopler_theme/templates/layout/region--admin-tabs.html.twig index dceb264e3..f04dd2ec6 100644 --- a/themes/custom/droopler_theme/templates/layout/region--admin-tabs.html.twig +++ b/themes/custom/droopler_theme/templates/layout/region--admin-tabs.html.twig @@ -20,7 +20,7 @@ 'container' ] %} -{% if content %} +{% if content|render|trim %} {{ content }}