Skip to content

Commit 4db36b0

Browse files
committed
Add a generic state help page, make provisions for displaying
IESG I-D states in it - Legacy-Id: 5635
1 parent 3d1eb07 commit 4db36b0

8 files changed

Lines changed: 107 additions & 41 deletions

File tree

ietf/doc/views_help.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
from django import forms
2+
from django.shortcuts import render_to_response, get_object_or_404
3+
from django.template import RequestContext
4+
5+
from ietf.doc.models import *
6+
7+
def state_help(request, type):
8+
slug, title = {
9+
"draft-iesg": ("draft-iesg", "IESG States For Internet-Drafts"),
10+
"draft-rfceditor": ("draft-rfceditor", "RFC Editor States For Internet-Drafts"),
11+
"draft-iana-action": ("draft-iana-action", "IANA Action States For Internet-Drafts"),
12+
"charter": ("charter", "Charter States"),
13+
"conflict-review": ("conflrev", "Conflict Review States")
14+
}.get(type, "")
15+
state_type = get_object_or_404(StateType, slug=slug)
16+
17+
states = State.objects.filter(type=state_type).order_by("order")
18+
19+
has_next_states = False
20+
for state in states:
21+
if state.next_states.all():
22+
has_next_states = True
23+
break
24+
25+
tags = []
26+
27+
if state_type.slug == "draft-iesg":
28+
# legacy hack
29+
states = list(states)
30+
fake_state = dict(name="I-D Exists",
31+
desc="Initial (default) state for all internet drafts. Such documents are not being tracked by the IESG as no request has been made of the IESG to do anything with the document.",
32+
next_states=dict(all=State.objects.filter(type="draft-iesg", slug__in=("watching", "pub-req")))
33+
)
34+
states.insert(0, fake_state)
35+
36+
tags = DocTagName.objects.filter(slug__in=IESG_SUBSTATE_TAGS)
37+
38+
return render_to_response("doc/state_help.html", {
39+
"title": title,
40+
"state_type": state_type,
41+
"states": states,
42+
"has_next_states": has_next_states,
43+
"tags": tags,
44+
},
45+
context_instance=RequestContext(request))

ietf/idrfc/urls.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,8 @@
8080
url(r'^(?P<name>[A-Za-z0-9._+-]+)/edit/approveballot/$', views_ballot.approve_ballot, name='doc_approve_ballot'),
8181
url(r'^(?P<name>[A-Za-z0-9._+-]+)/edit/makelastcall/$', views_ballot.make_last_call, name='doc_make_last_call'),
8282

83+
url(r'^help/state/(?P<type>[\w-]+)/$', 'ietf.doc.views_help.state_help', name="state_help"),
84+
8385
(r'^(?P<name>charter-[A-Za-z0-9._+-]+)/', include('ietf.wgcharter.urls')),
8486
(r'^(?P<name>[A-Za-z0-9._+-]+)/conflict-review/', include('ietf.doc.urls_conflict_review')),
8587
)
86-
87-
urlpatterns += patterns('django.views.generic.simple',
88-
url(r'^help/state/charter/$', 'direct_to_template', { 'template': 'doc/states.html', 'extra_context': { 'states': State.objects.filter(type="charter"),'title':"Charter" } }, name='help_charter_states'),
89-
url(r'^help/state/conflict-review/$', 'direct_to_template', { 'template': 'doc/states.html', 'extra_context': { 'states': State.objects.filter(type="conflrev").order_by("order"),'title':"Conflict Review" } }, name='help_conflict_review_states'),
90-
)
91-
92-

ietf/templates/doc/conflict_review/change_state.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
{% block content %}
2121
<h1>Change State: {{doc.title}}</h1>
2222

23-
<p class="helptext">For help on the states, see the <a href="{% url help_conflict_review_states %}">state table</a>.</p>
23+
<p class="helptext">For help on the states, see the <a href="{% url state_help type="conflict-review" %}">state table</a>.</p>
2424

2525
<form class="change-state" action="" method="post">
2626
<table>

ietf/templates/doc/conflict_review/start.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
{% block content %}
1919
<h1>Begin IETF conflict review for {{doc_to_review.canonical_name}}-{{doc_to_review.rev}}</h1>
2020

21-
<p class="helptext">For help on the initial state choice, see the <a href="{% url help_conflict_review_states %}">state table</a>.</p>
21+
<p class="helptext">For help on the initial state choice, see the <a href="{% url state_help type="conflict-review" %}">state table</a>.</p>
2222

2323
<form class="start-conflict-review" action="" method="post">
2424
<table>

ietf/templates/doc/state_help.html

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{% extends "base.html" %}
2+
3+
{% block title %}{{ title }}{% endblock %}
4+
5+
{% block morecss %}
6+
.ietf-table .name { white-space: nowrap; padding-right: 1em; }
7+
.ietf-table .desc { max-width: 35em; }
8+
{% endblock %}
9+
10+
{% block content %}
11+
<h1>{{ title }}</h1>
12+
13+
{% if state_type.slug == "draft-iesg" %}
14+
<p><a href="/images/iesg_draft_state_diagram.png">View Diagram</a></p>
15+
{% endif %}
16+
17+
<table class="ietf-table">
18+
<tr>
19+
<th>State</th>
20+
<th>Description</th>
21+
{% if has_next_states %}<th>Next State</th>{% endif %}
22+
</tr>
23+
24+
{% for state in states %}
25+
<tr id="{{ state.slug }}" class="{{ forloop.counter|divisibleby:2|yesno:"evenrow,oddrow" }}">
26+
<td class="name">{{ state.name }}</td>
27+
<td class="desc">{{ state.desc|linebreaksbr }}</td>
28+
{% if has_next_states %}
29+
<td class="name">
30+
{% for s in state.next_states.all %}
31+
{{ s.name }}<br/>
32+
{% endfor %}
33+
</td>
34+
{% endif %}
35+
</tr>
36+
{% endfor %}
37+
</table>
38+
39+
{% if tags %}
40+
<h2>Tags</h2>
41+
42+
<table class="ietf-table">
43+
<tr>
44+
<th>Tag</th>
45+
<th>Description</th>
46+
</tr>
47+
48+
{% for tag in tags %}
49+
<tr id="{{ tag.slug }}" class="{{ forloop.counter|divisibleby:2|yesno:"evenrow,oddrow" }}">
50+
<td class="name">{{ tag.name }}</td>
51+
<td class="desc">{{ tag.desc|linebreaksbr }}</td>
52+
</tr>
53+
{% endfor %}
54+
</table>
55+
{% endif %}
56+
57+
{% endblock %}

ietf/templates/doc/states.html

Lines changed: 0 additions & 31 deletions
This file was deleted.

ietf/templates/wgcharter/change_state.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<h1>{{ title }}</h1>
2222

2323
{% if not option %}
24-
<p class="helptext">For help on the states, see the <a href="{% url help_charter_states %}">state table</a>.</p>
24+
<p class="helptext">For help on the states, see the <a href="{% url state_help type="charter" %}">state table</a>.</p>
2525
{% endif %}
2626

2727
<form class="change-state" action="" method="post">
File renamed without changes.

0 commit comments

Comments
 (0)