diff --git a/ietf/doc/mails.py b/ietf/doc/mails.py index 73627baa8..75ef27638 100644 --- a/ietf/doc/mails.py +++ b/ietf/doc/mails.py @@ -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, ) ) diff --git a/ietf/doc/models.py b/ietf/doc/models.py index ced0d7043..b6639d8a1 100644 --- a/ietf/doc/models.py +++ b/ietf/doc/models.py @@ -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 diff --git a/ietf/doc/tests_ballot.py b/ietf/doc/tests_ballot.py index ecf4af059..68f4b4887 100644 --- a/ietf/doc/tests_ballot.py +++ b/ietf/doc/tests_ballot.py @@ -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() diff --git a/ietf/doc/views_ballot.py b/ietf/doc/views_ballot.py index 8053212e4..790bf0874 100644 --- a/ietf/doc/views_ballot.py +++ b/ietf/doc/views_ballot.py @@ -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) diff --git a/ietf/templates/doc/ballot/rfceditornote.html b/ietf/templates/doc/ballot/rfceditornote.html index 8555e1fe0..53e029351 100644 --- a/ietf/templates/doc/ballot/rfceditornote.html +++ b/ietf/templates/doc/ballot/rfceditornote.html @@ -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 %} -

RFC Editor Note for ballot
{{ doc }}

+

RFC Editor Note for
{{ doc }}

{% bootstrap_messages %} diff --git a/ietf/templates/doc/document_draft.html b/ietf/templates/doc/document_draft.html index 40a1a4918..405b51da7 100644 --- a/ietf/templates/doc/document_draft.html +++ b/ietf/templates/doc/document_draft.html @@ -264,41 +264,56 @@ {% endif %} - - - Document shepherd - - {% if can_edit_stream_info %} - Edit - {% elif is_shepherd %} - Change Email - {% endif %} - - - {% if doc.shepherd %}{{ doc.shepherd.person }}{% else %}No shepherd assigned{% endif %} - - - - {% if shepherd_writeup or can_edit_shepherd_writeup %} + {% if stream_state_type_slug == "draft-stream-ietf" %} - Shepherd write-up + Document shepherd - {% if can_edit_shepherd_writeup %} - {% url "doc_edit_shepherd_writeup" name=doc.name as doc_edit_url %} - {% if doc_edit_url %} - Edit - {% endif %} + {% if can_edit_stream_info %} + Edit + {% elif is_shepherd %} + Change Email {% endif %} - {% if shepherd_writeup %} - Show - (last changed {{ shepherd_writeup.time|date:"Y-m-d"}}) - {% else %} - (None) + {% if doc.shepherd %}{{ doc.shepherd.person }}{% else %}No shepherd assigned{% endif %} + + + + {% if shepherd_writeup or can_edit_shepherd_writeup %} + + + Shepherd write-up + + {% if can_edit_shepherd_writeup %} + {% url "doc_edit_shepherd_writeup" name=doc.name as doc_edit_url %} + {% if doc_edit_url %} + Edit + {% endif %} + {% endif %} + + + {% if shepherd_writeup %} + Show + (last changed {{ shepherd_writeup.time|date:"Y-m-d"}}) + {% else %} + (None) + {% endif %} + + + {% endif %} + {% else %} + + + RFC Editor Note + + {% if can_edit_stream_info %} + Edit {% endif %} + + {% if doc.has_rfc_editor_note %}(last changed {{ doc.has_rfc_editor_note|date:"Y-m-d"}}){% else %}(None){% endif %} + {% endif %} @@ -310,105 +325,108 @@ {% endif %} - - - IESG - IESG state - - {% if iesg_state and can_edit %} - Edit - {% endif %} - - - {{ iesg_state_summary|default:"I-D Exists" }} - - - {% if consensus and stream_state_type_slug == "draft-stream-ietf" %} + {% if not stream_state_type_slug == "draft-stream-iab" %} + - - Consensus + IESG + IESG state - {% if can_edit or can_edit_stream_info %} - Edit + {% if iesg_state and can_edit %} + Edit {% endif %} - {{ consensus }} + {{ iesg_state_summary|default:"I-D Exists" }} - {% endif %} - - - Telechat date - - {% if can_edit %} - Edit - {% endif %} - - - {% if telechat %} - On agenda of {{ telechat.telechat_date }} IESG telechat - {% if telechat.returning_item %} - (returning item) - {% endif %} - {% else %} - {% if can_edit %} - (None) - {% endif %} - {% endif %} - - {% if ballot_summary %} -
{{ ballot_summary }} - {% endif %} - - - - - - Responsible AD - - {% if can_edit %} - Edit - {% endif %} - - - {{ doc.ad|default:"(None)" }} - - - - {% if iesg_state %} - {% if doc.note or can_edit %} + {% if consensus and stream_state_type_slug == "draft-stream-ietf" %} - IESG note + Consensus - {% if can_edit %} - Edit + {% if can_edit or can_edit_stream_info %} + Edit {% endif %} - {{ doc.note|default:"(None)"|linebreaksbr }} + {{ consensus }} - {% endif %} - {% endif %} + {% endif %} - - - Send notices to - - {% if can_edit_notify %} - Edit + + + Telechat date + + {% if can_edit %} + Edit + {% endif %} + + + {% if telechat %} + On agenda of {{ telechat.telechat_date }} IESG telechat + {% if telechat.returning_item %} + (returning item) + {% endif %} + {% else %} + {% if can_edit %} + (None) + {% endif %} + {% endif %} + + {% if ballot_summary %} +
{{ ballot_summary }} + {% endif %} + + + + + + Responsible AD + + {% if can_edit %} + Edit + {% endif %} + + + {{ doc.ad|default:"(None)" }} + + + + {% if iesg_state %} + {% if doc.note or can_edit %} + + + IESG note + + {% if can_edit %} + Edit + {% endif %} + + + {{ doc.note|default:"(None)"|linebreaksbr }} + + {% endif %} - - - {{ doc.notify|default:"(None)"}} - - + {% endif %} - + + + Send notices to + + {% if can_edit_notify %} + Edit + {% endif %} + + + {{ doc.notify|default:"(None)"}} + + + + + {% endif %} {% if iana_review_state %} diff --git a/ietf/templates/doc/mail/publication_request.txt b/ietf/templates/doc/mail/publication_request.txt index f314d4190..d4a0de1b4 100644 --- a/ietf/templates/doc/mail/publication_request.txt +++ b/ietf/templates/doc/mail/publication_request.txt @@ -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 %}