From be146163f66c9f6888d1cd55df1f144e4e0a1f24 Mon Sep 17 00:00:00 2001 From: volpino Date: Tue, 17 Jul 2012 13:18:44 +0200 Subject: [PATCH] euscanwww: Displaying unstable versions in package view Signed-off-by: volpino --- .../0012_auto__add_field_versionlog_vtype.py | 201 ++++++++++++++++++ euscanwww/djeuscan/models.py | 2 + .../djeuscan/processing/scan/scan_portage.py | 21 +- .../templates/euscan/_categories_table.html | 2 +- .../templates/euscan/_herds_table.html | 2 +- .../templates/euscan/_maintainers_table.html | 2 +- .../templates/euscan/_package_cols.html | 2 +- .../djeuscan/templates/euscan/_packages.html | 2 +- .../templates/euscan/accounts/categories.html | 2 +- .../templates/euscan/accounts/herds.html | 2 +- .../euscan/accounts/maintainers.html | 2 +- .../templates/euscan/accounts/overlays.html | 2 +- .../templates/euscan/accounts/packages.html | 2 +- .../djeuscan/templates/euscan/categories.html | 2 +- .../djeuscan/templates/euscan/category.html | 2 +- euscanwww/djeuscan/templates/euscan/herd.html | 2 +- .../djeuscan/templates/euscan/herds.html | 2 +- .../djeuscan/templates/euscan/maintainer.html | 2 +- .../templates/euscan/maintainers.html | 2 +- .../djeuscan/templates/euscan/overlay.html | 2 +- .../djeuscan/templates/euscan/overlays.html | 2 +- .../djeuscan/templates/euscan/package.html | 15 ++ .../djeuscan/templates/euscan/world_scan.html | 2 +- .../{euscan.py => euscan_tags.py} | 7 + euscanwww/htdocs/img/unstable-icon.png | Bin 0 -> 605 bytes pym/euscan/helpers.py | 6 +- 26 files changed, 259 insertions(+), 31 deletions(-) create mode 100644 euscanwww/djeuscan/migrations/0012_auto__add_field_versionlog_vtype.py rename euscanwww/djeuscan/templatetags/{euscan.py => euscan_tags.py} (91%) create mode 100644 euscanwww/htdocs/img/unstable-icon.png diff --git a/euscanwww/djeuscan/migrations/0012_auto__add_field_versionlog_vtype.py b/euscanwww/djeuscan/migrations/0012_auto__add_field_versionlog_vtype.py new file mode 100644 index 0000000..920a6d0 --- /dev/null +++ b/euscanwww/djeuscan/migrations/0012_auto__add_field_versionlog_vtype.py @@ -0,0 +1,201 @@ +# -*- coding: utf-8 -*- +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + + def forwards(self, orm): + # Adding field 'VersionLog.vtype' + db.add_column('djeuscan_versionlog', 'vtype', + self.gf('django.db.models.fields.CharField')(default='', max_length=128, blank=True), + keep_default=False) + + def backwards(self, orm): + # Deleting field 'VersionLog.vtype' + db.delete_column('djeuscan_versionlog', 'vtype') + + models = { + 'auth.group': { + 'Meta': {'object_name': 'Group'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + 'auth.permission': { + 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + 'auth.user': { + 'Meta': {'object_name': 'User'}, + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + 'contenttypes.contenttype': { + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + }, + 'djeuscan.categoryassociation': { + 'Meta': {'unique_together': "(['user', 'category'],)", 'object_name': 'CategoryAssociation'}, + 'category': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) + }, + 'djeuscan.categorylog': { + 'Meta': {'object_name': 'CategoryLog', '_ormbases': ['djeuscan.Log']}, + 'category': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'log_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['djeuscan.Log']", 'unique': 'True', 'primary_key': 'True'}) + }, + 'djeuscan.euscanresult': { + 'Meta': {'object_name': 'EuscanResult'}, + 'datetime': ('django.db.models.fields.DateTimeField', [], {}), + 'ebuild': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'package': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['djeuscan.Package']"}), + 'result': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'scan_time': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}) + }, + 'djeuscan.herd': { + 'Meta': {'object_name': 'Herd'}, + 'email': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}), + 'herd': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) + }, + 'djeuscan.herdassociation': { + 'Meta': {'unique_together': "(['user', 'herd'],)", 'object_name': 'HerdAssociation'}, + 'herd': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['djeuscan.Herd']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) + }, + 'djeuscan.herdlog': { + 'Meta': {'object_name': 'HerdLog', '_ormbases': ['djeuscan.Log']}, + 'herd': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['djeuscan.Herd']"}), + 'log_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['djeuscan.Log']", 'unique': 'True', 'primary_key': 'True'}) + }, + 'djeuscan.log': { + 'Meta': {'object_name': 'Log'}, + 'datetime': ('django.db.models.fields.DateTimeField', [], {}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'n_packages_gentoo': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'n_packages_outdated': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'n_packages_overlay': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'n_versions_gentoo': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'n_versions_overlay': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'n_versions_upstream': ('django.db.models.fields.IntegerField', [], {'default': '0'}) + }, + 'djeuscan.maintainer': { + 'Meta': {'object_name': 'Maintainer'}, + 'email': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}) + }, + 'djeuscan.maintainerassociation': { + 'Meta': {'unique_together': "(['user', 'maintainer'],)", 'object_name': 'MaintainerAssociation'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'maintainer': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['djeuscan.Maintainer']"}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) + }, + 'djeuscan.maintainerlog': { + 'Meta': {'object_name': 'MaintainerLog', '_ormbases': ['djeuscan.Log']}, + 'log_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['djeuscan.Log']", 'unique': 'True', 'primary_key': 'True'}), + 'maintainer': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['djeuscan.Maintainer']"}) + }, + 'djeuscan.overlayassociation': { + 'Meta': {'unique_together': "(['user', 'overlay'],)", 'object_name': 'OverlayAssociation'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'overlay': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) + }, + 'djeuscan.package': { + 'Meta': {'unique_together': "(['category', 'name'],)", 'object_name': 'Package'}, + 'category': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'herds': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['djeuscan.Herd']", 'symmetrical': 'False', 'blank': 'True'}), + 'homepage': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'last_version_gentoo': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'last_version_gentoo'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['djeuscan.Version']"}), + 'last_version_overlay': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'last_version_overlay'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['djeuscan.Version']"}), + 'last_version_upstream': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'last_version_upstream'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['djeuscan.Version']"}), + 'maintainers': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['djeuscan.Maintainer']", 'symmetrical': 'False', 'blank': 'True'}), + 'n_overlay': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'n_packaged': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'n_versions': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}) + }, + 'djeuscan.packageassociation': { + 'Meta': {'unique_together': "(['user', 'package'],)", 'object_name': 'PackageAssociation'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'package': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['djeuscan.Package']"}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) + }, + 'djeuscan.problemreport': { + 'Meta': {'object_name': 'ProblemReport'}, + 'datetime': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'message': ('django.db.models.fields.TextField', [], {}), + 'package': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['djeuscan.Package']"}), + 'subject': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'version': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['djeuscan.Version']", 'null': 'True', 'blank': 'True'}) + }, + 'djeuscan.refreshpackagequery': { + 'Meta': {'object_name': 'RefreshPackageQuery'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'package': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['djeuscan.Package']"}), + 'priority': ('django.db.models.fields.IntegerField', [], {'default': '0'}) + }, + 'djeuscan.version': { + 'Meta': {'unique_together': "(['package', 'slot', 'revision', 'version', 'overlay'],)", 'object_name': 'Version'}, + 'alive': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}), + 'confidence': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'ebuild_path': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}), + 'handler': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'metadata_path': ('django.db.models.fields.CharField', [], {'max_length': '256', 'blank': 'True'}), + 'overlay': ('django.db.models.fields.CharField', [], {'default': "'gentoo'", 'max_length': '128', 'db_index': 'True', 'blank': 'True'}), + 'package': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['djeuscan.Package']"}), + 'packaged': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'revision': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'slot': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'blank': 'True'}), + 'urls': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'version': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'vtype': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}) + }, + 'djeuscan.versionlog': { + 'Meta': {'object_name': 'VersionLog'}, + 'action': ('django.db.models.fields.IntegerField', [], {}), + 'datetime': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'overlay': ('django.db.models.fields.CharField', [], {'default': "'gentoo'", 'max_length': '128', 'blank': 'True'}), + 'package': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['djeuscan.Package']"}), + 'packaged': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'revision': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'slot': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'blank': 'True'}), + 'version': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'vtype': ('django.db.models.fields.CharField', [], {'max_length': '128', 'blank': 'True'}) + }, + 'djeuscan.worldlog': { + 'Meta': {'object_name': 'WorldLog', '_ormbases': ['djeuscan.Log']}, + 'log_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['djeuscan.Log']", 'unique': 'True', 'primary_key': 'True'}) + } + } + + complete_apps = ['djeuscan'] \ No newline at end of file diff --git a/euscanwww/djeuscan/models.py b/euscanwww/djeuscan/models.py index f7c59bb..5a8bd0b 100644 --- a/euscanwww/djeuscan/models.py +++ b/euscanwww/djeuscan/models.py @@ -165,6 +165,8 @@ class VersionLog(models.Model): validators=[validate_name], blank=True) action = models.IntegerField(choices=VERSION_ACTIONS) + vtype = models.CharField(max_length=128, blank=True) + objects = VersionLogManager() def __unicode__(self): diff --git a/euscanwww/djeuscan/processing/scan/scan_portage.py b/euscanwww/djeuscan/processing/scan/scan_portage.py index a3fa0c7..6e1ed4c 100644 --- a/euscanwww/djeuscan/processing/scan/scan_portage.py +++ b/euscanwww/djeuscan/processing/scan/scan_portage.py @@ -266,17 +266,16 @@ class ScanPortage(object): package.n_versions += 1 package.save() - if self.no_log: - return - - VersionLog.objects.create( - package=obj.package, - action=VersionLog.VERSION_ADDED, - slot=obj.slot, - revision=obj.revision, - version=obj.version, - overlay=obj.overlay - ) + if not self.no_log: + VersionLog.objects.create( + package=obj.package, + action=VersionLog.VERSION_ADDED, + slot=obj.slot, + revision=obj.revision, + version=obj.version, + overlay=obj.overlay, + vtype=obj.vtype, + ) def purge_old_packages(self, packages, alive): if not self.purge_packages: diff --git a/euscanwww/djeuscan/templates/euscan/_categories_table.html b/euscanwww/djeuscan/templates/euscan/_categories_table.html index f40e404..cd4ad30 100644 --- a/euscanwww/djeuscan/templates/euscan/_categories_table.html +++ b/euscanwww/djeuscan/templates/euscan/_categories_table.html @@ -1,5 +1,5 @@ {% load url from future %} -{% load euscan %} +{% load euscan_tags %} diff --git a/euscanwww/djeuscan/templates/euscan/_herds_table.html b/euscanwww/djeuscan/templates/euscan/_herds_table.html index ae218a6..622c9de 100644 --- a/euscanwww/djeuscan/templates/euscan/_herds_table.html +++ b/euscanwww/djeuscan/templates/euscan/_herds_table.html @@ -1,5 +1,5 @@ {% load url from future %} -{% load euscan %} +{% load euscan_tags %}
diff --git a/euscanwww/djeuscan/templates/euscan/_maintainers_table.html b/euscanwww/djeuscan/templates/euscan/_maintainers_table.html index f7b1412..ffbd536 100644 --- a/euscanwww/djeuscan/templates/euscan/_maintainers_table.html +++ b/euscanwww/djeuscan/templates/euscan/_maintainers_table.html @@ -1,5 +1,5 @@ {% load url from future %} -{% load euscan %} +{% load euscan_tags %}
diff --git a/euscanwww/djeuscan/templates/euscan/_package_cols.html b/euscanwww/djeuscan/templates/euscan/_package_cols.html index 5140701..20995ce 100644 --- a/euscanwww/djeuscan/templates/euscan/_package_cols.html +++ b/euscanwww/djeuscan/templates/euscan/_package_cols.html @@ -1,4 +1,4 @@ -{% load euscan %} +{% load euscan_tags %} {% load mul %} {% load sub %} {% load div %} diff --git a/euscanwww/djeuscan/templates/euscan/_packages.html b/euscanwww/djeuscan/templates/euscan/_packages.html index 6df68c9..e5deb06 100644 --- a/euscanwww/djeuscan/templates/euscan/_packages.html +++ b/euscanwww/djeuscan/templates/euscan/_packages.html @@ -1,4 +1,4 @@ -{% load euscan %} +{% load euscan_tags %} {% load sub %} {% load div %} {% load mul %} diff --git a/euscanwww/djeuscan/templates/euscan/accounts/categories.html b/euscanwww/djeuscan/templates/euscan/accounts/categories.html index 3c823f3..3b1b6d4 100644 --- a/euscanwww/djeuscan/templates/euscan/accounts/categories.html +++ b/euscanwww/djeuscan/templates/euscan/accounts/categories.html @@ -1,6 +1,6 @@ {% extends "euscan/_datatable.html" %} {% load url from future %} -{% load euscan %} +{% load euscan_tags %} {% block title %} {{ block.super }} - Watched categories diff --git a/euscanwww/djeuscan/templates/euscan/accounts/herds.html b/euscanwww/djeuscan/templates/euscan/accounts/herds.html index d55c034..f34d364 100644 --- a/euscanwww/djeuscan/templates/euscan/accounts/herds.html +++ b/euscanwww/djeuscan/templates/euscan/accounts/herds.html @@ -1,6 +1,6 @@ {% extends "euscan/_datatable.html" %} {% load url from future %} -{% load euscan %} +{% load euscan_tags %} {% block title %} {{ block.super }} - Watched herds diff --git a/euscanwww/djeuscan/templates/euscan/accounts/maintainers.html b/euscanwww/djeuscan/templates/euscan/accounts/maintainers.html index 06cfc1f..8bce022 100644 --- a/euscanwww/djeuscan/templates/euscan/accounts/maintainers.html +++ b/euscanwww/djeuscan/templates/euscan/accounts/maintainers.html @@ -1,6 +1,6 @@ {% extends "euscan/_datatable.html" %} {% load url from future %} -{% load euscan %} +{% load euscan_tags %} {% block title %} {{ block.super }} - Watched maintainers diff --git a/euscanwww/djeuscan/templates/euscan/accounts/overlays.html b/euscanwww/djeuscan/templates/euscan/accounts/overlays.html index 589922b..56dacad 100644 --- a/euscanwww/djeuscan/templates/euscan/accounts/overlays.html +++ b/euscanwww/djeuscan/templates/euscan/accounts/overlays.html @@ -1,6 +1,6 @@ {% extends "euscan/_datatable.html" %} -{% load euscan %} +{% load euscan_tags %} {% load url from future %} {% block title %} diff --git a/euscanwww/djeuscan/templates/euscan/accounts/packages.html b/euscanwww/djeuscan/templates/euscan/accounts/packages.html index bd87b5d..c83d6cd 100644 --- a/euscanwww/djeuscan/templates/euscan/accounts/packages.html +++ b/euscanwww/djeuscan/templates/euscan/accounts/packages.html @@ -1,7 +1,7 @@ {% extends "euscan/_datatable.html" %} {% load url from future %} -{% load euscan %} +{% load euscan_tags %} {% block title %} {{ block.super }} - Watched packages diff --git a/euscanwww/djeuscan/templates/euscan/categories.html b/euscanwww/djeuscan/templates/euscan/categories.html index 1887627..8893b65 100644 --- a/euscanwww/djeuscan/templates/euscan/categories.html +++ b/euscanwww/djeuscan/templates/euscan/categories.html @@ -1,6 +1,6 @@ {% extends "euscan/_datatable.html" %} -{% load euscan %} +{% load euscan_tags %} {% load url from future %} {% block title %} diff --git a/euscanwww/djeuscan/templates/euscan/category.html b/euscanwww/djeuscan/templates/euscan/category.html index 0096af1..1f65253 100644 --- a/euscanwww/djeuscan/templates/euscan/category.html +++ b/euscanwww/djeuscan/templates/euscan/category.html @@ -1,6 +1,6 @@ {% extends "euscan/_datatable.html" %} -{% load euscan %} +{% load euscan_tags %} {% load url from future %} {% block title %} diff --git a/euscanwww/djeuscan/templates/euscan/herd.html b/euscanwww/djeuscan/templates/euscan/herd.html index 28b7f39..9156d39 100644 --- a/euscanwww/djeuscan/templates/euscan/herd.html +++ b/euscanwww/djeuscan/templates/euscan/herd.html @@ -1,6 +1,6 @@ {% extends "euscan/_datatable.html" %} -{% load euscan %} +{% load euscan_tags %} {% load url from future %} {% block title %} diff --git a/euscanwww/djeuscan/templates/euscan/herds.html b/euscanwww/djeuscan/templates/euscan/herds.html index ef11932..638010f 100644 --- a/euscanwww/djeuscan/templates/euscan/herds.html +++ b/euscanwww/djeuscan/templates/euscan/herds.html @@ -1,6 +1,6 @@ {% extends "euscan/_datatable.html" %} -{% load euscan %} +{% load euscan_tags %} {% load url from future %} {% block title %} diff --git a/euscanwww/djeuscan/templates/euscan/maintainer.html b/euscanwww/djeuscan/templates/euscan/maintainer.html index 3913447..828f6b8 100644 --- a/euscanwww/djeuscan/templates/euscan/maintainer.html +++ b/euscanwww/djeuscan/templates/euscan/maintainer.html @@ -1,6 +1,6 @@ {% extends "euscan/_datatable.html" %} -{% load euscan %} +{% load euscan_tags %} {% load url from future %} {% block title %} diff --git a/euscanwww/djeuscan/templates/euscan/maintainers.html b/euscanwww/djeuscan/templates/euscan/maintainers.html index 8c2e6d5..0c89c04 100644 --- a/euscanwww/djeuscan/templates/euscan/maintainers.html +++ b/euscanwww/djeuscan/templates/euscan/maintainers.html @@ -1,6 +1,6 @@ {% extends "euscan/_datatable.html" %} -{% load euscan %} +{% load euscan_tags %} {% load url from future %} {% block title %} diff --git a/euscanwww/djeuscan/templates/euscan/overlay.html b/euscanwww/djeuscan/templates/euscan/overlay.html index b241be6..3de2687 100644 --- a/euscanwww/djeuscan/templates/euscan/overlay.html +++ b/euscanwww/djeuscan/templates/euscan/overlay.html @@ -1,7 +1,7 @@ {% extends "euscan/_datatable.html" %} {% load url from future %} -{% load euscan %} +{% load euscan_tags %} {% block title %} {{ block.super }} - Overlay: {{ overlay }} diff --git a/euscanwww/djeuscan/templates/euscan/overlays.html b/euscanwww/djeuscan/templates/euscan/overlays.html index bb4edf6..2fc8d4c 100644 --- a/euscanwww/djeuscan/templates/euscan/overlays.html +++ b/euscanwww/djeuscan/templates/euscan/overlays.html @@ -1,6 +1,6 @@ {% extends "euscan/_datatable.html" %} -{% load euscan %} +{% load euscan_tags %} {% load url from future %} {% block title %} diff --git a/euscanwww/djeuscan/templates/euscan/package.html b/euscanwww/djeuscan/templates/euscan/package.html index e5edfb8..16fca3a 100644 --- a/euscanwww/djeuscan/templates/euscan/package.html +++ b/euscanwww/djeuscan/templates/euscan/package.html @@ -1,6 +1,7 @@ {% extends "euscan/_datatable.html" %} {% load sub %} +{% load euscan_tags %} {% load url from future %} {% block meta %} @@ -98,6 +99,11 @@ {% else %} overlays {% endif %} + + {% if version.vtype and not version.vtype|is_stable %} + unstable + {% endif %} + {{ version.version }}-{{ version.revision }} :{{ version.slot }} [{{ version.overlay }}] {% endfor %} @@ -111,6 +117,11 @@ {% for version in upstream %}
  • upstream + + {% if version.vtype and not version.vtype|is_stable %} + unstable + {% endif %} + {{ version.version }} - {{ version.urls }}
  • {% endfor %} @@ -134,6 +145,10 @@ upstream {% endif %} + {% if version.vtype and not version.vtype|is_stable %} + unstable + {% endif %} + {{ version }} - {{ version.datetime }} diff --git a/euscanwww/djeuscan/templates/euscan/world_scan.html b/euscanwww/djeuscan/templates/euscan/world_scan.html index b16a850..11ac23f 100644 --- a/euscanwww/djeuscan/templates/euscan/world_scan.html +++ b/euscanwww/djeuscan/templates/euscan/world_scan.html @@ -1,6 +1,6 @@ {% extends "euscan/_datatable.html" %} -{% load euscan %} +{% load euscan_tags %} {% block title %} {{ block.super }} - World Scan diff --git a/euscanwww/djeuscan/templatetags/euscan.py b/euscanwww/djeuscan/templatetags/euscan_tags.py similarity index 91% rename from euscanwww/djeuscan/templatetags/euscan.py rename to euscanwww/djeuscan/templatetags/euscan_tags.py index 19bf908..2cff3c9 100644 --- a/euscanwww/djeuscan/templatetags/euscan.py +++ b/euscanwww/djeuscan/templatetags/euscan_tags.py @@ -1,6 +1,8 @@ from django import template from django.conf import settings +from euscan import helpers + register = template.Library() @@ -55,3 +57,8 @@ def overlays_table(overlays): "overlays": overlays, "STATIC_URL": settings.STATIC_URL, } + + +@register.filter +def is_stable(version_type): + return helpers.is_version_type_stable(version_type) diff --git a/euscanwww/htdocs/img/unstable-icon.png b/euscanwww/htdocs/img/unstable-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..f0323e56dde91bc0207e192f218fe708c8079213 GIT binary patch literal 605 zcmV-j0;2tiP)Y`goF)^44yMGF&=&L`0-p;Wy`OI1P5uodG(6n$H z7cO0z_2R|zth&0ozXT1)NY9YY&dI*X&c?{QLKBxp)l- z3JhXQPfgp-#m(uoY4euY?w;gwuDii(OmR8&-5wY9Y(@fxsh&AMzu1N|v`_U`FT zO;0a@iCbD)^7HcYhV0t4Yc5U$PRx_c6)|1b{^-S@drOxuH=R3g-cM}muo|$Toi)M1 zTw>n4_um<}U)G7pZaAvU$dFINS7i;$aSDU+);WJSNr1&rh zWCrn^QB@RFe(>ly!^XpZ5^Lu$EWj5|ClX zL>aKShB3k2MtnZQzuydJuD<)VYtfe;Js7@=Q>5|DgCU5Q7Z<38nvly)dne-&vIR^PE|m{_Wm< rnqf6i=nD{oqV5|Me@D{v7uf{>CyUmhTzF(#00000NkvXXu0mjfGm$YO literal 0 HcmV?d00001 diff --git a/pym/euscan/helpers.py b/pym/euscan/helpers.py index eea4382..17df9f4 100644 --- a/pym/euscan/helpers.py +++ b/pym/euscan/helpers.py @@ -35,7 +35,11 @@ _v = r'((\d+)((\.\d+)*)([a-zA-Z]*?)(' + _v_end + '*))' def is_version_stable(version): - return get_version_type(version) not in ("alpha", "beta", "pre", "rc") + return is_version_type_stable(get_version_type(version)) + + +def is_version_type_stable(version_type): + return version_type not in ("alpha", "beta", "pre", "rc") def get_version_type(version):