support-2.0.x-dev/modules/support_ticket/templates/support-ticket.html.twig
modules/support_ticket/templates/support-ticket.html.twig
{#
/**
* @file
* Default theme implementation to display a support ticket.
*
* Available variables:
* - support_ticket: Full support ticket entity.
* - id: The support ticket ID.
* - bundle: The type of the support ticket.
* - authorid: The user ID of the support ticket author.
* - createdtime: Time the support ticket was published formatted in Unix timestamp.
* - changedtime: Time the support ticket was changed formatted in Unix timestamp.
* - label: The title of the support ticket.
* - content: All support ticket items. Use {{ content }} to print them all,
* or print a subset such as {{ content.field_example }}. Use
* {{ content|without('field_example') }} to temporarily suppress the printing
* of a given child element.
* - author_picture: The support ticket author user entity, rendered using the "compact"
* view mode.
* - metadata: Metadata for this support ticket.
* - date: Themed creation date field.
* - author_name: Themed author name field.
* - url: Direct URL of the current support ticket.
* - display_submitted: Whether submission information should be displayed.
* - attributes: HTML attributes for the containing element.
* The attributes.class element may contain one or more of the following
* classes:
* - support ticket: The current template type (also known as a "theming hook").
* - support ticket--type-[type]: The current support ticket type.
* - support-ticket--view-mode-[view_mode]: The View Mode of the support ticket; for example, a
* teaser would result in: "support-ticket--view-mode-teaser", and
* full: "support-ticket--view-mode-full".
* The following are controlled through the support ticket publishing options.
* - support-ticket--locked: Normal users can't make changes to this ticket.
* - support-ticket--unpublished: Appears on unpublished support tickets visible only to site
* admins.
* - title_attributes: Same as attributes, except applied to the main title
* tag that appears in the template.
* - content_attributes: Same as attributes, except applied to the main
* content tag that appears in the template.
* - author_attributes: Same as attributes, except applied to the author of
* the support ticket tag that appears in the template.
* - title_prefix: Additional output populated by modules, intended to be
* displayed in front of the main title tag that appears in the template.
* - title_suffix: Additional output populated by modules, intended to be
* displayed after the main title tag that appears in the template.
* - view_mode: View mode; for example, "teaser" or "full".
* - teaser: Flag for the teaser state. Will be true if view_mode is 'teaser'.
* - page: Flag for the full page state. Will be true if view_mode is 'full'.
* - readmore: Flag for more state. Will be true if the teaser content of the
* support ticket cannot hold the main body content.
* - logged_in: Flag for authenticated user status. Will be true when the
* current user is a logged-in member.
* - is_admin: Flag for admin user status. Will be true when the current user
* is an administrator.
*
* @see template_preprocess_support_ticket()
*
* @todo Remove the id attribute (or make it a class), because if that gets
* rendered twice on a page this is invalid CSS for example: two lists
* in different view modes.
*
* @ingroup themeable
*/
#}
{%
set classes = [
'support-ticket',
'support-ticket--type-' ~ support_ticket.bundle|clean_class,
support-ticket.isLocked() ? 'support-ticket--locked',
not support-ticket.isPublished() ? 'support-ticket--unpublished',
view_mode ? 'support-ticket--view-mode-' ~ view_mode|clean_class,
]
%}
{{ attach_library('diff/diff.github') }}
<article{{ attributes.addClass(classes) }}>
{{ title_prefix }}
{% if not page %}
<h2{{ title_attributes }}>
<a href="{{ url }}" rel="bookmark">{{ label }}</a>
</h2>
{% endif %}
{{ title_suffix }}
{% if display_submitted %}
<footer class="support_ticket__meta">
{{ author_picture }}
<div{{ author_attributes.addClass('support_ticket__submitted') }}>
{% trans %}Submitted by {{ author_name }} on {{ date }}{% endtrans %}
{{ metadata }}
</div>
</footer>
{% endif %}
<div{{ content_attributes.addClass('support_ticket__content') }}>
{{ content|without('links') }}
</div>
{% if content.links %}
<div class="support_ticket__links">
{{ content.links }}
</div>
{% endif %}
</article>
