You are here

workflow-transition--full.html.twig in Workflow 8

Default theme implementation for comments.

Available variables:

  • author: Comment author. Can be a link or plain text.
  • content: The content-related items for the workflow transition display. Use {{ content }} to print them all, or print a subset such as {{ content.field_example }}. Use the following code to temporarily suppress the printing of a given child element:

  {{ content|without('field_example') }}
  
  • time: Formatted date and time for when the workflow transition was created.
  • from_state: State object, you can display label via from_state.label.
  • to_state: State object, you can display label via to_state.label.
  • user: User object.

File

templates/workflow-transition--full.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for comments.
  5. *
  6. * Available variables:
  7. * - author: Comment author. Can be a link or plain text.
  8. * - content: The content-related items for the workflow transition display. Use
  9. * {{ content }} to print them all, or print a subset such as
  10. * {{ content.field_example }}. Use the following code to temporarily suppress
  11. * the printing of a given child element:
  12. * @code
  13. * {{ content|without('field_example') }}
  14. * @endcode
  15. * - time: Formatted date and time for when the workflow transition was created.
  16. * - from_state: State object, you can display label via from_state.label.
  17. * - to_state: State object, you can display label via to_state.label.
  18. * - user: User object.
  19. *
  20. * @see template_preprocess_workflow_transition()
  21. *
  22. * @ingroup themeable
  23. */
  24. #}
  25. {%
  26. set classes = [
  27. 'field',
  28. 'field--type-workflow-transition',
  29. 'field--label-inline',
  30. ]
  31. %}
  32. {%
  33. set field_classes = [
  34. 'field--label-inline',
  35. 'clearfix',
  36. ]
  37. %}
  38. {%
  39. set label_classes = [
  40. 'field__label',
  41. ]
  42. %}
  43. {%
  44. set value_classes = [
  45. 'field__item',
  46. ]
  47. %}
  48. <article{{ attributes }}>
  49. <div class="status">
  50. <div{{ field_attributes.addClass(field_classes) }}>
  51. <div{{ label_attributes.addClass(label_classes) }}>{% trans %}From State{% endtrans %}</div>
  52. <div{{ value_attributes.addClass(value_classes) }}>{{ from_state.label }}</div>
  53. </div>
  54. <div{{ field_attributes.addClass(field_classes) }}>
  55. <div{{ label_attributes.addClass(title_classes) }}>{% trans %}To State{% endtrans %}</div>
  56. <div{{ value_attributes.addClass(item_classes) }}>{{ to_state.label }}</div>
  57. </div>
  58. <div{{ field_attributes.addClass(field_classes) }}>
  59. <div{{ label_attributes.addClass(title_classes) }}>{% trans %}Date{% endtrans %}</div>
  60. <div{{ value_attributes.addClass(item_classes) }}>{{ time }}</div>
  61. </div>
  62. <div{{ field_attributes.addClass(field_classes) }}>
  63. <div{{ label_attributes.addClass(title_classes) }}>{% trans %}By{% endtrans %}</div>
  64. <div{{ value_attributes.addClass(item_classes) }}>{{ user.label }}</div>
  65. </div>
  66. {% if comment %}
  67. <div{{ field_attributes.addClass(field_classes) }}>
  68. <div{{ label_attributes.addClass(title_classes) }}>{% trans %}Comment{% endtrans %}</div>
  69. <div{{ value_attributes.addClass(item_classes) }}>{{ comment }}</div>
  70. </div>
  71. {% endif %}
  72. </div>
  73. {% if content %}
  74. {{ content }}
  75. {% endif %}
  76. </article>