From faf196aa521e794aed905122600d12f1c9ab1f0e Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 21 Jan 2014 08:06:56 -0600 Subject: Flag out-of-date message is no longer optional Changed way back in commit ef9d1c1e, but I didn't update the actual text at the same time. FS#38126. Signed-off-by: Dan McGee --- templates/packages/flag.html | 2 +- templates/packages/flaghelp.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'templates/packages') diff --git a/templates/packages/flag.html b/templates/packages/flag.html index d1226295..a83f37ff 100644 --- a/templates/packages/flag.html +++ b/templates/packages/flag.html @@ -20,7 +20,7 @@

Flag Package: {{ package.pkgname }} {{ package.full_version }} ({{ package.a {% endfor %} -

The message box portion of the flag utility is optional, and meant +

The message box portion is meant for short messages only. If you need more than 200 characters for your message, then file a bug report, email the maintainer directly, or send an email to the Flagging Packages

package so they can update it. If the package is unmaintained, the notification will be sent to a developer mailing list.

-

The message box portion of the flag utility is optional, and meant +

The message box portion of the flag utility is meant for short messages only. If you need more than 200 characters for your message, then file a bug report, email the maintainer directly, or send an email to the Date: Sat, 25 Jan 2014 09:16:48 -0600 Subject: Add 'Latest Update' column to stale package relations This helps when doing the irregular cleanup of these things and making sure a relation has been stale for some time and not just a couple minutes or hours. Signed-off-by: Dan McGee --- packages/models.py | 9 ++++++--- packages/utils.py | 3 ++- templates/packages/stale_relations.html | 2 ++ 3 files changed, 10 insertions(+), 4 deletions(-) (limited to 'templates/packages') diff --git a/packages/models.py b/packages/models.py index 6477d412..da8adc56 100644 --- a/packages/models.py +++ b/packages/models.py @@ -28,6 +28,9 @@ class PackageRelation(models.Model): type = models.PositiveIntegerField(choices=TYPE_CHOICES, default=MAINTAINER) created = models.DateTimeField(editable=False) + class Meta: + unique_together = (('pkgbase', 'user', 'type'),) + def get_associated_packages(self): return Package.objects.normal().filter(pkgbase=self.pkgbase) @@ -35,13 +38,13 @@ def repositories(self): packages = self.get_associated_packages() return sorted({p.repo for p in packages}) + def last_update(self): + return Update.objects.filter(pkgbase=self.pkgbase).latest() + def __unicode__(self): return u'%s: %s (%s)' % ( self.pkgbase, self.user, self.get_type_display()) - class Meta: - unique_together = (('pkgbase', 'user', 'type'),) - class SignoffSpecificationManager(models.Manager): def get_from_package(self, pkg): diff --git a/packages/utils.py b/packages/utils.py index 6ec39483..0f47f170 100644 --- a/packages/utils.py +++ b/packages/utils.py @@ -243,7 +243,8 @@ def get_wrong_permissions(): cursor = connection.cursor() cursor.execute(sql, [PackageRelation.MAINTAINER]) to_fetch = [row[0] for row in cursor.fetchall()] - relations = PackageRelation.objects.select_related('user').filter( + relations = PackageRelation.objects.select_related( + 'user', 'user__userprofile').filter( id__in=to_fetch) return relations diff --git a/templates/packages/stale_relations.html b/templates/packages/stale_relations.html index 76f32052..f1ad4373 100644 --- a/templates/packages/stale_relations.html +++ b/templates/packages/stale_relations.html @@ -52,6 +52,7 @@

Relations with Non-existent pkgbase ({{ missing_pkgbase|length }})< User Type Created + Latest Update @@ -62,6 +63,7 @@

Relations with Non-existent pkgbase ({{ missing_pkgbase|length }})< {{ relation.user.get_full_name }} {{ relation.get_type_display }} {{ relation.created }} + {{ relation.last_update.created }} {% empty %} No non-existent pkgbase relations. -- cgit v1.2.3-54-g00ecf From 2e06e74d3a2a09cbb2a2521cdd55d6543cb56674 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 9 Mar 2014 11:40:58 -0500 Subject: Use localStorage to save/restore signoffs filters Signed-off-by: Dan McGee --- sitestatic/archweb.js | 18 ++++++++++++++++++ templates/packages/signoffs.html | 1 + 2 files changed, 19 insertions(+) (limited to 'templates/packages') diff --git a/sitestatic/archweb.js b/sitestatic/archweb.js index 209d6f67..8212e85b 100644 --- a/sitestatic/archweb.js +++ b/sitestatic/archweb.js @@ -444,6 +444,7 @@ function filter_signoffs() { $('#filter-count').text(rows.length); /* make sure we update the odd/even styling from sorting */ $('.results').trigger('applyWidgets', [false]); + filter_signoffs_save(); } function filter_signoffs_reset() { $('#signoffs_filter .arch_filter').attr('checked', 'checked'); @@ -451,6 +452,23 @@ function filter_signoffs_reset() { $('#id_pending').removeAttr('checked'); filter_signoffs(); } +function filter_signoffs_save() { + var state = $('#signoffs_filter').serializeArray(); + localStorage['filter_signoffs'] = JSON.stringify(state); +} +function filter_signoffs_load() { + var state = localStorage['filter_signoffs']; + if (!state) + return; + state = JSON.parse(state); + $('#signoffs_filter .arch_filter').removeAttr('checked'); + $('#signoffs_filter .repo_filter').removeAttr('checked'); + $('#id_pending').removeAttr('checked'); + $.each(state, function (i, v) { + // this assumes our only filters are checkboxes + $('#signoffs_filter input[name="' + v['name'] + '"]').attr('checked', 'checked'); + }); +} function collapseNotes(elements) { // Remove any trailing
tags from the note contents diff --git a/templates/packages/signoffs.html b/templates/packages/signoffs.html index 83f81d39..1c133f15 100644 --- a/templates/packages/signoffs.html +++ b/templates/packages/signoffs.html @@ -93,6 +93,7 @@

Filter Displayed Signoffs

$('#signoffs_filter input').change(filter_signoffs); $('#criteria_reset').click(filter_signoffs_reset); // fire function on page load to ensure the current form selections take effect + filter_signoffs_load(); filter_signoffs(); }); $(document).ready(function() { -- cgit v1.2.3-54-g00ecf