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/public_list.html | 4 ++-- templates/todolists/view.html | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'templates/todolists') diff --git a/templates/todolists/public_list.html b/templates/todolists/public_list.html index 0d14250d..c3054863 100644 --- a/templates/todolists/public_list.html +++ b/templates/todolists/public_list.html @@ -1,4 +1,5 @@ {% extends "base.html" %} +{% load package_extras %} {% block title %}Arch Linux - Todo Lists{% endblock %} @@ -43,8 +44,7 @@

{{ 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:', ' }} 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 e3e3e498765ab416a2902adf114cd3270e3eb12e Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 2 Nov 2011 09:47:02 -0500 Subject: Add URL to todolist email Signed-off-by: Dan McGee --- main/models.py | 5 +++++ templates/todolists/email_notification.txt | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'templates/todolists') diff --git a/main/models.py b/main/models.py index d55a9673..972b098c 100644 --- a/main/models.py +++ b/main/models.py @@ -470,6 +470,11 @@ class Meta: def get_absolute_url(self): return '/todo/%i/' % self.id + def get_full_url(self, proto='https'): + '''get a URL suitable for things like email including the domain''' + domain = Site.objects.get_current().domain + return '%s://%s%s' % (proto, domain, self.get_absolute_url()) + class TodolistPkg(models.Model): list = models.ForeignKey(Todolist) pkg = models.ForeignKey(Package) diff --git a/templates/todolists/email_notification.txt b/templates/todolists/email_notification.txt index 10b50f64..8b22b465 100644 --- a/templates/todolists/email_notification.txt +++ b/templates/todolists/email_notification.txt @@ -1,10 +1,11 @@ -{% autoescape off %}The todo list {{ todolist.name }} has had the following packages added to it for which you are a maintainer: +{% autoescape off %}The todo list "{{ todolist.name }}" has had the following packages added to it for which you are a maintainer: {% for tpkg in todo_packages %} * {{ tpkg.pkg.repo.name|lower }}/{{ tpkg.pkg.pkgname }} ({{ tpkg.pkg.arch.name }}) - {{ tpkg.pkg.get_full_url }}{% endfor %} Todo list information: -Creator: {{todolist.creator.get_full_name}} -Name: {{todolist.name}} +Name: {{ todolist.name }} +URL: {{ todolist.get_full_url }} +Creator: {{ todolist.creator.get_full_name }} Description: -{{todolist.description|striptags|wordwrap:69}}{% endautoescape %} +{{ todolist.description|striptags|wordwrap:78 }}{% endautoescape %} -- 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') 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 %} 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