Merged in Adam and Ben's wgcharter pages and generation script, and Arifumi and RjS' 1wg-charters.txt generation script.
- Legacy-Id: 1609
This commit is contained in:
parent
800bfc2529
commit
7f7025020b
11
changelog
11
changelog
|
@ -1,3 +1,14 @@
|
|||
ietfdb (2.30)
|
||||
|
||||
* Merged in Adam and Ben's rewrite of the WG charter page generation,
|
||||
which is used to produce the individual WG charter.txt and charter.html
|
||||
pages, and also used by the script which produces 1wg-charters.txt.
|
||||
|
||||
* Also merged in Arifumi and RjS' rewrite of the script which produces
|
||||
1wg-charters.txt.
|
||||
|
||||
-- Henrik Levkowetz <henrik@levkowetz.com> 28 Jul 2009 14:14:17 +0200
|
||||
|
||||
ietfdb (2.29)
|
||||
|
||||
* New script bin/abstracts.py, intended to be run as a cronjob, to generate
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
# Copyright The IETF Trust 2007, All Rights Reserved
|
||||
|
||||
import os.path
|
||||
import datetime
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import models
|
||||
from ietf.utils import FKAsOneToOne
|
||||
from django.test import TestCase
|
||||
import datetime
|
||||
|
||||
class Acronym(models.Model):
|
||||
acronym_id = models.AutoField(primary_key=True)
|
||||
|
@ -425,6 +427,15 @@ class Rfc(models.Model):
|
|||
self._idinternal_cache = None
|
||||
self._idinternal_cached = True
|
||||
return self._idinternal_cache
|
||||
|
||||
# return set of RfcObsolete objects obsoleted or updated by this RFC
|
||||
def obsoletes(self):
|
||||
return RfcObsolete.objects.filter(rfc=self.rfc_number)
|
||||
|
||||
# return set of RfcObsolete objects obsoleting or updating this RFC
|
||||
def obsoleted_by(self):
|
||||
return RfcObsolete.objects.filter(rfc_acted_on=self.rfc_number)
|
||||
|
||||
class Meta:
|
||||
db_table = 'rfcs'
|
||||
verbose_name = 'RFC'
|
||||
|
@ -852,6 +863,26 @@ class IETFWG(models.Model):
|
|||
return areas[areas.count()-1].area.areadirector_set.all()
|
||||
else:
|
||||
return None
|
||||
def chairs(self): # return a set of WGChair objects for this work group
|
||||
return WGChair.objects.filter(group_acronym__exact=self.group_acronym)
|
||||
def secretaries(self): # return a set of WGSecretary objects for this group
|
||||
return WGSecretary.objects.filter(group_acronym__exact=self.group_acronym)
|
||||
def milestones(self): # return a set of GoalMilestone objects for this group
|
||||
return GoalMilestone.objects.filter(group_acronym__exact=self.group_acronym)
|
||||
def rfcs(self): # return a set of Rfc objects for this group
|
||||
return Rfc.objects.filter(group_acronym__exact=self.group_acronym)
|
||||
def drafts(self): # return a set of Rfc objects for this group
|
||||
return InternetDraft.objects.filter(group__exact=self.group_acronym)
|
||||
def charter_text(self): # return string containing WG description read from file
|
||||
# get file path from settings. Syntesize file name from path, acronym, and suffix
|
||||
try:
|
||||
filename = os.path.join(settings.IETFWG_DESCRIPTIONS_PATH, self.group_acronym.acronym) + ".desc.txt"
|
||||
desc_file = open(filename)
|
||||
desc = desc_file.read()
|
||||
except BaseException:
|
||||
desc = 'Error Loading Work Group Description'
|
||||
return desc
|
||||
|
||||
class Meta:
|
||||
db_table = 'groups_ietf'
|
||||
ordering = ['?'] # workaround django wanting to sort by acronym but not joining with it
|
||||
|
|
|
@ -22,6 +22,14 @@ def expand_comma(value):
|
|||
long comma-separated lists."""
|
||||
return value.replace(",", ", ")
|
||||
|
||||
@register.filter(name='format_charter')
|
||||
def format_charter(value):
|
||||
return value.replace("\n\n", "</p><p>").replace("\n","<br/>\n")
|
||||
|
||||
@register.filter(name='indent')
|
||||
def indent(value):
|
||||
return value.replace("\n", "\n ");
|
||||
|
||||
@register.filter(name='parse_email_list')
|
||||
def parse_email_list(value):
|
||||
"""
|
||||
|
|
|
@ -164,10 +164,13 @@ TEST_RUNNER = 'ietf.tests.run_tests'
|
|||
TEST_REFERENCE_URL_PREFIX = os.environ.get("IETFDB_REF_PREFIX","") or 'https://datatracker.ietf.org/'
|
||||
|
||||
# Override this in settings_local.py if needed
|
||||
# *_PATH variables ends with a slash/ .
|
||||
INTERNET_DRAFT_PATH = '/a/www/ietf-ftp/internet-drafts/'
|
||||
RFC_PATH = '/a/www/ietf-ftp/rfc/'
|
||||
AGENDA_PATH = '/a/www/www6/proceedings/'
|
||||
IPR_DOCUMENT_PATH = '/a/www/ietf-ftp/ietf/IPR'
|
||||
IPR_DOCUMENT_PATH = '/a/www/ietf-ftp/ietf/IPR/'
|
||||
# Path to Work Group Description Text Files
|
||||
IETFWG_DESCRIPTIONS_PATH = '/a/www/www6s/wg-descriptions/'
|
||||
|
||||
# External page top and bottom, which gives a html page the current menubar
|
||||
# and footer used in the current web-page design
|
||||
|
@ -195,3 +198,4 @@ YUI_URL = "https://ajax.googleapis.com/ajax/libs/yui"
|
|||
# Put SECRET_KEY in here, or any other sensitive or site-specific
|
||||
# changes. DO NOT commit settings_local.py to svn.
|
||||
from settings_local import *
|
||||
|
||||
|
|
4
ietf/templates/wginfo/1wg-charters-by-acronym.txt
Normal file
4
ietf/templates/wginfo/1wg-charters-by-acronym.txt
Normal file
|
@ -0,0 +1,4 @@
|
|||
{% load ietf_filters %}{% for wg in wg_list|dictsort:"group_acronym.acronym" %}{% ifequal wg.area.area.status_id 1 %}{% if wg.start_date %}{{ wg }}
|
||||
{% endif %}{% endifequal %}{% endfor %}
|
||||
{% 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" %}
|
||||
{% endif %}{% endifequal %}{% endfor %}
|
5
ietf/templates/wginfo/1wg-charters.txt
Normal file
5
ietf/templates/wginfo/1wg-charters.txt
Normal file
|
@ -0,0 +1,5 @@
|
|||
{% 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 }}
|
||||
{% endif %}{% endifequal %}{% endfor %}{% endfor %}
|
||||
{% 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 %}
|
||||
{% include "wginfo/wg-charter.txt" %}
|
||||
{% endif %}{% endifequal %}{% endfor %}{% endfor %}
|
117
ietf/templates/wginfo/wg-charter.html
Normal file
117
ietf/templates/wginfo/wg-charter.html
Normal file
|
@ -0,0 +1,117 @@
|
|||
{% load ietf_filters %}
|
||||
{% extends "base.html" %}
|
||||
{# Copyright The IETF Trust 2009, All Rights Reserved #}
|
||||
|
||||
{% block title %} {{ wg.group_acronym.name }} ({{wg}}) Charter {% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% ifequal wg.status.status 'Concluded' %}<div class="wgdone"> {%endifequal%}
|
||||
{% ifequal wg.status.status 'Dormant' %}<div class="wgdormant"> {%endifequal%}
|
||||
<h1>{{wg.group_acronym.name}} ({{wg}}) {{wg.group_type}}</h1>
|
||||
|
||||
<p>Last Modified: {{ wg.last_modified_date }}</p>
|
||||
<p>Status: {% ifequal wg.status.status 'Active' %}Active{%else%}
|
||||
<font color="red">{{ wg.status }}
|
||||
{% ifequal wg.status.status 'Concluded' %}on {{wg.concluded_date}}{%endifequal%}
|
||||
{% ifequal wg.status.status 'Dormant' %}on {{wg.dormant_date}}{%endifequal%}
|
||||
</font>
|
||||
{% endifequal %}</p>
|
||||
|
||||
<h2>Chair{{ wg.chairs.count|pluralize:": ,s:" }}</h2>
|
||||
<ul>
|
||||
{% for chair in wg.chairs %}
|
||||
<li><a href="mailto:{{ chair.person.email.1 }}">{{ chair.person }} <{{ chair.person.email.1 }}></a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<h2>Area Directors:</h2>
|
||||
<ul>
|
||||
{% for ad in wg.area_directors %}
|
||||
<li><a href="mailto:{{ ad.person.email.1 }}">{{ ad.person }} <{{ ad.person.email.1 }}></a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
{% ifequal wg.area_director.person.email.1 "noreply@ietf.org" %}{%else%}
|
||||
<h2>Area Advisor:</h2>
|
||||
<ul>
|
||||
<li><a href="mailto:{{ wg.area_director.person.email.1 }}">{{ wg.area_director.person }} <{{wg.area_director.person.email.1 }}></a></li>
|
||||
</ul>
|
||||
{% endifequal %}
|
||||
|
||||
{% if wg.secretaries %}
|
||||
<h2>Secretar{{ wg.secretaries.count|pluralize:"y: ,ies:" }}</h2>
|
||||
<ul>
|
||||
{% for secretary in wg.secretaries %}
|
||||
<li><a href="mailto:{{ secretary.person.email.1 }}">{{ secretary.person }} <{{ secretary.person.email.1 }}></a></li>
|
||||
</ul>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
<h2>Mailing List:</h2>
|
||||
<table>
|
||||
<tr><td>General Discussion:</td><td> <a href="mailto:{{ wg.email_address }}">{{ wg.email_address }}</a></td></tr>
|
||||
<tr><td>To Subscribe:</td><td<a href="{{ wg.email_subscribe }}">{{ wg.email_subscribe }}</a></td></tr>
|
||||
<tr><td>Archive:</td><td><a href="{{ wg.email_archive }}">{{ wg.email_archive }}</a></td></tr>
|
||||
</table>
|
||||
|
||||
<h2>Description of Working Group:</h2>
|
||||
<blockquote><p>{{ wg.charter_text|escape|format_charter }}</p></blockquote>
|
||||
|
||||
<h2>Goals and Milestones:</h2>
|
||||
<table>
|
||||
{% for milestone in wg.milestones %}
|
||||
<tr>
|
||||
<td width="80px">
|
||||
{% 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 %}
|
||||
</td>
|
||||
<td>{{ milestone.description }}
|
||||
</td></tr>
|
||||
{% endfor %}
|
||||
<table>
|
||||
|
||||
<h2>Internet-Drafts:</h2>
|
||||
<ul>
|
||||
{% for draft in wg.drafts %}
|
||||
<li><a href="{{draft.doclink}}">{{draft.title}}</a> ({{ draft.txt_page_count }} pages)</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
{% if wg.rfcs %}
|
||||
<h2>Requests for Comments:</h2>
|
||||
<table>
|
||||
{% for rfc in wg.rfcs %}
|
||||
<tr><td>{{rfc}}{% if rfc.fyi_number %}<br> / FYI{{rfc.fyi_number}}{%endif%}{% if rfc.std_number %}<br> / STD{{rfc.std_number}}{%endif%}:
|
||||
</td><td><a href="{{rfc.doclink}}">{{rfc.title}}</a> ({{rfc.txt_page_count}} pages)
|
||||
{% for obs in rfc.obsoletes%}
|
||||
- <font color="orange">{{obs.action}} RFC{{obs.rfc_acted_on_id}}</font>
|
||||
{% endfor %}
|
||||
|
||||
{% for obs in rfc.obsoleted_by%}
|
||||
- {%ifequal obs.action 'Obsoletes'%}<font color="red">Obsoleted by{%else%}<font color="orange">Updated by{%endifequal%} RFC{{obs.rfc_id}}
|
||||
{% endfor %}
|
||||
|
||||
</td></tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% else %}
|
||||
<h2>No Requests for Comments</h2>
|
||||
{% endif %}
|
||||
|
||||
{% ifequal wg.status.status 'Concluded' %} </div> {%endifequal%}
|
||||
{% ifequal wg.status.status 'Dormant' %} </div> {%endifequal%}
|
||||
{% endblock %}
|
42
ietf/templates/wginfo/wg-charter.txt
Normal file
42
ietf/templates/wginfo/wg-charter.txt
Normal file
|
@ -0,0 +1,42 @@
|
|||
{% load ietf_filters %}{{wg.group_acronym.name}} ({{wg}})
|
||||
{{ wg.group_acronym.name|dashify }}{{ wg.group_acronym.acronym|dashify }}---
|
||||
|
||||
Charter
|
||||
Last Modified: {{ wg.last_modified_date }}
|
||||
|
||||
Current Status: {{ wg.status }}
|
||||
|
||||
Chair{{ wg.chairs.count|pluralize:": ,s:" }}
|
||||
{% for chair in wg.chairs %} {{ chair.person }} <{{chair.person.email.1}}>
|
||||
{% endfor %}
|
||||
Area Directors:
|
||||
{% for ad in wg.area_directors %} {{ ad.person }} <{{ad.person.email.1}}>
|
||||
{% endfor %}
|
||||
Area Advisor:
|
||||
{{ wg.area_director.person }} <{{wg.area_director.person.email.1}}>
|
||||
{% if wg.secretaries %}
|
||||
Secretar{{ wg.secretaries.count|pluralize:"y: ,ies:" }}
|
||||
{% for secretary in wg.secretaries %} {{ secretary.person }} <{{secretary.person.email.1}}>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
Mailing List:
|
||||
General Discussion: {{ wg.email_address }}
|
||||
To Subscribe: {{ wg.email_subscribe }}
|
||||
Archive: {{ wg.email_archive }}
|
||||
|
||||
Description of Working Group:
|
||||
|
||||
{{ wg.charter_text|indent }}
|
||||
|
||||
Goals and Milestones:
|
||||
{% 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 }}
|
||||
{% endfor %}
|
||||
Internet-Drafts:
|
||||
{% for draft in wg.drafts %} - {{draft.title}} [{{draft.filename}}-{{draft.revision}}] ({{ draft.txt_page_count }} pages)
|
||||
{% endfor %}
|
||||
{% if wg.rfcs %}Requests for Comments:
|
||||
{% for rfc in wg.rfcs %} {{rfc}}: {{rfc.title}} ({{ rfc.txt_page_count }} pages){% for obs in rfc.obsoletes%}
|
||||
* {{obs.action}} RFC{{obs.rfc_acted_on_id}}{% endfor %}{% for obs in rfc.obsoleted_by%}
|
||||
* {%ifequal obs.action 'Obsoletes'%}OBSOLETED BY{%else%}Updated by{%endifequal%} RFC{{obs.rfc_id}}{% endfor %}
|
||||
{%endfor%}
|
||||
{%else%}No Requests for Comments{% endif %}
|
|
@ -8,4 +8,8 @@ urlpatterns = patterns('',
|
|||
(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),
|
||||
(r'^(?P<wg>.*)-charter.html', views.wg_charter),
|
||||
(r'^(?P<wg>.*)-charter.txt', views.wg_charter_txt),
|
||||
(r'^1wg-charters.txt', views.wg_charters),
|
||||
(r'^1wg-charters-by-acronym.txt', views.wg_charters_by_acronym),
|
||||
)
|
||||
|
|
|
@ -22,3 +22,27 @@ def wg_summary_area(request):
|
|||
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))
|
||||
|
||||
def collect_wg_info(acronym):
|
||||
wg = (IETFWG.objects.get(group_acronym__acronym=acronym))
|
||||
return {'wg': wg}
|
||||
|
||||
def wg_charter(request, wg="1"):
|
||||
return render_to_response('wginfo/wg-charter.html', collect_wg_info(wg), RequestContext(request))
|
||||
|
||||
def generate_text_charter(wg):
|
||||
text = loader.render_to_string('wginfo/wg-charter.txt',collect_wg_info(wg));
|
||||
return text
|
||||
|
||||
def wg_charter_txt(request, wg="1"):
|
||||
return HttpResponse(generate_text_charter(wg),
|
||||
mimetype='text/plain; charset=UTF-8')
|
||||
|
||||
def wg_charters(request):
|
||||
wgs = IETFWG.objects.filter(status='1',start_date__isnull=False)
|
||||
return HttpResponse(loader.render_to_string('wginfo/1wg-charters.txt', {'wg_list': wgs}),mimetype='text/plain; charset=UTF-8')
|
||||
|
||||
def wg_charters_by_acronym(request):
|
||||
wgs = IETFWG.objects.filter(status='1',start_date__isnull=False)
|
||||
return HttpResponse(loader.render_to_string('wginfo/1wg-charters-by-acronym.txt', {'wg_list': wgs}),mimetype='text/plain; charset=UTF-8')
|
||||
|
||||
|
|
|
@ -213,3 +213,20 @@ tbody.even {
|
|||
#agenda pre {
|
||||
font-size: 1.3em;
|
||||
}
|
||||
|
||||
.wgdone {
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
background-color: #F8F8D0;
|
||||
|
||||
}
|
||||
|
||||
.wgdormant {
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
background-color: lightgray;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue