diff --git a/core/themes/seven/seven.theme b/core/themes/seven/seven.theme
index c3e7a32..f892be3 100644
--- a/core/themes/seven/seven.theme
+++ b/core/themes/seven/seven.theme
@@ -113,104 +113,70 @@ function seven_menu_local_task($variables) {
}
/**
- * Displays the list of available node types for node creation.
+ * Implements hook_preprocess_HOOK() for list of available node type templates.
*/
-function seven_node_add_list($variables) {
- $content = $variables['content'];
- if ($content) {
- $output = '
';
}
else {
- $output = '' . t('You have not created any content types yet. Go to the content type creation page to add a new content type.', array('@create-content' => url('admin/structure/types/add'))) . '
';
+ $variables['add_content_type_url'] = \Drupal::url('node.type_add');
}
- return $output;
}
/**
- * Overrides theme_custom_block_add_list().
+ * Implements hook_preprocess_HOOK() for custom block add list templates.
*
- * Displays the list of available custom block types for creation.
+ * Displays the list of available custom block types for creation, adding
+ * separate variables for the label, description, and url.
*/
-function seven_custom_block_add_list($variables) {
- $output = '';
- if (!empty($variables['types'])) {
- $output = '';
}
- return $output;
}
/**
- * Overrides theme_admin_block_content().
+ * Implements hook_preprocess_HOOK() for block admin page templates.
*
* Uses an unordered list markup in both compact and extended mode.
*/
-function seven_admin_block_content($variables) {
- $content = $variables['content'];
- $output = '';
- if (!empty($content)) {
- $output = system_admin_compact_mode() ? '' : '';
}
- return $output;
}
/**
- * Overrides theme_tablesort_indicator().
+ * Implements hook_preprocess_HOOK() for tablesort indicator templates.
*
* Uses Seven's image versions, so the arrows show up as black and not gray on
* gray.
*/
-function seven_tablesort_indicator($variables) {
+function seven_preprocess_tablesort_indicator(&$variables) {
$theme_path = drupal_get_path('theme', 'seven');
-
- if ($variables['style'] == 'asc') {
- $image_uri = $theme_path . '/images/arrow-asc.png';
- $text = t('Sort ascending');
- }
- else {
- $image_uri = $theme_path . '/images/arrow-desc.png';
- $text = t('Sort descending');
- }
-
- $image = array(
- '#theme' => 'image',
- '#uri' => $image_uri,
- '#alt' => $text,
- '#width' => 9,
- '#height' => 5,
- '#title' => $text,
- );
- return drupal_render($image);
+ $variables['arrow_asc'] = file_create_url($theme_path . '/images/arrow-asc.png');
+ $variables['arrow_desc'] = file_create_url($theme_path . '/images/arrow-desc.png');
}
/**
@@ -326,7 +292,7 @@ function seven_form_node_form_alter(&$form, &$form_state) {
);
$form['advanced']['#type'] = 'container';
- $form['meta'] = array (
+ $form['meta'] = array(
'#attributes' => array('class' => array('entity-meta-header')),
'#type' => 'container',
'#group' => 'advanced',
diff --git a/core/themes/seven/templates/admin-block-content.html.twig b/core/themes/seven/templates/admin-block-content.html.twig
new file mode 100644
index 0000000..821b02c
--- /dev/null
+++ b/core/themes/seven/templates/admin-block-content.html.twig
@@ -0,0 +1,25 @@
+{#
+/**
+ * @file
+ * Seven's theme implementation for the content of an administrative block.
+ *
+ * Available variables:
+ * - content: List of administrative menu items. Each menu item contains:
+ * - path: Path to the admin section.
+ * - label: Short name of the section.
+ * - description: Description of the administrative menu item.
+ * - attributes: HTML attributes to be added to the element.
+ *
+ * @see template_preprocess_admin_block_content()
+ * @see seven_preprocess_admin_block_content()
+ *
+ * @ingroup themeable
+ */
+#}
+{% if content %}
+
+{% endif %}
diff --git a/core/themes/seven/templates/custom-block-add-list.html.twig b/core/themes/seven/templates/custom-block-add-list.html.twig
new file mode 100644
index 0000000..2942ba2
--- /dev/null
+++ b/core/themes/seven/templates/custom-block-add-list.html.twig
@@ -0,0 +1,29 @@
+{#
+/**
+ * @file
+ * Overrides custom-block-add-list.html.twig.
+ *
+ * Displays the list of available custom block types for creation.
+ *
+ * Available variables:
+ * - types: A collection of all the available custom block types.
+ * Each type contains:
+ * - type: The custom block type, containing all the items below.
+ * - link: A link to add a block of this type.
+ * - description: A description of this custom block type.
+ * - label: The title of the custom block type.
+ * - path: A path for the link to add a block of this type.
+ *
+ * @see template_preprocess_custom_block_add_list()
+ * @see seven_preprocess_custom_block_add_list()
+ *
+ * @ingroup themeable
+ */
+ #}
+
diff --git a/core/themes/seven/templates/node-add-list.html.twig b/core/themes/seven/templates/node-add-list.html.twig
new file mode 100644
index 0000000..97640e1
--- /dev/null
+++ b/core/themes/seven/templates/node-add-list.html.twig
@@ -0,0 +1,27 @@
+{#
+/**
+ * @file
+ * Seven's theme implementation to list node types available for adding content.
+ *
+ * Available variables:
+ * - types: List of content types. Each content type contains:
+ * - add_link: Link to create a piece of content of this type.
+ * - description: Description of this type of content.
+ *
+ * @see template_preprocess_node_add_list()
+ * @see seven_preprocess_node_add_list()
+ *
+ * @ingroup themeable
+ */
+#}
+{% if content %}
+
+{% else %}
+ {% trans %}
+ You have not created any content types yet. Go to the content type creation page to add a new content type.
+ {% endtrans %}
+{% endif %}
diff --git a/core/themes/seven/templates/tablesort-indicator.html.twig b/core/themes/seven/templates/tablesort-indicator.html.twig
new file mode 100644
index 0000000..5a679a6
--- /dev/null
+++ b/core/themes/seven/templates/tablesort-indicator.html.twig
@@ -0,0 +1,17 @@
+{#
+/**
+ * @file
+ * Default theme implementation for displaying a tablesort indicator.
+ *
+ * Available variables:
+ * - style: Either 'asc' or 'desc', indicating the sorting direction.
+ * - theme_path: Path to the theme.
+ *
+ * @ingroup themeable
+ */
+#}
+{% if style == 'asc' -%}
+
+{% else -%}
+
+{% endif %}
diff --git a/diff.txt b/diff.txt
new file mode 100644
index 0000000..803cefc
--- /dev/null
+++ b/diff.txt
@@ -0,0 +1,36 @@
+diff --git a/old.txt b/old.txt
+index 07b281a..76bbc0c 100644
+--- a/old.txt
++++ b/old.txt
+@@ -1,17 +1,22 @@
++
+
++
+ Updated
+
+-
+-
+-
+-
++
++
++
++
+
++
+
++
++
+
++
diff --git a/new.txt b/new.txt
new file mode 100644
index 0000000..76bbc0c
--- /dev/null
+++ b/new.txt
@@ -0,0 +1,28 @@
+
+
+
+Updated
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/urls.txt b/urls.txt
new file mode 100644
index 0000000..f4843ec
--- /dev/null
+++ b/urls.txt
@@ -0,0 +1,13 @@
+URLs to Twig template renders:
+
+node-add-list
+/node/add
+
+tablesort_indicator
+/admin/content
+
+custom-block-add-list
+/block/add?destination=admin%2Fstructure%2Fblock%2Fcustom-blocks
+
+admin-block-content
+/admin/structure/display-modes/view/add