Skip to content

Commit

Permalink
fix(doc): Unify help texts for document states (#6060)
Browse files Browse the repository at this point in the history
* Fix IESG State help text link (only)

* Intermediate checkpoint

* Correct URL filtering of state descriptions

* Unify help texts for document states

* Remove redundant load static from template

---------

Co-authored-by: Robert Sparks <[email protected]>
  • Loading branch information
jimfenton and rjsparks committed Aug 8, 2023
1 parent aa6136d commit 71ccba6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
5 changes: 4 additions & 1 deletion ietf/doc/views_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,11 +516,13 @@ def document_main(request, name, rev=None, document_html=False):
# Do not show the Auth48 URL in the "Additional URLs" section
additional_urls = doc.documenturl_set.exclude(tag_id='auth48')

# Stream description passing test
# Stream description and name passing test
if doc.stream != None:
stream_desc = doc.stream.desc
stream = "draft-stream-" + doc.stream.slug
else:
stream_desc = "(None)"
stream = "(None)"

html = None
js = None
Expand Down Expand Up @@ -557,6 +559,7 @@ def document_main(request, name, rev=None, document_html=False):
split_content=split_content,
revisions=simple_diff_revisions if document_html else revisions,
snapshot=snapshot,
stream=stream,
stream_desc=stream_desc,
latest_revision=latest_revision,
latest_rev=latest_rev,
Expand Down
7 changes: 4 additions & 3 deletions ietf/doc/views_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
from ietf.name.models import DocRelationshipName, DocTagName
from ietf.doc.utils import get_tags_for_stream_id

# TODO: This is haphazardly implemented. Either flesh it out or reconsider the utility of showing these in these this way.
def state_help(request, type):
def state_help(request, type=None):
slug, title = {
"draft-iesg": ("draft-iesg", "IESG States for Internet-Drafts"),
"draft-rfceditor": ("draft-rfceditor", "RFC Editor States for Internet-Drafts"),
"draft-iana-action": ("draft-iana-action", "IANA Action States for Internet-Drafts"),
"draft-iana-review": ("draft-iana-review", "IANA Review States for Internet-Drafts"),
"draft-iana-experts": ("draft-iana-experts", "IANA Expert Review States for Internet-Drafts"),
"draft-stream-ietf": ("draft-stream-ietf", "IETF Stream States for Internet-Drafts"),
"draft-stream-irtf": ("draft-stream-irtf", "IRTF Stream States for Internet-Drafts"),
"draft-stream-ise": ("draft-stream-ise", "ISE Stream States for Internet-Drafts"),
Expand All @@ -26,7 +27,7 @@ def state_help(request, type):
}.get(type, (None, None))
state_type = get_object_or_404(StateType, slug=slug)

states = State.objects.filter(type=state_type).order_by("order")
states = State.objects.filter(used=True, type=state_type).order_by("order")

has_next_states = False
for state in states:
Expand Down
12 changes: 6 additions & 6 deletions ietf/templates/doc/document_draft.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
{% if doc.stream %}
<th scope="row">
{% if doc.stream.slug != "legacy" %}
<a href="{% url "ietf.help.views.state" doc=doc.type.slug type=doc.stream.slug %}">
<a href="{% url "ietf.doc.views_help.state_help" type=stream %}">
{% if doc.stream_id == 'ietf' %}
WG
{% else %}
Expand Down Expand Up @@ -274,7 +274,7 @@
IESG
</th>
<th scope="row">
<a href="{% url "ietf.help.views.state" doc=doc.type.slug type="iesg" %}">
<a href="{% url "ietf.doc.views_help.state_help" type="draft-iesg" %}">
IESG state
</a>
</th>
Expand Down Expand Up @@ -468,7 +468,7 @@
IANA
</th>
<th scope="row">
<a href="{% url "ietf.help.views.state" doc=doc.type.slug type="iana-review" %}">
<a href="{% url "ietf.doc.views_help.state_help" type="draft-iana-review" %}">
IANA review state
</a>
</th>
Expand Down Expand Up @@ -497,7 +497,7 @@
{% if not can_edit_iana_state and not iana_review_state %}IANA{% endif %}
</th>
<th scope="row">
<a href="{% url "ietf.help.views.state" doc=doc.type.slug type="iana-action" %}">
<a href="{% url "ietf.doc.views_help.state_help" type="draft-iana-action" %}">
IANA action state
</a>
</th>
Expand Down Expand Up @@ -526,7 +526,7 @@
{% if not can_edit_iana_state and not iana_review_state and not iana_action_state %}IANA{% endif %}
</th>
<th scope="row">
<a href="{% url "ietf.help.views.state" doc=doc.type.slug type="iana-experts" %}">
<a href="{% url "ietf.doc.views_help.state_help" type="draft-iana-experts" %}">
IANA expert review state
</a>
</th>
Expand Down Expand Up @@ -587,7 +587,7 @@
RFC Editor
</th>
<th scope="row">
<a href="{% url "ietf.help.views.state" doc=doc.type.slug type="rfceditor" %}">
<a href="{% url "ietf.doc.views_help.state_help" type="draft-rfceditor" %}">
RFC Editor state
</a>
</th>
Expand Down
5 changes: 2 additions & 3 deletions ietf/templates/doc/state_help.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{% extends "base.html" %}
{# Copyright The IETF Trust 2015, All Rights Reserved #}
{% load origin %}
{% load static %}
{% load origin static ietf_filters textfilters %}
{% block title %}{{ title }}{% endblock %}
{% block pagehead %}
<link rel="stylesheet" href="{% static "ietf/css/list.css" %}">
Expand All @@ -27,7 +26,7 @@ <h1>{{ title }}</h1>
{% for state in states %}
<tr id="{{ state.slug|default:"idexists" }}">
<th scope="row">{{ state.name }}</th>
<td>{{ state.desc|safe|linebreaksbr }}</td>
<td>{{ state.desc|urlize_ietf_docs|linkify }}</td>
{% if has_next_states %}
<td>
{% for s in state.next_states.all %}
Expand Down

0 comments on commit 71ccba6

Please sign in to comment.