update-project-status.html.twig

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

Theme override 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/themes/stable9/templates/admin/update-project-status.html.twig

View source
  1. {#
  2. /**
  3. * @file
  4. * Theme override 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. #}
  28. {%
  29. set status_classes = [
  30. project.status == constant('Drupal\\update\\UpdateManagerInterface::NOT_SECURE') ? 'project-update__status--security-error',
  31. project.status == constant('Drupal\\update\\UpdateManagerInterface::REVOKED') ? 'project-update__status--revoked',
  32. project.status == constant('Drupal\\update\\UpdateManagerInterface::NOT_SUPPORTED') ? 'project-update__status--not-supported',
  33. project.status == constant('Drupal\\update\\UpdateManagerInterface::NOT_CURRENT') ? 'project-update__status--not-current',
  34. project.status == constant('Drupal\\update\\UpdateManagerInterface::CURRENT') ? 'project-update__status--current',
  35. ]
  36. %}
  37. <div{{ status.attributes.addClass('project-update__status', status_classes) }}>
  38. {%- if status.label -%}
  39. <span>{{ status.label }}</span>
  40. {%- else -%}
  41. {{ status.reason }}
  42. {%- endif %}
  43. <span class="project-update__status-icon">
  44. {{ status.icon }}
  45. </span>
  46. </div>
  47. <div class="project-update__title">
  48. {%- if url -%}
  49. <a href="{{ url }}">{{ title }}</a>
  50. {%- else -%}
  51. {{ title }}
  52. {%- endif %}
  53. {{ existing_version }}
  54. {% if install_type == 'dev' and datestamp %}
  55. <span class="project-update__version-date">({{ datestamp }})</span>
  56. {% endif %}
  57. </div>
  58. {% if versions %}
  59. {% for version in versions %}
  60. {{ version }}
  61. {% endfor %}
  62. {% endif %}
  63. {%
  64. set extra_classes = [
  65. project.status == constant('Drupal\\update\\UpdateManagerInterface::NOT_SECURE') ? 'project-not-secure',
  66. project.status == constant('Drupal\\update\\UpdateManagerInterface::REVOKED') ? 'project-revoked',
  67. project.status == constant('Drupal\\update\\UpdateManagerInterface::NOT_SUPPORTED') ? 'project-not-supported',
  68. ]
  69. %}
  70. <div class="project-updates__details">
  71. {% if extras %}
  72. <div class="extra">
  73. {% for extra in extras %}
  74. <div{{ extra.attributes.addClass(extra_classes) }}>
  75. {{ extra.label }}: {{ extra.data }}
  76. </div>
  77. {% endfor %}
  78. </div>
  79. {% endif %}
  80. {% set includes = includes|join(', ') %}
  81. {% if disabled %}
  82. {{ 'Includes:'|t }}
  83. <ul>
  84. <li>
  85. {% trans %}
  86. Enabled: {{ includes|placeholder }}
  87. {% endtrans %}
  88. </li>
  89. <li>
  90. {% set disabled = disabled|join(', ') %}
  91. {% trans %}
  92. Disabled: {{ disabled|placeholder }}
  93. {% endtrans %}
  94. </li>
  95. </ul>
  96. {% else %}
  97. {% trans %}
  98. Includes: {{ includes|placeholder }}
  99. {% endtrans %}
  100. {% endif %}
  101. </div>

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