summaryrefslogtreecommitdiffstats
path: root/core/modules/block/templates/block-admin-display-form.html.twig
blob: 545a06cca447a0249cf6345a016c8654a9b401f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{#
/**
 * @file
 * Default theme implementation to configure blocks.
 *
 * Available variables:
 * - block_regions: A collection of regions. Keyed by name with the title as value.
 * - block_listing: A collection of blocks keyed by region and then delta.
 * - form: The form elements.
 *
 * Each block_listing[region] contains a collection of blocks for that region.
 * - data: Each data in block_listing[region] contains.
 *    - region_title: Region title for the listed block.
 *    - block_title: Block title.
 *    - region_select: Drop-down menu for assigning a region.
 *    - weight_select: Drop-down menu for setting weights.
 *    - operations: Block operations.
 *
 * @see template_preprocess()
 * @see template_preprocess_block_admin_display_form()
 *
 * @ingroup themeable
 */
#}
<table id="blocks" class="sticky-enabled">
  <thead>
    <tr>
      <th>{{ 'Block'|t }}</th>
      <th>{{ 'Region'|t }}</th>
      <th>{{ 'Weight'|t }}</th>
      <th>{{ 'Operations'|t }}</th>
    </tr>
  </thead>
  <tbody>
    {% set row = 0 %}
    {% for region, title in block_regions %}
      <tr class="region-title region-title-{{ region }}">
        <td colspan="5">{{ title }}</td>
      </tr>
      <tr class="region-message region-{{ region }}-message {{ block_listing[region] is empty ? 'region-empty' : 'region-populated' }}">
        <td colspan="5"><em>{{ 'No blocks in this region'|t }}</em></td>
      </tr>
      {% for delta, data in block_listing[region] %}
      <tr{{ data.attributes }}>
        <td class="block">{{ data.block_title }}</td>
        <td>{{ data.region_select }}</td>
        <td>{{ data.weight_select }}</td>
        <td>{{ data.operations }}</td>
      </tr>
      {% set row = row + 1 %}
      {% endfor %}
    {% endfor %}
  </tbody>
</table>

{{ form }}