diff options
author | Dan McGee <dan@archlinux.org> | 2011-09-19 15:44:22 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-09-19 15:44:22 +0200 |
commit | 797185faed0555efb88a1e6a18e447548a9935fd (patch) | |
tree | ab2169212e085667b79d12ba0b0ca93fd385b246 | |
parent | b893682f356ca2861d676a51c4ae1c937d4c7c44 (diff) | |
download | archweb-797185faed0555efb88a1e6a18e447548a9935fd.tar.gz archweb-797185faed0555efb88a1e6a18e447548a9935fd.tar.xz |
Add some dev dashboard info regarding signed package count
This adds a column similar to the flagged package count for the number
of signed packages in a given architecture or repository. It is up to
the user to do some simple math to figure out the number of unsigned
packages.
Also, add 'signed' as a hidden search field option similar to what we
did for packager.
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r-- | main/models.py | 4 | ||||
-rw-r--r-- | packages/views.py | 8 | ||||
-rw-r--r-- | templates/devel/index.html | 5 |
3 files changed, 17 insertions, 0 deletions
diff --git a/main/models.py b/main/models.py index b5cd863..ec1f0d2 100644 --- a/main/models.py +++ b/main/models.py @@ -98,6 +98,10 @@ class PackageManager(models.Manager): """Used by dev dashboard.""" return self.filter(flag_date__isnull=False) + def signed(self): + """Used by dev dashboard.""" + return self.filter(pgp_signature__isnull=False) + def normal(self): return self.select_related('arch', 'repo') diff --git a/packages/views.py b/packages/views.py index 7979335..61e4d29 100644 --- a/packages/views.py +++ b/packages/views.py @@ -199,6 +199,9 @@ class PackageSearchForm(forms.Form): flagged = forms.ChoiceField( choices=[('', 'All')] + make_choice(['Flagged', 'Not Flagged']), required=False) + signed = forms.ChoiceField( + choices=[('', 'All')] + make_choice(['Signed', 'Unsigned']), + required=False) limit = LimitTypedChoiceField( choices=make_choice([50, 100, 250]) + [('all', 'All')], coerce=coerce_limit_value, @@ -254,6 +257,11 @@ def search(request, page=None): elif form.cleaned_data['flagged'] == 'Not Flagged': packages = packages.filter(flag_date__isnull=True) + if form.cleaned_data['signed'] == 'Signed': + packages = packages.filter(pgp_signature__isnull=False) + elif form.cleaned_data['signed'] == 'Unsigned': + packages = packages.filter(pgp_signature__isnull=True) + if form.cleaned_data['q']: query = form.cleaned_data['q'] q = Q(pkgname__icontains=query) | Q(pkgdesc__icontains=query) diff --git a/templates/devel/index.html b/templates/devel/index.html index 0c818d3..b2da70c 100644 --- a/templates/devel/index.html +++ b/templates/devel/index.html @@ -135,6 +135,7 @@ <th class="key">Arch</th> <th># Packages</th> <th># Flagged</th> + <th># Signed</th> </tr> </thead> <tbody> @@ -147,6 +148,8 @@ <td><a href="/packages/?arch={{ arch.name }}&flagged=Flagged" title="View all flagged packages for the {{ arch.name }} architecture"> <strong>{{ arch.packages.flagged.count }}</strong> packages</a></td> + + <td><strong>{{ arch.packages.signed.count }}</strong> packages</td> </tr> {% endfor %} </tbody> @@ -165,6 +168,7 @@ <th class="key">Repository</th> <th># Packages</th> <th># Flagged</th> + <th># Signed</th> </tr> </thead> <tbody> @@ -177,6 +181,7 @@ <td><a href="/packages/?repo={{ repo.name }}&flagged=Flagged" title="View all flagged packages in the {{ repo.name }} repository"> <strong>{{ repo.packages.flagged.count }}</strong> packages</a></td> + <td><strong>{{ repo.packages.signed.count }}</strong> packages</td> </tr> {% endfor %} </tbody> |