mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-10 15:07:35 +01:00
Add page with list of all update configs
This commit is contained in:
parent
c5fa76dab0
commit
ac4d5c8c88
@ -301,6 +301,7 @@ def update_config(package):
|
|||||||
if last_release and last_release.commit_hash:
|
if last_release and last_release.commit_hash:
|
||||||
package.update_config.last_commit = last_release.commit_hash
|
package.update_config.last_commit = last_release.commit_hash
|
||||||
|
|
||||||
|
package.update_config.outdated_at = None
|
||||||
package.update_config.auto_created = False
|
package.update_config.auto_created = False
|
||||||
|
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
@ -328,3 +329,21 @@ def setup_releases(package):
|
|||||||
return redirect(package.getUpdateConfigURL())
|
return redirect(package.getUpdateConfigURL())
|
||||||
|
|
||||||
return render_template("packages/release_wizard.html", package=package)
|
return render_template("packages/release_wizard.html", package=package)
|
||||||
|
|
||||||
|
|
||||||
|
@bp.route("/users/<username>/update-configs/")
|
||||||
|
@login_required
|
||||||
|
def bulk_update_config(username):
|
||||||
|
user: User = User.query.filter_by(username=username).first()
|
||||||
|
if not user:
|
||||||
|
abort(404)
|
||||||
|
|
||||||
|
if current_user != user and not current_user.rank.atLeast(UserRank.EDITOR):
|
||||||
|
abort(403)
|
||||||
|
|
||||||
|
confs = user.maintained_packages \
|
||||||
|
.filter(Package.state != PackageState.DELETED,
|
||||||
|
Package.update_config.has()) \
|
||||||
|
.order_by(db.asc(Package.title)).all()
|
||||||
|
|
||||||
|
return render_template("packages/bulk_update_conf.html", user=user, confs=confs)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{% macro render_outdated_packages(outdated_packages, current_player) -%}
|
{% macro render_outdated_packages(outdated_packages, current_player, show_config=False) -%}
|
||||||
<ul class="list-group mt-3">
|
<ul class="list-group mt-3">
|
||||||
{% for package in outdated_packages %}
|
{% for package in outdated_packages %}
|
||||||
{% set config = package.update_config %}
|
{% set config = package.update_config %}
|
||||||
@ -18,24 +18,31 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
{% if config.trigger == config.trigger.TAG and config.last_tag %}
|
{% if show_config %}
|
||||||
{{ _("New tag: %(tag)s", tag=config.last_tag) }}
|
{% set action = "Make release" if config.make_release else "Notification" %}
|
||||||
|
{{ _("On %(trigger)s, do %(action)s", trigger=config.trigger.value, action=action) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ _("Git repo has commit %(ref)s", ref=config.last_commit[0:5]) }}
|
{% if config.trigger == config.trigger.TAG and config.last_tag %}
|
||||||
|
{{ _("New tag: %(tag)s", tag=config.last_tag) }}
|
||||||
|
{% else %}
|
||||||
|
{{ _("Git repo has commit %(ref)s", ref=config.last_commit[0:5]) }}
|
||||||
|
{% endif %}
|
||||||
|
<span class="text-muted ml-3">
|
||||||
|
{{ config.outdated_at | datetime }}
|
||||||
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<span class="text-muted ml-3">
|
|
||||||
{{ config.outdated_at | datetime }}
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-sm-auto">
|
<div class="col-sm-auto">
|
||||||
{% set release_title = config.last_tag or (config.outdated_at | isodate) %}
|
{% if not show_config %}
|
||||||
{% if package.checkPerm(current_player, "MAKE_RELEASE") %}
|
{% set release_title = config.last_tag or (config.outdated_at | isodate) %}
|
||||||
<a class="btn btn-sm btn-primary mr-2"
|
{% if package.checkPerm(current_player, "MAKE_RELEASE") %}
|
||||||
href="{{ package.getCreateReleaseURL(title=release_title, ref=config.last_tag or config.last_commit) }}">
|
<a class="btn btn-sm btn-primary mr-2"
|
||||||
<i class="fas fa-plus mr-1"></i>
|
href="{{ package.getCreateReleaseURL(title=release_title, ref=config.last_tag or config.last_commit) }}">
|
||||||
{{ _("Release") }}
|
<i class="fas fa-plus mr-1"></i>
|
||||||
</a>
|
{{ _("Release") }}
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<a class="btn btn-sm btn-secondary mr-2" href="{{ package.repo }}">
|
<a class="btn btn-sm btn-secondary mr-2" href="{{ package.repo }}">
|
||||||
|
13
app/templates/packages/bulk_update_conf.html
Normal file
13
app/templates/packages/bulk_update_conf.html
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block title %}
|
||||||
|
{{ _("%(username)s's Automated Update Detection Configs", username=user.display_name) }}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<a class="btn btn-secondary float-right" href="/help/update_config/">Help</a>
|
||||||
|
<h1 class="mb-5">{{ self.title() }}</h1>
|
||||||
|
|
||||||
|
{% from "macros/todo.html" import render_outdated_packages %}
|
||||||
|
{{ render_outdated_packages(confs, current_user, show_config=True) }}
|
||||||
|
{% endblock %}
|
@ -35,6 +35,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<a class="btn btn-secondary float-right" href="/help/update_config/">Help</a>
|
<a class="btn btn-secondary float-right" href="/help/update_config/">Help</a>
|
||||||
|
<a class="btn btn-secondary float-right mr-2" href="{{ url_for('packages.bulk_update_config', username=user.username) }}">See all Update Settings</a>
|
||||||
<h2>{{ _("Potentially Outdated Packages") }}</h2>
|
<h2>{{ _("Potentially Outdated Packages") }}</h2>
|
||||||
{% if outdated_packages %}
|
{% if outdated_packages %}
|
||||||
<p>
|
<p>
|
||||||
@ -45,7 +46,6 @@
|
|||||||
{% from "macros/todo.html" import render_outdated_packages %}
|
{% from "macros/todo.html" import render_outdated_packages %}
|
||||||
{{ render_outdated_packages(outdated_packages, current_user) }}
|
{{ render_outdated_packages(outdated_packages, current_user) }}
|
||||||
|
|
||||||
|
|
||||||
<h2 class="mt-5">{{ _("Unadded Topics") }}</h2>
|
<h2 class="mt-5">{{ _("Unadded Topics") }}</h2>
|
||||||
{% if topics_to_add %}
|
{% if topics_to_add %}
|
||||||
<p>
|
<p>
|
||||||
|
Loading…
Reference in New Issue
Block a user