Skip to content

Commit 7d3bef3

Browse files
committed
Import announcements, port NomCom views
- Legacy-Id: 3077
1 parent 53a2370 commit 7d3bef3

15 files changed

Lines changed: 338 additions & 48 deletions

File tree

ietf/announcements/urls.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
from django.conf.urls.defaults import patterns
44
from ietf.announcements.models import Announcement
55

6+
from django.conf import settings
7+
68
nomcom_dict = {
79
'queryset': Announcement.objects.all().filter(nomcom=True)
8-
}
10+
}
911

1012
urlpatterns = patterns('',
1113
# (r'^nomcom/$', 'django.views.generic.simple.redirect_to', {'url': 'http://www.ietf.org/nomcom/index.html'} ),
1214
(r'^nomcom/$', 'ietf.announcements.views.nomcom'),
13-
(r'^nomcom/(?P<object_id>\d+)/$', 'django.views.generic.list_detail.object_detail', nomcom_dict)
15+
(r'^nomcom/(?P<object_id>\d+)/$', 'ietf.announcements.views.message_detail' if settings.USE_DB_REDESIGN_PROXY_CLASSES else 'django.views.generic.list_detail.object_detail', nomcom_dict)
1416
)

ietf/announcements/views.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Copyright The IETF Trust 2007, All Rights Reserved
22

33
from django.views.generic.simple import direct_to_template
4+
from django.shortcuts import get_object_or_404
5+
from django.conf import settings
6+
from django.db.models import Q
7+
8+
import re
49

510
from ietf.idtracker.models import ChairsHistory
611
from ietf.idtracker.models import Role
@@ -29,3 +34,58 @@ def nomcom(request):
2934
{ 'curr_chair' : curr_chair,
3035
'regimes' : regimes })
3136

37+
def nomcomREDESIGN(request):
38+
from person.models import Email
39+
from group.models import Group
40+
from redesign.announcements.models import Message
41+
42+
address_re = re.compile("<.*>")
43+
44+
nomcoms = list(Group.objects.filter(acronym__startswith="nomcom").exclude(name="nomcom"))
45+
46+
regimes = []
47+
48+
for n in nomcoms:
49+
e = n.latest_event(type="started")
50+
n.start_year = e.time.year if e else 0
51+
if n.start_year <= 2003:
52+
continue
53+
e = n.latest_event(type="concluded")
54+
n.end_year = e.time.year if e else ""
55+
56+
chair = n.role_set.get(name="chair").email
57+
announcements = Message.objects.filter(related_groups=n).order_by('-time')
58+
for a in announcements:
59+
a.to_name = address_re.sub("", a.to)
60+
61+
regimes.append(dict(chair=chair,
62+
announcements=announcements,
63+
group=n))
64+
65+
regimes.sort(key=lambda x: x["group"].start_year, reverse=True)
66+
67+
return direct_to_template(request,
68+
"announcements/nomcomREDESIGN.html",
69+
{ 'curr_chair' : regimes[0]["chair"],
70+
'regimes' : regimes })
71+
72+
73+
if settings.USE_DB_REDESIGN_PROXY_CLASSES:
74+
nomcom = nomcomREDESIGN
75+
76+
77+
def message_detail(request, object_id, queryset):
78+
from person.models import Email
79+
from group.models import Group
80+
from redesign.announcements.models import Message
81+
82+
# restrict to nomcom announcements for the time being
83+
nomcoms = Group.objects.filter(acronym__startswith="nomcom").exclude(acronym="nomcom")
84+
m = get_object_or_404(Message, id=object_id,
85+
related_groups__in=nomcoms)
86+
87+
return direct_to_template(request,
88+
"announcements/message_detail.html",
89+
dict(message=m))
90+
91+

ietf/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@
125125
'redesign.name',
126126
'redesign.group',
127127
'redesign.doc',
128+
'redesign.announcements',
128129
'redesign.issue',
129130
'ietf.announcements',
130131
'ietf.idindex',
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{% extends "base.html" %}
2+
{% load ietf_filters %}
3+
4+
{% block title %}Announcement: {{ message.time|date:"F j, Y" }} -- {{ message.subject|escape }}{% endblock %}
5+
6+
{% block content %}
7+
<h1>NomCom Message</h1>
8+
<p>
9+
From: {{ message.frm|escape }}<br/>
10+
To: {{ message.to|escape }}<br/>
11+
Date: {{ message.time|date:"F j, Y" }}<br/>
12+
Subject: {{ message.subject|escape }}
13+
</p>
14+
<hr width="400" align="left" />
15+
<pre>
16+
{{ message.text|escape }}
17+
</pre>
18+
{% endblock %}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{% extends "base.html" %}
2+
{% load ietf_filters %}
3+
{% block title %}IAB/IESG Nominating Committee{% endblock %}
4+
{% block content %}
5+
6+
<h1>IAB/IESG Nominating Committee</h1>
7+
8+
<h3>Current Committee Chair: <a href="mailto:{{ curr_chair.address }}">{{ curr_chair.get_name }}</a></h3>
9+
10+
{% for regime in regimes %}
11+
<hr>
12+
<h1>Messages from {{ regime.group.start_year }} - {{ regime.group.end_year }}</h1>
13+
<h4>Committee Chair: <a href="mailto:{{ regime.chair.address }}">{{ regime.chair.get_name }}</a></h4>
14+
<table class="ietf-table">
15+
<tr>
16+
<th width="10%">Date</th>
17+
<th width="60%">Subject</th>
18+
<th width="30%">Sent To</th>
19+
</tr>
20+
{% for ann in regime.announcements %}
21+
<tr>
22+
<td>{{ ann.time|date:"Y-M-d" }}</td>
23+
<td style="max-width:50%"><a href="/ann/nomcom/{{ ann.id }}/">{{ ann.subject|escape }}</a></td>
24+
<td>{{ ann.to_name }}</td>
25+
<tr>
26+
{% endfor %}
27+
</table>
28+
{% endfor %}
29+
30+
<hr>
31+
32+
{# somebody ought to import these announcements in the DB instead of this mess #}
33+
34+
<h3>Messages from 2003-2004 NomCom</h3>
35+
Committee Chair: <A HREF="mailto:richdr@microsoft.com">Rich Draves</A>
36+
<br><br><li><a href="http://www.ietf.org/old/2009/nomcom/msg08-25-2003.txt">IETF Nominations Committee Chair Announcement</a> August 25, 2003
37+
<LI><a href="http://www.ietf.org/old/2009/nomcom/msg09.22.txt">NomCom call for volunteers</a> September 22, 2003
38+
<LI><A HREF="http://www.ietf.org/old/2009/nomcom/select-announce_03.txt">Selection of the Nominations Committee</A>
39+
<LI><A HREF="http://www.ietf.org/old/2009/nomcom/msg10.06.txt">NomCom Volunteer List</a> October 06, 2004
40+
<LI><A HREF="http://www.ietf.org/old/2009/nomcom/msg1010.txt">NomCom Selection</a> October 10, 2003
41+
<LI><A HREF="http://www.ietf.org/old/2009/nomcom/msg10.17.txt">Call for Nominees</a> October 17, 2003
42+
<LI><A HREF="http://www.ietf.org/old/2009/nomcom/msg10.24.txt">NomCom members</a> October 24, 2003
43+
<LI><A HREF="http://www.ietf.org/old/2009/nomcom/msg11.07.txt">NomCom at IETF</a> November 07, 2003
44+
<LI><A HREF="http://www.ietf.org/old/2009/nomcom/msg11.14.txt">NomCom News</a> November 14, 2003
45+
<LI><A HREF="http://www.ietf.org/old/2009/nomcom/msg11.26.txt">Reminder - nominations to replace Randy Bush</a> November 26, 2003
46+
<LI><A HREF="http://www.ietf.org/old/2009/nomcom/msg12.01.txt">Randy Bush replacement schedule</a> December 01, 2003
47+
<LI><A HREF="http://www.ietf.org/old/2009/nomcom/msg01.14.txt">Randy Bush replacement</a> January 14, 2004
48+
<LI><A HREF="http://www.ietf.org/old/2009/nomcom/msg02.13.txt">NomCom results</a> February 13, 2004
49+
<LI><A HREF="http://www.ietf.org/old/2009/nomcom/msg09.28.txt">Call for Security AD nominations</a> September 28, 2004
50+
<LI><A HREF="http://www.ietf.org/old/2009/nomcom/msg11.07.04.txt">Steve Bellovin replacement</a> November 07, 2004
51+
52+
<h3>Messages from 2002-2003 NomCom</h3>
53+
54+
Committee Chair: <A HREF="mailto:PRoberts@MEGISTO.com">Phil Roberts</A>
55+
<br><br>
56+
<LI><A HREF="http://www.ietf.org/old/2009/nomcom/msg19765.html">First Call for Volunteers</A> July 30, 2002
57+
<LI><A HREF="http://www.ietf.org/old/2009/nomcom/select-announce.txt">Selection of the Nominations Committee</A>
58+
<LI><A HREF="http://www.ietf.org/old/2009/nomcom/msg0918.txt">Announcement of the Nominations Committee</A> September 18, 2002
59+
<LI><A HREF="http://www.ietf.org/old/2009/nomcom/msg10.21.txt">Announcement of IESG and IAB Nominations Requests</A> October 21, 2002
60+
<LI><A HREF="http://www.ietf.org/old/2009/nomcom/msg11.05.txt">Announcement of IESG and IAB Nominations Requests</A> November 5, 2002
61+
<LI><A HREF="http://www.ietf.org/old/2009/nomcom/msg11.12.txt">Announcement of IESG and IAB Nominations Requests</A> November 12, 2002
62+
<LI><a href="http://www.ietf.org/old/2009/nomcom/msg02.27.txt">IETF Nomcom Announcement</a> February 27, 2003
63+
<LI><a href="http://www.ietf.org/old/2009/nomcom/msg06.11.txt">Announcement of IESG and IAB Nominations Request</a> June 11, 2003
64+
<LI><a href="http://www.ietf.org/old/2009/nomcom/msg07.15.txt">Nomcom result announcement</a> July 15, 2003
65+
66+
<h3>Historical Information</h3>
67+
68+
<li><a href="http://www.ietf.org/nomcom/committee.html">IAB/IESG Nominating Committee Members (by year)</a>
69+
70+
<h3>References</h3>
71+
72+
<LI><A HREF="http://www.ietf.org/rfc/rfc2026.txt">The Internet Standards Process (RFC 2026)</A>
73+
<LI><A HREF="http://www.ietf.org/rfc/rfc3777.txt">IAB and IESG Selection, Confirmation, and Recall Process: Operation of the Nominating and Recall Committees (RFC 3777) (Also BCP10)</A>
74+
<LI><A HREF="http://www.ietf.org/rfc/rfc3797.txt">Publicly Verifiable Nominations Committee (NomCom) Random Selection (RFC 3797)</A>
75+
76+
{% endblock %}

redesign/announcements/__init__.py

Whitespace-only changes.

redesign/announcements/admin.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from django.contrib import admin
2+
from models import *
3+
4+
class MessageAdmin(admin.ModelAdmin):
5+
list_display = ["time", "by", "subject", "groups"]
6+
search_fields = ["text"]
7+
raw_id_fields = ["by"]
8+
9+
def groups(self, instance):
10+
return ", ".join(g.acronym for g in related_groups.all())
11+
12+
admin.site.register(Message, MessageAdmin)
13+
14+
class SendQueueAdmin(admin.ModelAdmin):
15+
list_display = ["time", "by", "message", "send_at", "sent_at"]
16+
list_filter = ["time", "send_at", "sent_at"]
17+
search_fields = ["message__text"]
18+
raw_id_fields = ["by"]
19+
20+
admin.site.register(SendQueue, SendQueueAdmin)

redesign/announcements/models.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
from django.db import models
2+
3+
import datetime
4+
5+
from person.models import Email
6+
from group.models import Group
7+
8+
class Message(models.Model):
9+
time = models.DateTimeField(default=datetime.datetime.now)
10+
by = models.ForeignKey(Email)
11+
12+
subject = models.CharField(max_length=255)
13+
frm = models.CharField(max_length=255)
14+
to = models.CharField(max_length=255)
15+
cc = models.CharField(max_length=255, blank=True)
16+
bcc = models.CharField(max_length=255, blank=True)
17+
reply_to = models.CharField(max_length=255, blank=True)
18+
text = models.TextField()
19+
20+
related_groups = models.ManyToManyField(Group, blank=True)
21+
22+
class Meta:
23+
ordering = ['time']
24+
25+
def __unicode__(self):
26+
return "'%s' %s -> %s" % (self.subject, self.frm, self.to)
27+
28+
class SendQueue(models.Model):
29+
time = models.DateTimeField(default=datetime.datetime.now)
30+
by = models.ForeignKey(Email)
31+
comment = models.TextField()
32+
message = models.ForeignKey(Message)
33+
send_at = models.DateTimeField(blank=True, null=True)
34+
sent_at = models.DateTimeField(blank=True, null=True)
35+
36+
class Meta:
37+
ordering = ['time']

redesign/doc/admin.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ class DocAliasAdmin(admin.ModelAdmin):
2121
raw_id_fields = ['document']
2222
admin.site.register(DocAlias, DocAliasAdmin)
2323

24-
class SendQueueAdmin(admin.ModelAdmin):
25-
pass
26-
admin.site.register(SendQueue, SendQueueAdmin)
27-
2824

2925
# events
3026

@@ -38,7 +34,6 @@ def by_raw(self, instance):
3834

3935
admin.site.register(Event, EventAdmin)
4036

41-
admin.site.register(Message, EventAdmin)
4237
admin.site.register(NewRevisionEvent, EventAdmin)
4338
admin.site.register(WriteupEvent, EventAdmin)
4439
admin.site.register(StatusDateEvent, EventAdmin)

redesign/doc/models.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -169,15 +169,6 @@ class Meta:
169169
verbose_name = "document alias"
170170
verbose_name_plural = "document aliases"
171171

172-
class SendQueue(models.Model):
173-
time = models.DateTimeField() # Scheduled at this time
174-
agent = models.ForeignKey(Email) # Scheduled by this person
175-
comment = models.TextField()
176-
#
177-
msg = models.ForeignKey('Message')
178-
to = models.ForeignKey(Email, related_name='to_messages')
179-
cc = models.ManyToManyField(Email, related_name='cc_messages')
180-
send = models.DateTimeField() # Send message at this time
181172

182173
# class Ballot(models.Model): # A collection of ballot positions
183174
# """A collection of ballot positions, and the actions taken during the
@@ -243,10 +234,6 @@ def __unicode__(self):
243234
class Meta:
244235
ordering = ['-time', 'id']
245236

246-
class Message(Event):
247-
subj = models.CharField(max_length=255)
248-
body = models.TextField()
249-
250237
class NewRevisionEvent(Event):
251238
rev = models.CharField(max_length=16)
252239

0 commit comments

Comments
 (0)