summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-06-23 20:13:01 -0500
committerDan McGee <dan@archlinux.org>2011-06-23 20:13:01 -0500
commitdcbb859a259082bf8d0587a63385ece44c697e45 (patch)
tree1ef16b20f111709c4144d2445840e659485412e8
parent82289ebb4432b3372b959430581afa0a2158acb9 (diff)
Add (hidden) ability to search by last packager
This is used from the developer dashboard to add a new column to the stats of # of packages for a given developer where they were the last to do the packaging. Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--devel/views.py2
-rw-r--r--packages/views.py10
-rw-r--r--templates/devel/index.html41
3 files changed, 40 insertions, 13 deletions
diff --git a/devel/views.py b/devel/views.py
index 1827f2ac..4399b73f 100644
--- a/devel/views.py
+++ b/devel/views.py
@@ -50,9 +50,11 @@ def index(request):
total_orphans = Package.objects.exclude(pkgbase__in=maintained).count()
total_flagged_orphans = Package.objects.filter(
flag_date__isnull=False).exclude(pkgbase__in=maintained).count()
+ total_updated = Package.objects.filter(packager__isnull=True).count()
orphan = {
'package_count': total_orphans,
'flagged_count': total_flagged_orphans,
+ 'updated_count': total_updated,
}
page_dict = {
diff --git a/packages/views.py b/packages/views.py
index 7b8c2e67..02b9f93b 100644
--- a/packages/views.py
+++ b/packages/views.py
@@ -191,6 +191,7 @@ class PackageSearchForm(forms.Form):
arch = forms.MultipleChoiceField(required=False)
q = forms.CharField(required=False)
maintainer = forms.ChoiceField(required=False)
+ packager = forms.ChoiceField(required=False)
last_update = forms.DateField(required=False, widget=AdminDateWidget(),
label='Last Updated After')
flagged = forms.ChoiceField(
@@ -213,6 +214,9 @@ class PackageSearchForm(forms.Form):
self.fields['maintainer'].choices = \
[('', 'All'), ('orphan', 'Orphan')] + \
[(m.username, m.get_full_name()) for m in maints]
+ self.fields['packager'].choices = \
+ [('', 'All'), ('unknown', 'Unknown')] + \
+ [(m.username, m.get_full_name()) for m in maints]
def search(request, page=None):
limit = 50
@@ -237,6 +241,12 @@ def search(request, page=None):
user__username=form.cleaned_data['maintainer']).values('pkgbase')
packages = packages.filter(pkgbase__in=inner_q)
+ if form.cleaned_data['packager'] == 'unknown':
+ packages = packages.filter(packager__isnull=True)
+ elif form.cleaned_data['packager']:
+ packages = packages.filter(
+ packager__username=form.cleaned_data['packager'])
+
if form.cleaned_data['flagged'] == 'Flagged':
packages = packages.filter(flag_date__isnull=False)
elif form.cleaned_data['flagged'] == 'Not Flagged':
diff --git a/templates/devel/index.html b/templates/devel/index.html
index 2a0058d3..f9ca2135 100644
--- a/templates/devel/index.html
+++ b/templates/devel/index.html
@@ -182,10 +182,10 @@
</div>{# dash-by-arch #}
{% endcache %}
-{% cache 60 dev-dash-by-maintainer %}
-<div id="dash-by-maintainer" class="box">
+{% cache 60 dev-dash-by-developer %}
+<div id="dash-by-developer" class="box">
- <h2>Stats by Maintainer</h2>
+ <h2>Stats by Developer</h2>
{% if perms.main.change_package %}
<p><a href="/packages/stale_relations/">Look for stale relations</a></p>
@@ -195,17 +195,24 @@
<thead>
<tr>
<th class="key">Maintainer</th>
- <th># Packages</th>
+ <th># Maintained</th>
<th># Flagged</th>
+ <th># Last Packager</th>
</tr>
<tr class="even">
- <td><em>Orphan</em></td>
+ <td><em>Orphan/Unknown</em></td>
<td><a href="/packages/?maintainer=orphan"
title="View all orphan packages">
- <strong>{{ orphan.package_count }}</strong> packages</a></td>
+ <strong>{{ orphan.package_count }}</strong> packages</a>
+ </td>
<td><a href="/packages/?maintainer=orphan&amp;flagged=Flagged"
title="View all flagged orphan packages">
- <strong>{{ orphan.flagged_count }}</strong> packages</a></td>
+ <strong>{{ orphan.flagged_count }}</strong> packages</a>
+ </td>
+ <td><a href="/packages/?packager=unknown"
+ title="View all packages last updated by unknown">
+ <strong>{{ orphan.updated_count }}</strong> packages</a>
+ </td>
</tr>
</thead>
<tbody>
@@ -214,15 +221,21 @@
<td>{{ maint.get_full_name }}</td>
<td><a href="/packages/?maintainer={{ maint.username }}"
title="View all packages maintained by {{ maint.get_full_name }}">
- <strong>{{ maint.package_count }}</strong> packages</a></td>
+ <strong>{{ maint.package_count }}</strong> packages</a>
+ </td>
<td><a href="/packages/?maintainer={{ maint.username }}&amp;flagged=Flagged"
title="View all flagged packages maintained by {{ maint.get_full_name }}">
- <strong>{{ maint.flagged_count }}</strong> packages</a></td>
+ <strong>{{ maint.flagged_count }}</strong> packages</a>
+ </td>
+ <td><a href="/packages/?packager={{ maint.username }}"
+ title="View all packages last updated by {{ maint.get_full_name }}">
+ <strong>{{ maint.updated_count }}</strong> packages</a>
+ </td>
</tr>
{% endfor %}
</tbody>
</table>
-</div>{# #dash-by-maintainer #}
+</div>{# #dash-by-developer #}
{% endcache %}
{% load cdn %}{% jquery %}
@@ -236,9 +249,11 @@ $(document).ready(function() {
{widgets: ['zebra'], sortList: [[0,0], [1,0]]});
$("#dash-todo:not(:has(tbody tr.empty))").tablesorter(
{widgets: ['zebra'], sortList: [[1,1]]});
- $(".dash-stats").tablesorter(
- {widgets: ['zebra'], sortList: [[0,0]],
- headers: { 1: { sorter: 'pkgcount' }, 2: { sorter: 'pkgcount' } } });
+ $(".dash-stats").tablesorter({
+ widgets: ['zebra'],
+ sortList: [[0,0]],
+ headers: { 1: { sorter: 'pkgcount' }, 2: { sorter: 'pkgcount' }, 3: { sorter: 'pkgcount' } }
+ });
});
</script>
{% endblock %}