summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2014-11-20 09:35:08 (GMT)
committerAlex Pott2014-11-20 09:35:08 (GMT)
commit8de9b679a6a908d545bbc4f61d5699003a562323 (patch)
tree29a4ab670f06e2813e7cad678fb53ae870789543
parenta69bc3eb896032beff64050f3e41240ae3893885 (diff)
Issue #2349633 by mortendk, runand, bradwade, emma.maria: Copy book templates to Classy
-rw-r--r--core/modules/book/templates/book-all-books-block.html.twig2
-rw-r--r--core/modules/book/templates/book-export-html.html.twig2
-rw-r--r--core/modules/book/templates/book-navigation.html.twig12
-rw-r--r--core/modules/book/templates/book-node-export-html.html.twig4
-rw-r--r--core/modules/book/templates/book-tree.html.twig2
-rw-r--r--core/themes/classy/templates/book-all-books-block.html.twig24
-rw-r--r--core/themes/classy/templates/book-export-html.html.twig47
-rw-r--r--core/themes/classy/templates/book-navigation.html.twig57
-rw-r--r--core/themes/classy/templates/book-node-export-html.html.twig22
-rw-r--r--core/themes/classy/templates/book-tree.html.twig16
10 files changed, 177 insertions, 11 deletions
diff --git a/core/modules/book/templates/book-all-books-block.html.twig b/core/modules/book/templates/book-all-books-block.html.twig
index 6160982..a4d0c9a 100644
--- a/core/modules/book/templates/book-all-books-block.html.twig
+++ b/core/modules/book/templates/book-all-books-block.html.twig
@@ -18,7 +18,7 @@
*/
#}
{% for book in book_menus %}
- <nav id="book-block-menu-{{ book.id }}" class="book-block-menu" role="navigation" aria-label="{% trans %}Book outline for {{ book.title }}{% endtrans %}">
+ <nav role="navigation" aria-label="{% trans %}Book outline for {{ book.title }}{% endtrans %}">
{{ book.menu }}
</nav>
{% endfor %}
diff --git a/core/modules/book/templates/book-export-html.html.twig b/core/modules/book/templates/book-export-html.html.twig
index cbeb3b3..5fb2e97 100644
--- a/core/modules/book/templates/book-export-html.html.twig
+++ b/core/modules/book/templates/book-export-html.html.twig
@@ -37,7 +37,7 @@
#}
{% for i in 1..depth-1 if depth > 1 %}
- <div class="section-{{ i }}">
+ <div>
{% endfor %}
{{ contents }}
{% for i in 1..depth-1 if depth > 1 %}
diff --git a/core/modules/book/templates/book-navigation.html.twig b/core/modules/book/templates/book-navigation.html.twig
index abb0d31..f10a4e5 100644
--- a/core/modules/book/templates/book-navigation.html.twig
+++ b/core/modules/book/templates/book-navigation.html.twig
@@ -31,23 +31,23 @@
*/
#}
{% if tree or has_links %}
- <nav id="book-navigation-{{ book_id }}" class="book-navigation" role="navigation" aria-labelledby="book-label-{{ book_id }}">
+ <nav id="book-navigation-{{ book_id }}" role="navigation" aria-labelledby="book-label-{{ book_id }}">
{{ tree }}
{% if has_links %}
- <h2 class="visually-hidden" id="book-label-{{ book_id }}">{{ 'Book traversal links for'|t }} {{ book_title }}</h2>
- <ul class="book-pager">
+ <h2>{{ 'Book traversal links for'|t }} {{ book_title }}</h2>
+ <ul>
{% if prev_url %}
- <li class="previous">
+ <li>
<a href="{{ prev_url }}" rel="prev" title="{{ 'Go to previous page'|t }}"><b>{{ '‹'|t }}</b> {{ prev_title }}</a>
</li>
{% endif %}
{% if parent_url %}
- <li class="up">
+ <li>
<a href="{{ parent_url }}" title="{{ 'Go to parent page'|t }}">{{ 'Up'|t }}</a>
</li>
{% endif %}
{% if next_url %}
- <li class="next">
+ <li>
<a href="{{ next_url }}" rel="next" title="{{ 'Go to next page'|t }}">{{ next_title }} <b>{{ '›'|t }}</b></a>
</li>
{% endif %}
diff --git a/core/modules/book/templates/book-node-export-html.html.twig b/core/modules/book/templates/book-node-export-html.html.twig
index 0efa9a7..39a41fc 100644
--- a/core/modules/book/templates/book-node-export-html.html.twig
+++ b/core/modules/book/templates/book-node-export-html.html.twig
@@ -15,8 +15,8 @@
* @ingroup themeable
*/
#}
-<article id="node-{{ node.id }}" class="section-{{ depth }}">
- <h1 class="book-heading">{{ title }}</h1>
+<article>
+ <h1>{{ title }}</h1>
{{ content }}
{{ children }}
</article>
diff --git a/core/modules/book/templates/book-tree.html.twig b/core/modules/book/templates/book-tree.html.twig
index 9f640d0..46068c7 100644
--- a/core/modules/book/templates/book-tree.html.twig
+++ b/core/modules/book/templates/book-tree.html.twig
@@ -13,4 +13,4 @@
* @ingroup themeable
*/
#}
-<ul class="menu">{{ tree }}</ul>
+<ul>{{ tree }}</ul>
diff --git a/core/themes/classy/templates/book-all-books-block.html.twig b/core/themes/classy/templates/book-all-books-block.html.twig
new file mode 100644
index 0000000..6160982
--- /dev/null
+++ b/core/themes/classy/templates/book-all-books-block.html.twig
@@ -0,0 +1,24 @@
+{#
+/**
+ * @file
+ * Default theme implementation for rendering book outlines within a block.
+ *
+ * This template is used only when the block is configured to "show block on all
+ * pages", which presents multiple independent books on all pages.
+ *
+ * Available variables:
+ * - book_menus: Book outlines.
+ * - id: The parent book ID.
+ * - title: The parent book title.
+ * - menu: The top-level book links.
+ *
+ * @see template_preprocess_book_all_books_block()
+ *
+ * @ingroup themeable
+ */
+#}
+{% for book in book_menus %}
+ <nav id="book-block-menu-{{ book.id }}" class="book-block-menu" role="navigation" aria-label="{% trans %}Book outline for {{ book.title }}{% endtrans %}">
+ {{ book.menu }}
+ </nav>
+{% endfor %}
diff --git a/core/themes/classy/templates/book-export-html.html.twig b/core/themes/classy/templates/book-export-html.html.twig
new file mode 100644
index 0000000..cbeb3b3
--- /dev/null
+++ b/core/themes/classy/templates/book-export-html.html.twig
@@ -0,0 +1,47 @@
+{#
+/**
+ * @file
+ * Default theme implementation for printed version of book outline.
+ *
+ * Available variables:
+ * - title: Top level node title.
+ * - head: Header tags.
+ * - language: Language object.
+ * - language_rtl: A flag indicating whether the current display language is a
+ * right to left language.
+ * - base_url: URL to the home page.
+ * - contents: Nodes within the current outline rendered through
+ * book-node-export-html.html.twig.
+ *
+ * @see template_preprocess_book_export_html()
+ *
+ * @ingroup themeable
+ */
+#}
+<!DOCTYPE html>
+<html{{ html_attributes }}>
+ <head>
+ <title>{{ title }}</title>
+ {{ page.head }}
+ <base href="{{ base_url }}" />
+ <link type="text/css" rel="stylesheet" href="misc/print.css" />
+ </head>
+ <body>
+ {#
+ The given node is embedded to its absolute depth in a top level section.
+ For example, a child node with depth 2 in the hierarchy is contained in
+ (otherwise empty) div elements corresponding to depth 0 and depth 1. This
+ is intended to support WYSIWYG output - e.g., level 3 sections always look
+ like level 3 sections, no matter their depth relative to the node selected
+ to be exported as printer-friendly HTML.
+ #}
+
+ {% for i in 1..depth-1 if depth > 1 %}
+ <div class="section-{{ i }}">
+ {% endfor %}
+ {{ contents }}
+ {% for i in 1..depth-1 if depth > 1 %}
+ </div>
+ {% endfor %}
+ </body>
+</html>
diff --git a/core/themes/classy/templates/book-navigation.html.twig b/core/themes/classy/templates/book-navigation.html.twig
new file mode 100644
index 0000000..abb0d31
--- /dev/null
+++ b/core/themes/classy/templates/book-navigation.html.twig
@@ -0,0 +1,57 @@
+{#
+/**
+ * @file
+ * Default theme implementation to navigate books.
+ *
+ * Presented under nodes that are a part of book outlines.
+ *
+ * Available variables:
+ * - tree: The immediate children of the current node rendered as an unordered
+ * list.
+ * - current_depth: Depth of the current node within the book outline. Provided
+ * for context.
+ * - prev_url: URL to the previous node.
+ * - prev_title: Title of the previous node.
+ * - parent_url: URL to the parent node.
+ * - parent_title: Title of the parent node. Not printed by default. Provided
+ * as an option.
+ * - next_url: URL to the next node.
+ * - next_title: Title of the next node.
+ * - has_links: Flags TRUE whenever the previous, parent or next data has a
+ * value.
+ * - book_id: The book ID of the current outline being viewed. Same as the node
+ * ID containing the entire outline. Provided for context.
+ * - book_url: The book/node URL of the current outline being viewed. Provided
+ * as an option. Not used by default.
+ * - book_title: The book/node title of the current outline being viewed.
+ *
+ * @see template_preprocess_book_navigation()
+ *
+ * @ingroup themeable
+ */
+#}
+{% if tree or has_links %}
+ <nav id="book-navigation-{{ book_id }}" class="book-navigation" role="navigation" aria-labelledby="book-label-{{ book_id }}">
+ {{ tree }}
+ {% if has_links %}
+ <h2 class="visually-hidden" id="book-label-{{ book_id }}">{{ 'Book traversal links for'|t }} {{ book_title }}</h2>
+ <ul class="book-pager">
+ {% if prev_url %}
+ <li class="previous">
+ <a href="{{ prev_url }}" rel="prev" title="{{ 'Go to previous page'|t }}"><b>{{ '‹'|t }}</b> {{ prev_title }}</a>
+ </li>
+ {% endif %}
+ {% if parent_url %}
+ <li class="up">
+ <a href="{{ parent_url }}" title="{{ 'Go to parent page'|t }}">{{ 'Up'|t }}</a>
+ </li>
+ {% endif %}
+ {% if next_url %}
+ <li class="next">
+ <a href="{{ next_url }}" rel="next" title="{{ 'Go to next page'|t }}">{{ next_title }} <b>{{ '›'|t }}</b></a>
+ </li>
+ {% endif %}
+ </ul>
+ {% endif %}
+ </nav>
+{% endif %}
diff --git a/core/themes/classy/templates/book-node-export-html.html.twig b/core/themes/classy/templates/book-node-export-html.html.twig
new file mode 100644
index 0000000..0efa9a7
--- /dev/null
+++ b/core/themes/classy/templates/book-node-export-html.html.twig
@@ -0,0 +1,22 @@
+{#
+/**
+ * @file
+ * Default theme implementation for a single node in a printer-friendly outline.
+ *
+ * Available variables:
+ * - node: Fully loaded node.
+ * - depth: Depth of the current node inside the outline.
+ * - title: Node title.
+ * - content: Node content.
+ * - children: All the child nodes recursively rendered through this file.
+ *
+ * @see template_preprocess_book_node_export_html()
+ *
+ * @ingroup themeable
+ */
+#}
+<article id="node-{{ node.id }}" class="section-{{ depth }}">
+ <h1 class="book-heading">{{ title }}</h1>
+ {{ content }}
+ {{ children }}
+</article>
diff --git a/core/themes/classy/templates/book-tree.html.twig b/core/themes/classy/templates/book-tree.html.twig
new file mode 100644
index 0000000..9f640d0
--- /dev/null
+++ b/core/themes/classy/templates/book-tree.html.twig
@@ -0,0 +1,16 @@
+{#
+/**
+ * @file
+ * Default theme implementation for a book tree.
+ *
+ * Returns HTML for a wrapper for a book sub-tree.
+ *
+ * Available variables:
+ * - tree: An HTML string containing the tree's items.
+ *
+ * @see template_preprocess_book_tree()
+ *
+ * @ingroup themeable
+ */
+#}
+<ul class="menu">{{ tree }}</ul>