From f250a653a2b3c31287b270b3beb9442786b4b923 Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Thu, 22 Jun 2023 18:35:59 +0300 Subject: [PATCH] fix: Remove IESG-related about tabs from non-IETF-stream docs (#5515) * fix: Remove IESG-related about tabs from non-IETF-stream docs Fixes #5514 * Fix code review comments * Address review comments * Address code review comments --- ietf/doc/views_doc.py | 47 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/ietf/doc/views_doc.py b/ietf/doc/views_doc.py index b693f54e13..c87602a9fc 100644 --- a/ietf/doc/views_doc.py +++ b/ietf/doc/views_doc.py @@ -114,13 +114,46 @@ def render_document_top(request, doc, tab, name): rsab_ballot, None if rsab_ballot else "RSAB Evaluation Ballot has not been created yet" )) - if doc.type_id in ("draft","conflrev", "statchg"): - tabs.append(("IESG Evaluation Record", "ballot", urlreverse("ietf.doc.views_doc.document_ballot", kwargs=dict(name=name)), iesg_ballot, None if iesg_ballot else "IESG Evaluation Ballot has not been created yet")) - elif doc.type_id == "charter" and doc.group.type_id == "wg": - tabs.append(("IESG Review", "ballot", urlreverse("ietf.doc.views_doc.document_ballot", kwargs=dict(name=name)), iesg_ballot, None if iesg_ballot else "IESG Review Ballot has not been created yet")) - - if doc.type_id == "draft" or (doc.type_id == "charter" and doc.group.type_id == "wg"): - tabs.append(("IESG Writeups", "writeup", urlreverse('ietf.doc.views_doc.document_writeup', kwargs=dict(name=name)), True, None)) + + if iesg_ballot or (doc.group and doc.group.type_id == "wg"): + if doc.type_id in ("draft", "conflrev", "statchg"): + tabs.append( + ( + "IESG Evaluation Record", + "ballot", + urlreverse( + "ietf.doc.views_doc.document_ballot", kwargs=dict(name=name) + ), + iesg_ballot, + None, + ) + ) + elif doc.type_id == "charter" and doc.group and doc.group.type_id == "wg": + tabs.append( + ( + "IESG Review", + "ballot", + urlreverse( + "ietf.doc.views_doc.document_ballot", kwargs=dict(name=name) + ), + iesg_ballot, + None, + ) + ) + if doc.type_id == "draft" or ( + doc.type_id == "charter" and doc.group and doc.group.type_id == "wg" + ): + tabs.append( + ( + "IESG Writeups", + "writeup", + urlreverse( + "ietf.doc.views_doc.document_writeup", kwargs=dict(name=name) + ), + True, + None, + ) + ) tabs.append(("Email expansions","email",urlreverse('ietf.doc.views_doc.document_email', kwargs=dict(name=name)), True, None)) tabs.append(("History", "history", urlreverse('ietf.doc.views_doc.document_history', kwargs=dict(name=name)), True, None))