Skip to content

Commit a1f5862

Browse files
committed
Merged in code for a new IESG telechat agenda page at /iesg/agenda/, from Pasi Eronen <pasi.eronen@nokia.com>
- Legacy-Id: 1275
1 parent e21f5fd commit a1f5862

6 files changed

Lines changed: 605 additions & 1 deletion

File tree

ietf/iesg/models.py

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

3+
# Portion Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
4+
# All rights reserved. Contact: Pasi Eronen <pasi.eronen@nokia.com>
5+
#
6+
# Redistribution and use in source and binary forms, with or without
7+
# modification, are permitted provided that the following conditions
8+
# are met:
9+
#
10+
# * Redistributions of source code must retain the above copyright
11+
# notice, this list of conditions and the following disclaimer.
12+
#
13+
# * Redistributions in binary form must reproduce the above
14+
# copyright notice, this list of conditions and the following
15+
# disclaimer in the documentation and/or other materials provided
16+
# with the distribution.
17+
#
18+
# * Neither the name of the Nokia Corporation and/or its
19+
# subsidiary(-ies) nor the names of its contributors may be used
20+
# to endorse or promote products derived from this software
21+
# without specific prior written permission.
22+
#
23+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27+
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34+
335
from django.db import models
36+
from ietf.idtracker.models import Acronym
437

538
class TelechatMinutes(models.Model):
639
telechat_date = models.DateField(null=True, blank=True)
@@ -12,6 +45,77 @@ def __str__(self):
1245
return "IESG Telechat Minutes for %s" % self.telechat_date
1346
class Meta:
1447
db_table = 'telechat_minutes'
48+
verbose_name = "Telechat Minute Text"
49+
verbose_name_plural = "Telechat Minutes"
1550
class Admin:
1651
pass
1752

53+
class TelechatDates(models.Model):
54+
date1 = models.DateField(primary_key=True, null=True, blank=True)
55+
date2 = models.DateField(null=True, blank=True)
56+
date3 = models.DateField(null=True, blank=True)
57+
date4 = models.DateField(null=True, blank=True)
58+
def dates(self):
59+
l = []
60+
if self.date1:
61+
l.append(self.date1)
62+
if self.date2:
63+
l.append(self.date2)
64+
if self.date3:
65+
l.append(self.date3)
66+
if self.date4:
67+
l.append(self.date4)
68+
return l
69+
70+
def __str__(self):
71+
return " / ".join([str(d) for d in [self.date1,self.date2,self.date3,self.date4]])
72+
class Meta:
73+
db_table = "telechat_dates"
74+
verbose_name = "Next Telechat Date"
75+
class Admin:
76+
pass
77+
78+
class TelechatAgendaItem(models.Model):
79+
TYPE_CHOICES = (
80+
(1, "Working Group News"),
81+
(2, "IAB News"),
82+
(3, "Management Items")
83+
)
84+
id = models.AutoField(primary_key=True, db_column='template_id')
85+
text = models.TextField(blank=True, db_column='template_text')
86+
type = models.IntegerField(db_column='template_type', choices=TYPE_CHOICES)
87+
title = models.CharField(maxlength=255, db_column='template_title')
88+
#The following fields are apparently not used
89+
#note = models.TextField(null=True,blank=True)
90+
#discussed_status_id = models.IntegerField(null=True, blank=True)
91+
#decision = models.TextField(null=True,blank=True)
92+
class Meta:
93+
db_table = 'templates'
94+
class Admin:
95+
pass
96+
97+
class WGAction(models.Model):
98+
CATEGORY_CHOICES = (
99+
(11, "WG Creation::In Internal Review"),
100+
(12, "WG Creation::Proposed for IETF Review"),
101+
(13, "WG Creation::Proposed for Approval"),
102+
(21, "WG Rechartering::In Internal Review"),
103+
(22, "WG Rechartering::Under evaluation for IETF Review"),
104+
(23, "WG Rechartering::Proposed for Approval")
105+
)
106+
group_acronym = models.ForeignKey(Acronym, db_column='group_acronym_id', primary_key=True, unique=True)
107+
note = models.TextField(blank=True,null=True)
108+
status_date = models.DateField()
109+
agenda = models.BooleanField("On Agenda")
110+
token_name = models.CharField(maxlength=25)
111+
category = models.IntegerField(db_column='pwg_cat_id', choices=CATEGORY_CHOICES, default=11)
112+
telechat_date = models.DateField() #choices = [(x.telechat_date,x.telechat_date) for x in Telechat.objects.all().order_by('-telechat_date')])
113+
def __str__(self):
114+
return str(self.telechat_date)+": "+str(self.group_acronym)
115+
class Meta:
116+
db_table = 'group_internal'
117+
ordering = ['-telechat_date']
118+
verbose_name = "WG Action"
119+
class Admin:
120+
pass
121+

ietf/iesg/urls.py

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

3+
# Portion Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
4+
# All rights reserved. Contact: Pasi Eronen <pasi.eronen@nokia.com>
5+
#
6+
# Redistribution and use in source and binary forms, with or without
7+
# modification, are permitted provided that the following conditions
8+
# are met:
9+
#
10+
# * Redistributions of source code must retain the above copyright
11+
# notice, this list of conditions and the following disclaimer.
12+
#
13+
# * Redistributions in binary form must reproduce the above
14+
# copyright notice, this list of conditions and the following
15+
# disclaimer in the documentation and/or other materials provided
16+
# with the distribution.
17+
#
18+
# * Neither the name of the Nokia Corporation and/or its
19+
# subsidiary(-ies) nor the names of its contributors may be used
20+
# to endorse or promote products derived from this software
21+
# without specific prior written permission.
22+
#
23+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27+
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34+
335
from django.conf.urls.defaults import patterns
436
from ietf.iesg import views
537
from ietf.iesg.models import TelechatMinutes
@@ -31,6 +63,7 @@
3163
)
3264

3365
urlpatterns += patterns('',
66+
(r'^agenda/$', views.telechat_agenda),
3467
(r'^ann/ind/$',views.inddocs),
3568
(r'^ann/(?P<cat>[^/]+)/$',views.wgdocs),
3669
)

ietf/iesg/views.py

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

3+
# Portion Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
4+
# All rights reserved. Contact: Pasi Eronen <pasi.eronen@nokia.com>
5+
#
6+
# Redistribution and use in source and binary forms, with or without
7+
# modification, are permitted provided that the following conditions
8+
# are met:
9+
#
10+
# * Redistributions of source code must retain the above copyright
11+
# notice, this list of conditions and the following disclaimer.
12+
#
13+
# * Redistributions in binary form must reproduce the above
14+
# copyright notice, this list of conditions and the following
15+
# disclaimer in the documentation and/or other materials provided
16+
# with the distribution.
17+
#
18+
# * Neither the name of the Nokia Corporation and/or its
19+
# subsidiary(-ies) nor the names of its contributors may be used
20+
# to endorse or promote products derived from this software
21+
# without specific prior written permission.
22+
#
23+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27+
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34+
335
# Create your views here.
436
#from django.views.generic.date_based import archive_index
5-
from ietf.idtracker.models import IDInternal, InternetDraft
37+
from ietf.idtracker.models import IDInternal, InternetDraft,AreaGroup,IETFWG
638
from django.views.generic.list_detail import object_list
739
from django.http import Http404
840
from django.template import RequestContext
941
from django.shortcuts import render_to_response
42+
from ietf.iesg.models import TelechatDates, TelechatAgendaItem, WGAction
1043
import datetime
1144

1245
def date_threshold():
@@ -51,3 +84,70 @@ def wgdocs(request,cat):
5184
queryset_list_doc.append(sub_item2)
5285
return render_to_response( 'iesg/ietf_doc.html', {'object_list': queryset_list, 'object_list_doc':queryset_list_doc, 'is_recent':is_recent}, context_instance=RequestContext(request) )
5386

87+
def get_doc_section(id):
88+
states = [16,17,18,19,20,21]
89+
if id.document().intended_status.intended_status_id in [1,2,6,7]:
90+
s = "2"
91+
else:
92+
s = "3"
93+
if id.rfc_flag == 0:
94+
g = id.document().group_acronym()
95+
else:
96+
g = id.document().group_acronym
97+
if g and str(g) != 'none':
98+
s = s + "1"
99+
elif (s == "3") and id.via_rfc_editor > 0:
100+
s = s + "3"
101+
else:
102+
s = s + "2"
103+
if not id.rfc_flag and id.cur_state.document_state_id not in states:
104+
s = s + "3"
105+
elif id.returning_item > 0:
106+
s = s + "2"
107+
else:
108+
s = s + "1"
109+
return s
110+
111+
def agenda_docs(date):
112+
matches = IDInternal.objects.filter(telechat_date=date,primary_flag=1,agenda=1)
113+
idmatches = matches.filter(rfc_flag=0).order_by('ballot_id')
114+
rfcmatches = matches.filter(rfc_flag=1).order_by('ballot_id')
115+
res = {}
116+
for id in list(idmatches)+list(rfcmatches):
117+
section_key = "s"+get_doc_section(id)
118+
if section_key not in res:
119+
res[section_key] = []
120+
others = id.ballot_others()
121+
if id.note:
122+
id.note = str(id.note).replace("\240","&nbsp;")
123+
if len(others) > 0:
124+
res[section_key].append({'obj':id, 'ballot_set':[id]+list(others)})
125+
else:
126+
res[section_key].append({'obj':id})
127+
return res
128+
129+
def agenda_wg_actions(date):
130+
mapping = {12:'411', 13:'412',22:'421',23:'422'}
131+
matches = WGAction.objects.filter(agenda=1,telechat_date=date,category__in=mapping.keys()).order_by('category')
132+
res = {}
133+
for o in matches:
134+
section_key = "s"+mapping[o.category]
135+
if section_key not in res:
136+
res[section_key] = []
137+
area = AreaGroup.objects.get(group=o.group_acronym)
138+
res[section_key].append({'obj':o, 'area':str(area.area)})
139+
return res
140+
141+
def agenda_management_issues(date):
142+
matches = TelechatAgendaItem.objects.filter(type=3).order_by('id')
143+
return [o.title for o in matches]
144+
145+
def telechat_agenda(request):
146+
date = TelechatDates.objects.all()[0].date1
147+
#date = "2006-03-16"
148+
docs = agenda_docs(date)
149+
mgmt = agenda_management_issues(date)
150+
wgs = agenda_wg_actions(date)
151+
private = 'private' in request.REQUEST
152+
return render_to_response('iesg/agenda.html', {'date':str(date), 'docs':docs,'mgmt':mgmt,'wgs':wgs, 'private':private}, context_instance=RequestContext(request) )
153+

0 commit comments

Comments
 (0)