|
1 | 1 | # Copyright The IETF Trust 2007, All Rights Reserved |
2 | 2 |
|
| 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 | + |
3 | 35 | # Create your views here. |
4 | 36 | #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 |
6 | 38 | from django.views.generic.list_detail import object_list |
7 | 39 | from django.http import Http404 |
8 | 40 | from django.template import RequestContext |
9 | 41 | from django.shortcuts import render_to_response |
| 42 | +from ietf.iesg.models import TelechatDates, TelechatAgendaItem, WGAction |
10 | 43 | import datetime |
11 | 44 |
|
12 | 45 | def date_threshold(): |
@@ -51,3 +84,70 @@ def wgdocs(request,cat): |
51 | 84 | queryset_list_doc.append(sub_item2) |
52 | 85 | 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) ) |
53 | 86 |
|
| 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"," ") |
| 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