From 21461e78608bb687d7101dd55e72d44cbebf2ff6 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 9 Aug 2011 22:53:01 -0500 Subject: Add package details link tag Signed-off-by: Dan McGee --- packages/templatetags/package_extras.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/templatetags/package_extras.py b/packages/templatetags/package_extras.py index e089b723..14a519d4 100644 --- a/packages/templatetags/package_extras.py +++ b/packages/templatetags/package_extras.py @@ -36,6 +36,11 @@ def do_buildsortqs(parser, token): "%r tag's argument should be in quotes" % tagname) return BuildQueryStringNode(sortfield[1:-1]) +@register.simple_tag +def pkg_details_link(pkg): + template = '%s' + return template % (pkg.get_absolute_url(), pkg.pkgname, pkg.pkgname) + @register.simple_tag def userpkgs(user): if user: @@ -48,7 +53,6 @@ def userpkgs(user): ) return '' - def svn_link(package, svnpath): '''Helper function for the two real SVN link methods.''' parts = (package.repo.svn_root, package.pkgbase, svnpath) -- cgit v1.2.3-2-g168b 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/devel/index.html | 7 +++---- templates/devel/packages.html | 4 ++-- templates/packages/details.html | 17 +++++------------ templates/packages/flag.html | 4 +++- templates/packages/flag_confirmed.html | 8 ++++---- templates/packages/flagged.html | 7 +++---- templates/packages/packages_list.html | 5 +++-- templates/packages/search.html | 3 +-- templates/packages/signoffs.html | 5 +++-- templates/todolists/public_list.html | 4 ++-- templates/todolists/view.html | 5 +++-- 11 files changed, 32 insertions(+), 37 deletions(-) diff --git a/templates/devel/index.html b/templates/devel/index.html index ad101145..0c818d36 100644 --- a/templates/devel/index.html +++ b/templates/devel/index.html @@ -1,5 +1,6 @@ {% extends "base.html" %} {% load cache %} +{% load package_extras %} {% block title %}Arch Linux - Developer Dashboard{% endblock %} @@ -24,8 +25,7 @@ {% for pkg in flagged %} - {{ pkg.pkgname }} + {% pkg_details_link pkg %} {{ pkg.repo.name }} {{ pkg.full_version }} {{ pkg.arch.name }} @@ -55,8 +55,7 @@ {{ todopkg.list.name }} - {{ todopkg.pkg.pkgname }} + {% pkg_details_link todopkg.pkg %} {{ todopkg.pkg.repo.name }} {{ todopkg.pkg.arch.name }} {{ todopkg.pkg.maintainers|join:', ' }} diff --git a/templates/devel/packages.html b/templates/devel/packages.html index a9553d70..9f01167c 100644 --- a/templates/devel/packages.html +++ b/templates/devel/packages.html @@ -1,5 +1,6 @@ {% extends "base.html" %} {% load attributes %} +{% load package_extras %} {% block title %}Arch Linux - {{ title }}{% endblock %} @@ -32,8 +33,7 @@ {{ pkg.arch.name }} {{ pkg.repo.name|capfirst }} - {{ pkg.pkgname }} + {% pkg_details_link pkg %} {% if pkg.flag_date %} {{ pkg.full_version }} {% else %} diff --git a/templates/packages/details.html b/templates/packages/details.html index 7972b9ab..8e3c0022 100644 --- a/templates/packages/details.html +++ b/templates/packages/details.html @@ -1,5 +1,6 @@ {% extends "base.html" %} {% load cache %} +{% load package_extras %} {% block title %}Arch Linux - {{ pkg.pkgname }} {{ pkg.full_version }} - Package Details{% endblock %} {% block navbarclass %}anb-packages{% endblock %} @@ -82,20 +83,14 @@ {% with pkg.split_packages as splits %}{% if splits %} Split Packages: - - {% for s in splits %} - {{ s.pkgname }}
- {% endfor %} - + {% for s in splits %}{% pkg_details_link s %}
{% endfor %} {% endif %}{% endwith %} {% else %} Base Package: {% if pkg.base_package %} - {{ pkg.pkgbase }} + {% pkg_details_link pkg.base_package %} {% else %} {{ pkg.pkgbase }} @@ -165,8 +160,7 @@ {% ifequal depend.pkg None %}
  • {{ depend.dep.depname }} (virtual)
  • {% else %} -
  • {{ depend.dep.depname }}{{ depend.dep.depvcmp|default:"" }} +
  • {% pkg_details_link depend.pkg %}{{ depend.dep.depvcmp|default:"" }} {% if depend.pkg.repo.testing %}(testing){% endif %} {% if depend.dep.optional %}(optional){% endif %} {% if depend.dep.description %}- {{ depend.dep.description }}{% endif %} @@ -188,8 +182,7 @@ {% if rqdby %}
      {% for req in rqdby %} -
    • {{ req.pkg.pkgname }} +
    • {% pkg_details_link req.pkg %} {% if req.pkg.repo.testing %}(testing){% endif %} {% if req.optional %}(optional){% endif %}
    • diff --git a/templates/packages/flag.html b/templates/packages/flag.html index 4a3c6966..261d6066 100644 --- a/templates/packages/flag.html +++ b/templates/packages/flag.html @@ -1,4 +1,6 @@ {% extends "base.html" %} +{% load package_extras %} + {% block title %}Arch Linux - Flag Package - {{ package.pkgname }}{% endblock %} {% block navbarclass %}anb-packages{% endblock %} @@ -13,7 +15,7 @@

      Note that all of the following packages will be marked out of date:

        {% for pkg in packages %} -
      • {{ pkg.pkgname }} {{ pkg.full_version }} [{{ pkg.repo.name|lower }}] ({{ pkg.arch.name }})
      • +
      • {% pkg_details_link pkg %} {{ pkg.full_version }} [{{ pkg.repo.name|lower }}] ({{ pkg.arch.name }})
      • {% endfor %}
      diff --git a/templates/packages/flag_confirmed.html b/templates/packages/flag_confirmed.html index 9ef316cb..398212f8 100644 --- a/templates/packages/flag_confirmed.html +++ b/templates/packages/flag_confirmed.html @@ -1,4 +1,6 @@ {% extends "base.html" %} +{% load package_extras %} + {% block title %}Arch Linux - Package Flagged - {{ package.pkgname }}{% endblock %} {% block navbarclass %}anb-packages{% endblock %} @@ -9,12 +11,10 @@

      Thank you, the maintainers have been notified the following packages are out-of-date:

        {% for pkg in packages %} -
      • {{ pkg.pkgname }} {{ pkg.full_version }} [{{ pkg.repo.name|lower }}] ({{ pkg.arch.name }})
      • +
      • {% pkg_details_link pkg %} {{ pkg.full_version }} [{{ pkg.repo.name|lower }}] ({{ pkg.arch.name }})
      • {% endfor %}
      -

      You can return to the package details page for - {{package.pkgname}}.

      +

      You can return to the package details page for {% pkg_details_link package %}.

      {% endblock %} diff --git a/templates/packages/flagged.html b/templates/packages/flagged.html index 3a39d178..a99a6924 100644 --- a/templates/packages/flagged.html +++ b/templates/packages/flagged.html @@ -1,16 +1,15 @@ {% extends "base.html" %} +{% load package_extras %} + {% block title %}Arch Linux - Flag Package - {{ pkg.pkgname }}{% endblock %} {% block navbarclass %}anb-packages{% endblock %} {% block content %}
      -

      Error: Package already flagged

      {{pkg.pkgname}} has already been flagged out-of-date.

      -

      You can return to the package details page for - {{pkg.pkgname}}.

      - +

      You can return to the package details page for {% pkg_details_link pkg %}.

      {% endblock %} diff --git a/templates/packages/packages_list.html b/templates/packages/packages_list.html index ccc091d8..942e1073 100644 --- a/templates/packages/packages_list.html +++ b/templates/packages/packages_list.html @@ -1,4 +1,6 @@ {% extends "base.html" %} +{% load package_extras %} + {% block title %}Arch Linux - {{ name }} ({{ arch.name }}) - {{ list_title }}{% endblock %} {% block navbarclass %}anb-packages{% endblock %} @@ -23,8 +25,7 @@ {{ pkg.arch.name }} {{ pkg.repo.name|capfirst }} - {{ pkg.pkgname }} + {% pkg_details_link pkg %} {% if pkg.flag_date %} {{ pkg.full_version }} {% else %} diff --git a/templates/packages/search.html b/templates/packages/search.html index 381ebb01..eb4aceca 100644 --- a/templates/packages/search.html +++ b/templates/packages/search.html @@ -104,8 +104,7 @@ {% endif %} {{ pkg.arch.name }} {{ pkg.repo.name|capfirst }} - {{ pkg.pkgname }} + {% pkg_details_link pkg %} {% if pkg.flag_date %} {{ pkg.full_version }} {% else %} diff --git a/templates/packages/signoffs.html b/templates/packages/signoffs.html index 6014396c..baf85338 100644 --- a/templates/packages/signoffs.html +++ b/templates/packages/signoffs.html @@ -1,4 +1,6 @@ {% extends "base.html" %} +{% load package_extras %} + {% block title %}Arch Linux - Package Signoffs{% endblock %} {% block navbarclass %}anb-packages{% endblock %} @@ -28,8 +30,7 @@ {% with group.package as pkg %} {{ pkg.arch.name }} - {{ pkg.pkgname }} + {% pkg_details_link pkg %} {{ group.packages|length }} {{ pkg.full_version }} {{ pkg.last_update|date }} 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 @@ {% 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 @@ {% 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-2-g168b From 02c0dbc482fc6037c19e713f4645d627eb004e9c Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 9 Aug 2011 23:33:27 -0500 Subject: Add some methods to PackageDepend object This will allow for some future "find the best provider link" stuff as well as refactoring of the get_depends() method on Package. Signed-off-by: Dan McGee --- main/models.py | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/main/models.py b/main/models.py index 70372823..4897cb65 100644 --- a/main/models.py +++ b/main/models.py @@ -386,6 +386,64 @@ class PackageDepend(models.Model): optional = models.BooleanField(default=False) description = models.TextField(null=True, blank=True) + def get_best_satisfier(self, arches=None, testing=None, staging=None): + '''Find a satisfier for this dependency that best matches the given + criteria. It will not search provisions, but will find packages named + and matching repo characteristics if possible.''' + pkgs = Package.objects.normal().filter(pkgname=self.depname) + if arches is not None: + # make sure we match architectures if possible + pkgs = pkgs.filter(arch__in=arches) + if len(pkgs) == 0: + # couldn't find a package in the DB + # it should be a virtual depend (or a removed package) + return None + if len(pkgs) == 1: + return pkgs[0] + # more than one package, see if we can't shrink it down + # grab the first though in case we fail + pkg = pkgs[0] + # prevents yet more DB queries, these lists should be short; + # after each grab the best available in case we remove all entries + if staging is not None: + pkgs = [p for p in pkgs if p.repo.staging == staging] + if len(pkgs) > 0: + pkg = pkgs[0] + + if testing is not None: + pkgs = [p for p in pkgs if p.repo.testing == testing] + if len(pkgs) > 0: + pkg = pkgs[0] + + return pkg + + def get_providers(self, arches=None, testing=None, staging=None): + '''Return providers of this dep. Does *not* include exact matches as it + checks the Provision names only, use get_best_satisfier() instead.''' + pkgs = Package.objects.normal().filter( + provides__name=self.depname).distinct() + if arches is not None: + pkgs = pkgs.filter(arch__in=arches) + + # Logic here is to filter out packages that are in multiple repos if + # they are not requested. For example, if testing is False, only show a + # testing package if it doesn't exist in a non-testing repo. + if staging is not None: + filtered = {} + for p in pkgs: + if p.pkgname not in filtered or p.repo.staging == staging: + filtered[p.pkgname] = p + pkgs = filtered.values() + + if testing is not None: + filtered = {} + for p in pkgs: + if p.pkgname not in filtered or p.repo.testing == testing: + filtered[p.pkgname] = p + pkgs = filtered.values() + + return pkgs + def __unicode__(self): return "%s%s" % (self.depname, self.depvcmp) -- cgit v1.2.3-2-g168b From b167fcb08725da983344fc18d449db6fc87d2f8a Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 9 Aug 2011 23:34:29 -0500 Subject: Refactor get_depends() to use PackageDepends methods The returned objects now also have a providers list if it makes sense. Signed-off-by: Dan McGee --- main/models.py | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/main/models.py b/main/models.py index 4897cb65..0125cc0e 100644 --- a/main/models.py +++ b/main/models.py @@ -269,36 +269,30 @@ class Package(models.Model): @cache_function(300) def get_depends(self): """ - Returns a list of dicts. Each dict contains ('pkg' and 'dep'). If it - represents a found package both vars will be available; else pkg will - be None if it is a 'virtual' dependency. Packages will match the - testing status of this package if possible. + Returns a list of dicts. Each dict contains ('dep', 'pkg', and + 'providers'). If it represents a found package both vars will be + available; else pkg will be None if it is a 'virtual' dependency. + If pkg is None and providers are known, they will be available in + providers. + Packages will match the testing status of this package if possible. """ deps = [] + arches = None + if not self.arch.agnostic: + arches = self.applicable_arches() # TODO: we can use list comprehension and an 'in' query to make this more effective for dep in self.packagedepend_set.order_by('optional', 'depname'): - pkgs = Package.objects.normal().filter(pkgname=dep.depname) - if not self.arch.agnostic: - # make sure we match architectures if possible - pkgs = pkgs.filter(arch__in=self.applicable_arches()) - if len(pkgs) == 0: - # couldn't find a package in the DB - # it should be a virtual depend (or a removed package) - pkg = None - elif len(pkgs) == 1: - pkg = pkgs[0] - else: - # more than one package, see if we can't shrink it down - # grab the first though in case we fail - pkg = pkgs[0] - # prevents yet more DB queries, these lists should be short - pkgs = [p for p in pkgs if p.repo.testing == self.repo.testing - and p.repo.staging == self.repo.staging] - if len(pkgs) > 0: - pkg = pkgs[0] - deps.append({'dep': dep, 'pkg': pkg}) + pkg = dep.get_best_satisfier(arches, testing=self.repo.testing, + staging=self.repo.staging) + providers = None + if not pkg: + providers = dep.get_providers(arches, + testing=self.repo.testing, staging=self.repo.staging) + print providers + deps.append({'dep': dep, 'pkg': pkg, 'providers': providers}) return deps + @cache_function(300) def base_package(self): """ Locate the base package for this package. It may be this very package, -- cgit v1.2.3-2-g168b From d14e80e2f04edb2f52811dba805a7ed2aa680fab Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 9 Aug 2011 23:35:27 -0500 Subject: Add a template tag to link multiple packages at once Comma-separated list. Signed-off-by: Dan McGee --- packages/templatetags/package_extras.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/templatetags/package_extras.py b/packages/templatetags/package_extras.py index 14a519d4..7bc868de 100644 --- a/packages/templatetags/package_extras.py +++ b/packages/templatetags/package_extras.py @@ -41,6 +41,10 @@ def pkg_details_link(pkg): template = '%s' return template % (pkg.get_absolute_url(), pkg.pkgname, pkg.pkgname) +@register.simple_tag +def multi_pkg_details(pkgs): + return ', '.join([pkg_details_link(pkg) for pkg in pkgs]) + @register.simple_tag def userpkgs(user): if user: -- cgit v1.2.3-2-g168b From b158cdedb5510becc39cc4ab9baf6eddb38c8389 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 9 Aug 2011 23:36:04 -0500 Subject: Link package provisions if available Rather than just the blank 'virtual' text we used to have in the dependencies listing on the package page. Signed-off-by: Dan McGee --- templates/packages/details.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/packages/details.html b/templates/packages/details.html index 8e3c0022..a3f2cef4 100644 --- a/templates/packages/details.html +++ b/templates/packages/details.html @@ -158,7 +158,10 @@
        {% for depend in deps %} {% ifequal depend.pkg None %} -
      • {{ depend.dep.depname }} (virtual)
      • + {% if depend.providers %} +
      • {{ depend.dep.depname }} ({% multi_pkg_details depend.providers %})
      • + {% else %}
      • {{ depend.dep.depname }} (virtual)
      • + {% endif %} {% else %}
      • {% pkg_details_link depend.pkg %}{{ depend.dep.depvcmp|default:"" }} {% if depend.pkg.repo.testing %}(testing){% endif %} -- cgit v1.2.3-2-g168b From 110c79ad0637c8e35b18c9ccc201d33d456d5453 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 16 Aug 2011 14:23:57 -0500 Subject: Small Python convention fixup Signed-off-by: Dan McGee --- mirrors/management/commands/mirrorcheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mirrors/management/commands/mirrorcheck.py b/mirrors/management/commands/mirrorcheck.py index 7bd79c83..8eb8b010 100644 --- a/mirrors/management/commands/mirrorcheck.py +++ b/mirrors/management/commands/mirrorcheck.py @@ -68,7 +68,7 @@ def check_mirror_url(mirror_url): log.last_sync = parsed_time # if we couldn't parse a time, this is a failure - if parsed_time == None: + if parsed_time is None: log.error = "Could not parse time from lastsync" log.is_success = False log.duration = end - start -- cgit v1.2.3-2-g168b From f7626c05719ebb4362836d2ba7e1d297bd8a92a6 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 16 Aug 2011 14:39:23 -0500 Subject: Add a removed date for releng ISOs Signed-off-by: Dan McGee --- releng/management/commands/syncisos.py | 5 +- .../migrations/0002_auto__add_field_iso_removed.py | 99 ++++++++++++++++++++++ releng/models.py | 1 + 3 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 releng/migrations/0002_auto__add_field_iso_removed.py diff --git a/releng/management/commands/syncisos.py b/releng/management/commands/syncisos.py index ba174131..23955afe 100644 --- a/releng/management/commands/syncisos.py +++ b/releng/management/commands/syncisos.py @@ -1,3 +1,4 @@ +from datetime import datetime import re import urllib from HTMLParser import HTMLParser, HTMLParseError @@ -45,7 +46,9 @@ class Command(BaseCommand): if iso not in isonames: new = Iso(name=iso, active=True) new.save() + now = datetime.utcnow() # and then mark all other names as no longer active - Iso.objects.exclude(name__in=active_isos).update(active=False) + Iso.objects.filter(active=True).exclude(name__in=active_isos).update( + active=False, removed=now) # vim: set ts=4 sw=4 et: diff --git a/releng/migrations/0002_auto__add_field_iso_removed.py b/releng/migrations/0002_auto__add_field_iso_removed.py new file mode 100644 index 00000000..d5cd09c8 --- /dev/null +++ b/releng/migrations/0002_auto__add_field_iso_removed.py @@ -0,0 +1,99 @@ +# encoding: 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): + db.add_column('releng_iso', 'removed', self.gf('django.db.models.fields.DateTimeField')(default=None, null=True, blank=True), keep_default=False) + + def backwards(self, orm): + db.delete_column('releng_iso', 'removed') + + models = { + 'releng.architecture': { + 'Meta': {'object_name': 'Architecture'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}) + }, + 'releng.bootloader': { + 'Meta': {'object_name': 'Bootloader'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}) + }, + 'releng.boottype': { + 'Meta': {'object_name': 'BootType'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}) + }, + 'releng.clockchoice': { + 'Meta': {'object_name': 'ClockChoice'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}) + }, + 'releng.filesystem': { + 'Meta': {'object_name': 'Filesystem'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}) + }, + 'releng.hardwaretype': { + 'Meta': {'object_name': 'HardwareType'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}) + }, + 'releng.installtype': { + 'Meta': {'object_name': 'InstallType'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}) + }, + 'releng.iso': { + 'Meta': {'object_name': 'Iso'}, + 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'created': ('django.db.models.fields.DateTimeField', [], {}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'removed': ('django.db.models.fields.DateTimeField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}) + }, + 'releng.isotype': { + 'Meta': {'object_name': 'IsoType'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}) + }, + 'releng.module': { + 'Meta': {'object_name': 'Module'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}) + }, + 'releng.source': { + 'Meta': {'object_name': 'Source'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}) + }, + 'releng.test': { + 'Meta': {'object_name': 'Test'}, + 'architecture': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['releng.Architecture']"}), + 'boot_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['releng.BootType']"}), + 'bootloader': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['releng.Bootloader']"}), + 'clock_choice': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['releng.ClockChoice']"}), + 'comments': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'created': ('django.db.models.fields.DateTimeField', [], {}), + 'filesystem': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['releng.Filesystem']"}), + 'hardware_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['releng.HardwareType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'install_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['releng.InstallType']"}), + 'ip_address': ('django.db.models.fields.IPAddressField', [], {'max_length': '15'}), + 'iso': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['releng.Iso']"}), + 'iso_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['releng.IsoType']"}), + 'modules': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['releng.Module']", 'null': 'True', 'blank': 'True'}), + 'rollback_filesystem': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'rollback_test_set'", 'null': 'True', 'to': "orm['releng.Filesystem']"}), + 'rollback_modules': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'rollback_test_set'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['releng.Module']"}), + 'source': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['releng.Source']"}), + 'success': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'user_email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}), + 'user_name': ('django.db.models.fields.CharField', [], {'max_length': '500'}) + } + } + + complete_apps = ['releng'] diff --git a/releng/models.py b/releng/models.py index 5510db6a..ceac948b 100644 --- a/releng/models.py +++ b/releng/models.py @@ -45,6 +45,7 @@ class RollbackOption(IsoOption): class Iso(models.Model): name = models.CharField(max_length=255) created = models.DateTimeField(editable=False) + removed = models.DateTimeField(null=True, blank=True, default=None) active = models.BooleanField(default=True) def __unicode__(self): -- cgit v1.2.3-2-g168b From 0df3567ae25bb2856bc62951844d9dab5ea97990 Mon Sep 17 00:00:00 2001 From: Sergej Pupykin Date: Sat, 13 Aug 2011 00:23:36 +0400 Subject: add "search wiki" link to package details page Dan: fix usage of urlencode() function. Signed-off-by: Dan McGee --- packages/templatetags/package_extras.py | 8 ++++++++ templates/packages/details.html | 1 + 2 files changed, 9 insertions(+) diff --git a/packages/templatetags/package_extras.py b/packages/templatetags/package_extras.py index 7bc868de..e4c7a010 100644 --- a/packages/templatetags/package_extras.py +++ b/packages/templatetags/package_extras.py @@ -72,6 +72,14 @@ def svn_arch(package): def svn_trunk(package): return svn_link(package, "trunk") +@register.simple_tag +def get_wiki_link(package): + data = { + 'search': package.pkgname, + } + return "https://wiki.archlinux.org/index.php/Special:Search?%s" % \ + urlencode(data) + @register.simple_tag def bugs_list(package): data = { diff --git a/templates/packages/details.html b/templates/packages/details.html index a3f2cef4..bec4bdff 100644 --- a/templates/packages/details.html +++ b/templates/packages/details.html @@ -18,6 +18,7 @@
        • SVN Entries ({{pkg.repo|lower}}-{{pkg.arch}})
        • SVN Entries (trunk)
        • +
        • Search Wiki
        • Bug Reports
        • Report a Bug
        • {% if pkg.flag_date %} -- cgit v1.2.3-2-g168b From f5b5c59b3c2e2aed161bc71a0e26cdeb59055a11 Mon Sep 17 00:00:00 2001 From: Evangelos Foutras Date: Sat, 13 Aug 2011 17:25:51 +0300 Subject: Update README to use virtualenv2 (FS#25520) Signed-off-by: Dan McGee --- README | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/README b/README index 184d1c8a..0d3ee082 100644 --- a/README +++ b/README @@ -14,8 +14,8 @@ See AUTHORS file. # Dependencies -- python -- python-virtualenv +- python2 +- python2-virtualenv # Python dependencies @@ -31,13 +31,13 @@ packages, you will probably want the following: # Testing Installation -1. Run `virtualenv`. +1. Run `virtualenv2`. - $ cd /path/to/archweb && virtualenv ../archweb-env + $ cd /path/to/archweb && virtualenv2 ../archweb-env -2. Source the virtualenv. +2. Activate the virtualenv. - $ . ../archweb-env/bin/activate + $ source ../archweb-env/bin/activate 2. Install dependencies through `pip`. @@ -58,7 +58,7 @@ packages, you will probably want the following: provided data, adjust the file glob accordingly. (archweb-env) $ ./manage.py loaddata */fixtures/*.json - + 7. Use the following commands to start a service instance (archweb-env) $ ./manage.py runserver @@ -69,7 +69,8 @@ packages, you will probably want the following: (archweb-env) $ ./manage.py reporead i686 core.db.tar.gz (archweb-env) $ ./manage.py syncisos -Alter architecture and repo to get x86\_64 and packages from other repos if needed. +Alter architecture and repo to get x86\_64 and packages from other repos if +needed. # Production Installation -- cgit v1.2.3-2-g168b From 8e1cae30596e48bfcc958dcd840c09b4cb8987ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20B=C3=A4chler?= Date: Sun, 14 Aug 2011 16:32:35 +0200 Subject: templates/flag.html: Improve the note about bug reports. There are tons of morons out there who are not able to read. Thus, I keep getting bug reports via the "flag out of date" feature. This patch removes all occurrences of "please" from the note and adds a new sentence that explains our ignorance properly. The hint to file a bug report is now longer, so idiots might see it. Dan: add one more line in the early text. Signed-off-by: Dan McGee --- templates/packages/flag.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/templates/packages/flag.html b/templates/packages/flag.html index 261d6066..34dfe34e 100644 --- a/templates/packages/flag.html +++ b/templates/packages/flag.html @@ -10,7 +10,7 @@

          If you notice a package is out-of-date (i.e., there is a newer stable release available), then please notify us using - the form below.

          + the form below. Do not report bugs via this form!

          Note that all of the following packages will be marked out of date:

            @@ -26,9 +26,10 @@ title="Visit the arch-general mailing list">arch-general mailing list with your additional text.

            -

            Note: Please do not use this facility if the - package is broken! Please file a bug instead.

            +

            Note: Do not use this facility if the + package is broken! The package will be unflagged and the report will be ignored! + Use the + bugtracker to file a bug instead.

            Please confirm your flag request for {{package.pkgname}}:

            -- cgit v1.2.3-2-g168b From a06ab5c1eb2053d33e15244ea579875aa72c0c1f Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 16 Aug 2011 15:35:59 -0500 Subject: Tabs -> spaces in templates Signed-off-by: Dan McGee --- templates/packages/search.html | 12 ++++++------ templates/public/about.html | 2 +- templates/public/index.html | 4 ++-- templates/public/svn.html | 18 +++++++++--------- templates/registration/logout.html | 2 +- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/templates/packages/search.html b/templates/packages/search.html index eb4aceca..8a357024 100644 --- a/templates/packages/search.html +++ b/templates/packages/search.html @@ -153,12 +153,12 @@ {% else %}
            -

            We couldn't find any packages matching your query. Try searching again - using different criteria, or try - {% if search_form.q.data %} - searching the AUR - {% else %}searching the AUR{% endif %} - to see if the package can be found there.

            +

            We couldn't find any packages matching your query. Try searching again + using different criteria, or try + {% if search_form.q.data %} + searching the AUR + {% else %}searching the AUR{% endif %} + to see if the package can be found there.

            {% endif %} diff --git a/templates/public/about.html b/templates/public/about.html index 0e0601e8..bf38e8a1 100644 --- a/templates/public/about.html +++ b/templates/public/about.html @@ -3,7 +3,7 @@ {% block content %}

            About Arch Linux

            -

            +

            Arch Linux is an independently developed, i686/x86-64 general purpose GNU/Linux distribution versatile enough to suit any role. Development focuses on simplicity, minimalism, and code elegance. Arch is installed as a diff --git a/templates/public/index.html b/templates/public/index.html index add921d1..e68943c8 100644 --- a/templates/public/index.html +++ b/templates/public/index.html @@ -82,7 +82,7 @@ {% for update in pkg_updates %} {{ update.pkgbase }} {{ update.version }} - + {% for pkg in update.package_links %}{{ pkg.arch }}{% if not forloop.last %}/{% endif %}{% endfor %} @@ -161,7 +161,7 @@ title="Developer Wiki articles">DeveloperWiki

          • Todo Lists
          • -
          • Releng Testbuild Feedback
          diff --git a/templates/public/svn.html b/templates/public/svn.html index dd175bcc..aedd9a73 100644 --- a/templates/public/svn.html +++ b/templates/public/svn.html @@ -7,25 +7,25 @@ The PKGBUILD files can be fetched via the ABS utility. To learn more about ABS, see the ABS wiki page.

          -

          The SVN repositories have been cloned into git repositories and can be - viewed via the cgit interface. - All - packages are available here except for - community - and multilib which are available in a different repository.

          +

          The SVN repositories have been cloned into git repositories and can be + viewed via the cgit interface. + All + packages are available here except for + community + and multilib which are available in a different repository.

          You can also get individual PKGBUILDs directly from SVN. This can be especially useful if you need to compile an older version of a package. DO NOT CHECK OUT THE ENTIRE SVN REPO. Your address may be blocked. Use the following commands to check out a specific package: -

          +

          svn checkout --depth=empty svn://svn.archlinux.org/packages
           cd packages
           svn update <your-package-name>
          - For the community and multilib repositories, use the following commands - instead: + For the community and multilib repositories, use the following commands + instead:
          svn checkout --depth=empty svn://svn.archlinux.org/community
           cd community
           svn update <your-package-name>
          diff --git a/templates/registration/logout.html b/templates/registration/logout.html index e890ce99..50b3574b 100644 --- a/templates/registration/logout.html +++ b/templates/registration/logout.html @@ -5,7 +5,7 @@

          Developer Logout

          -

          Logout was successful.

          +

          Logout was successful.

          {% endblock %} -- cgit v1.2.3-2-g168b From a4895f06680beaf447ed43ee326423fcc8232815 Mon Sep 17 00:00:00 2001 From: Olivier Keun Date: Fri, 22 Jul 2011 16:25:57 +0200 Subject: News frontpage layout changes Signed-off-by: Dan McGee --- media/archweb.css | 21 ++++++++++++++++----- public/views.py | 2 +- templates/public/index.html | 31 +++++++++++++++++++++++++++---- 3 files changed, 44 insertions(+), 10 deletions(-) diff --git a/media/archweb.css b/media/archweb.css index 85fdb610..ce1ece1d 100644 --- a/media/archweb.css +++ b/media/archweb.css @@ -21,7 +21,7 @@ p { margin: .33em 0 1em; } ol, ul { margin-bottom: 1em; padding-left: 2em; } ul { list-style: square; } code { font: 1.2em monospace; background: #ffd; padding: 0.15em 0.25em; } -pre { font: 1.2em monospace; border: 1px solid #bdb; background: #dfd; padding: 0.5em; margin: 0.25em 2em; } +pre { font: 1.2em monospace; border: 1px solid #bdb; background: #dfd; padding: 0.5em; margin: 1em; } pre code { display: block; background: none; } blockquote { margin: 1.5em 2em; } input { vertical-align: middle; } @@ -44,7 +44,7 @@ a:active { color: #e90; } /* headings */ h2 { font-size: 1.5em; margin-bottom: 0.5em; border-bottom: 1px solid #888; } -h3 { font-size: 1.25em; margin-top: 1em; } +h3 { font-size: 1.25em; margin-top: .5em; } h4 { font-size: 1.15em; margin-top: 1em; } h5 { font-size: 1em; margin-top: 1em; } @@ -76,6 +76,12 @@ table.pretty2 { width: auto; margin-top: 0.25em; margin-bottom: 0.5em; border-co table.pretty2 th { padding: 0.35em; background: #eee; border: 1px solid #bbb; } table.pretty2 td { padding: 0.35em; border: 1px dotted #bbb; } +/* definition lists */ +dl { clear:both; } +dl dt, +dl dd { margin-bottom:4px; padding: 8px 0px 4px; font-weight:bold; border-top:1px solid #888; } +dl dt { color: #333; float:left; padding-right:15px; } + /* forms and input styling */ form p { margin: 0.5em 0; } fieldset { border: 0; } @@ -105,14 +111,19 @@ ul.errorlist { color: red; } /* home: news */ #news { margin-top: 1.5em; } -#news h3 { border-bottom: 1px solid #888; } +#news h3 { float:left; padding-bottom: .5em } #news div { margin-bottom: 1em; } #news div p { margin-bottom: 0.5em; } #news .more { font-weight: normal; } -#news .rss-icon { float: right; margin: -1.6em 0.4em 0 0; } -#news h4 { font-size: 1em; margin-top: 1.5em; border-bottom: 1px dotted #bbb; } +#news .rss-icon { float: right; margin-top: 1em; } +#news h4 { clear:both; font-size: 1em; margin-top: 1.5em; border-bottom: 1px dotted #bbb; } #news .timestamp { float: right; font-size: 0.85em; margin: -1.8em 0.5em 0 0; } +/* home: arrowed headings */ +#news h3 a { display: block; background: #1794D1; font-size: 15px; padding: 2px 10px; color: white; } +#news a:active { color: white; } +h3 span.arrow { display: block; width: 0px; height: 0px; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 6px solid #1794D1; margin: 0 auto; font-size: 0px; line-height: 0px; } + /* home: pkgsearch box */ #pkgsearch { padding: 1em 0.75em; background: #3ad; color: #fff; border: 1px solid #08b; } #pkgsearch label { width: auto; padding: 0.1em 0; } diff --git a/public/views.py b/public/views.py index 46291b88..e3f3b02f 100644 --- a/public/views.py +++ b/public/views.py @@ -13,7 +13,7 @@ from django.views.generic.simple import direct_to_template def index(request): pkgs = utils.get_recent_updates() context = { - 'news_updates': News.objects.order_by('-postdate', '-id')[:10], + 'news_updates': News.objects.order_by('-postdate', '-id')[:15], 'pkg_updates': pkgs, } return direct_to_template(request, 'public/index.html', context) diff --git a/templates/public/index.html b/templates/public/index.html index e68943c8..c8b6def0 100644 --- a/templates/public/index.html +++ b/templates/public/index.html @@ -40,17 +40,40 @@
          -

          Latest News (more)

          +

          + Latest News + +

          RSS Feed {% for news in news_updates %} -

          {{ news.title }}

          + {% if forloop.counter0 < 5 %} +

          + {{ news.title }} +

          {{ news.postdate|date }}

          {{ news.content|markdown|truncatewords_html:75 }}
          + {% else %} + {% if forloop.counter0 == 5 %} +

          + Older News + +

          +
          + {% endif %} +
          {{ news.postdate|date }}
          +
          + {{ news.title }} +
          + {% if forloop.last %} +
          + {% endif %} + {% endif %} {% endfor %}
          -- cgit v1.2.3-2-g168b From c35e8b867c619a4191b5ab93fa1653cc9847e9e7 Mon Sep 17 00:00:00 2001 From: Olivier Keun Date: Mon, 25 Jul 2011 22:34:26 +0200 Subject: Clean up and reformat default stylesheet Signed-off-by: Dan McGee --- media/archweb.css | 1017 +++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 835 insertions(+), 182 deletions(-) diff --git a/media/archweb.css b/media/archweb.css index ce1ece1d..be455680 100644 --- a/media/archweb.css +++ b/media/archweb.css @@ -13,273 +13,926 @@ @import url('archnavbar/archnavbar.css'); /* simple reset */ -* { margin: 0; padding: 0; line-height: 1.4; } +* { + margin: 0; + padding: 0; + line-height: 1.4; +} /* general styling */ -body { min-width: 650px; background: #f6f9fc; color: #222; font: normal 100% sans-serif; text-align: center; } -p { margin: .33em 0 1em; } -ol, ul { margin-bottom: 1em; padding-left: 2em; } -ul { list-style: square; } -code { font: 1.2em monospace; background: #ffd; padding: 0.15em 0.25em; } -pre { font: 1.2em monospace; border: 1px solid #bdb; background: #dfd; padding: 0.5em; margin: 1em; } -pre code { display: block; background: none; } -blockquote { margin: 1.5em 2em; } -input { vertical-align: middle; } -select[multiple] { padding-top: 1px; padding-bottom: 1px; } -select[multiple] option { padding-left: 0.3em; padding-right: 0.5em; } -input[type=submit] { padding-left: 0.6em; padding-right: 0.6em; } -.clear { clear: both; } -hr { border: none; border-top: 1px solid #888; } -img { border: 0; } +body { + min-width: 650px; + background: #f6f9fc; + color: #222; + font: normal 100% sans-serif; + text-align: center; +} + +p { + margin: .33em 0 1em; +} + +ol, +ul { + margin-bottom: 1em; + padding-left: 2em; +} + + ul { + list-style: square; + } + +code { + font: 1.2em monospace; + background: #ffd; + padding: 0.15em 0.25em; +} + +pre { + font: 1.2em monospace; + border: 1px solid #bdb; + background: #dfd; + padding: 0.5em; + margin: 1em; +} + + pre code { + display: block; + background: none; + } + +blockquote { + margin: 1.5em 2em; +} + +input { + vertical-align: middle; +} + +select[multiple] { + padding: 1px 0; +} + + select[multiple] option { + padding: 0 0.5em 0 0.3em; + } + +input[type=submit] { + padding-left: 0 0.6em; +} + +.clear { + clear: both; +} + +hr { + border: none; + border-top: 1px solid #888; +} + +img { + border: 0; +} /* scale fonts down to a sane default (16 * .812 = 13px) */ -#content { font-size: 0.812em; } +#content { + font-size: 0.812em; +} /* link style */ -a { text-decoration: none; } -a:link, th a:visited { color: #07b; } -a:visited { color: #666; } -a:hover { text-decoration: underline; color: #666; } -a:active { color: #e90; } +a { + text-decoration: none; +} + + a:link, + th a:visited { + color: #07b; + } + + a:visited { + color: #666; + } + + a:hover { + text-decoration: underline; + color: #666; + } + + a:active { + color: #e90; + } /* headings */ -h2 { font-size: 1.5em; margin-bottom: 0.5em; border-bottom: 1px solid #888; } -h3 { font-size: 1.25em; margin-top: .5em; } -h4 { font-size: 1.15em; margin-top: 1em; } -h5 { font-size: 1em; margin-top: 1em; } +h2 { + font-size: 1.5em; + margin-bottom: 0.5em; + border-bottom: 1px solid #888; +} + +h3 { + font-size: 1.25em; + margin-top: .5em; +} + +h4 { + font-size: 1.15em; + margin-top: 1em; +} + +h5 { + font-size: 1em; + margin-top: 1em; +} /* general layout */ -div#content { width: 95%; margin: 0 auto; text-align: left; } -div#content-left-wrapper { float: left; width: 100%; } /* req to keep content above sidebar in source code */ -div#content-left { margin: 0 340px 0 0; } -div#content-right { float: left; width: 300px; margin-left: -300px; } -div.box { margin-bottom: 1.5em; padding: 0.65em; background: #ecf2f5; border: 1px solid #bcd; } -div#footer { clear: both; margin: 2em 0 1em; } -div#footer p { margin: 0; text-align: center; font-size: 0.85em; } +div#content { + width: 95%; + margin: 0 auto; + text-align: left; +} + +div#content-left-wrapper { + float: left; + width: 100%; /* req to keep content above sidebar in source code */ +} + +div#content-left { + margin: 0 340px 0 0; +} + +div#content-right { + float: left; + width: 300px; + margin-left: -300px; +} + +div.box { + margin-bottom: 1.5em; + padding: 0.65em; + background: #ecf2f5; + border: 1px solid #bcd; +} + +div#footer { + clear: both; + margin: 2em 0 1em; +} + + div#footer p { + margin: 0; + text-align: center; + font-size: 0.85em; + } /* alignment */ -div.center, table.center, img.center { width: auto; margin-left: auto; margin-right: auto; } -p.center, td.center, th.center { text-align: center; } +div.center, +table.center, +img.center { + width: auto; + margin-left: auto; + margin-right: auto; +} + +p.center, +td.center, +th.center { + text-align: center; +} /* table generics */ -table { width: 100%; border-collapse: collapse; } -table .wrap { white-space: normal; } -th, td { white-space: nowrap; text-align: left; } -th { vertical-align: middle; font-weight: bold; } -td { vertical-align: top; } +table { + width: 100%; + border-collapse: collapse; +} + + table .wrap { + white-space: normal; + } + +th, +td { + white-space: nowrap; + text-align: left; +} + + th { + vertical-align: middle; + font-weight: bold; + } + + td { + vertical-align: top; + } /* table pretty styles */ -table.pretty1 { width: auto; margin-top: 0.25em; margin-bottom: 0.5em; border-collapse: collapse; border: 1px solid #bcd; } -table.pretty1 th { padding: 0.35em; background: #e4eeff; border: 1px solid #bcd; } -table.pretty1 td { padding: 0.35em; border: 1px dotted #bcd; } -table.pretty2 { width: auto; margin-top: 0.25em; margin-bottom: 0.5em; border-collapse: collapse; border: 1px solid #bbb; } -table.pretty2 th { padding: 0.35em; background: #eee; border: 1px solid #bbb; } -table.pretty2 td { padding: 0.35em; border: 1px dotted #bbb; } +table.pretty1 { + width: auto; + margin-top: 0.25em; + margin-bottom: 0.5em; + border-collapse: collapse; + border: 1px solid #bcd; +} + + table.pretty1 th { + padding: 0.35em; + background: #e4eeff; + border: 1px solid #bcd; + } + + table.pretty1 td { + padding: 0.35em; + border: 1px dotted #bcd; + } + +table.pretty2 { + width: auto; + margin-top: 0.25em; + margin-bottom: 0.5em; + border-collapse: collapse; + border: 1px solid #bbb; +} + + table.pretty2 th { + padding: 0.35em; + background: #eee; + border: 1px solid #bbb; + } + + table.pretty2 td { + padding: 0.35em; + border: 1px dotted #bbb; + } /* definition lists */ -dl { clear:both; } -dl dt, -dl dd { margin-bottom:4px; padding: 8px 0px 4px; font-weight:bold; border-top:1px solid #888; } -dl dt { color: #333; float:left; padding-right:15px; } +dl { + clear: both; +} + + dl dt, + dl dd { + margin-bottom: 4px; + padding: 8px 0px 4px; + font-weight: bold; + border-top: 1px solid #888; + } + + dl dt { + color: #333; + float:left; + padding-right:15px; + } /* forms and input styling */ -form p { margin: 0.5em 0; } -fieldset { border: 0; } -label { width: 12em; vertical-align: top; display: inline-block; font-weight: bold; } -input[type=text], input[type=password], textarea { padding: 0.10em; } -form.general-form label, form.general-form .form-help { width: 10em; vertical-align: top; display: inline-block; } -form.general-form input[type=text], form.general-form textarea { width: 45%; } +form p { + margin: 0.5em 0; +} + +fieldset { + border: 0; +} + +label { + width: 12em; + vertical-align: top; + display: inline-block; + font-weight: bold; +} + +input[type=text], +input[type=password], +textarea { + padding: 0.10em; +} + +form.general-form label, +form.general-form .form-help { + width: 10em; + vertical-align: top; + display: inline-block; +} + +form.general-form input[type=text], +form.general-form textarea { + width: 45%; +} /* archdev navbar */ -div#archdev-navbar { margin: 1.5em 0; } -div#archdev-navbar ul { list-style: none; margin: -0.5em 0; padding: 0; } -div#archdev-navbar li { display: inline; margin: 0; padding: 0; font-size: 0.9em; } -div#archdev-navbar li a { padding: 0 0.5em; color: #07b; } +div#archdev-navbar { + margin: 1.5em 0; +} + + div#archdev-navbar ul { + list-style: none; + margin: -0.5em 0; + padding: 0; + } + + div#archdev-navbar li { + display: inline; + margin: 0; + padding: 0; + font-size: 0.9em; + } + + div#archdev-navbar li a { + padding: 0 0.5em; + color: #07b; + } /* error/info messages (x pkg is already flagged out-of-date, etc) */ -#sys-message { width: 35em; text-align: center; margin: 1em auto; padding: 0.5em; background: #fff; border: 1px solid #f00; } -#sys-message p { margin: 0; } - -ul.errorlist { color: red; } - -/* +#sys-message { + width: 35em; + text-align: center; + margin: 1em auto; + padding: 0.5em; + background: #fff; + border: 1px solid #f00; +} + + #sys-message p { + margin: 0; + } + +ul.errorlist { + color: red; +} + +/** * PAGE SPECIFIC STYLES */ /* home: introduction */ -#intro p.readmore { margin: -0.5em 0 0 0; font-size: .9em; text-align: right; } +#intro p.readmore { + margin: -0.5em 0 0 0; + font-size: .9em; + text-align: right; +} /* home: news */ -#news { margin-top: 1.5em; } -#news h3 { float:left; padding-bottom: .5em } -#news div { margin-bottom: 1em; } -#news div p { margin-bottom: 0.5em; } -#news .more { font-weight: normal; } -#news .rss-icon { float: right; margin-top: 1em; } -#news h4 { clear:both; font-size: 1em; margin-top: 1.5em; border-bottom: 1px dotted #bbb; } -#news .timestamp { float: right; font-size: 0.85em; margin: -1.8em 0.5em 0 0; } +#news { + margin-top: 1.5em; +} + + #news h3 { + float: left; + padding-bottom: .5em + } + + #news div { + margin-bottom: 1em; + } + + #news div p { + margin-bottom: 0.5em; + } + + #news .more { + font-weight: normal; + } + + #news .rss-icon { + float: right; + margin-top: 1em; + } + + #news h4 { + clear: both; + font-size: 1em; + margin-top: 1.5em; + border-bottom: 1px dotted #bbb; + } + + #news .timestamp { + float: right; + font-size: 0.85em; + margin: -1.8em 0.5em 0 0; + } /* home: arrowed headings */ -#news h3 a { display: block; background: #1794D1; font-size: 15px; padding: 2px 10px; color: white; } -#news a:active { color: white; } -h3 span.arrow { display: block; width: 0px; height: 0px; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 6px solid #1794D1; margin: 0 auto; font-size: 0px; line-height: 0px; } +#news h3 a { + display: block; + background: #1794D1; + font-size: 15px; + padding: 2px 10px; + color: white; +} + + #news a:active { + color: white; + } + +h3 span.arrow { + display: block; + width: 0px; + height: 0px; + border-left: 6px solid transparent; + border-right: 6px solid transparent; + border-top: 6px solid #1794D1; + margin: 0 auto; + font-size: 0px; + line-height: 0px; +} /* home: pkgsearch box */ -#pkgsearch { padding: 1em 0.75em; background: #3ad; color: #fff; border: 1px solid #08b; } -#pkgsearch label { width: auto; padding: 0.1em 0; } -#pkgsearch input { width: 10em; float: right; font-size: 1em; color: #000; background: #fff; border: 1px solid #09c; } +#pkgsearch { + padding: 1em 0.75em; + background: #3ad; + color: #fff; + border: 1px solid #08b; +} + + #pkgsearch label { + width: auto; + padding: 0.1em 0; + } + + #pkgsearch input { + width: 10em; + float: right; + font-size: 1em; + color: #000; + background: #fff; + border: 1px solid #09c; + } /* home: recent pkg updates */ -#pkg-updates h3 { margin: 0 0 0.3em; } -#pkg-updates .more { font-weight: normal; } -#pkg-updates .rss-icon { float: right; margin: -2em 0 0 0; } -#pkg-updates table { margin: 0; } -#pkg-updates td.pkg-name { white-space: normal; } -#pkg-updates td.pkg-arch { text-align: right; } -#pkg-updates span.testing, #pkg-updates span.community-testing, span.multilib-testing { font-style: italic; } -#pkg-updates span.staging, #pkg-updates span.community-staging, span.multilib-staging { font-style: italic; color: #ff8040; } +#pkg-updates h3 { + margin: 0 0 0.3em; +} + + #pkg-updates .more { + font-weight: normal; + } + + #pkg-updates .rss-icon { + float: right; + margin: -2em 0 0 0; + } + + #pkg-updates table { + margin: 0; + } + + #pkg-updates td.pkg-name { + white-space: normal; + } + + #pkg-updates td.pkg-arch { + text-align: right; + } + + #pkg-updates span.testing, + #pkg-updates span.community-testing, + span.multilib-testing { + font-style: italic; + } + + #pkg-updates span.staging, + #pkg-updates span.community-staging, + span.multilib-staging { + font-style: italic; + color: #ff8040; + } /* home: sidebar navigation */ -div#nav-sidebar ul { list-style: none; margin: 0.5em 0 0.5em 1em; padding: 0; } +div#nav-sidebar ul { + list-style: none; + margin: 0.5em 0 0.5em 1em; + padding: 0; +} /* home: sponsor banners */ -div#arch-sponsors img { padding: 0.3em 0; } +div#arch-sponsors img { + padding: 0.3em 0; +} /* home: sidebar components (navlist, sponsors, pkgsearch, etc) */ -div.widget { margin-bottom: 1.5em; } +div.widget { + margin-bottom: 1.5em; +} /* feeds page */ -#rss-feeds .rss { padding-right: 20px; background: url(rss.png) top right no-repeat; } +#rss-feeds .rss { + padding-right: 20px; + background: url(rss.png) top right no-repeat; +} /* artwork: logo images */ -#artwork img.inverted { background: #333; padding: 0; } -#artwork div.imagelist img { display: inline; margin: 0.75em; } +#artwork img.inverted { + background: #333; + padding: 0; +} + +#artwork div.imagelist img { + display: inline; + margin: 0.75em; +} /* news: article list */ -.news-nav { float: right; margin-top: -2.2em; } -.news-nav .prev, .news-nav .next { margin-left: 1em; margin-right: 1em; } +.news-nav { + float: right; + margin-top: -2.2em; +} + + .news-nav .prev, + .news-nav .next { + margin: 0 1em; + } /* news: article pages */ -div.news-article .article-info { margin: 0; color: #999; } +div.news-article .article-info { + margin: 0; + color: #999; +} /* news: add/edit article */ -form#newsform { width: 60em; } -form#newsform input[type=text], form#newsform textarea { width: 75%; } +form#newsform { + width: 60em; +} + + form#newsform input[type=text], + form#newsform textarea { + width: 75%; + } /* donate: donor list */ -div#donor-list ul { width: 100%; } -/* max 4 columns, but possibly fewer if screen size doesn't allow for more */ -div#donor-list li { float: left; width: 25%; min-width: 20em; } +div#donor-list ul { + width: 100%; +} + /* max 4 columns, but possibly fewer if screen size doesn't allow for more */ + div#donor-list li { + float: left; + width: 25%; + min-width: 20em; + } /* download page */ -#arch-downloads h3 { border-bottom: 1px dotted #aaa; } -table#download-torrents .cpu-arch { text-align: center; } -table#download-mirrors { width: auto; margin-bottom: 1em; } -table#download-mirrors td.mirror-country { padding-top: 1em; } -table#download-mirrors td.mirror-server { padding-right: 1em; } -table#download-mirrors a { display: block; float: right; width: 4em; } +#arch-downloads h3 { + border-bottom: 1px dotted #aaa; +} + +table#download-torrents .cpu-arch { + text-align: center; +} + +table#download-mirrors { + width: auto; + margin-bottom: 1em; +} + + table#download-mirrors td.mirror-country { + padding-top: 1em; + } + + table#download-mirrors td.mirror-server { + padding-right: 1em; + } + + table#download-mirrors a { + display: block; + float: right; + width: 4em; + } /* pkglists/devlists */ -table.results { font-size: 0.846em; border-top: 1px dotted #999; border-bottom: 1px dotted #999; } -table.results th { padding: 0.5em 1em 0.25em 0.25em; border-bottom: 1px solid #999; white-space: nowrap; background-color:#fff; } -table.results td { padding: .3em 1em .3em 3px; } -table.results tr.odd { background: #fff; } -table.results tr.even { background: #e4eeff; } -/* additional styles for JS sorting */ -table.results th.header { padding-right: 20px; background-image: url(nosort.gif); background-repeat: no-repeat; background-position: center right; cursor: pointer; } -table.results th.headerSortDown { background-color: #e4eeff; background-image: url(desc.gif); } -table.results th.headerSortUp { background-color: #e4eeff; background-image: url(asc.gif); } -table.results .flagged { color: red; } +table.results { + font-size: 0.846em; + border-top: 1px dotted #999; + border-bottom: 1px dotted #999; +} + + table.results th { + padding: 0.5em 1em 0.25em 0.25em; + border-bottom: 1px solid #999; + white-space: nowrap; + background-color:#fff; + } + + /* additional styles for JS sorting */ + table.results th.header { + padding-right: 20px; + background-image: url(nosort.gif); + background-repeat: no-repeat; + background-position: center right; + cursor: pointer; + } + + table.results th.headerSortDown { + background-color: #e4eeff; + background-image: url(desc.gif); + } + + table.results th.headerSortUp { + background-color: #e4eeff; + background-image: url(asc.gif); + } + + table.results td { + padding: .3em 1em .3em 3px; + } + + table.results tr.odd { + background: #fff; + } + + table.results tr.even { + background: #e4eeff; + } + + table.results .flagged { + color: red; + } /* pkglist: layout */ -div#pkglist-about { margin-top: 1.5em; } +div#pkglist-about { + margin-top: 1.5em; +} /* pkglist: results navigation */ -#pkglist-stats-top, #pkglist-stats-bottom { font-size: 0.85em; } -#pkglist-results .pkglist-nav { float: right; margin-top: -2.2em; } -.pkglist-nav .prev { margin-right: 1em; } -.pkglist-nav .next { margin-right: 1em; } +#pkglist-stats-top, +#pkglist-stats-bottom { + font-size: 0.85em; +} + +#pkglist-results .pkglist-nav { + float: right; + margin-top: -2.2em; +} + +.pkglist-nav .prev { + margin-right: 1em; +} + +.pkglist-nav .next { + margin-right: 1em; +} /* search fields and other filter selections */ -.filter-criteria h3 { font-size: 1em; margin-top:0; } -.filter-criteria div { float: left; margin-right: 1.65em; font-size: 0.85em; } -.filter-criteria legend { display: none; } -.filter-criteria label { width: auto; display: block; font-weight: normal; } +.filter-criteria h3 { + font-size: 1em; + margin-top:0; +} + +.filter-criteria div { + float: left; + margin-right: 1.65em; + font-size: 0.85em; +} + +.filter-criteria legend { + display: none; +} + +.filter-criteria label { + width: auto; + display: block; + font-weight: normal; +} /* pkgdetails: details links that float on the right */ -#pkgdetails #detailslinks { float: right; } -#pkgdetails #detailslinks h4 { margin-top: 0; margin-bottom: 0.25em; } -#pkgdetails #detailslinks ul { list-style: none; padding: 0; margin-bottom: 0; font-size: 0.846em; } -#pkgdetails #detailslinks > div { padding: 0.5em; margin-bottom: 1em; background: #eee; border: 1px solid #bbb; } -#pkgdetails #actionlist .flagged { color: red; font-size: 0.9em; font-style: italic; } +#pkgdetails #detailslinks { + float: right; +} + + #pkgdetails #detailslinks h4 { + margin-top: 0; + margin-bottom: 0.25em; + } + + #pkgdetails #detailslinks ul { + list-style: none; + padding: 0; + margin-bottom: 0; + font-size: 0.846em; + } + + #pkgdetails #detailslinks > div { + padding: 0.5em; + margin-bottom: 1em; + background: #eee; + border: 1px solid #bbb; + } + +#pkgdetails #actionlist .flagged { + color: red; + font-size: 0.9em; + font-style: italic; +} /* pkgdetails: pkg info */ -#pkgdetails #pkginfo { width: auto; } -#pkgdetails #pkginfo td { padding: 0.25em 0 0.25em 1.5em; } +#pkgdetails #pkginfo { + width: auto; +} + + #pkgdetails #pkginfo td { + padding: 0.25em 0 0.25em 1.5em; + } /* pkgdetails: flag package */ -form#flag-pkg-form label { width: 10em; } -form#flag-pkg-form textarea, form#flag-pkg-form input[type=text] { width: 45%; } +form#flag-pkg-form label { + width: 10em; +} + +form#flag-pkg-form textarea, +form#flag-pkg-form input[type=text] { + width: 45%; +} /* pkgdetails: deps, required by and file lists */ -#pkgdetails #metadata h3 { background: #555; color: #fff; font-size: 1em; margin-bottom: 0.5em; padding: 0.2em 0.35em; } -#pkgdetails #metadata ul { list-style: none; margin: 0; padding: 0; } -#pkgdetails #metadata li { padding-left: 0.5em; } -#pkgdetails #metadata p { padding-left: 0.5em; } -#pkgdetails #metadata .message { font-style: italic; } -#pkgdetails #metadata br { clear: both; } -#pkgdetails #pkgdeps { float: left; width: 48%; margin-right: 2%; } -#pkgdetails #metadata .virtual-dep { font-style: italic; } -#pkgdetails #metadata .testing-dep { font-style: italic; } -#pkgdetails #metadata .opt-dep { font-style: italic; } -#pkgdetails #metadata .dep-desc { font-style: italic; } -#pkgdetails #pkgreqs { float: left; width: 50%; } -#pkgdetails #pkgfiles { clear: left; padding-top: 1em; } +#pkgdetails #metadata h3 { + background: #555; + color: #fff; + font-size: 1em; + margin-bottom: 0.5em; + padding: 0.2em 0.35em; +} + +#pkgdetails #metadata ul { + list-style: none; + margin: 0; + padding: 0; +} + +#pkgdetails #metadata li { + padding-left: 0.5em; +} + +#pkgdetails #metadata p { + padding-left: 0.5em; +} + +#pkgdetails #metadata .message { + font-style: italic; +} + +#pkgdetails #metadata br { + clear: both; +} + +#pkgdetails #pkgdeps { + float: left; + width: 48%; + margin-right: 2%; +} + +#pkgdetails #metadata .virtual-dep, +#pkgdetails #metadata .testing-dep, +#pkgdetails #metadata .opt-dep, +#pkgdetails #metadata .dep-desc { + font-style: italic; +} +#pkgdetails #pkgreqs { + float: left; + width: 50%; +} + +#pkgdetails #pkgfiles { + clear: left; + padding-top: 1em; +} /* dev/TU biographies */ -div#arch-bio-toc { width: 75%; margin: 0 auto; text-align: center; } -table.arch-bio-entry td.pic { vertical-align: top; padding-right: 15px; padding-top: 10px; } -table.arch-bio-entry td.pic img { padding: 4px; border: 1px solid #ccc; } -table.arch-bio-entry table.bio { margin-bottom: 2em; } -table.arch-bio-entry table.bio th { text-align: left; padding-right: 0.5em; vertical-align: top; white-space: nowrap; } -table.arch-bio-entry table.bio td { width: 100%; padding-bottom: 0.25em; } +div#arch-bio-toc { + width: 75%; + margin: 0 auto; + text-align: center; +} + +table.arch-bio-entry td.pic { + vertical-align: top; + padding-right: 15px; + padding-top: 10px; +} + + table.arch-bio-entry td.pic img { + padding: 4px; + border: 1px solid #ccc; + } + +table.arch-bio-entry table.bio { + margin-bottom: 2em; +} + + table.arch-bio-entry table.bio th { + text-align: left; + padding-right: 0.5em; + vertical-align: top; + white-space: nowrap; + } + + table.arch-bio-entry table.bio td { + width: 100%; + padding-bottom: 0.25em; + } /* dev: login/out */ -p.login-error {} -table#dev-login { width: auto; } +table#dev-login { + width: auto; +} /* dev dashboard: flagged packages */ -form#dash-pkg-notify { text-align: right; padding: 1em 0 0; margin-top: 1em; font-size: 0.85em; border-top: 1px dotted #aaa; } -form#dash-pkg-notify label { width: auto; font-weight: normal; } -form#dash-pkg-notify input { vertical-align: middle; margin: 0 0.25em; } -form#dash-pkg-notify input[type=submit] { margin-top: -0.25em; } -form#dash-pkg-notify p { margin: 0; } - -table.dash-stats .key { width: 50%; } +form#dash-pkg-notify { + text-align: right; + padding: 1em 0 0; + margin-top: 1em; + font-size: 0.85em; + border-top: 1px dotted #aaa; +} + + form#dash-pkg-notify label { + width: auto; + font-weight: normal; + } + + form#dash-pkg-notify input { + vertical-align: middle; + margin: 0 0.25em; + } + + form#dash-pkg-notify input[type=submit] { + margin-top: -0.25em; + } + + form#dash-pkg-notify p { + margin: 0; + } + +table.dash-stats .key { + width: 50%; +} /* dev dashboard: admin actions (add news items, todo list, etc) */ -ul.admin-actions { float: right; list-style: none; margin-top: -2.5em; } -ul.admin-actions li { display: inline; padding-left: 1.5em; } +ul.admin-actions { + float: right; + list-style: none; + margin-top: -2.5em; +} + + ul.admin-actions li { + display: inline; + padding-left: 1.5em; + } /* todo lists (public and private) */ -.todo-table .complete { color: green; } -.todo-table .incomplete { color: red; } -.todo-info { margin: 0; color: #999; } -.todo-list h4 { margin-top: 0; margin-bottom: 0.4em; } +.todo-table .complete { + color: green; +} + +.todo-table .incomplete { + color: red; +} +.todo-info { + margin: 0; color: #999; +} + +.todo-list h4 { + margin-top: 0; + margin-bottom: 0.4em; +} /* dev: signoff page */ -#dev-signoffs ul { list-style: none; margin: 0; padding: 0; } -#dev-signoffs .signoff-yes { color: green; font-weight: bold; } -#dev-signoffs .signoff-no { color: red; } -#dev-signoffs .signed-username { color: #888; margin-left: 0.5em; } +#dev-signoffs ul { + list-style: none; + margin: 0; + padding: 0; +} + +#dev-signoffs .signoff-yes { + color: green; + font-weight: bold; +} + +#dev-signoffs .signoff-no { + color: red; +} + +#dev-signoffs .signed-username { + color: #888; + margin-left: 0.5em; +} /* iso testing feedback form */ -#releng-feedback label { width: auto; display: inline; font-weight: normal; } -#releng-feedback ul { padding-left: 1em; } -#releng-feedback li { list-style: none; } -#releng-feedback ul+.helptext { position: relative; top: -0.9em; } +#releng-feedback label { + width: auto; + display: inline; + font-weight: normal; +} + +#releng-feedback ul { + padding-left: 1em; +} + +#releng-feedback li { + list-style: none; +} + +#releng-feedback ul+.helptext { + position: relative; top: -0.9em; +} /* highlight current website in the navbar */ -#archnavbar.anb-home ul li#anb-home a { color: white !important; } -#archnavbar.anb-packages ul li#anb-packages a { color: white !important; } -#archnavbar.anb-download ul li#anb-download a { color: white !important; } +#archnavbar.anb-home ul li#anb-home a, +#archnavbar.anb-packages ul li#anb-packages a, +#archnavbar.anb-download ul li#anb-download a { + color: white !important; +} -- cgit v1.2.3-2-g168b From b6f86d9ab0d6910f0f70398b07e965d337bd9e78 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 16 Aug 2011 16:04:16 -0500 Subject: Add two new DB fields to reporead Signed-off-by: Dan McGee --- devel/management/commands/reporead.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devel/management/commands/reporead.py b/devel/management/commands/reporead.py index 470b785d..97fdbb73 100644 --- a/devel/management/commands/reporead.py +++ b/devel/management/commands/reporead.py @@ -73,7 +73,7 @@ class Command(BaseCommand): class Pkg(object): """An interim 'container' object for holding Arch package data.""" bare = ( 'name', 'base', 'arch', 'desc', 'filename', - 'md5sum', 'url', 'packager' ) + 'md5sum', 'sha256sum', 'pgpsig', 'url', 'packager' ) number = ( 'csize', 'isize' ) collections = ( 'depends', 'optdepends', 'conflicts', 'provides', 'replaces', 'groups', 'license', 'files' ) -- cgit v1.2.3-2-g168b From e3ac14389448a73d9f9b8286a25930f3978784fb Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 16 Aug 2011 16:30:14 -0500 Subject: Settings refresh Update a few things in settings.py, but more importantly, update local_settings.py.template to be more in line with modern Django settings. Signed-off-by: Dan McGee --- local_settings.py.example | 58 +++++++++++++++++++++++++++++++---------------- settings.py | 5 +++- 2 files changed, 42 insertions(+), 21 deletions(-) diff --git a/local_settings.py.example b/local_settings.py.example index 9af4ebc8..beb48f84 100644 --- a/local_settings.py.example +++ b/local_settings.py.example @@ -2,41 +2,59 @@ ## Debug settings DEBUG = False +TEMPLATE_DEBUG = True +DEBUG_TOOLBAR = True + +## For django debug toolbar +INTERNAL_IPS = ('127.0.0.1',) ## Notification admins ADMINS = ( # ('Joe Admin', 'joeadmin@example.com'), ) -## Sqlite Database settings -#DATABASE_ENGINE = 'sqlite3' -#DATABASE_NAME = 'archweb.db' - ## MySQL Database settings -#DATABASE_ENGINE = 'mysql' -#DATABASE_NAME = 'archlinux' -#DATABASE_USER = 'archlinux' -#DATABASE_PASSWORD = 'archlinux' -#DATABASE_HOST = '' -#DATABASE_PORT = '' - -## Define cache middleware settings -CACHE_BACKEND = 'memcached://127.0.0.1:11211' -CACHE_MIDDLEWARE_SECONDS = 900 +DATABASES = { + 'default': { + 'ENGINE' : 'django.db.backends.mysql', + 'NAME' : 'archlinux', + 'USER' : 'archlinux', + 'PASSWORD': 'archlinux', + 'HOST' : '', + 'PORT' : '', + 'OPTIONS' : {'init_command': 'SET storage_engine=InnoDB'}, + }, +} + +## Define cache settings +CACHES = { + 'default': { + 'BACKEND' : 'django.core.cache.backends.dummy.DummyCache', + #'BACKEND' : 'django.core.cache.backends.memcached.MemcachedCache', + #'LOCATION': '127.0.0.1:11211', + } +} CACHE_MIDDLEWARE_KEY_PREFIX = 'arch' +CACHE_MIDDLEWARE_SECONDS = 300 + +## Use secure session cookies? Make this true if you want all +## logged-in actions to take place over HTTPS only. If developing +## locally, you will want to use False. +SESSION_COOKIE_SECURE = False ## location for saving dev pictures -MEDIA_ROOT = '/var/www/archlinux/htdocs/img/' +MEDIA_ROOT = '/srv/example.com/img/' ## web url for serving image files -MEDIA_URL = 'http://www.archlinux.org/img/' +MEDIA_URL = 'http://example.com/img/' ## Make this unique, and don't share it with anybody. SECRET_KEY = '00000000000000000000000000000000000000000000000' -#dummy cache -if DEBUG: - CACHE_BACKEND = 'dummy:///' +## CDN settings +CDN_ENABLED = False +CDN_PATH = 'http://example.com/path/' +CDN_PATH_SECURE = 'https://example.com/path/' -# vim: set ts=4 sw=4 et: +# vim: set ts=4 sw=4 et: diff --git a/settings.py b/settings.py index 5cca6047..18437098 100644 --- a/settings.py +++ b/settings.py @@ -84,9 +84,12 @@ MIDDLEWARE_CLASSES = ( ROOT_URLCONF = 'urls' -# Configure where sessions and messages should reside +# Configure where messages should reside MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage' + +# Session configuration SESSION_ENGINE = 'django.contrib.sessions.backends.cached_db' +SESSION_COOKIE_HTTPONLY = True INSTALLED_APPS = ( 'django.contrib.auth', -- cgit v1.2.3-2-g168b From 7954617a0593632d749d7e8b60beab2aae1669ba Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Wed, 17 Aug 2011 01:26:23 +0200 Subject: New page ISO Overview ISO Overview shows a simple list of all the ISOs that are available and how many times they've been tested successfully or have failed. Signed-off-by: Tom Willemsen Signed-off-by: Dan McGee --- releng/urls.py | 1 + releng/views.py | 14 +++++++++++ templates/releng/iso_overview.html | 48 ++++++++++++++++++++++++++++++++++++++ templates/releng/results.html | 3 +++ templates/releng/thanks.html | 4 +++- 5 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 templates/releng/iso_overview.html diff --git a/releng/urls.py b/releng/urls.py index 4a125dff..239ad02b 100644 --- a/releng/urls.py +++ b/releng/urls.py @@ -6,6 +6,7 @@ feedback_patterns = patterns('releng.views', (r'^thanks/$', 'submit_test_thanks', {}, 'releng-test-thanks'), (r'^iso/(?P\d+)/$', 'test_results_iso', {}, 'releng-results-iso'), (r'^(?P
        +

        Test ISO Info

        + +

        We provide daily snapshot ISOs. Those are largely untested, + but may be more up to date than the releases.

        +

        HTTP/FTP Direct Downloads

        -- cgit v1.2.3-2-g168b From 5e5182ba9b727e112b3bd16f94f41a2fc5847804 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 19 Aug 2011 13:08:26 -0500 Subject: Add color to releng results success column Signed-off-by: Dan McGee --- media/archweb.css | 8 ++++++++ templates/releng/result_list.html | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/media/archweb.css b/media/archweb.css index be455680..92487d93 100644 --- a/media/archweb.css +++ b/media/archweb.css @@ -930,6 +930,14 @@ ul.admin-actions { position: relative; top: -0.9em; } +#releng-result .success-yes { + color: green; +} + +#releng-result .success-no { + color: red; +} + /* highlight current website in the navbar */ #archnavbar.anb-home ul li#anb-home a, #archnavbar.anb-packages ul li#anb-packages a, diff --git a/templates/releng/result_list.html b/templates/releng/result_list.html index 0233bf8c..845d330d 100644 --- a/templates/releng/result_list.html +++ b/templates/releng/result_list.html @@ -26,7 +26,7 @@ {{ test.user_name }} {{ test.created|date }} {{ test.architecture }} - {{ test.success|yesno|capfirst }} + {{ test.success|yesno|capfirst }} {% endfor %} -- cgit v1.2.3-2-g168b From 1908b3c4609d1c3acf04c94a490516ff5284d2c7 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 19 Aug 2011 18:03:39 -0500 Subject: Fix CSS validation error Signed-off-by: Dan McGee --- media/archweb.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/media/archweb.css b/media/archweb.css index 92487d93..865a4f0b 100644 --- a/media/archweb.css +++ b/media/archweb.css @@ -78,7 +78,7 @@ select[multiple] { } input[type=submit] { - padding-left: 0 0.6em; + padding-left: 0.6em; } .clear { -- cgit v1.2.3-2-g168b From c9c3dffdec1afa8ce4ff8d26113ff871a25d224d Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 19 Aug 2011 18:32:17 -0500 Subject: Ensure ampersands are properly escaped in hrefs This was pointed out by the W3C validator. Signed-off-by: Dan McGee --- packages/templatetags/package_extras.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/templatetags/package_extras.py b/packages/templatetags/package_extras.py index e4c7a010..42001aa5 100644 --- a/packages/templatetags/package_extras.py +++ b/packages/templatetags/package_extras.py @@ -9,6 +9,10 @@ from django.utils.html import escape register = template.Library() +def link_encode(url, query, doseq=False): + data = urlencode(query, doseq).replace('&', '&') + return "%s?%s" % (url, data) + class BuildQueryStringNode(template.Node): def __init__(self, sortfield): self.sortfield = sortfield @@ -22,7 +26,7 @@ class BuildQueryStringNode(template.Node): qs['sort'] = ['-' + self.sortfield] else: qs['sort'] = [self.sortfield] - return urlencode(qs, True) + return urlencode(qs, True).replace('&', '&') @register.tag(name='buildsortqs') def do_buildsortqs(parser, token): @@ -74,27 +78,29 @@ def svn_trunk(package): @register.simple_tag def get_wiki_link(package): + url = "https://wiki.archlinux.org/index.php/Special:Search" data = { 'search': package.pkgname, } - return "https://wiki.archlinux.org/index.php/Special:Search?%s" % \ - urlencode(data) + return link_encode(url, data) @register.simple_tag def bugs_list(package): + url = "https://bugs.archlinux.org/" data = { 'project': package.repo.bugs_project, 'string': package.pkgname, } - return "https://bugs.archlinux.org/?%s" % urlencode(data) + return link_encode(url, data) @register.simple_tag def bug_report(package): + url = "https://bugs.archlinux.org/newtask" data = { 'project': package.repo.bugs_project, 'product_category': package.repo.bugs_category, 'item_summary': '[%s]' % package.pkgname, } - return "https://bugs.archlinux.org/newtask?%s" % urlencode(data) + return link_encode(url, data) # vim: set ts=4 sw=4 et: -- cgit v1.2.3-2-g168b From 60738969375fc72ff254517107ce53e14b068e24 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 19 Aug 2011 18:36:47 -0500 Subject: Fix template comment guard Signed-off-by: Dan McGee --- templates/packages/details.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/packages/details.html b/templates/packages/details.html index 2f1031a6..d09d8ada 100644 --- a/templates/packages/details.html +++ b/templates/packages/details.html @@ -142,8 +142,8 @@ {% comment %} Signed: {{ pkg.is_signed|yesno|capfirst }} - {% endcomment %} + {% endcomment %} Build Date: {{ pkg.build_date|date:"DATETIME_FORMAT" }} UTC -- cgit v1.2.3-2-g168b From c5b370f432215eb69dabd6bcb911b6429b16447a Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 22 Aug 2011 16:42:06 -0500 Subject: Admin setup tweaks Signed-off-by: Dan McGee --- mirrors/admin.py | 3 ++- packages/admin.py | 3 ++- releng/admin.py | 4 ++-- releng/models.py | 6 +++++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/mirrors/admin.py b/mirrors/admin.py index b7b478de..0632872d 100644 --- a/mirrors/admin.py +++ b/mirrors/admin.py @@ -59,7 +59,8 @@ class MirrorAdminForm(forms.ModelForm): class MirrorAdmin(admin.ModelAdmin): form = MirrorAdminForm - list_display = ('name', 'tier', 'country', 'active', 'public', 'isos', 'admin_email', 'supported_protocols') + list_display = ('name', 'tier', 'country', 'active', 'public', + 'isos', 'admin_email') list_filter = ('tier', 'active', 'public', 'country') search_fields = ('name',) inlines = [ diff --git a/packages/admin.py b/packages/admin.py index 3ecfdbb1..01b6ed6c 100644 --- a/packages/admin.py +++ b/packages/admin.py @@ -3,8 +3,9 @@ from django.contrib import admin from .models import PackageRelation class PackageRelationAdmin(admin.ModelAdmin): - list_display = ('user', 'pkgbase', 'type') + list_display = ('user', 'pkgbase', 'type', 'created') list_filter = ('type', 'user') + search_fields = ('user__username', 'pkgbase') admin.site.register(PackageRelation, PackageRelationAdmin) diff --git a/releng/admin.py b/releng/admin.py index be5e211f..e1411b84 100644 --- a/releng/admin.py +++ b/releng/admin.py @@ -5,8 +5,8 @@ from .models import (Architecture, BootType, Bootloader, ClockChoice, Test) class IsoAdmin(admin.ModelAdmin): - list_display = ('name', 'created', 'active') - list_filter = ('active',) + list_display = ('name', 'created', 'active', 'removed') + list_filter = ('active', 'created') class TestAdmin(admin.ModelAdmin): list_display = ('user_name', 'user_email', 'created', 'ip_address', diff --git a/releng/models.py b/releng/models.py index a958288b..56187766 100644 --- a/releng/models.py +++ b/releng/models.py @@ -29,11 +29,15 @@ class Iso(models.Model): def __unicode__(self): return self.name + class Meta: + verbose_name = 'ISO' + class Architecture(IsoOption): pass class IsoType(IsoOption): - pass + class Meta: + verbose_name = 'ISO type' class BootType(IsoOption): pass -- cgit v1.2.3-2-g168b From 6b34f60ba641c124055d8ae3e9c4cf425ef540c9 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 25 Aug 2011 11:10:06 -0500 Subject: Ensure package depends/required by div clears top details pane Signed-off-by: Dan McGee --- media/archweb.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/media/archweb.css b/media/archweb.css index 865a4f0b..0efd53db 100644 --- a/media/archweb.css +++ b/media/archweb.css @@ -739,6 +739,10 @@ form#flag-pkg-form input[type=text] { } /* pkgdetails: deps, required by and file lists */ +#pkgdetails #metadata { + clear: both; +} + #pkgdetails #metadata h3 { background: #555; color: #fff; -- cgit v1.2.3-2-g168b From e4b75dc124a53090b429bafbc3621c0e0a0f6247 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 25 Aug 2011 11:10:56 -0500 Subject: Enable display of package signed status Signed-off-by: Dan McGee --- templates/packages/details.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/templates/packages/details.html b/templates/packages/details.html index d09d8ada..afbf9103 100644 --- a/templates/packages/details.html +++ b/templates/packages/details.html @@ -139,11 +139,9 @@ Last Packager: {% with pkg.packager as pkgr %}{% if pkgr %}{% userpkgs pkgr %}{% else %}{{ pkg.packager_str }}{% endif %}{% endwith %} - {% comment %} Signed: {{ pkg.is_signed|yesno|capfirst }} - {% endcomment %} Build Date: {{ pkg.build_date|date:"DATETIME_FORMAT" }} UTC -- cgit v1.2.3-2-g168b From 2ed3676f61af821e71a5c070e65419cd60906cb8 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 23 Aug 2011 17:17:30 -0500 Subject: Escape parameter to search AUR link Addresses FS#25732. Signed-off-by: Dan McGee --- templates/packages/search.html | 2 +- templates/public/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/packages/search.html b/templates/packages/search.html index 8a357024..4744aa88 100644 --- a/templates/packages/search.html +++ b/templates/packages/search.html @@ -156,7 +156,7 @@

        We couldn't find any packages matching your query. Try searching again using different criteria, or try {% if search_form.q.data %} - searching the AUR + searching the AUR {% else %}searching the AUR{% endif %} to see if the package can be found there.

        diff --git a/templates/public/index.html b/templates/public/index.html index c8b6def0..bea19e0f 100644 --- a/templates/public/index.html +++ b/templates/public/index.html @@ -20,7 +20,7 @@

        Currently we have official packages optimized for the i686 and x86-64 architectures. We complement our official package sets with a - + community-operated package repository that grows in size and quality each and every day.

        -- cgit v1.2.3-2-g168b From 25a15d4c570823c6e28693d68d57b803dc2673fa Mon Sep 17 00:00:00 2001 From: Evangelos Foutras Date: Thu, 1 Sep 2011 19:56:05 +0300 Subject: Use package branches to display commit history We now have one link pointing to the tree of /trunk, and another pointing to the log of /trunk. Both links specify a package branch. Signed-off-by: Evangelos Foutras Signed-off-by: Dan McGee --- packages/templatetags/package_extras.py | 19 ++++++------------- templates/packages/details.html | 6 ++++-- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/packages/templatetags/package_extras.py b/packages/templatetags/package_extras.py index 42001aa5..01bf7510 100644 --- a/packages/templatetags/package_extras.py +++ b/packages/templatetags/package_extras.py @@ -61,20 +61,13 @@ def userpkgs(user): ) return '' -def svn_link(package, svnpath): - '''Helper function for the two real SVN link methods.''' - parts = (package.repo.svn_root, package.pkgbase, svnpath) - linkbase = "http://projects.archlinux.org/svntogit/%s.git/tree/%s/%s/" - return linkbase % tuple(urlquote(part) for part in parts) - @register.simple_tag -def svn_arch(package): - repo = package.repo.name.lower() - return svn_link(package, "repos/%s-%s" % (repo, package.arch.name)) - -@register.simple_tag -def svn_trunk(package): - return svn_link(package, "trunk") +def scm_link(package, operation): + parts = (package.repo.svn_root, operation, package.pkgbase) + linkbase = ( + "http://projects.archlinux.org/svntogit/%s.git/%s/trunk?" + "h=packages/%s") + return linkbase % tuple(urlquote(part) for part in parts) @register.simple_tag def get_wiki_link(package): diff --git a/templates/packages/details.html b/templates/packages/details.html index afbf9103..fa8283ed 100644 --- a/templates/packages/details.html +++ b/templates/packages/details.html @@ -16,8 +16,10 @@

        Package Actions

          -
        • SVN Entries ({{pkg.repo|lower}}-{{pkg.arch}})
        • -
        • SVN Entries (trunk)
        • +
        • + Source Files / + View Changes +
        • Search Wiki
        • Bug Reports
        • Report a Bug
        • -- cgit v1.2.3-2-g168b From 6aaa9119c55503f382cecbef72532db87a87c782 Mon Sep 17 00:00:00 2001 From: Evangelos Foutras Date: Thu, 1 Sep 2011 19:56:06 +0300 Subject: Compact bug report links in "Package Actions" box Using the same style as the SCM links. Signed-off-by: Evangelos Foutras Signed-off-by: Dan McGee --- templates/packages/details.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/packages/details.html b/templates/packages/details.html index fa8283ed..76d3ce86 100644 --- a/templates/packages/details.html +++ b/templates/packages/details.html @@ -20,9 +20,11 @@ Source Files / View Changes +
        • + Bug Reports / + Add New Bug +
        • Search Wiki
        • -
        • Bug Reports
        • -
        • Report a Bug
        • {% if pkg.flag_date %}
        • Flagged out-of-date on {{ pkg.flag_date|date }}
        • {% with pkg.in_testing as tp %}{% if tp %} -- cgit v1.2.3-2-g168b From b283e5ff83efcc8e8b160d8e8084ff25d14c3ad3 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 2 Sep 2011 10:51:13 -0500 Subject: Correctly fix archweb.css style error Commit 1908b3c460 attempted to fix a validation error; we really wanted to change the left hand side rather than the right hand side. Signed-off-by: Dan McGee --- media/archweb.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/media/archweb.css b/media/archweb.css index 0efd53db..0cadd7a7 100644 --- a/media/archweb.css +++ b/media/archweb.css @@ -78,7 +78,7 @@ select[multiple] { } input[type=submit] { - padding-left: 0.6em; + padding: 0 0.6em; } .clear { -- cgit v1.2.3-2-g168b From f173a03857e92268412196cd8e7c0f5d27fb6a38 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 8 Sep 2011 14:09:45 -0500 Subject: Show provides in package details view Signed-off-by: Dan McGee --- templates/packages/details.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/templates/packages/details.html b/templates/packages/details.html index 76d3ce86..8be408fb 100644 --- a/templates/packages/details.html +++ b/templates/packages/details.html @@ -123,7 +123,16 @@ {% else %}None{% endif %} {% endwith %} - + + {% with pkg.provides.all as provides %} + {% if provides %} + + Provides: + {% for p in provides %}{{ p.name }}{% if p.version %}={{ p.version }}{% endif %}
          {% endfor %} + + {% endif %} + {% endwith %} + Maintainers: {% with pkg.maintainers as maints %} {% if maints %} -- cgit v1.2.3-2-g168b From 293e42fc55ca0ee8f67d5bdcb3d32fd0ec93786e Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 8 Sep 2011 14:10:13 -0500 Subject: List packages in required by list with depend provided by this package Implements FS#25862. Most noticable on package like util-linux (util-linux-ng) and openjdk6 (java-runtime, java-environment). Signed-off-by: Dan McGee --- main/models.py | 4 +++- templates/packages/details.html | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/main/models.py b/main/models.py index e0681abf..1efca78d 100644 --- a/main/models.py +++ b/main/models.py @@ -234,9 +234,11 @@ class Package(models.Model): list slim by including the corresponding package in the same testing category as this package if that check makes sense. """ + provides = set(self.provides.values_list('name', flat=True)) + provides.add(self.pkgname) requiredby = PackageDepend.objects.select_related('pkg', 'pkg__arch', 'pkg__repo').filter( - depname=self.pkgname).order_by( + depname__in=provides).order_by( 'pkg__pkgname', 'pkg__arch__name', 'pkg__repo__name') if not self.arch.agnostic: # make sure we match architectures if possible diff --git a/templates/packages/details.html b/templates/packages/details.html index 8be408fb..1016b43a 100644 --- a/templates/packages/details.html +++ b/templates/packages/details.html @@ -203,6 +203,7 @@
            {% for req in rqdby %}
          • {% pkg_details_link req.pkg %} + {% if req.depname != pkg.pkgname %}(requires {{ req.depname }}){% endif %} {% if req.pkg.repo.testing %}(testing){% endif %} {% if req.optional %}(optional){% endif %}
          • -- cgit v1.2.3-2-g168b From 2cc3385aad120b9e9e0d3271b417c6764751c2a6 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 10 Sep 2011 07:08:16 -0500 Subject: Use HTTPS by default in email URLs Signed-off-by: Dan McGee --- main/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/models.py b/main/models.py index 1efca78d..b5cd8638 100644 --- a/main/models.py +++ b/main/models.py @@ -196,7 +196,7 @@ class Package(models.Model): return '/packages/%s/%s/%s/' % (self.repo.name.lower(), self.arch.name, self.pkgname) - def get_full_url(self, proto='http'): + 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()) -- cgit v1.2.3-2-g168b From 617550628b39f94e6cb11ec032eb18e6195bf64a Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 11 Sep 2011 15:48:09 -0500 Subject: Bump Django requirement to 1.3.1 Signed-off-by: Dan McGee --- requirements.txt | 2 +- requirements_prod.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 9be5d88e..27fda229 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -Django==1.3 +Django==1.3.1 Markdown==2.0.3 South==0.7.3 pytz>=2011c diff --git a/requirements_prod.txt b/requirements_prod.txt index babf65f9..9749a072 100644 --- a/requirements_prod.txt +++ b/requirements_prod.txt @@ -1,4 +1,4 @@ -Django==1.3 +Django==1.3.1 Markdown==2.0.3 MySQL-python==1.2.3 South==0.7.3 -- cgit v1.2.3-2-g168b