diff --git a/app/models.py b/app/models.py index ed9a21f..be4cdea 100644 --- a/app/models.py +++ b/app/models.py @@ -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) diff --git a/app/templates/todo/list.html b/app/templates/todo/list.html index 2a6fa5e..3eb3251 100644 --- a/app/templates/todo/list.html +++ b/app/templates/todo/list.html @@ -15,6 +15,16 @@
{% for p in packages %} + {% if p.getState() == "thread" %} + Thread + {% elif p.getState() == "ready" %} + Ready + {% elif p.getState() == "wip" %} + WIP + {% elif p.getState() == "license" %} + WIP + {% endif %} + {{ p.title }} by {{ p.author.display_name }} {% else %}