|
20 | 20 | from ietf.dbtemplate.models import DBTemplate |
21 | 21 | from ietf.dbtemplate.views import template_edit |
22 | 22 | from ietf.name.models import NomineePositionState, FeedbackType |
| 23 | +from ietf.group.models import Group |
23 | 24 |
|
24 | 25 | from ietf.nomcom.decorators import nomcom_private_key_required |
25 | 26 | from ietf.nomcom.forms import (NominateForm, FeedbackForm, QuestionnaireForm, |
|
33 | 34 | HOME_TEMPLATE, NOMINEE_REMINDER_TEMPLATE) |
34 | 35 | from ietf.ietfauth.utils import role_required |
35 | 36 |
|
| 37 | +import debug |
36 | 38 |
|
37 | 39 | def index(request): |
38 | | - nomcom_list = NomCom.objects.all() |
| 40 | + nomcom_list = Group.objects.filter(type__slug='nomcom').order_by('acronym') |
| 41 | + for nomcom in nomcom_list: |
| 42 | + year = nomcom.acronym[6:] |
| 43 | + debug.show('year') |
| 44 | + try: |
| 45 | + year = int(year) |
| 46 | + except ValueError: |
| 47 | + year = None |
| 48 | + debug.show('year') |
| 49 | + nomcom.year = year |
| 50 | + nomcom.label = "%s/%s" % (year, year+1) |
| 51 | + if year in [ 2005, 2006, 2007, 2008, 2009, 2010 ]: |
| 52 | + nomcom.url = "https://tools.ietf.org/group/nomcom/%02d" % (year % 100) |
| 53 | + elif year in [ 2011, 2012 ]: |
| 54 | + nomcom.url = "https://www.ietf.org/nomcom/%04d" % year |
| 55 | + elif year > 2012: |
| 56 | + nomcom.url = "/nomcom/%04d" % year |
| 57 | + else: |
| 58 | + nomcom.url = None |
| 59 | + if year >= 2002: |
| 60 | + nomcom.ann_url = "/ann/nomcom/#%4d" % year |
| 61 | + else: |
| 62 | + nomcom.ann_url = None |
| 63 | + debug.show('nomcom.url') |
39 | 64 | return render_to_response('nomcom/index.html', |
40 | 65 | {'nomcom_list': nomcom_list,}, RequestContext(request)) |
41 | 66 |
|
|
0 commit comments