system-modules-uninstall.html.twig 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. {#
  2. /**
  3. * @file
  4. * Theme override for the modules uninstall page.
  5. *
  6. * Available variables:
  7. * - form: The modules uninstall form.
  8. * - modules: Contains multiple module instances. Each module contains:
  9. * - attributes: Attributes on the row.
  10. * - module_name: The name of the module.
  11. * - checkbox: A checkbox for uninstalling the module.
  12. * - checkbox_id: A unique identifier for interacting with the checkbox
  13. * element.
  14. * - name: The human-readable name of the module.
  15. * - description: The description of the module.
  16. * - disabled_reasons: (optional) A list of reasons why this module cannot be
  17. * uninstalled.
  18. *
  19. * @see template_preprocess_system_modules_uninstall()
  20. */
  21. #}
  22. {{ form.filters }}
  23. <table class="responsive-enabled" data-striping="1">
  24. <thead>
  25. <tr>
  26. <th>{{ 'Uninstall'|t }}</th>
  27. <th>{{ 'Name'|t }}</th>
  28. <th>{{ 'Description'|t }}</th>
  29. </tr>
  30. </thead>
  31. <tbody>
  32. {% for module in modules %}
  33. {% set zebra = cycle(['odd', 'even'], loop.index0) -%}
  34. <tr{{ module.attributes.addClass(zebra) }}>
  35. <td align="center">
  36. {{- module.checkbox -}}
  37. </td>
  38. <td>
  39. <label for="{{ module.checkbox_id }}" class="module-name table-filter-text-source">{{ module.name }}</label>
  40. </td>
  41. <td class="description">
  42. <span class="text module-description">{{ module.description }}</span>
  43. {% if module.reasons_count > 0 %}
  44. <div class="admin-requirements">
  45. {%- trans -%}
  46. The following reason prevents {{ module.module_name }} from being uninstalled:
  47. {%- plural module.reasons_count -%}
  48. The following reasons prevent {{ module.module_name }} from being uninstalled:
  49. {%- endtrans %}
  50. <div class="item-list">
  51. <ul>
  52. {%- for reason in module.validation_reasons -%}
  53. <li>{{ reason }}</li>
  54. {%- endfor -%}
  55. {%- if module.required_by -%}
  56. <li>{{ 'Required by: @module-list'|t({'@module-list': module.required_by|safe_join(', ') }) }}</li>
  57. {%- endif -%}
  58. </ul>
  59. </div>
  60. </div>
  61. {% endif %}
  62. </td>
  63. </tr>
  64. {% else %}
  65. <tr class="odd">
  66. <td colspan="3" class="empty message">{{ 'No modules are available to uninstall.'|t }}</td>
  67. </tr>
  68. {% endfor %}
  69. </tbody>
  70. </table>
  71. {{ form|without('filters', 'modules', 'uninstall') }}