mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-08 22:17:34 +01:00
Allow standard users to override game support
This commit is contained in:
parent
c7ee42a4d5
commit
3992b30cc2
@ -271,8 +271,8 @@ def remind_missing_game_support():
|
|||||||
packages_list = _package_list(packages)
|
packages_list = _package_list(packages)
|
||||||
|
|
||||||
add_notification(user, system_user, NotificationType.PACKAGE_APPROVAL,
|
add_notification(user, system_user, NotificationType.PACKAGE_APPROVAL,
|
||||||
f"You need to confirm whether the following packages support all games: {packages_list}",
|
f"You need to confirm whether the following packages support all games: {packages_list}",
|
||||||
url_for('todo.all_game_support', username=user.username))
|
url_for('todo.all_game_support', username=user.username))
|
||||||
|
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
|
@ -653,7 +653,7 @@ class GameSupportForm(FlaskForm):
|
|||||||
enable_support_detection = BooleanField(lazy_gettext("Enable support detection based on dependencies (recommended)"), [Optional()])
|
enable_support_detection = BooleanField(lazy_gettext("Enable support detection based on dependencies (recommended)"), [Optional()])
|
||||||
supported = StringField(lazy_gettext("Supported games (Comma-separated)"), [Optional()])
|
supported = StringField(lazy_gettext("Supported games (Comma-separated)"), [Optional()])
|
||||||
unsupported = StringField(lazy_gettext("Unsupported 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"))
|
submit = SubmitField(lazy_gettext("Save"))
|
||||||
|
|
||||||
|
|
||||||
@ -673,7 +673,7 @@ def game_support(package):
|
|||||||
|
|
||||||
can_support_all_games = package.type != PackageType.TXP
|
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
|
form = GameSupportForm() if can_edit else None
|
||||||
if form and request.method == "GET":
|
if form and request.method == "GET":
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
{% if support.confidence == 1 %}
|
{% if support.confidence == 1 %}
|
||||||
{{ _("Detected from dependencies") }}
|
{{ _("Detected from dependencies") }}
|
||||||
{% elif support.confidence == 11 %}
|
{% elif support.confidence == 11 %}
|
||||||
{{ _("Added by Editor") }}
|
{{ _("Overridden on ContentDB") }}
|
||||||
{% elif support.confidence == 10 %}
|
{% elif support.confidence == 10 %}
|
||||||
{{ package.get_conf_file_name() }}
|
{{ package.get_conf_file_name() }}
|
||||||
{% else %}
|
{% else %}
|
||||||
@ -104,9 +104,12 @@
|
|||||||
|
|
||||||
{% if form.supported and form.unsupported %}
|
{% if form.supported and form.unsupported %}
|
||||||
<h3>
|
<h3>
|
||||||
{{ _("Editor Overrides") }}
|
{{ _("Overrides") }}
|
||||||
<i class="ml-2 fas fa-user-edit"></i>
|
|
||||||
</h3>
|
</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.supported) }}
|
||||||
{{ render_field(form.unsupported) }}
|
{{ render_field(form.unsupported) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Loading…
Reference in New Issue
Block a user