update-project-status.html.twig

Same filename in this branch
  1. 10 core/themes/stable9/templates/admin/update-project-status.html.twig
Same filename in other branches
  1. 9 core/themes/stable9/templates/admin/update-project-status.html.twig
  2. 9 core/themes/stable/templates/admin/update-project-status.html.twig
  3. 9 core/modules/update/templates/update-project-status.html.twig
  4. 8.9.x core/themes/stable/templates/admin/update-project-status.html.twig
  5. 8.9.x core/modules/update/templates/update-project-status.html.twig
  6. 11.x core/themes/stable9/templates/admin/update-project-status.html.twig
  7. 11.x core/modules/update/templates/update-project-status.html.twig

Default theme implementation for the project status report.

Available variables:

  • title: The project title.
  • url: The project URL.
  • status: The project status.
    • label: The project status label.
    • attributes: HTML attributes for the project status.
    • reason: The reason you should update the project.
    • icon: The project status version indicator icon.
  • existing_version: The version of the installed project.
  • versions: The available versions of the project.
  • install_type: The type of project (e.g., dev).
  • datestamp: The date/time of a project version's release.
  • extras: HTML attributes and additional information about the project.
    • attributes: HTML attributes for the extra item.
    • label: The label for an extra item.
    • data: The data about an extra item.
  • includes: The projects within the project.
  • disabled: The currently disabled projects in the project.

See also

template_preprocess_update_project_status()

1 theme call to update-project-status.html.twig
template_preprocess_update_report in core/modules/update/update.report.inc
Prepares variables for project status report templates.

File

core/modules/update/templates/update-project-status.html.twig

View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for the project status report.
  5. *
  6. * Available variables:
  7. * - title: The project title.
  8. * - url: The project URL.
  9. * - status: The project status.
  10. * - label: The project status label.
  11. * - attributes: HTML attributes for the project status.
  12. * - reason: The reason you should update the project.
  13. * - icon: The project status version indicator icon.
  14. * - existing_version: The version of the installed project.
  15. * - versions: The available versions of the project.
  16. * - install_type: The type of project (e.g., dev).
  17. * - datestamp: The date/time of a project version's release.
  18. * - extras: HTML attributes and additional information about the project.
  19. * - attributes: HTML attributes for the extra item.
  20. * - label: The label for an extra item.
  21. * - data: The data about an extra item.
  22. * - includes: The projects within the project.
  23. * - disabled: The currently disabled projects in the project.
  24. *
  25. * @see template_preprocess_update_project_status()
  26. *
  27. * @ingroup themeable
  28. */
  29. #}
  30. {%
  31. set status_classes = [
  32. project.status == constant('Drupal\\update\\UpdateManagerInterface::NOT_SECURE') ? 'project-update__status--security-error',
  33. project.status == constant('Drupal\\update\\UpdateManagerInterface::REVOKED') ? 'project-update__status--revoked',
  34. project.status == constant('Drupal\\update\\UpdateManagerInterface::NOT_SUPPORTED') ? 'project-update__status--not-supported',
  35. project.status == constant('Drupal\\update\\UpdateManagerInterface::NOT_CURRENT') ? 'project-update__status--not-current',
  36. project.status == constant('Drupal\\update\\UpdateManagerInterface::CURRENT') ? 'project-update__status--current',
  37. ]
  38. %}
  39. <div{{ status.attributes.addClass('project-update__status', status_classes) }}>
  40. {%- if status.label -%}
  41. <span>{{ status.label }}</span>
  42. {%- else -%}
  43. {{ status.reason }}
  44. {%- endif %}
  45. <span class="project-update__status-icon">
  46. {{ status.icon }}
  47. </span>
  48. </div>
  49. <div class="project-update__title">
  50. {%- if url -%}
  51. <a href="{{ url }}">{{ title }}</a>
  52. {%- else -%}
  53. {{ title }}
  54. {%- endif %}
  55. {{ existing_version }}
  56. {% if install_type == 'dev' and datestamp %}
  57. <span class="project-update__version-date">({{ datestamp }})</span>
  58. {% endif %}
  59. </div>
  60. {% if versions %}
  61. {% for version in versions %}
  62. {{ version }}
  63. {% endfor %}
  64. {% endif %}
  65. {%
  66. set extra_classes = [
  67. project.status == constant('Drupal\\update\\UpdateManagerInterface::NOT_SECURE') ? 'project-not-secure',
  68. project.status == constant('Drupal\\update\\UpdateManagerInterface::REVOKED') ? 'project-revoked',
  69. project.status == constant('Drupal\\update\\UpdateManagerInterface::NOT_SUPPORTED') ? 'project-not-supported',
  70. ]
  71. %}
  72. <div class="project-updates__details">
  73. {% if extras %}
  74. <div class="extra">
  75. {% for extra in extras %}
  76. <div{{ extra.attributes.addClass(extra_classes) }}>
  77. {{ extra.label }}: {{ extra.data }}
  78. </div>
  79. {% endfor %}
  80. </div>
  81. {% endif %}
  82. {% set includes = includes|join(', ') %}
  83. {% if disabled %}
  84. {{ 'Includes:'|t }}
  85. <ul>
  86. <li>
  87. {% trans %}
  88. Enabled: {{ includes|placeholder }}
  89. {% endtrans %}
  90. </li>
  91. <li>
  92. {% set disabled = disabled|join(', ') %}
  93. {% trans %}
  94. Disabled: {{ disabled|placeholder }}
  95. {% endtrans %}
  96. </li>
  97. </ul>
  98. {% else %}
  99. {% trans %}
  100. Includes: {{ includes|placeholder }}
  101. {% endtrans %}
  102. {% endif %}
  103. </div>

Related topics


Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.