From 156b91eb5935df4afdb8f0f0311d36537808c2f5 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 9 Aug 2011 23:16:00 -0500 Subject: Use new package details link tag in templates This replaces a lot of boilerplate we had everywhere, and makes sure things like the title are consistent across all links. Signed-off-by: Dan McGee --- templates/todolists/view.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'templates/todolists/view.html') diff --git a/templates/todolists/view.html b/templates/todolists/view.html index 9a6e3c0f..8f515c9b 100644 --- a/templates/todolists/view.html +++ b/templates/todolists/view.html @@ -1,4 +1,6 @@ {% extends "base.html" %} +{% load package_extras %} + {% block title %}Arch Linux - Todo: {{ list.name }}{% endblock %} {% block content %} @@ -34,8 +36,7 @@

Todo List: {{ list.name }}

{% for pkg in list.packages %} - {{ pkg.pkg.pkgname }} + {% pkg_details_link pkg.pkg %} {{ pkg.pkg.arch.name }} {{ pkg.pkg.repo.name|capfirst }} {{ pkg.pkg.maintainers|join:', ' }} -- cgit v1.2.3-54-g00ecf From 0aa42e2c01df2bf1c9e425994420f5ae10252597 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 3 Nov 2011 21:32:30 -0500 Subject: Allow signoff manipulation if you are a maintainer This is a more expensive and not-yet-optimized way of doing this, but we can fix that later as needed. Signed-off-by: Dan McGee --- packages/utils.py | 4 ++++ templates/packages/signoff_cell.html | 2 +- templates/todolists/view.html | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'templates/todolists/view.html') diff --git a/packages/utils.py b/packages/utils.py index 60b95e21..1a2c0de0 100644 --- a/packages/utils.py +++ b/packages/utils.py @@ -2,6 +2,7 @@ from django.db import connection from django.db.models import Count, Max +from django.contrib.auth.models import User from main.models import Package, Repo from main.utils import cache_function, groupby_preserve_order, PackageStandin @@ -172,6 +173,9 @@ def __init__(self, packages): self.version = '' self.last_update = first.last_update self.packager = first.packager + self.maintainers = User.objects.filter( + package_relations__type=PackageRelation.MAINTAINER, + package_relations__pkgbase=self.pkgbase) self.specification = \ SignoffSpecification.objects.get_or_default_from_package(first) diff --git a/templates/packages/signoff_cell.html b/templates/packages/signoff_cell.html index 4f9f726b..0bf44ca2 100644 --- a/templates/packages/signoff_cell.html +++ b/templates/packages/signoff_cell.html @@ -17,7 +17,7 @@ title="Signoff {{ group.pkgbase }} for {{ group.arch }}">Signoff {% endif %} {% endif %} -{% if group.packager == user %} +{% if user == group.packager or user in group.maintainers %}
Signoff Options
diff --git a/templates/todolists/view.html b/templates/todolists/view.html index 8f515c9b..c9ea919a 100644 --- a/templates/todolists/view.html +++ b/templates/todolists/view.html @@ -29,7 +29,7 @@

Todo List: {{ list.name }}

Name Arch Repo - Maintainer + Maintainers Status -- cgit v1.2.3-54-g00ecf