From 08c1c0cb191d662270e5a373a85f090ffcbf7023 Mon Sep 17 00:00:00 2001 From: Richard Barnes Date: Sun, 29 Jul 2012 01:09:41 +0000 Subject: [PATCH] Adjusted the scribe template to make it XHTML compliant and fix what Robert broke - Legacy-Id: 4724 --- ietf/doc/models.py | 25 ++++++ ietf/manage.py | 3 + ietf/templates/iesg/scribe_doc.html | 101 ++++++++++++++--------- ietf/templates/iesg/scribe_doc2.html | 39 ++++----- ietf/templates/iesg/scribe_template.html | 12 +-- 5 files changed, 117 insertions(+), 63 deletions(-) diff --git a/ietf/doc/models.py b/ietf/doc/models.py index d30b2bb66..315e822e7 100644 --- a/ietf/doc/models.py +++ b/ietf/doc/models.py @@ -8,6 +8,7 @@ from ietf.group.models import * from ietf.name.models import * from ietf.person.models import Email, Person from ietf.utils.admin import admin_link +from ietf.doc.utils import active_ballot import datetime, os @@ -248,6 +249,30 @@ class Document(DocumentInfo): return self.latest_event(type="changed_document", desc__startswith="State changed to IESG Evaluation - Defer") return None + def active_ballot(self): + ballot = self.latest_event(BallotDocEvent, type="created_ballot") + e = self.latest_event(BallotDocEvent, ballot_type__slug=ballot.ballot_type.slug) if ballot else None + open = e and not e.type == "closed_ballot" + return ballot.ballot_type if open else None + + def active_ballot_positions(self): + """Return dict mapping each active AD to a current ballot position (or None if they haven't voted).""" + active_ads = list(Person.objects.filter(role__name="ad", role__group__state="active")) + res = {} + + ballot = self.latest_event(BallotDocEvent, type="created_ballot") + positions = BallotPositionDocEvent.objects.filter(doc=self, type="changed_ballot_position", ad__in=active_ads, ballot=ballot).select_related('ad', 'pos').order_by("-time", "-id") + + for pos in positions: + if pos.ad not in res: + res[pos.ad] = pos + + for ad in active_ads: + if ad not in res: + res[ad] = None + + return res.values() + def displayname_with_link(self): return '%s-%s' % (self.get_absolute_url(), self.name , self.rev) diff --git a/ietf/manage.py b/ietf/manage.py index 56c3d7782..003848e15 100755 --- a/ietf/manage.py +++ b/ietf/manage.py @@ -1,6 +1,9 @@ #!/usr/bin/env python # Copyright The IETF Trust 2007, All Rights Reserved +import sys +sys.path.insert(0, '../') + # Don't complain about these DeprecationWarnings (we still # want to see others, though) import warnings diff --git a/ietf/templates/iesg/scribe_doc.html b/ietf/templates/iesg/scribe_doc.html index 9266f66f8..9ef60865a 100644 --- a/ietf/templates/iesg/scribe_doc.html +++ b/ietf/templates/iesg/scribe_doc.html @@ -32,45 +32,68 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. {% endcomment %}{% comment %} Some parts Copyright (c) 2009 The IETF Trust, all rights reserved. -{% endcomment %}{% load ietf_filters %} -{% if title2_first %}{% if title1_first %}

{{ title1 }}

{% endif %} -

{{ title2 }}

-{% endif %}

{{ title3 }}

+{% endcomment %} +{% load ietf_filters %} +{% if title2_first %} + {% if title1_first %} +

{{ title1 }}

+ {% endif %} +

{{ title2 }}

+ {% endif %}

{{ title3 }}

+ + diff --git a/ietf/templates/iesg/scribe_doc2.html b/ietf/templates/iesg/scribe_doc2.html index 233da157e..67aa1622e 100644 --- a/ietf/templates/iesg/scribe_doc2.html +++ b/ietf/templates/iesg/scribe_doc2.html @@ -32,27 +32,28 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -->{% endcomment %}{% comment %} Some parts Copyright (c) 2009 The IETF Trust, all rights reserved. -{% endcomment %}{% load ietf_filters %} +{% endcomment %} +{% load ietf_filters %} -

{{ doc.obj.document.filename }}

-{% if doc.obj.ballot.active %} -
    -{% for p in doc.obj.active_positions|dictsort:"ad.last_name" %} +

    {{ doc.obj.name }}

    -{% if p.pos and p.pos.pos_id == "discuss" %} -
  1. {{ p.ad.plain_name }}: Discuss [{{ p.pos.discuss_time|date:"Y-m-d" }}]:
    -
    {{ p.pos.orig.discuss|wrap_text:80|escape }}
    -
  2. -{% endif %} - -{% if p.pos and p.pos.comment %} -
  3. {{ p.ad.plain_name }}: Comment [{{ p.pos.comment_time|date:"Y-m-d" }}]:
    -
    {{ p.pos.comment|wrap_text:80|escape }}
    -
  4. -{% endif %} -{% endfor %} - -
+{% if doc.obj.active_ballot %} + {% endif%} diff --git a/ietf/templates/iesg/scribe_template.html b/ietf/templates/iesg/scribe_template.html index ef99cf6d3..282525e8d 100644 --- a/ietf/templates/iesg/scribe_template.html +++ b/ietf/templates/iesg/scribe_template.html @@ -32,11 +32,13 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. {% endcomment %}{% comment %} Some parts Copyright (c) 2009 The IETF Trust, all rights reserved. -{% endcomment %} - +{% endcomment %} + - - + + IESG Agenda - Scribe Template {% load ietf_filters %}{% filter compress_empty_lines %} @@ -46,7 +48,7 @@ Some parts Copyright (c) 2009 The IETF Trust, all rights reserved. {% include "iesg/agenda_outline_23.html" %} {% endwith %} -
+

Appendix: Snapshot of discusses/comments

(at {% now "Y-m-d H:i:s T" %})