Add supports_all_games to make game support explicit
Fixes #388 and fixes #441
This commit is contained in:
@@ -445,8 +445,11 @@
|
||||
{% endif %}
|
||||
|
||||
{% if package.type == package.type.MOD or package.type == package.type.TXP %}
|
||||
{% set supported_games = package.getSortedSupportedGames() %}
|
||||
{% if supported_games or package.type == package.type.MOD %}
|
||||
{% set pair = package.get_sorted_game_support_pair() %}
|
||||
{% set supported_games = pair[0] %}
|
||||
{% set unsupported_games = pair[1] %}
|
||||
{% set show_unsupported = package.supports_all_games or supported_games == [] %}
|
||||
{% if supported_games or unsupported_games or package.type == package.type.MOD %}
|
||||
<h3>
|
||||
{% if package.checkPerm(current_user, "EDIT_PACKAGE") %}
|
||||
<a href="{{ package.getURL('packages.game_support') }}" class="btn btn-secondary btn-sm float-right">
|
||||
@@ -455,19 +458,63 @@
|
||||
{% endif %}
|
||||
{{ _("Compatible Games") }}
|
||||
</h3>
|
||||
<div style="max-height: 300px; overflow: hidden auto;">
|
||||
{% for support in supported_games %}
|
||||
<a class="badge badge-secondary"
|
||||
href="{{ support.game.getURL('packages.view') }}">
|
||||
{{ _("%(title)s by %(display_name)s",
|
||||
title=support.game.title, display_name=support.game.author.display_name) }}
|
||||
</a>
|
||||
{% else %}
|
||||
{{ _("No specific game is required") }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% if package.type == package.type.MOD %}
|
||||
{% if package.supports_all_games %}
|
||||
<p>
|
||||
{{ _("Should support most games.") }}
|
||||
{% if supported_games %}
|
||||
<br>
|
||||
{{ _("Tested with:") }}
|
||||
{% endif %}
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
{% if supported_games %}
|
||||
<div style="max-height: 300px; overflow: hidden auto;" class="mb-3">
|
||||
{% for support in supported_games %}
|
||||
<a class="badge badge-secondary"
|
||||
href="{{ support.game.getURL('packages.view') }}">
|
||||
{{ _("%(title)s by %(display_name)s",
|
||||
title=support.game.title, display_name=support.game.author.display_name) }}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% elif not package.supports_all_games %}
|
||||
<p>
|
||||
{{ _("No specific game required") }}
|
||||
</p>
|
||||
{% if package.checkPerm(current_user, "EDIT_PACKAGE") %}
|
||||
<div class="alert alert-warning">
|
||||
<p>
|
||||
{{ _("Is the above correct?") }}
|
||||
{{ _("You need to either confirm this or tell ContentDB about supported games") }}
|
||||
</p>
|
||||
|
||||
<a class="btn btn-sm btn-warning" href="{{ package.getURL('packages.game_support') }}">
|
||||
Update
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if unsupported_games and show_unsupported %}
|
||||
<p>
|
||||
{{ _("Except for:") }}
|
||||
</p>
|
||||
<div style="max-height: 300px; overflow: hidden auto;">
|
||||
{% for support in unsupported_games %}
|
||||
<a class="badge badge-danger"
|
||||
href="{{ support.game.getURL('packages.view') }}">
|
||||
<i class="fas fa-times mr-1"></i>
|
||||
{{ _("%(title)s by %(display_name)s",
|
||||
title=support.game.title, display_name=support.game.author.display_name) }}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if package.type == package.type.MOD and (supported_games or unsupported_games) and
|
||||
not package.has_game_support_confirmed() %}
|
||||
<p class="text-muted small mt-2 mb-0">
|
||||
{{ _("This is an experimental feature.") }}
|
||||
{{ _("Supported games are determined by an algorithm, and may not be correct.") }}
|
||||
|
||||
Reference in New Issue
Block a user