Skip to content

Commit feec689

Browse files
committed
changes to support consensus status. Commit ready for merge
- Legacy-Id: 8301
1 parent 96bccc7 commit feec689

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

ietf/doc/templatetags/ietf_filters.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import types
77
from email.utils import parseaddr
88

9+
from ietf.doc.models import ConsensusDocEvent
910
from django import template
1011
from django.utils.html import escape, fix_ampersands
1112
from django.template.defaultfilters import truncatewords_html, linebreaksbr, stringfilter, urlize
@@ -498,3 +499,16 @@ def plural(text, seq, arg=u's'):
498499
def ics_esc(text):
499500
text = re.sub(r"([\n,;\\])", r"\\\1", text)
500501
return text
502+
503+
@register.filter
504+
def consensus(doc):
505+
"""Returns document consensus Yes/No/Unknown."""
506+
event = doc.latest_event(ConsensusDocEvent,type="changed_consensus")
507+
if event:
508+
if event.consensus:
509+
return "Yes"
510+
else:
511+
return "No"
512+
else:
513+
return "Unknown"
514+

ietf/secr/templates/telechat/doc.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{% extends "telechat/base_telechat.html" %}
2+
{% load ietf_filters %}
23

34
{% block breadcrumbs %}{{ block.super }}
45
» {{ date }}
@@ -20,6 +21,7 @@ <h3>{{ document.name }}-{{ document.rev }} ({{ document.intended_std_level }})</
2021
{% if conflictdoc %}References: <a href="{{ conflictdoc.get_absolute_url }}">{{ conflictdoc }}</a><br />{% endif %}
2122
<a href="#writeup">Ballot Writeup</a><br />
2223
Token: {{ document.ad.name }}<br />
24+
{% if document.type_id == "draft" %}Consensus: {{ document|consensus }}<br />{% endif %}
2325
Number of Open Positions: {{ open_positions }}<br />
2426
<br />
2527
<div>

ietf/templates/iesg/moderator_doc.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
<i>({{ doc.title }})</i><br>
4242
<b>
4343
Intended status: {{ doc.intended_std_level }}<br>
44+
Consensus: <a href="{% url "doc_edit_consensus" name=doc.name %}">{{ doc|consensus }}</a><br>
4445
Token: {{ doc.ad.plain_name }}<br>
4546
{% if doc.type_id == "draft" %}
4647
Last call ends: {{ doc.most_recent_ietflc.expires.date|default:"(none)" }}

0 commit comments

Comments
 (0)