diff --git a/core/modules/block/src/Tests/BlockViewBuilderTest.php b/core/modules/block/src/Tests/BlockViewBuilderTest.php index 2ddbcab..b25998e 100644 --- a/core/modules/block/src/Tests/BlockViewBuilderTest.php +++ b/core/modules/block/src/Tests/BlockViewBuilderTest.php @@ -58,7 +58,7 @@ protected function setUp() { // Create a block with only required values. $this->block = $this->controller->create(array( 'id' => 'test_block', - 'theme' => 'stark', + 'theme' => 'classy', 'plugin' => 'test_cache', )); $this->block->save(); @@ -74,7 +74,7 @@ public function testBasicRendering() { $entity = $this->controller->create(array( 'id' => 'test_block1', - 'theme' => 'stark', + 'theme' => 'classy', 'plugin' => 'test_html', )); $entity->save(); @@ -98,7 +98,7 @@ public function testBasicRendering() { // Test the rendering of a block with a given title. $entity = $this->controller->create(array( 'id' => 'test_block2', - 'theme' => 'stark', + 'theme' => 'classy', 'plugin' => 'test_html', 'settings' => array( 'label' => 'Powered by Bananas', @@ -128,7 +128,7 @@ public function testBlockViewBuilderCache() { // Create an empty block. $this->block = $this->controller->create(array( 'id' => 'test_block', - 'theme' => 'stark', + 'theme' => 'classy', 'plugin' => 'test_cache', )); $this->block->save(); @@ -215,7 +215,7 @@ public function testBlockViewBuilderAlter() { $request->setMethod('GET'); $default_keys = array('entity_view', 'block', 'test_block', 'en', 'cache_context.theme'); - $default_tags = array('block_view', 'block:test_block', 'theme:stark', 'block_plugin:test_cache'); + $default_tags = array('block_view', 'block:test_block', 'theme:classy', 'block_plugin:test_cache'); // Advanced: cached block, but an alter hook adds an additional cache key. $this->setBlockCacheConfig(array( @@ -230,7 +230,7 @@ public function testBlockViewBuilderAlter() { $this->assertIdentical(drupal_render($build), ''); $cache_entry = $this->container->get('cache.render')->get($cid); $this->assertTrue($cache_entry, 'The block render element has been cached with the expected cache ID.'); - $expected_tags = array('block_view', 'block:test_block', 'theme:stark', 'block_plugin:test_cache', 'rendered'); + $expected_tags = array('block_view', 'block:test_block', 'theme:classy', 'block_plugin:test_cache', 'rendered'); sort($expected_tags); $this->assertIdentical($cache_entry->tags, $expected_tags, 'The block render element has been cached with the expected cache tags.'); $this->container->get('cache.render')->delete($cid); @@ -246,7 +246,7 @@ public function testBlockViewBuilderAlter() { $this->assertIdentical(drupal_render($build), ''); $cache_entry = $this->container->get('cache.render')->get($cid); $this->assertTrue($cache_entry, 'The block render element has been cached with the expected cache ID.'); - $expected_tags = array('block_view', 'block:test_block', 'theme:stark', 'block_plugin:test_cache', $alter_add_tag, 'rendered'); + $expected_tags = array('block_view', 'block:test_block', 'theme:classy', 'block_plugin:test_cache', $alter_add_tag, 'rendered'); sort($expected_tags); $this->assertIdentical($cache_entry->tags, $expected_tags, 'The block render element has been cached with the expected cache tags.'); $this->container->get('cache.render')->delete($cid); diff --git a/core/modules/block/templates/block-list.html.twig b/core/modules/block/templates/block-list.html.twig index 854d3ce..29c3647 100644 --- a/core/modules/block/templates/block-list.html.twig +++ b/core/modules/block/templates/block-list.html.twig @@ -13,11 +13,6 @@ * @ingroup themeable */ #} -
-
- {{ form|without('place_blocks') }} -
-
- {{ form.place_blocks }} -
+
+ {{ form }}
diff --git a/core/modules/block_content/templates/block-content-add-list.html.twig b/core/modules/block_content/templates/block-content-add-list.html.twig index e5a5d97..0810461 100644 --- a/core/modules/block_content/templates/block-content-add-list.html.twig +++ b/core/modules/block_content/templates/block-content-add-list.html.twig @@ -15,7 +15,7 @@ */ #} {% spaceless %} -
+
{% for type in types %}
{{ type.link }}
{{ type.description }}
diff --git a/core/modules/block/templates/block-list.html.twig b/core/themes/classy/templates/block-list.html.twig similarity index 100% copy from core/modules/block/templates/block-list.html.twig copy to core/themes/classy/templates/block-list.html.twig diff --git a/core/themes/classy/templates/block.html.twig b/core/themes/classy/templates/block.html.twig new file mode 100644 index 0000000..aa750cb --- /dev/null +++ b/core/themes/classy/templates/block.html.twig @@ -0,0 +1,52 @@ +{# +/** + * @file + * 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. + * - module: The module that provided this block plugin. + * - cache: The cache settings. + * - Block plugin specific settings will also be stored here. + * - block - The full block entity. + * - label_hidden: The hidden block title value if the block was + * configured to hide the title ('label' is empty in this case). + * - module: The module that generated the block. + * - delta: An ID for the block, unique within each module. + * - region: The block region embedding the current block. + * - 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. + * - 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 + */ +#} +{% + set classes = [ + 'block', + 'block-' ~ configuration.provider|clean_class, + ] +%} + + {{ title_prefix }} + {% if label %} + {{ label }} + {% endif %} + {{ title_suffix }} + {% block content %} + {{ content }} + {% endblock %} +