mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-03 19:57:29 +01:00
parent
d6b1adf613
commit
59a5cf2df5
@ -63,18 +63,24 @@ def view_editor():
|
|||||||
else:
|
else:
|
||||||
abort(400)
|
abort(400)
|
||||||
|
|
||||||
|
license_needed = Package.query \
|
||||||
|
.filter(Package.state.in_([PackageState.READY_FOR_REVIEW, PackageState.APPROVED])) \
|
||||||
|
.filter(or_(Package.license.has(License.name.like("Other %")),
|
||||||
|
Package.media_license.has(License.name.like("Other %")))) \
|
||||||
|
.all()
|
||||||
|
|
||||||
total_packages = Package.query.filter_by(state=PackageState.APPROVED).count()
|
total_packages = Package.query.filter_by(state=PackageState.APPROVED).count()
|
||||||
total_to_tag = Package.query.filter_by(state=PackageState.APPROVED, tags=None).count()
|
total_to_tag = Package.query.filter_by(state=PackageState.APPROVED, tags=None).count()
|
||||||
|
|
||||||
unfulfilled_meta_packages = MetaPackage.query \
|
unfulfilled_meta_packages = MetaPackage.query \
|
||||||
.filter(~ MetaPackage.packages.any(state=PackageState.APPROVED)) \
|
.filter(~ MetaPackage.packages.any(state=PackageState.APPROVED)) \
|
||||||
.filter(MetaPackage.dependencies.any(optional=False)) \
|
.filter(MetaPackage.dependencies.any(Package.state == PackageState.APPROVED, optional=False)) \
|
||||||
.order_by(db.asc(MetaPackage.name)).count()
|
.order_by(db.asc(MetaPackage.name)).count()
|
||||||
|
|
||||||
return render_template("todo/editor.html", current_tab="editor",
|
return render_template("todo/editor.html", current_tab="editor",
|
||||||
packages=packages, wip_packages=wip_packages, releases=releases, screenshots=screenshots,
|
packages=packages, wip_packages=wip_packages, releases=releases, screenshots=screenshots,
|
||||||
canApproveNew=canApproveNew, canApproveRel=canApproveRel, canApproveScn=canApproveScn,
|
canApproveNew=canApproveNew, canApproveRel=canApproveRel, canApproveScn=canApproveScn,
|
||||||
total_packages=total_packages, total_to_tag=total_to_tag,
|
license_needed=license_needed, total_packages=total_packages, total_to_tag=total_to_tag,
|
||||||
unfulfilled_meta_packages=unfulfilled_meta_packages)
|
unfulfilled_meta_packages=unfulfilled_meta_packages)
|
||||||
|
|
||||||
|
|
||||||
|
@ -96,6 +96,19 @@ class PackageState(enum.Enum):
|
|||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
@property
|
||||||
|
def color(self):
|
||||||
|
if self == self.WIP:
|
||||||
|
return "warning"
|
||||||
|
elif self == self.CHANGES_NEEDED:
|
||||||
|
return "danger"
|
||||||
|
elif self == self.READY_FOR_REVIEW:
|
||||||
|
return "success"
|
||||||
|
elif self == self.APPROVED:
|
||||||
|
return "info"
|
||||||
|
else:
|
||||||
|
return "danger"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get(cls, name):
|
def get(cls, name):
|
||||||
try:
|
try:
|
||||||
|
@ -60,8 +60,6 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{{ p.title }} by {{ p.author.display_name }}
|
{{ p.title }} by {{ p.author.display_name }}
|
||||||
|
|
||||||
|
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<li class="list-group-item"><i>No packages need reviewing.</i></li>
|
<li class="list-group-item"><i>No packages need reviewing.</i></li>
|
||||||
@ -102,6 +100,28 @@
|
|||||||
</p>
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if license_needed %}
|
||||||
|
<h2 class="mt-5">License Needed</h2>
|
||||||
|
<div class="card">
|
||||||
|
<h3 class="card-header">License Needed</h3>
|
||||||
|
<div class="list-group list-group-flush">
|
||||||
|
{% for p in license_needed %}
|
||||||
|
<a href="{{ p.getURL("packages.view") }}" class="list-group-item list-group-item-action">
|
||||||
|
<span class="float-right" title="Created {{ p.created_at | datetime }}">
|
||||||
|
<small>
|
||||||
|
{{ p.created_at | timedelta }} ago
|
||||||
|
</small>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span class="mr-2 badge badge-{{ p.state.color }}">{{ p.state.value }}</span>
|
||||||
|
|
||||||
|
{{ p.title }} by {{ p.author.display_name }}
|
||||||
|
</a>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
<h2 class="mt-5">Tag Packages</h2>
|
<h2 class="mt-5">Tag Packages</h2>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user