You are here

shrinktheweb-modules-fieldset.html.twig in ShrinkTheWeb 8

Default theme implementation for the modules listing page.

Displays a list of all packages in a project.

Available variables:

  • modules: Contains multiple module instances. Each module contains:

    • attributes: Attributes on the row.
    • checkbox: A checkbox for enabling the module.
    • name: The human-readable name of the module.
    • id: A unique identifier for interacting with the details element.
    • enable_id: A unique identifier for interacting with the checkbox element.
    • description: The description of the module.
    • machine_name: The module's machine name.
    • version: Information about the module version.
    • requires: A list of modules that this module requires.
    • required_by: A list of modules that require this module.
    • links: A list of administration links provided by the module.
    • link_types: A list of administration link types provided by the module.

File

templates/shrinktheweb-modules-fieldset.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for the modules listing page.
  5. *
  6. * Displays a list of all packages in a project.
  7. *
  8. * Available variables:
  9. * - modules: Contains multiple module instances. Each module contains:
  10. * - attributes: Attributes on the row.
  11. * - checkbox: A checkbox for enabling the module.
  12. * - name: The human-readable name of the module.
  13. * - id: A unique identifier for interacting with the details element.
  14. * - enable_id: A unique identifier for interacting with the checkbox element.
  15. * - description: The description of the module.
  16. * - machine_name: The module's machine name.
  17. * - version: Information about the module version.
  18. * - requires: A list of modules that this module requires.
  19. * - required_by: A list of modules that require this module.
  20. * - links: A list of administration links provided by the module.
  21. * - link_types: A list of administration link types provided by the module.
  22. *
  23. * @see template_preprocess_shrinktheweb_modules_fieldset()
  24. *
  25. * @ingroup themeable
  26. */
  27. #}
  28. <table class="responsive-enabled" data-striping="1">
  29. <thead>
  30. <tr>
  31. <th class="checkbox visually-hidden">{{ 'Installed'|t }}</th>
  32. <th class="name visually-hidden">{{ 'Name'|t }}</th>
  33. <th class="description visually-hidden priority-low">{{ 'Description'|t }}</th>
  34. </tr>
  35. </thead>
  36. <tbody>
  37. {% for module in modules %}
  38. {% set zebra = cycle(['odd', 'even'], loop.index0) %}
  39. <tr{{ module.attributes.addClass(zebra) }}>
  40. <td class="checkbox">
  41. {{ module.checkbox }}
  42. </td>
  43. <td class="module">
  44. <label id="{{ module.id }}" for="{{ module.enable_id }}" class="module-name table-filter-text-source">{{ module.name }}</label>
  45. </td>
  46. <td class="description expand priority-low">
  47. <details class="js-form-wrapper form-wrapper" id="{{ module.enable_id }}-description">
  48. <summary aria-controls="{{ module.enable_id }}-description" role="button" aria-expanded="false"><span class="text module-description">{{ module.description }}</span></summary>
  49. <div class="details-wrapper">
  50. <div class="details-description">
  51. <div class="requirements">
  52. <div class="admin-requirements">{{ 'Machine name: <span dir="ltr" class="table-filter-text-source">@machine-name</span>'|t({'@machine-name': module.machine_name }) }}</div>
  53. {% if module.version %}
  54. <div class="admin-requirements">{{ 'Version: @module-version'|t({'@module-version': module.version }) }}</div>
  55. {% endif %}
  56. {% if module.requires %}
  57. <div class="admin-requirements">{{ 'Requires: @module-list'|t({'@module-list': module.requires }) }}</div>
  58. {% endif %}
  59. {% if module.required_by %}
  60. <div class="admin-requirements">{{ 'Required by: @module-list'|t({'@module-list': module.required_by }) }}</div>
  61. {% endif %}
  62. </div>
  63. {% if module.links %}
  64. <div class="links">
  65. {% for link_type in module.link_types %}
  66. {{ module.links[link_type] }}
  67. {% endfor %}
  68. </div>
  69. {% endif %}
  70. </div>
  71. </div>
  72. </details>
  73. </td>
  74. </tr>
  75. {% endfor %}
  76. </tbody>
  77. </table>