From b9870f0dfcd76e05ae4285fb753e4dbcc7ebdf2f Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Sun, 22 Mar 2009 01:16:19 +0000 Subject: [PATCH] Merged in Chris' replacement pages for the perl-generated WG overview page, the 1wg-summary.txt and 1wg-summary-by-acronym.txt pages. - Legacy-Id: 1421 --- ietf/idtracker/models.py | 9 +++ ietf/idtracker/templatetags/ietf_filters.py | 8 +++ ietf/templates/wginfo/summary-by-acronym.txt | 14 ++++ ietf/templates/wginfo/summary-by-area.txt | 13 ++++ ietf/templates/wginfo/wg-dir.html | 74 ++++++++++++++++++++ ietf/urls.py | 1 + ietf/wginfo/__init__.py | 2 + ietf/wginfo/models.py | 4 ++ ietf/wginfo/urls.py | 11 +++ ietf/wginfo/views.py | 24 +++++++ 10 files changed, 160 insertions(+) create mode 100644 ietf/templates/wginfo/summary-by-acronym.txt create mode 100644 ietf/templates/wginfo/summary-by-area.txt create mode 100644 ietf/templates/wginfo/wg-dir.html create mode 100644 ietf/wginfo/__init__.py create mode 100644 ietf/wginfo/models.py create mode 100644 ietf/wginfo/urls.py create mode 100644 ietf/wginfo/views.py diff --git a/ietf/idtracker/models.py b/ietf/idtracker/models.py index 53d33ff47..ebd1d1618 100644 --- a/ietf/idtracker/models.py +++ b/ietf/idtracker/models.py @@ -93,6 +93,15 @@ class Area(models.Model): list_display = ('area_acronym', 'status') pass +class AreaURL(models.Model): + area = models.ForeignKey(Area, db_column='area_acronym_id', edit_inline=models.STACKED, num_in_admin=1, null=True, related_name='urls') + url = models.URLField(maxlength=255, db_column='url_value') + url_label = models.CharField(maxlength=255, db_column='url_label') + def __str__(self): + return self.url + class Admin: + pass + class IDStatus(models.Model): status_id = models.AutoField(primary_key=True) status = models.CharField(maxlength=25, db_column='status_value') diff --git a/ietf/idtracker/templatetags/ietf_filters.py b/ietf/idtracker/templatetags/ietf_filters.py index 5f1608fe9..589f26c37 100644 --- a/ietf/idtracker/templatetags/ietf_filters.py +++ b/ietf/idtracker/templatetags/ietf_filters.py @@ -199,6 +199,14 @@ def rfcnospace(string): else: return string +@register.filter(name='dashify') +def dashify(string): + """ + Replace each character in string with '-', to produce + an underline effect for plain text files. + """ + return re.sub('.', '-', string) + @register.filter(name='lstrip') def lstripw(string, chars): """Strip matching leading characters from words in string""" diff --git a/ietf/templates/wginfo/summary-by-acronym.txt b/ietf/templates/wginfo/summary-by-acronym.txt new file mode 100644 index 000000000..9c848d806 --- /dev/null +++ b/ietf/templates/wginfo/summary-by-acronym.txt @@ -0,0 +1,14 @@ + IETF Working Group Summary (By Acronym) + + +The following Area Abreviations are used in this document +{% for area in area_list %} +{{ area }} - {{ area.area_acronym.name }}{% endfor %} +{% for wg in wg_list|dictsort:"group_acronym.acronym" %}{% if wg.start_date %} +{{ wg.group_acronym.name }} ({{ wg }}) -- {{ wg.area.area|upper }} +{% for chair in wg.wgchair_set.all %}{% if forloop.first %} Chair{{ forloop.revcounter|pluralize:": ,s:" }} {% else %} {% endif %}{{ chair.person }} <{{ chair.person.email.1 }}> +{% endfor %} WG Mail: {{ wg.email_address }} + To Join: {{ wg.email_subscribe }}{%if wg.email_keyword %} + In Body: {{ wg.email_keyword }}{% endif %} + Archive: {{ wg.email_archive }} +{% endif %}{% endfor %} diff --git a/ietf/templates/wginfo/summary-by-area.txt b/ietf/templates/wginfo/summary-by-area.txt new file mode 100644 index 000000000..35ac4b4b1 --- /dev/null +++ b/ietf/templates/wginfo/summary-by-area.txt @@ -0,0 +1,13 @@ +{% load ietf_filters %} IETF Working Group Summary (By Area) +{% regroup wg_list|dictsort:"area_acronym.acronym" by area.area as wga_list %}{% for area in wga_list %}{% for wg in area.list|dictsort:"group_acronym.acronym" %}{% ifequal wg.area.area.status_id 1 %}{% if forloop.first %} +{{ wg.area_acronym.name }} ({{ wg.area_acronym }}) +{{ wg.area_acronym.name|dashify }}------{% for ad in wg.area_directors %} + {{ ad.person }} <{{ ad.person.email.1 }}>{% endfor %} +{% endif %}{% if wg.start_date %} +{{ wg.group_acronym.name }} ({{ wg }}) +{% for chair in wg.wgchair_set.all %}{% if forloop.first %} Chair{{ forloop.revcounter|pluralize:": ,s:" }} {% else %} {% endif %}{{ chair.person }} <{{ chair.person.email.1 }}> +{% endfor %} WG Mail: {{ wg.email_address }} + To Join: {{ wg.email_subscribe }}{%if wg.email_keyword %} + In Body: {{ wg.email_keyword }}{% endif %} + Archive: {{ wg.email_archive }} +{% endif %}{% endifequal %}{% endfor %}{% endfor %} diff --git a/ietf/templates/wginfo/wg-dir.html b/ietf/templates/wginfo/wg-dir.html new file mode 100644 index 000000000..37da63ed0 --- /dev/null +++ b/ietf/templates/wginfo/wg-dir.html @@ -0,0 +1,74 @@ +{% extends "base.html" %} +{# Copyright The IETF Trust 2009, All Rights Reserved #} + +{% block title %} Active IETF Working Groups {% endblock %} + +{% block content %} +
+

Active IETF Working Groups

+
+

+ Old WG pages can be found in the Concluded WG Index. +

+

+ Archived WG Charters can be found in the Historic Charter Index. +

+
+

Table of Contents

+ +{% for area in wga_list %} +{% for wg in area.list|dictsort:"group_acronym.acronym" %} +{% ifequal wg.area.area.status_id 1 %} +{% if forloop.first %} +
+ +

{{ wg.area_acronym.name }}

+{% for ad in wg.area_directors %} +{% if forloop.first %} +

Area Director{{ forloop.revcounter|pluralize }}:

+ +{% for url in wg.area.urls %} +{% if forloop.first %} +

Additional Area Information:

+ +{% endif %} +{% endfor %} +

Working Groups:

+ ++ + + + +{% endif %} +{% if wg.start_date %} + +{% endif %} +{% if forloop.last %} +
{{ wg|escape }}{{ wg.group_acronym.name|escape }}
+{% endif %} +{% endifequal %} +{% endfor %} +{% endfor %} + + +{% endblock %} diff --git a/ietf/urls.py b/ietf/urls.py index 61d6a0e46..10c44cf34 100644 --- a/ietf/urls.py +++ b/ietf/urls.py @@ -54,6 +54,7 @@ urlpatterns = patterns('', (r'^meeting/', include('ietf.meeting.urls')), (r'^accounts/', include('ietf.ietfauth.urls')), (r'^doc/', include('ietf.idrfc.urls')), + (r'^wg/', include('ietf.wginfo.urls')), (r'^$', 'ietf.redirects.views.redirect'), diff --git a/ietf/wginfo/__init__.py b/ietf/wginfo/__init__.py new file mode 100644 index 000000000..5ed40b97d --- /dev/null +++ b/ietf/wginfo/__init__.py @@ -0,0 +1,2 @@ +# Copyright The IETF Trust 2008, All Rights Reserved + diff --git a/ietf/wginfo/models.py b/ietf/wginfo/models.py new file mode 100644 index 000000000..3bbc97949 --- /dev/null +++ b/ietf/wginfo/models.py @@ -0,0 +1,4 @@ +# Copyright The IETF Trust 2008, All Rights Reserved + +from django.db import models +from ietf.idtracker.models import Acronym, Area, IETFWG diff --git a/ietf/wginfo/urls.py b/ietf/wginfo/urls.py new file mode 100644 index 000000000..02d2680d1 --- /dev/null +++ b/ietf/wginfo/urls.py @@ -0,0 +1,11 @@ +# Copyright The IETF Trust 2008, All Rights Reserved + +from django.conf.urls.defaults import patterns +from ietf.wginfo import views + +urlpatterns = patterns('', + (r'^$', views.wg_dir), + (r'^summary.txt', views.wg_summary_area), + (r'^summary-by-area.txt', views.wg_summary_area), + (r'^summary-by-acronym.txt', views.wg_summary_acronym), +) diff --git a/ietf/wginfo/views.py b/ietf/wginfo/views.py new file mode 100644 index 000000000..034309662 --- /dev/null +++ b/ietf/wginfo/views.py @@ -0,0 +1,24 @@ +# Copyright The IETF Trust 2008, All Rights Reserved + +from ietf.idtracker.models import Area, AreaStatus, AreaDirector, IETFWG, WGChair +from django.shortcuts import get_object_or_404, render_to_response +from django.template import RequestContext, loader +from django.db.models import Q +from django.http import HttpResponse +from django.contrib.sites.models import Site +from ietf.contrib import wizard, form_decorator +from ietf.utils.mail import send_mail_subj +from datetime import datetime + +def wg_summary_acronym(request): + areas = Area.objects.filter(status='1') + wgs = IETFWG.objects.filter(status='1') + return HttpResponse(loader.render_to_string('wginfo/summary-by-acronym.txt', {'area_list': areas, 'wg_list': wgs}),mimetype='text/plain; charset=UTF-8') + +def wg_summary_area(request): + wgs = IETFWG.objects.filter(status='1',start_date__isnull=False) + return HttpResponse(loader.render_to_string('wginfo/summary-by-area.txt', {'wg_list': wgs}),mimetype='text/plain; charset=UTF-8') + +def wg_dir(request): + wgs = IETFWG.objects.filter(status='1',start_date__isnull=False) + return render_to_response('wginfo/wg-dir.html', {'wg_list': wgs}, RequestContext(request))