diff --git a/core/themes/seven/seven.theme b/core/themes/seven/seven.theme index 74592cf370cb3f5b2824f7e8b1b290eb8f41a68b..5585065165944e536673643c67eced6046a699e3 100644 --- a/core/themes/seven/seven.theme +++ b/core/themes/seven/seven.theme @@ -110,104 +110,59 @@ 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_block_content_add_list(). + * Implements hook_preprocess_HOOK() for block content 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_block_content_add_list($variables) { - $output = ''; - if (!empty($variables['types'])) { - $output = ''; } - return $output; } /** - * Overrides theme_admin_block_content(). - * - * Uses an unordered list markup in both compact and extended mode. + * Implements hook_preprocess_HOOK() for block admin page templates. */ -function seven_admin_block_content($variables) { - $content = $variables['content']; - $output = ''; - if (!empty($content)) { - $output = system_admin_compact_mode() ? ' +{% endif %} diff --git a/core/themes/seven/templates/block-content-add-list.html.twig b/core/themes/seven/templates/block-content-add-list.html.twig new file mode 100644 index 0000000000000000000000000000000000000000..0c0c49664a1c9efa5b12467c9c2fd49c39253fa6 --- /dev/null +++ b/core/themes/seven/templates/block-content-add-list.html.twig @@ -0,0 +1,26 @@ +{# +/** + * @file + * Seven's theme implementation to display a list of custom block types. + * + * 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: + * - url: 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_block_content_add_list() + * @see seven_preprocess_block_content_add_list() + */ + #} + 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 0000000000000000000000000000000000000000..4d5e020687cb54585d1b0bfea84540358807b788 --- /dev/null +++ b/core/themes/seven/templates/node-add-list.html.twig @@ -0,0 +1,29 @@ +{# +/** + * @file + * Seven's theme implementation to list node types available for adding content. + * + * Available variables: + * - types: List of content types. Each content type contains: + * - url: Path to the add content of this type page. + * - label: The title of this type of content. + * - description: Description of this type of content. + * - add_content_type_url: Path to the add content type page. + * + * @see template_preprocess_node_add_list() + * @see seven_preprocess_node_add_list() + */ +#} +{% 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 0000000000000000000000000000000000000000..b2eadaa4baa9d256fb684b67f573652e002ea6d0 --- /dev/null +++ b/core/themes/seven/templates/tablesort-indicator.html.twig @@ -0,0 +1,16 @@ +{# +/** + * @file + * Seven's theme implementation for displaying a tablesort indicator. + * + * Available variables: + * - style: Either 'asc' or 'desc', indicating the sorting direction. + * - arrow_asc: URL to the image for an ascending arrow. + * - arrow_desc: URL to the image for a descending arrow. + */ +#} +{% if style == 'asc' -%} + {{ 'Sort ascending'|t }} +{% else -%} + {{ 'Sort descending'|t }} +{% endif %}