File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33urlpatterns = patterns ('' ,
44 url (r'^state/(?P<doc>[-\w]+)/(?P<type>[-\w]+)/?$' , 'ietf.help.views.state' ),
55 url (r'^state/(?P<doc>[-\w]+)/?$' , 'ietf.help.views.state' ),
6+ url (r'^state/?$' , 'ietf.help.views.index' ),
67)
78
Original file line number Diff line number Diff line change 88from ietf .doc .models import State , StateType
99
1010
11+ def index (request ):
12+ types = StateType .objects .all ()
13+ names = [ type .slug for type in types ]
14+ for type in types :
15+ if "-" in type .slug and type .slug .split ('-' ,1 )[0 ] in names :
16+ type .stategroups = None
17+ else :
18+ groups = StateType .objects .filter (slug__startswith = type .slug )
19+ type .stategroups = [ g .slug [len (type .slug )+ 1 :] for g in groups if not g == type ] or ""
20+
21+ return render_to_response ('help/index.html' , {"types" : types },
22+ context_instance = RequestContext (request ))
23+
1124def state (request , doc , type = None ):
1225 slug = "%s-%s" % (doc ,type ) if type else doc
1326 debug .show ('slug' )
Original file line number Diff line number Diff line change 1+ {% extends "base.html" %}
2+ {# Copyright The IETF Trust 2007, All Rights Reserved #}
3+
4+ {% block title %} Document State Index{% endblock %}
5+
6+ {% block content %}
7+
8+ < h1 > Document State Index</ h1 >
9+
10+ < p > Document state information is available for the following document and document state groups:</ p >
11+
12+ < table class ="ietf-table ">
13+ < tr >
14+ < th > Document</ th >
15+ < th > State Groups</ th >
16+ </ tr >
17+
18+ {% for type in types %}
19+ {% if type.stategroups != None %}
20+ < tr class ="{% cycle oddrow,evenrow as cycle1 %} ">
21+ < td > < a href ='{{ type.slug }}/ '> {{type.slug}}</ td >
22+ < td >
23+ {% for group in type.stategroups %}
24+ < a href ='{{ type.slug }}/{{ group }} '> {{ group }}</ a >
25+ {% endfor %}
26+ </ td >
27+ </ tr >
28+ {% endif %}
29+ {% endfor %}
30+ </ table >
31+
32+
33+ {% endblock %}
You can’t perform that action at this time.
0 commit comments