diff --git a/core/modules/forum/templates/forum-icon.html.twig b/core/modules/forum/templates/forum-icon.html.twig index b32b734..3f83849 100644 --- a/core/modules/forum/templates/forum-icon.html.twig +++ b/core/modules/forum/templates/forum-icon.html.twig @@ -18,13 +18,7 @@ * @ingroup themeable */ #} -{% - set classes = [ - 'icon', - 'topic-status-' ~ icon_status, - ] -%} - + {% if first_new -%} {%- endif %} diff --git a/core/modules/forum/templates/forum-list.html.twig b/core/modules/forum/templates/forum-list.html.twig index 5b41f6a..1c75555 100644 --- a/core/modules/forum/templates/forum-list.html.twig +++ b/core/modules/forum/templates/forum-list.html.twig @@ -32,7 +32,7 @@ * @ingroup themeable */ #} - +
@@ -43,11 +43,10 @@ {% for child_id, forum in forums %} - + {% if forum.is_container == false %} - - - + + {% endif %} {% endfor %} diff --git a/core/modules/forum/templates/forum-submitted.html.twig b/core/modules/forum/templates/forum-submitted.html.twig index f679363..c0d7cd0 100644 --- a/core/modules/forum/templates/forum-submitted.html.twig +++ b/core/modules/forum/templates/forum-submitted.html.twig @@ -17,7 +17,7 @@ */ #} {% if time %} - + {% trans %}By {{ author|passthrough }} {{ time }} ago{% endtrans %} {% else %} {{ 'n/a'|t }} {% endif %} diff --git a/core/modules/forum/templates/forums.html.twig b/core/modules/forum/templates/forums.html.twig index 1bb7c05..ca40e32 100644 --- a/core/modules/forum/templates/forums.html.twig +++ b/core/modules/forum/templates/forums.html.twig @@ -17,7 +17,7 @@ */ #} {% if forums_defined %} -
+
{{ forums }} {{ topics }} {{ topics_pager }} diff --git a/core/themes/classy/templates/forum-icon.html.twig b/core/themes/classy/templates/forum-icon.html.twig new file mode 100644 index 0000000..b32b734 --- /dev/null +++ b/core/themes/classy/templates/forum-icon.html.twig @@ -0,0 +1,32 @@ +{# +/** + * @file + * Default theme implementation to display a status icon for a forum post. + * + * Available variables: + * - attributes: HTML attributes to be applied to the wrapper element. + * - class: HTML classes that determine which icon to display. May be one of + * 'hot', 'hot-new', 'new', 'default', 'closed', or 'sticky'. + * - title: Text alternative for the forum icon. + * - icon_title: Text alternative for the forum icon, same as above. + * - new_posts: '1' when this topic contains new posts, otherwise '0'. + * - first_new: '1' when this is the first topic with new posts, otherwise '0'. + * - icon_status: Indicates which status icon should be used. + * + * @see template_preprocess_forum_icon() + * + * @ingroup themeable + */ +#} +{% + set classes = [ + 'icon', + 'topic-status-' ~ icon_status, + ] +%} + + {% if first_new -%} + + {%- endif %} + {{ icon_title }} +
diff --git a/core/themes/classy/templates/forum-list.html.twig b/core/themes/classy/templates/forum-list.html.twig new file mode 100644 index 0000000..5b41f6a --- /dev/null +++ b/core/themes/classy/templates/forum-list.html.twig @@ -0,0 +1,81 @@ +{# +/** + * @file + * Default theme implementation to display a list of forums and containers. + * + * Available variables: + * - forums: A collection of forums and containers to display. It is keyed to + * the numeric IDs of all child forums and containers. Each forum in forums + * contains: + * - is_container: A flag indicating if the forum can contain other + * forums. Otherwise, the forum can only contain topics. + * - depth: How deep the forum is in the current hierarchy. + * - zebra: 'even' or 'odd', used for row class. + * - icon_class: 'default' or 'new', used for forum icon class. + * - icon_title: Text alternative for the forum icon. + * - name: The name of the forum. + * - link: The URL to link to this forum. + * - description: The description field for the forum, containing: + * - value: The descriptive text for the forum. + * - new_topics: A flag indicating if the forum contains unread posts. + * - new_url: A URL to the forum's unread posts. + * - new_text: Text for the above URL, which tells how many new posts. + * - old_topics: A count of posts that have already been read. + * - num_posts: The total number of posts in the forum. + * - last_reply: Text representing the last time a forum was posted or + * commented in. + * - forum_id: Forum ID for the current forum. Parent to all items within the + * forums array. + * + * @see template_preprocess_forum_list() + * + * @ingroup themeable + */ +#} +
{{ 'Forum'|t }}
{# Enclose the contents of this cell with X divs, where X is the @@ -55,25 +54,25 @@ left-margin for indenting. #} {% for i in 1..forum.depth if forum.depth > 0 %}
{% endfor %} -
+
{{ forum.icon_title }}
- + {% if forum.description.value %} -
{{ forum.description.value }}
+
{{ forum.description.value }}
{% endif %} {% for i in 1..forum.depth if forum.depth > 0 %}
{% endfor %}
+ {{ forum.num_topics }} {% if forum.new_topics == true %}
{{ forum.new_text }} {% endif %}
{{ forum.num_posts }}{{ forum.last_reply }}{{ forum.num_posts }}{{ forum.last_reply }}
+ + + + + + + + + + {% for child_id, forum in forums %} + + + {% if forum.is_container == false %} + + + + {% endif %} + + {% endfor %} + +
{{ 'Forum'|t }}{{ 'Topics'|t }}{{ 'Posts'|t }}{{ 'Last post'|t }}
+ {# + Enclose the contents of this cell with X divs, where X is the + depth this forum resides at. This will allow us to use CSS + left-margin for indenting. + #} + {% for i in 1..forum.depth if forum.depth > 0 %}
{% endfor %} +
+ {{ forum.icon_title }} +
+ + {% if forum.description.value %} +
{{ forum.description.value }}
+ {% endif %} + {% for i in 1..forum.depth if forum.depth > 0 %}
{% endfor %} +
+ {{ forum.num_topics }} + {% if forum.new_topics == true %} +
+ {{ forum.new_text }} + {% endif %} +
{{ forum.num_posts }}{{ forum.last_reply }}
diff --git a/core/themes/classy/templates/forum-submitted.html.twig b/core/themes/classy/templates/forum-submitted.html.twig new file mode 100644 index 0000000..f679363 --- /dev/null +++ b/core/themes/classy/templates/forum-submitted.html.twig @@ -0,0 +1,23 @@ +{# +/** + * @file + * Default theme implementation for a forum post submission string. + * + * The submission string indicates when and by whom a topic was submitted. + * + * Available variables: + * - author: The author of the post. + * - time: How long ago the post was created. + * - topic: An object with the raw data of the post. Potentially unsafe. Be + * sure to clean this data before printing. + * + * @see template_preprocess_forum_submitted() + * + * @ingroup themeable + */ +#} +{% if time %} + +{% else %} + {{ 'n/a'|t }} +{% endif %} diff --git a/core/themes/classy/templates/forums.html.twig b/core/themes/classy/templates/forums.html.twig new file mode 100644 index 0000000..1bb7c05 --- /dev/null +++ b/core/themes/classy/templates/forums.html.twig @@ -0,0 +1,25 @@ +{# +/** + * @file + * Default theme implementation to display a forum. + * + * May contain forum containers as well as forum topics. + * + * Available variables: + * - forums: The forums to display (as processed by forum-list.html.twig). + * - topics: The topics to display. + * - topics_pager: The topics pager. + * - forums_defined: A flag to indicate that the forums are configured. + * + * @see template_preprocess_forums() + * + * @ingroup themeable + */ +#} +{% if forums_defined %} +
+ {{ forums }} + {{ topics }} + {{ topics_pager }} +
+{% endif %}