Skip to content

Commit 7f70250

Browse files
committed
Merged in Adam and Ben's wgcharter pages and generation script, and Arifumi and RjS' 1wg-charters.txt generation script.
- Legacy-Id: 1609
1 parent 800bfc2 commit 7f70250

11 files changed

Lines changed: 269 additions & 2 deletions

File tree

changelog

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
ietfdb (2.30)
2+
3+
* Merged in Adam and Ben's rewrite of the WG charter page generation,
4+
which is used to produce the individual WG charter.txt and charter.html
5+
pages, and also used by the script which produces 1wg-charters.txt.
6+
7+
* Also merged in Arifumi and RjS' rewrite of the script which produces
8+
1wg-charters.txt.
9+
10+
-- Henrik Levkowetz <henrik@levkowetz.com> 28 Jul 2009 14:14:17 +0200
11+
112
ietfdb (2.29)
213

314
* New script bin/abstracts.py, intended to be run as a cronjob, to generate

ietf/idtracker/models.py

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# Copyright The IETF Trust 2007, All Rights Reserved
22

3+
import os.path
4+
import datetime
5+
36
from django.conf import settings
47
from django.db import models
58
from ietf.utils import FKAsOneToOne
69
from django.test import TestCase
7-
import datetime
810

911
class Acronym(models.Model):
1012
acronym_id = models.AutoField(primary_key=True)
@@ -425,6 +427,15 @@ def idinternal(self):
425427
self._idinternal_cache = None
426428
self._idinternal_cached = True
427429
return self._idinternal_cache
430+
431+
# return set of RfcObsolete objects obsoleted or updated by this RFC
432+
def obsoletes(self):
433+
return RfcObsolete.objects.filter(rfc=self.rfc_number)
434+
435+
# return set of RfcObsolete objects obsoleting or updating this RFC
436+
def obsoleted_by(self):
437+
return RfcObsolete.objects.filter(rfc_acted_on=self.rfc_number)
438+
428439
class Meta:
429440
db_table = 'rfcs'
430441
verbose_name = 'RFC'
@@ -852,6 +863,26 @@ def area_directors(self):
852863
return areas[areas.count()-1].area.areadirector_set.all()
853864
else:
854865
return None
866+
def chairs(self): # return a set of WGChair objects for this work group
867+
return WGChair.objects.filter(group_acronym__exact=self.group_acronym)
868+
def secretaries(self): # return a set of WGSecretary objects for this group
869+
return WGSecretary.objects.filter(group_acronym__exact=self.group_acronym)
870+
def milestones(self): # return a set of GoalMilestone objects for this group
871+
return GoalMilestone.objects.filter(group_acronym__exact=self.group_acronym)
872+
def rfcs(self): # return a set of Rfc objects for this group
873+
return Rfc.objects.filter(group_acronym__exact=self.group_acronym)
874+
def drafts(self): # return a set of Rfc objects for this group
875+
return InternetDraft.objects.filter(group__exact=self.group_acronym)
876+
def charter_text(self): # return string containing WG description read from file
877+
# get file path from settings. Syntesize file name from path, acronym, and suffix
878+
try:
879+
filename = os.path.join(settings.IETFWG_DESCRIPTIONS_PATH, self.group_acronym.acronym) + ".desc.txt"
880+
desc_file = open(filename)
881+
desc = desc_file.read()
882+
except BaseException:
883+
desc = 'Error Loading Work Group Description'
884+
return desc
885+
855886
class Meta:
856887
db_table = 'groups_ietf'
857888
ordering = ['?'] # workaround django wanting to sort by acronym but not joining with it

ietf/idtracker/templatetags/ietf_filters.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ def expand_comma(value):
2222
long comma-separated lists."""
2323
return value.replace(",", ", ")
2424

25+
@register.filter(name='format_charter')
26+
def format_charter(value):
27+
return value.replace("\n\n", "</p><p>").replace("\n","<br/>\n")
28+
29+
@register.filter(name='indent')
30+
def indent(value):
31+
return value.replace("\n", "\n ");
32+
2533
@register.filter(name='parse_email_list')
2634
def parse_email_list(value):
2735
"""

ietf/settings.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,13 @@
164164
TEST_REFERENCE_URL_PREFIX = os.environ.get("IETFDB_REF_PREFIX","") or 'https://datatracker.ietf.org/'
165165

166166
# Override this in settings_local.py if needed
167+
# *_PATH variables ends with a slash/ .
167168
INTERNET_DRAFT_PATH = '/a/www/ietf-ftp/internet-drafts/'
168169
RFC_PATH = '/a/www/ietf-ftp/rfc/'
169170
AGENDA_PATH = '/a/www/www6/proceedings/'
170-
IPR_DOCUMENT_PATH = '/a/www/ietf-ftp/ietf/IPR'
171+
IPR_DOCUMENT_PATH = '/a/www/ietf-ftp/ietf/IPR/'
172+
# Path to Work Group Description Text Files
173+
IETFWG_DESCRIPTIONS_PATH = '/a/www/www6s/wg-descriptions/'
171174

172175
# External page top and bottom, which gives a html page the current menubar
173176
# and footer used in the current web-page design
@@ -195,3 +198,4 @@
195198
# Put SECRET_KEY in here, or any other sensitive or site-specific
196199
# changes. DO NOT commit settings_local.py to svn.
197200
from settings_local import *
201+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{% load ietf_filters %}{% for wg in wg_list|dictsort:"group_acronym.acronym" %}{% ifequal wg.area.area.status_id 1 %}{% if wg.start_date %}{{ wg }}
2+
{% endif %}{% endifequal %}{% endfor %}
3+
{% for wg in wg_list|dictsort:"group_acronym.acronym" %}{% ifequal wg.area.area.status_id 1 %}{% if wg.start_date %}{% include "wginfo/wg-charter.txt" %}
4+
{% endif %}{% endifequal %}{% endfor %}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{% load ietf_filters %}{% 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.name" %}{% ifequal wg.area.area.status_id 1 %}{% if wg.start_date %}{{ wg }}
2+
{% endif %}{% endifequal %}{% endfor %}{% endfor %}
3+
{% 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.name" %}{% ifequal wg.area.area.status_id 1 %}{% if wg.start_date %}
4+
{% include "wginfo/wg-charter.txt" %}
5+
{% endif %}{% endifequal %}{% endfor %}{% endfor %}
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
{% load ietf_filters %}
2+
{% extends "base.html" %}
3+
{# Copyright The IETF Trust 2009, All Rights Reserved #}
4+
5+
{% block title %} {{ wg.group_acronym.name }} ({{wg}}) Charter {% endblock %}
6+
7+
{% block content %}
8+
{% ifequal wg.status.status 'Concluded' %}<div class="wgdone"> {%endifequal%}
9+
{% ifequal wg.status.status 'Dormant' %}<div class="wgdormant"> {%endifequal%}
10+
<h1>{{wg.group_acronym.name}} ({{wg}}) {{wg.group_type}}</h1>
11+
12+
<p>Last Modified: {{ wg.last_modified_date }}</p>
13+
<p>Status: {% ifequal wg.status.status 'Active' %}Active{%else%}
14+
<font color="red">{{ wg.status }}
15+
{% ifequal wg.status.status 'Concluded' %}on {{wg.concluded_date}}{%endifequal%}
16+
{% ifequal wg.status.status 'Dormant' %}on {{wg.dormant_date}}{%endifequal%}
17+
</font>
18+
{% endifequal %}</p>
19+
20+
<h2>Chair{{ wg.chairs.count|pluralize:": ,s:" }}</h2>
21+
<ul>
22+
{% for chair in wg.chairs %}
23+
<li><a href="mailto:{{ chair.person.email.1 }}">{{ chair.person }} &lt;{{ chair.person.email.1 }}&gt;</a></li>
24+
{% endfor %}
25+
</ul>
26+
27+
<h2>Area Directors:</h2>
28+
<ul>
29+
{% for ad in wg.area_directors %}
30+
<li><a href="mailto:{{ ad.person.email.1 }}">{{ ad.person }} &lt;{{ ad.person.email.1 }}&gt;</a></li>
31+
{% endfor %}
32+
</ul>
33+
34+
{% ifequal wg.area_director.person.email.1 "noreply@ietf.org" %}{%else%}
35+
<h2>Area Advisor:</h2>
36+
<ul>
37+
<li><a href="mailto:{{ wg.area_director.person.email.1 }}">{{ wg.area_director.person }} &lt;{{wg.area_director.person.email.1 }}&gt;</a></li>
38+
</ul>
39+
{% endifequal %}
40+
41+
{% if wg.secretaries %}
42+
<h2>Secretar{{ wg.secretaries.count|pluralize:"y: ,ies:" }}</h2>
43+
<ul>
44+
{% for secretary in wg.secretaries %}
45+
<li><a href="mailto:{{ secretary.person.email.1 }}">{{ secretary.person }} &lt;{{ secretary.person.email.1 }}&gt;</a></li>
46+
</ul>
47+
{% endfor %}
48+
{% endif %}
49+
50+
<h2>Mailing List:</h2>
51+
<table>
52+
<tr><td>General Discussion:</td><td> <a href="mailto:{{ wg.email_address }}">{{ wg.email_address }}</a></td></tr>
53+
<tr><td>To Subscribe:</td><td<a href="{{ wg.email_subscribe }}">{{ wg.email_subscribe }}</a></td></tr>
54+
<tr><td>Archive:</td><td><a href="{{ wg.email_archive }}">{{ wg.email_archive }}</a></td></tr>
55+
</table>
56+
57+
<h2>Description of Working Group:</h2>
58+
<blockquote><p>{{ wg.charter_text|escape|format_charter }}</p></blockquote>
59+
60+
<h2>Goals and Milestones:</h2>
61+
<table>
62+
{% for milestone in wg.milestones %}
63+
<tr>
64+
<td width="80px">
65+
{% if milestone.done %} Done
66+
{% else %}
67+
{%ifequal milestone.expected_due_date.month 1 %}Jan{% endifequal %}
68+
{%ifequal milestone.expected_due_date.month 2 %}Feb{% endifequal %}
69+
{%ifequal milestone.expected_due_date.month 3 %}Mar{% endifequal %}
70+
{%ifequal milestone.expected_due_date.month 4 %}Apr{% endifequal %}
71+
{%ifequal milestone.expected_due_date.month 5 %}May{% endifequal %}
72+
{%ifequal milestone.expected_due_date.month 6 %}Jun{% endifequal %}
73+
{%ifequal milestone.expected_due_date.month 7 %}Jul{% endifequal %}
74+
{%ifequal milestone.expected_due_date.month 8 %}Aug{% endifequal %}
75+
{%ifequal milestone.expected_due_date.month 9 %}Sep{% endifequal %}
76+
{%ifequal milestone.expected_due_date.month 10 %}Oct{% endifequal %}
77+
{%ifequal milestone.expected_due_date.month 11 %}Nov{% endifequal %}
78+
{%ifequal milestone.expected_due_date.month 12 %}Dec{% endifequal %}
79+
{{ milestone.expected_due_date.year }}
80+
{% endif %}
81+
</td>
82+
<td>{{ milestone.description }}
83+
</td></tr>
84+
{% endfor %}
85+
<table>
86+
87+
<h2>Internet-Drafts:</h2>
88+
<ul>
89+
{% for draft in wg.drafts %}
90+
<li><a href="{{draft.doclink}}">{{draft.title}}</a> ({{ draft.txt_page_count }} pages)</li>
91+
{% endfor %}
92+
</ul>
93+
94+
{% if wg.rfcs %}
95+
<h2>Requests for Comments:</h2>
96+
<table>
97+
{% for rfc in wg.rfcs %}
98+
<tr><td>{{rfc}}{% if rfc.fyi_number %}<br> / FYI{{rfc.fyi_number}}{%endif%}{% if rfc.std_number %}<br> / STD{{rfc.std_number}}{%endif%}:
99+
</td><td><a href="{{rfc.doclink}}">{{rfc.title}}</a> ({{rfc.txt_page_count}} pages)
100+
{% for obs in rfc.obsoletes%}
101+
- <font color="orange">{{obs.action}} RFC{{obs.rfc_acted_on_id}}</font>
102+
{% endfor %}
103+
104+
{% for obs in rfc.obsoleted_by%}
105+
- {%ifequal obs.action 'Obsoletes'%}<font color="red">Obsoleted by{%else%}<font color="orange">Updated by{%endifequal%} RFC{{obs.rfc_id}}
106+
{% endfor %}
107+
108+
</td></tr>
109+
{% endfor %}
110+
</table>
111+
{% else %}
112+
<h2>No Requests for Comments</h2>
113+
{% endif %}
114+
115+
{% ifequal wg.status.status 'Concluded' %} </div> {%endifequal%}
116+
{% ifequal wg.status.status 'Dormant' %} </div> {%endifequal%}
117+
{% endblock %}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{% load ietf_filters %}{{wg.group_acronym.name}} ({{wg}})
2+
{{ wg.group_acronym.name|dashify }}{{ wg.group_acronym.acronym|dashify }}---
3+
4+
Charter
5+
Last Modified: {{ wg.last_modified_date }}
6+
7+
Current Status: {{ wg.status }}
8+
9+
Chair{{ wg.chairs.count|pluralize:": ,s:" }}
10+
{% for chair in wg.chairs %} {{ chair.person }} <{{chair.person.email.1}}>
11+
{% endfor %}
12+
Area Directors:
13+
{% for ad in wg.area_directors %} {{ ad.person }} <{{ad.person.email.1}}>
14+
{% endfor %}
15+
Area Advisor:
16+
{{ wg.area_director.person }} <{{wg.area_director.person.email.1}}>
17+
{% if wg.secretaries %}
18+
Secretar{{ wg.secretaries.count|pluralize:"y: ,ies:" }}
19+
{% for secretary in wg.secretaries %} {{ secretary.person }} <{{secretary.person.email.1}}>
20+
{% endfor %}
21+
{% endif %}
22+
Mailing List:
23+
General Discussion: {{ wg.email_address }}
24+
To Subscribe: {{ wg.email_subscribe }}
25+
Archive: {{ wg.email_archive }}
26+
27+
Description of Working Group:
28+
29+
{{ wg.charter_text|indent }}
30+
31+
Goals and Milestones:
32+
{% for milestone in wg.milestones %} {% if milestone.done %}Done {% else %}{%ifequal milestone.expected_due_date.month 1 %}Jan{% endifequal %}{%ifequal milestone.expected_due_date.month 2 %}Feb{% endifequal %}{%ifequal milestone.expected_due_date.month 3 %}Mar{% endifequal %}{%ifequal milestone.expected_due_date.month 4 %}Apr{% endifequal %}{%ifequal milestone.expected_due_date.month 5 %}May{% endifequal %}{%ifequal milestone.expected_due_date.month 6 %}Jun{% endifequal %}{%ifequal milestone.expected_due_date.month 7 %}Jul{% endifequal %}{%ifequal milestone.expected_due_date.month 8 %}Aug{% endifequal %}{%ifequal milestone.expected_due_date.month 9 %}Sep{% endifequal %}{%ifequal milestone.expected_due_date.month 10 %}Oct{% endifequal %}{%ifequal milestone.expected_due_date.month 11 %}Nov{% endifequal %}{%ifequal milestone.expected_due_date.month 12 %}Dec{% endifequal %} {{ milestone.expected_due_date.year }}{% endif %} - {{ milestone.description }}
33+
{% endfor %}
34+
Internet-Drafts:
35+
{% for draft in wg.drafts %} - {{draft.title}} [{{draft.filename}}-{{draft.revision}}] ({{ draft.txt_page_count }} pages)
36+
{% endfor %}
37+
{% if wg.rfcs %}Requests for Comments:
38+
{% for rfc in wg.rfcs %} {{rfc}}: {{rfc.title}} ({{ rfc.txt_page_count }} pages){% for obs in rfc.obsoletes%}
39+
* {{obs.action}} RFC{{obs.rfc_acted_on_id}}{% endfor %}{% for obs in rfc.obsoleted_by%}
40+
* {%ifequal obs.action 'Obsoletes'%}OBSOLETED BY{%else%}Updated by{%endifequal%} RFC{{obs.rfc_id}}{% endfor %}
41+
{%endfor%}
42+
{%else%}No Requests for Comments{% endif %}

ietf/wginfo/urls.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@
88
(r'^summary.txt', views.wg_summary_area),
99
(r'^summary-by-area.txt', views.wg_summary_area),
1010
(r'^summary-by-acronym.txt', views.wg_summary_acronym),
11+
(r'^(?P<wg>.*)-charter.html', views.wg_charter),
12+
(r'^(?P<wg>.*)-charter.txt', views.wg_charter_txt),
13+
(r'^1wg-charters.txt', views.wg_charters),
14+
(r'^1wg-charters-by-acronym.txt', views.wg_charters_by_acronym),
1115
)

ietf/wginfo/views.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,27 @@ def wg_summary_area(request):
2222
def wg_dir(request):
2323
wgs = IETFWG.objects.filter(status='1',start_date__isnull=False)
2424
return render_to_response('wginfo/wg-dir.html', {'wg_list': wgs}, RequestContext(request))
25+
26+
def collect_wg_info(acronym):
27+
wg = (IETFWG.objects.get(group_acronym__acronym=acronym))
28+
return {'wg': wg}
29+
30+
def wg_charter(request, wg="1"):
31+
return render_to_response('wginfo/wg-charter.html', collect_wg_info(wg), RequestContext(request))
32+
33+
def generate_text_charter(wg):
34+
text = loader.render_to_string('wginfo/wg-charter.txt',collect_wg_info(wg));
35+
return text
36+
37+
def wg_charter_txt(request, wg="1"):
38+
return HttpResponse(generate_text_charter(wg),
39+
mimetype='text/plain; charset=UTF-8')
40+
41+
def wg_charters(request):
42+
wgs = IETFWG.objects.filter(status='1',start_date__isnull=False)
43+
return HttpResponse(loader.render_to_string('wginfo/1wg-charters.txt', {'wg_list': wgs}),mimetype='text/plain; charset=UTF-8')
44+
45+
def wg_charters_by_acronym(request):
46+
wgs = IETFWG.objects.filter(status='1',start_date__isnull=False)
47+
return HttpResponse(loader.render_to_string('wginfo/1wg-charters-by-acronym.txt', {'wg_list': wgs}),mimetype='text/plain; charset=UTF-8')
48+

0 commit comments

Comments
 (0)