diff --git a/core/themes/seven/seven.theme b/core/themes/seven/seven.theme index 7defd49..722b701 100644 --- a/core/themes/seven/seven.theme +++ b/core/themes/seven/seven.theme @@ -6,6 +6,8 @@ */ use Drupal\Core\Template\RenderWrapper; +use Drupal\Component\Utility\String; +use Drupal\Component\Utility\Xss; /** * Implements hook_library_info(). @@ -57,104 +59,58 @@ function seven_preprocess_page(&$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'))) . '

'; - } - 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. + * Add variables for the label and the path separately. + * + * Displays the list of available custom block types for creation, adding + * separate variables for the label and the path. */ -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() ? ' +{% 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..8e53e5c --- /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..fe1fe1e --- /dev/null +++ b/core/themes/seven/templates/node-add-list.html.twig @@ -0,0 +1,28 @@ +{# +/** + * @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 %} + {% set add_content_type_url = url('admin/structure/types/add') %} + {% 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..7fea0dc --- /dev/null +++ b/core/themes/seven/templates/tablesort-indicator.html.twig @@ -0,0 +1,16 @@ +{# +/** + * @file + * Default theme implementation for displaying a tablesort indicator. + * + * Available variables: + * - style: Either 'asc' or 'desc', indicating the sorting direction. + * + * @ingroup themeable + */ +#} +{% if style == 'asc' -%} + {{ 'Sort ascending'|t }} +{% else -%} + {{ 'Sort descending'|t }} +{% endif %}