Enable game support for texture packs

This commit is contained in:
rubenwardy
2023-01-12 19:48:18 +00:00
parent 605015f812
commit 42b9986fc8
5 changed files with 50 additions and 29 deletions

View File

@@ -48,6 +48,13 @@
{{ render_pkggrid(pop_mod) }}
<a href="{{ url_for('packages.list_all', type='txp', sort='score', order='desc', game=package.getId()) }}" class="btn btn-secondary float-right">
{{ _("See more") }}
</a>
<h2 class="my-3">{{ _("Top Texture Packs") }}</h2>
{{ render_pkggrid(pop_txp) }}
<a href="{{ url_for('packages.list_all', sort='reviews', order='desc', game=package.getId()) }}" class="btn btn-secondary float-right">
{{ _("See more") }}
</a>

View File

@@ -442,31 +442,45 @@
</dl>
{% endif %}
{% if 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">
<i class="fas fa-pen"></i>
</a>
{% endif %}
{{ _("Compatible Games") }}
</h3>
<div style="max-height: 300px; overflow: hidden auto;">
{% for support in package.getSortedSupportedGames() %}
<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 or package.type == package.type.TXP %}
{% set supported_games = package.getSortedSupportedGames() %}
{% if supported_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">
<i class="fas fa-pen"></i>
</a>
{% 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>
<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.") }}
</p>
{% if package.type == package.type.MOD %}
<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.") }}
</p>
{% endif %}
{% elif package.checkPerm(current_user, "EDIT_PACKAGE") %}
<p class="alert alert-warning">
{% if package.checkPerm(current_user, "EDIT_PACKAGE") %}
<a href="{{ package.getURL('packages.game_support') }}" class="btn btn-warning btn-sm float-right">
<i class="fas fa-pen"></i>
</a>
{% endif %}
{{ _("Please specify compatible games") }}
</p>
{% endif %}
{% endif %}
<h3>