system-modules-uninstall.html.twig 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation 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. * @ingroup themeable
  22. */
  23. #}
  24. {{ form.filters }}
  25. <table class="responsive-enabled">
  26. <thead>
  27. <tr>
  28. <th>{{ 'Uninstall'|t }}</th>
  29. <th>{{ 'Name'|t }}</th>
  30. <th>{{ 'Description'|t }}</th>
  31. </tr>
  32. </thead>
  33. <tbody>
  34. {% for module in modules %}
  35. {% set zebra = cycle(['odd', 'even'], loop.index0) -%}
  36. <tr{{ module.attributes.addClass(zebra) }}>
  37. <td align="center">
  38. {{- module.checkbox -}}
  39. </td>
  40. <td>
  41. <label for="{{ module.checkbox_id }}" class="module-name table-filter-text-source">{{ module.name }}</label>
  42. </td>
  43. <td class="description">
  44. <span class="text module-description">{{ module.description }}</span>
  45. {% if module.reasons_count > 0 %}
  46. <div class="admin-requirements">
  47. {%- trans -%}
  48. The following reason prevents {{ module.module_name }} from being uninstalled:
  49. {%- plural module.reasons_count -%}
  50. The following reasons prevent {{ module.module_name }} from being uninstalled:
  51. {%- endtrans %}
  52. <div class="item-list">
  53. <ul>
  54. {%- for reason in module.validation_reasons -%}
  55. <li>{{ reason }}</li>
  56. {%- endfor -%}
  57. {%- if module.required_by -%}
  58. <li>{{ 'Required by: @module-list'|t({'@module-list': module.required_by|safe_join(', ') }) }}</li>
  59. {%- endif -%}
  60. </ul>
  61. </div>
  62. </div>
  63. {% endif %}
  64. </td>
  65. </tr>
  66. {% else %}
  67. <tr class="odd">
  68. <td colspan="3" class="empty message">{{ 'No modules are available to uninstall.'|t }}</td>
  69. </tr>
  70. {% endfor %}
  71. </tbody>
  72. </table>
  73. {{ form|without('filters', 'modules', 'uninstall') }}