Add warning when removing a package will break mods

This commit is contained in:
rubenwardy
2023-12-03 13:47:52 +00:00
parent 54a4eb2ac8
commit b80ce88bc0
2 changed files with 23 additions and 1 deletions

View File

@@ -21,6 +21,20 @@ Remove {{ package.title }}
</p>
{% endif %}
{% if hard_deps %}
{% set hard_deps_links -%}
{%- for dep in hard_deps -%}
{%- if not loop.first and loop.length > 2 %}, {% endif -%}
{%- if loop.last and loop.length > 1 %} and {% endif -%}
<a href="{{ dep.get_url('packages.view') }}">{{ dep.title }}</a>
{%- endfor -%}
{%- endset %}
<p class="text-danger">
<i class="fas fa-exclamation-triangle me-2"></i>
{{ _("Removing this package will break the following mods: %(names)s", names=hard_deps_links) }}
</p>
{% endif %}
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<div class="form-group mb-3">