diff --git a/core/modules/block/css/block.admin.css b/core/modules/block/css/block.admin.css index 2b9eb45..eea844b 100644 --- a/core/modules/block/css/block.admin.css +++ b/core/modules/block/css/block.admin.css @@ -1,10 +1,6 @@ /* Block listing page */ -.region-title .button { - margin-left: 1em; /* LTR */ -} -[dir="rtl"] .region-title .button { - margin-left: 0; - margin-right: 1em; +.region-title .button-action { + font-weight: normal; } /* Block demo mode */ diff --git a/core/modules/block/src/BlockListBuilder.php b/core/modules/block/src/BlockListBuilder.php index 43d7a1c..9403ca6 100644 --- a/core/modules/block/src/BlockListBuilder.php +++ b/core/modules/block/src/BlockListBuilder.php @@ -215,20 +215,28 @@ protected function buildBlocksForm() { ), ); $form['region-' . $region]['title'] = array( - '#prefix' => $region != BlockInterface::BLOCK_REGION_NONE ? $title : $block_regions_with_disabled[$region], - '#type' => 'link', - '#title' => $this->t('Place block in the %region region', ['%region' => $block_regions_with_disabled[$region]]), - '#url' => Url::fromRoute('block.admin_library', ['theme' => $this->getThemeName()], ['query' => ['region' => $region]]), + 'data' => [ + 'title' => [ + '#type' => 'item', + '#markup' => $title, + ], + 'operations' => [ + '#type' => 'link', + '#title' => $this->t('Place block'), + '#url' => Url::fromRoute('block.admin_library', ['theme' => $this->getThemeName()], ['query' => ['region' => $region]]), + '#attributes' => [ + 'title' => $this->t('Place block in the %region region', ['%region' => $block_regions_with_disabled[$region]]), + 'class' => ['use-ajax', 'button-action'], + 'data-dialog-type' => 'modal', + 'data-dialog-options' => Json::encode([ + 'width' => 700, + ]), + ], + ], + ], '#wrapper_attributes' => array( 'colspan' => 5, ), - '#attributes' => [ - 'class' => ['use-ajax', 'button', 'button--small'], - 'data-dialog-type' => 'modal', - 'data-dialog-options' => Json::encode([ - 'width' => 700, - ]), - ], ); $form['region-' . $region . '-message'] = array( diff --git a/core/modules/block/src/Controller/BlockLibraryController.php b/core/modules/block/src/Controller/BlockLibraryController.php index 2a0148f..0f440c6 100644 --- a/core/modules/block/src/Controller/BlockLibraryController.php +++ b/core/modules/block/src/Controller/BlockLibraryController.php @@ -92,7 +92,6 @@ public function listBlocks(Request $request, $theme) { $headers = [ ['data' => $this->t('Block')], ['data' => $this->t('Category')], - ['data' => $this->t('Operations')], ]; // Only add blocks which work without any available context. @@ -103,31 +102,27 @@ public function listBlocks(Request $request, $theme) { $region = $request->query->get('region'); $rows = []; foreach ($definitions as $plugin_id => $plugin_definition) { - $row = []; - $row['title']['data'] = [ - '#markup' => $plugin_definition['admin_label'], - '#prefix' => '
', - '#suffix' => '
', - ]; - $row['category']['data'] = SafeMarkup::checkPlain($plugin_definition['category']); - $links['add'] = [ - 'title' => $this->t('Place block'), - 'url' => Url::fromRoute('block.admin_add', ['plugin_id' => $plugin_id, 'theme' => $theme]), - 'attributes' => [ + $place_block_link = [ + '#type' => 'link', + '#title' => $plugin_definition['admin_label'], + '#url' => Url::fromRoute( + 'block.admin_add', + ['plugin_id' => $plugin_id, 'theme' => $theme], + $region ? ['query' => ['region' => $region]] : [] + ), + '#attributes' => [ + 'title' => $this->t('Place block'), 'class' => ['use-ajax'], 'data-dialog-type' => 'modal', 'data-dialog-options' => Json::encode([ 'width' => 700, ]), ], + '#prefix' => '
', + '#suffix' => '
', ]; - if ($region) { - $links['add']['query']['region'] = $region; - } - $row['operations']['data'] = [ - '#type' => 'operations', - '#links' => $links, - ]; + $row = ['block' => ['data' => $place_block_link]]; + $row['category']['data'] = SafeMarkup::checkPlain($plugin_definition['category']); $rows[] = $row; }