From b2cfd30094b07546bbbdd2c83499cfd3d03f2161 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 2 Feb 2012 18:29:35 -0600 Subject: Show the latest flag request on package details if out of date This only shows up for logged in users, but might be helpful for developers browsing around the site, especially if they did not receive the email themselves, or in the case of orphan packages. Signed-off-by: Dan McGee --- main/models.py | 11 +++++++++++ sitestatic/archweb.css | 5 +++++ templates/packages/details.html | 5 +++++ 3 files changed, 21 insertions(+) diff --git a/main/models.py b/main/models.py index d72f2c05..15a92662 100644 --- a/main/models.py +++ b/main/models.py @@ -312,6 +312,17 @@ def split_packages(self): repo__testing=self.repo.testing, repo__staging=self.repo.staging, pkgbase=self.pkgbase).exclude(id=self.id) + def flag_request(self): + if not self.flag_date: + return None + from packages.models import FlagRequest + try: + request = FlagRequest.objects.filter(pkgbase=self.pkgbase, + repo=self.repo).latest() + return request + except FlagRequest.DoesNotExist: + return None + def is_same_version(self, other): 'is this package similar, name and version-wise, to another' return self.pkgname == other.pkgname \ diff --git a/sitestatic/archweb.css b/sitestatic/archweb.css index 46fd7844..d653d98c 100644 --- a/sitestatic/archweb.css +++ b/sitestatic/archweb.css @@ -728,6 +728,11 @@ div#pkglist-about { padding: 0.25em 0 0.25em 1.5em; } + #pkgdetails #pkginfo .userdata { + font-size: 0.85em; + padding: 0.5em; + } + /* pkgdetails: flag package */ form#flag-pkg-form label { width: 10em; diff --git a/templates/packages/details.html b/templates/packages/details.html index f68aefa3..fd7bea4d 100644 --- a/templates/packages/details.html +++ b/templates/packages/details.html @@ -161,6 +161,11 @@

Versions Elsewhere

Last Updated: {{ pkg.last_update|date }} + {% if user.is_authenticated %}{% with pkg.flag_request as flag_request %}{% if flag_request %} + Last Flag Request: + From {{ flag_request.who }} on {{ flag_request.created|date }}:
+
{{ flag_request.message|linebreaksbr|default:"{no message}" }}
+ {% endif %}{% endwith %}{% endif %}
-- cgit v1.2.3-54-g00ecf