mirror of
https://github.com/minetest/contentdb.git
synced 2024-11-10 01:23:48 +01:00
Add badges next to packages awaiting approval list
This commit is contained in:
parent
7e4eb29db7
commit
f8b290fc45
@ -417,6 +417,22 @@ class Package(db.Model):
|
||||
for e in PackagePropertyKey:
|
||||
setattr(self, e.name, getattr(package, e.name))
|
||||
|
||||
def getState(self):
|
||||
if self.approved:
|
||||
return "approved"
|
||||
elif self.review_thread_id:
|
||||
return "thread"
|
||||
elif (self.type == PackageType.GAME or \
|
||||
self.type == PackageType.TXP) and \
|
||||
self.screenshots.count() == 0:
|
||||
return "wip"
|
||||
elif not self.getDownloadRelease():
|
||||
return "wip"
|
||||
elif "Other" in self.license.name or "Other" in self.media_license.name:
|
||||
return "license"
|
||||
else:
|
||||
return "ready"
|
||||
|
||||
def getAsDictionaryShort(self, base_url, version=None, protonum=None):
|
||||
tnurl = self.getThumbnailURL(1)
|
||||
release = self.getDownloadRelease(version=version, protonum=protonum)
|
||||
|
@ -15,6 +15,16 @@
|
||||
<div class="list-group list-group-flush">
|
||||
{% for p in packages %}
|
||||
<a href="{{ p.getDetailsURL() }}" class="list-group-item list-group-item-action">
|
||||
{% if p.getState() == "thread" %}
|
||||
<span class="mr-2 badge badge-danger">Thread</span>
|
||||
{% elif p.getState() == "ready" %}
|
||||
<span class="mr-2 badge badge-success">Ready</span>
|
||||
{% elif p.getState() == "wip" %}
|
||||
<span class="mr-2 badge badge-warning">WIP</span>
|
||||
{% elif p.getState() == "license" %}
|
||||
<span class="mr-2 badge badge-info">WIP</span>
|
||||
{% endif %}
|
||||
|
||||
{{ p.title }} by {{ p.author.display_name }}
|
||||
</a>
|
||||
{% else %}
|
||||
|
Loading…
Reference in New Issue
Block a user