summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/admin.py12
-rw-r--r--packages/templatetags/package_extras.py7
2 files changed, 9 insertions, 10 deletions
diff --git a/packages/admin.py b/packages/admin.py
index 4680c755..5df0043a 100644
--- a/packages/admin.py
+++ b/packages/admin.py
@@ -15,10 +15,9 @@ class PackageRelationAdmin(admin.ModelAdmin):
class FlagRequestAdmin(admin.ModelAdmin):
list_display = ('pkgbase', 'full_version', 'repo', 'created', 'who',
'is_spam', 'is_legitimate', 'message')
- list_filter = ('is_spam', 'is_legitimate', 'repo')
+ list_filter = ('is_spam', 'is_legitimate', 'repo', 'created')
search_fields = ('pkgbase', 'user_email', 'message')
ordering = ('-created',)
- date_hierarchy = 'created'
def get_queryset(self, request):
qs = super(FlagRequestAdmin, self).queryset(request)
@@ -28,19 +27,17 @@ class FlagRequestAdmin(admin.ModelAdmin):
class SignoffAdmin(admin.ModelAdmin):
list_display = ('pkgbase', 'full_version', 'arch', 'repo',
'user', 'created', 'revoked')
- list_filter = ('arch', 'repo', 'user')
+ list_filter = ('arch', 'repo', 'user', 'created')
search_fields = ('pkgbase', 'user__username')
ordering = ('-created',)
- date_hierarchy = 'created'
class SignoffSpecificationAdmin(admin.ModelAdmin):
list_display = ('pkgbase', 'full_version', 'arch', 'repo',
'user', 'created', 'comments')
- list_filter = ('arch', 'repo', 'user')
+ list_filter = ('arch', 'repo', 'user', 'created')
search_fields = ('pkgbase', 'user__username')
ordering = ('-created',)
- date_hierarchy = 'created'
def get_queryset(self, request):
qs = super(SignoffSpecificationAdmin, self).queryset(request)
@@ -50,10 +47,9 @@ class SignoffSpecificationAdmin(admin.ModelAdmin):
class UpdateAdmin(admin.ModelAdmin):
list_display = ('pkgname', 'repo', 'arch', 'action_flag',
'old_version', 'new_version', 'created')
- list_filter = ('action_flag', 'repo', 'arch')
+ list_filter = ('action_flag', 'repo', 'arch', 'created')
search_fields = ('pkgname',)
ordering = ('-created',)
- date_hierarchy = 'created'
raw_id_fields = ('package',)
diff --git a/packages/templatetags/package_extras.py b/packages/templatetags/package_extras.py
index 20c127c1..70456985 100644
--- a/packages/templatetags/package_extras.py
+++ b/packages/templatetags/package_extras.py
@@ -67,13 +67,16 @@ def do_buildsortqs(parser, token):
@register.simple_tag
-def pkg_details_link(pkg, link_title=None):
+def pkg_details_link(pkg, link_title=None, honor_flagged=False):
if not pkg:
return link_title or ''
if link_title is None:
link_title = pkg.pkgname
+ link_content = link_title
+ if honor_flagged and pkg.flag_date:
+ link_content = '<span class="flagged">%s</span>' % link_title
link = '<a href="%s" title="View package details for %s">%s</a>'
- return link % (pkg.get_absolute_url(), pkg.pkgname, link_title)
+ return link % (pkg.get_absolute_url(), pkg.pkgname, link_content)
@register.simple_tag