Allow IAB, IRTF, and Independent streams to use new capability for RFC Editor Notes. Do not display of document shepherd and shepherd writeup for non-IETF stream documents. Do not display IESG information for IAB stream documents.

- Legacy-Id: 10834
This commit is contained in:
Russ Housley 2016-02-11 22:12:52 +00:00
parent 8b87125716
commit 6cf8680a16
7 changed files with 109 additions and 48 deletions

View file

@ -243,6 +243,9 @@ def generate_publication_request(request, doc):
approving_body = str(doc.stream)
consensus_body = approving_body
e = doc.latest_event(WriteupDocEvent, type="changed_rfc_editor_note_text")
rfcednote = e.text if e else ""
return render_to_string("doc/mail/publication_request.txt",
dict(doc=doc,
doc_url=settings.IDTRACKER_BASE_URL + doc.get_absolute_url(),
@ -250,6 +253,7 @@ def generate_publication_request(request, doc):
approving_body=approving_body,
consensus_body=consensus_body,
consensus=consensus,
rfc_editor_note=rfcednote,
)
)

View file

@ -234,7 +234,10 @@ class DocumentInfo(models.Model):
def has_rfc_editor_note(self):
e = self.latest_event(WriteupDocEvent, type="changed_rfc_editor_note_text")
return bool(e and (e.text != ""))
if e and (e.text != ""):
return e.time
else:
return False
def meeting_related(self):
answer = False

View file

@ -421,15 +421,49 @@ class BallotWriteupsTests(TestCase):
e.text = u"Test note to the RFC Editor text."
e.save()
# IETF Stream Documents
for p in ['doc_ballot_approvaltext','doc_ballot_writeupnotes','doc_ballot_rfceditornote']:
url = urlreverse(p, kwargs=dict(name=draft.name))
for username in ['plain','marschairman','iana','iab chair']:
for username in ['plain','marschairman','iab chair','irtf chair','ise','iana']:
verify_fail(username, url)
for username in ['secretary','ad']:
verify_can_see(username, url)
# RFC Editor Notes for documents in the IAB Stream
draft.stream_id = 'iab'
draft.save()
url = urlreverse('doc_ballot_rfceditornote', kwargs=dict(name=draft.name))
for username in ['plain','marschairman','ad','irtf chair','ise','iana']:
verify_fail(username, url)
for username in ['secretary','iab chair']:
verify_can_see(username, url)
# RFC Editor Notes for documents in the IRTF Stream
draft.stream_id = 'irtf'
draft.save()
url = urlreverse('doc_ballot_rfceditornote', kwargs=dict(name=draft.name))
for username in ['plain','marschairman','ad','iab chair','ise','iana']:
verify_fail(username, url)
for username in ['secretary','irtf chair']:
verify_can_see(username, url)
# RFC Editor Notes for documents in the IAB Stream
draft.stream_id = 'ise'
draft.save()
url = urlreverse('doc_ballot_rfceditornote', kwargs=dict(name=draft.name))
for username in ['plain','marschairman','ad','iab chair','irtf chair','iana']:
verify_fail(username, url)
for username in ['secretary','ise']:
verify_can_see(username, url)
class ApproveBallotTests(TestCase):
def test_approve_ballot(self):
draft = make_test_data()

View file

@ -23,7 +23,7 @@ from ietf.doc.mails import ( email_ballot_deferred, email_ballot_undeferred,
generate_approval_mail )
from ietf.doc.lastcall import request_last_call
from ietf.iesg.models import TelechatDate
from ietf.ietfauth.utils import has_role, role_required
from ietf.ietfauth.utils import has_role, role_required, is_authorized_in_doc_stream
from ietf.message.utils import infer_message
from ietf.name.models import BallotPositionName
from ietf.person.models import Person
@ -592,15 +592,16 @@ class BallotRfcEditorNoteForm(forms.Form):
def clean_rfc_editor_note(self):
return self.cleaned_data["rfc_editor_note"].replace("\r", "")
@role_required('Area Director','Secretariat')
@role_required('Area Director','Secretariat','IAB Chair','IRTF Chair','ISE')
def ballot_rfceditornote(request, name):
"""Editing of RFC Editor Note in the ballot"""
"""Editing of RFC Editor Note"""
doc = get_object_or_404(Document, docalias__name=name)
if not is_authorized_in_doc_stream(request.user, doc):
return HttpResponseForbidden("You do not have the necessary permissions to change the RFC Editor Note for this document")
login = request.user.person
existing = doc.latest_event(WriteupDocEvent, type="changed_rfc_editor_note_text")
if not existing or (existing.text == ""):
existing = generate_ballot_rfceditornote(request, doc)

View file

@ -4,12 +4,12 @@
{% load bootstrap3 %}
{% block title %}RFC Editor Note for ballot for {{ doc }}{% endblock %}
{% block title %}RFC Editor Note for {{ doc }}{% endblock %}
{% block content %}
{% origin %}
<h1>RFC Editor Note for ballot<br><small><a href="{% url "doc_view" name=doc.canonical_name %}">{{ doc }}</a></small></h1>
<h1>RFC Editor Note for<br><small><a href="{% url "doc_view" name=doc.canonical_name %}">{{ doc }}</a></small></h1>
{% bootstrap_messages %}

View file

@ -264,42 +264,56 @@
</tr>
{% endif %}
{% if stream_state_type_slug == "draft-stream-ietf" %}
<tr>
<th></th>
<th>Document shepherd</th>
<td class="edit">
{% if can_edit_stream_info %}
{% if can_edit_stream_info %}
<a class="btn btn-default btn-xs" href="{% url "doc_edit_shepherd" name=doc.name %}">Edit</a>
{% elif is_shepherd %}
{% elif is_shepherd %}
<a class="btn btn-default btn-xs" href="{% url "doc_change_shepherd_email" name=doc.name %}">Change Email</a>
{% endif %}
{% endif %}
</td>
<td>
{% if doc.shepherd %}{{ doc.shepherd.person }}{% else %}No shepherd assigned{% endif %}
{% if doc.shepherd %}{{ doc.shepherd.person }}{% else %}No shepherd assigned{% endif %}
</td>
</tr>
{% if shepherd_writeup or can_edit_shepherd_writeup %}
{% if shepherd_writeup or can_edit_shepherd_writeup %}
<tr>
<th></th>
<th>Shepherd write-up</th>
<td class="edit">
{% if can_edit_shepherd_writeup %}
{% url "doc_edit_shepherd_writeup" name=doc.name as doc_edit_url %}
{% if doc_edit_url %}
{% if can_edit_shepherd_writeup %}
{% url "doc_edit_shepherd_writeup" name=doc.name as doc_edit_url %}
{% if doc_edit_url %}
<a class="btn btn-default btn-xs" href="{{doc_edit_url}}">Edit</a>
{% endif %}
{% endif %}
{% endif %}
</td>
<td>
{% if shepherd_writeup %}
{% if shepherd_writeup %}
<a class="btn btn-default btn-xs" href="{% url "doc_shepherd_writeup" name=doc.name %}">Show</a>
(last changed {{ shepherd_writeup.time|date:"Y-m-d"}})
{% else %}
{% else %}
(None)
{% endif %}
{% endif %}
</td>
</tr>
{% endif %}
{% else %}
<tr>
<th></th>
<th>RFC Editor Note</th>
<td class="edit">
{% if can_edit_stream_info %}
<a class="btn btn-default btn-xs" href="{% url "doc_ballot_rfceditornote" name=doc.name %}">Edit</a>
{% endif %}
</td>
<td>
{% if doc.has_rfc_editor_note %}(last changed {{ doc.has_rfc_editor_note|date:"Y-m-d"}}){% else %}(None){% endif %}
</td>
{% endif %}
{% if published and started_iesg_process and published.time < started_iesg_process.time %}
@ -310,58 +324,60 @@
{% endif %}
</tbody>
{% if not stream_state_type_slug == "draft-stream-iab" %}
<tbody class="meta">
<tr>
<th>IESG</th>
<th><a href="{% url "ietf.help.views.state" doc=doc.type.slug type="iesg" %}">IESG state</a></th>
<td class="edit">
{% if iesg_state and can_edit %}
{% if iesg_state and can_edit %}
<a class="btn btn-default btn-xs" href="{% url "doc_change_state" name=doc.name %}">Edit</a>
{% endif %}
{% endif %}
</td>
<td>
{{ iesg_state_summary|default:"I-D Exists" }}
{{ iesg_state_summary|default:"I-D Exists" }}
</td>
</tr>
{% if consensus and stream_state_type_slug == "draft-stream-ietf" %}
{% if consensus and stream_state_type_slug == "draft-stream-ietf" %}
<tr>
<th></th>
<th>Consensus</th>
<td class="edit">
{% if can_edit or can_edit_stream_info %}
{% if can_edit or can_edit_stream_info %}
<a class="btn btn-default btn-xs" href="{% url "doc_edit_consensus" name=doc.name %}">Edit</a>
{% endif %}
{% endif %}
</td>
<td>
<span title="Whether the document is the result of a community consensus process as defined in RFC 5741">{{ consensus }}</span>
</td>
</tr>
{% endif %}
{% endif %}
<tr>
<th></th>
<th>Telechat date</th>
<td class="edit">
{% if can_edit %}
{% if can_edit %}
<a class="btn btn-default btn-xs" href="{% url "doc_change_telechat_date" name=doc.name %}">Edit</a>
{% endif %}
{% endif %}
</td>
<td>
{% if telechat %}
{% if telechat %}
On agenda of {{ telechat.telechat_date }} IESG telechat
{% if telechat.returning_item %}
{% if telechat.returning_item %}
(returning item)
{% endif %}
{% else %}
{% if can_edit %}
{% endif %}
{% else %}
{% if can_edit %}
(None)
{% endif %}
{% endif %}
{% endif %}
{% if ballot_summary %}
{% if ballot_summary %}
<br><i>{{ ballot_summary }}</i>
{% endif %}
{% endif %}
</td>
</tr>
@ -369,30 +385,30 @@
<th></th>
<th>Responsible AD</th>
<td class="edit">
{% if can_edit %}
{% if can_edit %}
<a class="btn btn-default btn-xs" href="{% url "doc_change_ad" name=doc.name %}">Edit</a>
{% endif %}
{% endif %}
</td>
<td>
{{ doc.ad|default:"(None)" }}
{{ doc.ad|default:"(None)" }}
</td>
</tr>
{% if iesg_state %}
{% if doc.note or can_edit %}
{% if iesg_state %}
{% if doc.note or can_edit %}
<tr>
<th></th>
<th>IESG note</th>
<td class="edit">
{% if can_edit %}
{% if can_edit %}
<a class="btn btn-default btn-xs" href="{% url "doc_change_iesg_note" name=doc.name %}">Edit</a>
{% endif %}
{% endif %}
</td>
<td>
{{ doc.note|default:"(None)"|linebreaksbr }}
{{ doc.note|default:"(None)"|linebreaksbr }}
</td>
</tr>
{% endif %}
{% endif %}
{% endif %}
<tr>
@ -409,6 +425,7 @@
</tr>
</tbody>
{% endif %}
{% if iana_review_state %}
<tbody class="meta">

View file

@ -7,7 +7,7 @@ This document is the product of the {{ group_description }}.{% endif %}{% endfil
URL: {{ doc_url }}
{% filter wordwrap:73 %}{% if consensus != None %}The document {% if consensus %}represents{% else %}does not necessarily represent{% endif%} the consensus of the {{ consensus_body }}.
{% filter wordwrap:73 %}{% if consensus != None %}The document {% if consensus %}represents{% else %}does not necessarily represent{% endif %} the consensus of the {{ consensus_body }}.
{% endif %}No IANA allocation in the document requires IETF Consensus or Standards Action.{% endfilter %}
@ -17,4 +17,6 @@ URL: {{ doc_url }}
[OPTIONAL: Include statement of the purpose of publishing this document, its intended audience, its merits and significance.]
[OPTIONAL: Include suggested names and contact information for one or more competent and independent potential reviewers for the document (this can speed the review and approval process).]
{% if doc.has_rfc_editor_note %}{% filter wordwrap:73 %}{{ rfc_editor_note }}{% endfilter %}{% endif %}
{% endautoescape %}