Allow standard users to override game support

This commit is contained in:
rubenwardy 2023-06-19 22:35:26 +01:00
parent c7ee42a4d5
commit 3992b30cc2
3 changed files with 10 additions and 7 deletions

@ -271,8 +271,8 @@ def remind_missing_game_support():
packages_list = _package_list(packages)
add_notification(user, system_user, NotificationType.PACKAGE_APPROVAL,
f"You need to confirm whether the following packages support all games: {packages_list}",
url_for('todo.all_game_support', username=user.username))
f"You need to confirm whether the following packages support all games: {packages_list}",
url_for('todo.all_game_support', username=user.username))
db.session.commit()

@ -653,7 +653,7 @@ class GameSupportForm(FlaskForm):
enable_support_detection = BooleanField(lazy_gettext("Enable support detection based on dependencies (recommended)"), [Optional()])
supported = StringField(lazy_gettext("Supported games (Comma-separated)"), [Optional()])
unsupported = StringField(lazy_gettext("Unsupported games (Comma-separated)"), [Optional()])
supports_all_games = BooleanField(lazy_gettext("Supports all games (unless stated)"), [Optional()])
supports_all_games = BooleanField(lazy_gettext("Supports all games (unless stated) / is game independent"), [Optional()])
submit = SubmitField(lazy_gettext("Save"))
@ -673,7 +673,7 @@ def game_support(package):
can_support_all_games = package.type != PackageType.TXP
can_override = can_edit and current_user not in package.maintainers
can_override = can_edit
form = GameSupportForm() if can_edit else None
if form and request.method == "GET":

@ -46,7 +46,7 @@
{% if support.confidence == 1 %}
{{ _("Detected from dependencies") }}
{% elif support.confidence == 11 %}
{{ _("Added by Editor") }}
{{ _("Overridden on ContentDB") }}
{% elif support.confidence == 10 %}
{{ package.get_conf_file_name() }}
{% else %}
@ -104,9 +104,12 @@
{% if form.supported and form.unsupported %}
<h3>
{{ _("Editor Overrides") }}
<i class="ml-2 fas fa-user-edit"></i>
{{ _("Overrides") }}
</h3>
<p class="text-muted">
{{ _("It's best to add supported/unsupported games to %(conf)s, but in the meantime you can add them here.",
conf=package.get_conf_file_name()) }}
</p>
{{ render_field(form.supported) }}
{{ render_field(form.unsupported) }}
{% endif %}