Adjusted the scribe template to make it XHTML compliant and fix what Robert broke

- Legacy-Id: 4724
This commit is contained in:
Richard Barnes 2012-07-29 01:09:41 +00:00
parent 8ff61de5f2
commit 08c1c0cb19
5 changed files with 117 additions and 63 deletions

View file

@ -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 <b>IESG Evaluation - Defer</b>")
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 '<a href="%s">%s-%s</a>' % (self.get_absolute_url(), self.name , self.rev)

View file

@ -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

View file

@ -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 %}<p><b>{{ title1 }}</b></p>{% endif %}
<p><b>{{ title2 }}</b></p>
{% endif %}<p><b>{{ title3 }}</b></p>
{% endcomment %}
{% load ietf_filters %}
{% if title2_first %}
{% if title1_first %}
<p><b>{{ title1 }}</b></p>
{% endif %}
<p><b>{{ title2 }}</b></p>
{% endif %}<p><b>{{ title3 }}</b></p>
<ul>
{% for doc in section_docs %}
<li>
{{ doc.obj.title|escape }} ({{ doc.obj.intended_std_level }})
<br/><a href="{% url doc_view name=doc.obj.canonical_name %}">{{doc.obj.canonical_name}}</a>
{% with doc.obj.rfc_number as rfc_number %}
{% if rfc_number %}
<a href="http://www.rfc-editor.org/rfc/rfc{{rfc_number}}/">[txt]</a>
{% else %}
<a href="http://www.ietf.org/id/{{doc.obj.canonical_name}}-{{doc.obj.rev}}.txt">[txt]</a>
{% endif %}
{% endwith %}
<br/>Token: {{ doc.obj.ad|escape }} ({{doc.obj.area_acronym}} area)
{% if doc.obj.note %}{# note: note is not escaped #}
<br/>Note: {{ doc.obj.note|safe }}
{% endif %}
{% for ipr in doc.obj.ipr %}
{% ifequal ipr.ipr.status 1 %}
<br/>IPR: <a href="http://datatracker.ietf.org/ipr/{{ ipr.ipr.ipr_id }}/">{{ ipr.ipr.title|escape }}</a>
{% endifequal %}
{% endfor %}
{% if doc.obj.active_ballot %}
<br/><b>Discusses/comments</b> <a href="http://datatracker.ietf.org/idtracker/ballot/{{doc.obj.canonical_name}}/">[ballot]</a>:
<ul>
{% for p in doc.obj.active_ballot_positions %}
{% if p.pos %}
{% if p.discuss %}
<li>
<a href="#{{doc.obj.name}}+{{p.ad|slugify}}+discuss">{{ p.ad }}: Discuss [{{ p.discuss_time }}]</a>:
<br/>{{ p.discuss }}
</li>
{% endif %}
{% if p.comment %}
<li>
<a href="#{{doc.obj.name}}+{{p.ad|slugify}}+comment">{{ p.ad }}: Comment [{{ p.comment_time }}]</a>:
<br/>{{ p.comment }}
</li>
{% endif %}
{% endif %}
{% endfor %}
</ul>
{% endif %}
<ol>
{% for doc in section_docs %}
<li>{{ doc.obj.document.title|escape }} ({{ doc.obj.document.intended_status }}){% if doc.obj.rfc_flag %}
<br><a href="http://tools.ietf.org/html/rfc{{doc.obj.document.rfc_number }}">{{ doc.obj.document.filename }}</a>
{% else %}
<br><a href="http://tools.ietf.org/html/{{doc.obj.document.filename}}-{{doc.obj.document.revision}}.html">{{doc.obj.document.filename}}-{{doc.obj.document.revision}}</a>
{% endif %} <br>Token: {{ doc.obj.token_name|escape }}
{% if doc.obj.note %}{# note: note is not escaped #} <br>Note: {{ doc.obj.note|safe }}
{% endif %}{% for ipr in doc.obj.draft.ipr.all %}{% ifequal ipr.ipr.status 1 %} <br>IPR: <a href="http://datatracker.ietf.org/ipr/{{ ipr.ipr.ipr_id }}/">{{ ipr.ipr.title|escape }}</a>{% endifequal %}
{% endfor %} {% if doc.obj.ballot.active %}<br><b>Discusses/comments</b> (from <a href="http://datatracker.ietf.org/idtracker/ballot/{{ doc.obj.ballot.ballot}}/">ballot {{doc.obj.ballot.ballot }})</a>:
<ol>
{% if USE_DB_REDESIGN_PROXY_CLASSES %}
{% for p in doc.obj.active_positions|dictsort:"ad.last_name" %}{% if p.pos %}{% ifequal p.pos.pos_id "discuss" %}<li><a href="#{{doc.obj.document.filename}}+{{p.pos.ad|slugify}}+discuss">{{ p.pos.ad.plain_name }}: Discuss [{{ p.pos.discuss_time.date }}]</a>:
<br>...
{% endifequal %}{% if p.pos.comment %} <li><a href="#{{doc.obj.document.filename}}+{{p.ad.plain_name|slugify}}+comment">{{ p.pos.ad.plain_name }}: Comment [{{ p.pos.comment_time.date }}]</a>:
<br>...
{% endif %}{% endif %}{% endfor %}
{% else %}
{% for position in doc.obj.ballot.positions.all|dictsort:"ad.last_name" %}{% ifequal position.discuss 1 %} <li><a href="#{{doc.obj.document.filename}}+{{position.ad|slugify}}+discuss">{{ position.ad }}:{% for item in doc.obj.ballot.discusses.all %}{% ifequal position.ad item.ad %} Discuss [{{ item.date }}]</a>:
<br>...
{% endifequal %}{% endfor %}{% endifequal %}{% for item in doc.obj.ballot.comments.all %}{% ifequal position.ad item.ad %} <li><a href="#{{doc.obj.document.filename}}+{{position.ad|slugify}}+comment">{{ position.ad }}: Comment [{{ item.date }}]</a>:
<br>...
{% endifequal %}{% endfor %}{% endfor %}
{% endif%}
</ol>
{%endif %} <p><b>Telechat</b>:
<ul>
<li>...
<li>...
<li>...
<li>...
<li>...
</ul><p>
<p><b>Telechat:</b></p>
<ul>
<li>...</li>
<li>...</li>
<li>...</li>
<li>...</li>
<li>...</li>
</ul>
</li>
{% empty %}
<li>(none)</li>
<li>(none)</li>
{% endfor %}
</ol>
</ul>

View file

@ -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 %}
<!-- ============================================================ -->
<p><b>{{ doc.obj.document.filename }}</b></p>
{% if doc.obj.ballot.active %}
<ol>
{% for p in doc.obj.active_positions|dictsort:"ad.last_name" %}
<p><b>{{ doc.obj.name }}</b></p>
{% if p.pos and p.pos.pos_id == "discuss" %}
<li><a name="{{doc.obj.document.filename}}+{{p.ad.plain_name|slugify}}+discuss">{{ p.ad.plain_name }}</a>: Discuss [{{ p.pos.discuss_time|date:"Y-m-d" }}]:<br>
<pre>{{ p.pos.orig.discuss|wrap_text:80|escape }}</pre>
</li>
{% endif %}
{% if p.pos and p.pos.comment %}
<li><a name="{{doc.obj.document.filename}}+{{p.ad.plain_name|slugify}}+comment">{{ p.ad.plain_name }}</a>: Comment [{{ p.pos.comment_time|date:"Y-m-d" }}]:<br>
<pre>{{ p.pos.comment|wrap_text:80|escape }}</pre>
</li>
{% endif %}
{% endfor %}
</ol>
{% if doc.obj.active_ballot %}
<ul>
{% for p in doc.obj.active_ballot_positions %}
{% if p.pos and p.discuss %}
<li>
<a name="{{doc.obj.name}}+{{p.ad|slugify}}+discuss">{{ p.ad }}: Discuss [{{ p.discuss_time }}]</a>:
<br/>{{ p.discuss }}
</li>
{% endif %}
{% if p.pos and p.comment %}
<li>
<a name="{{doc.obj.name}}+{{p.ad|slugify}}+comment">{{ p.ad }}: Comment [{{ p.comment_time }}]</a>:
<br/>{{ p.comment }}
</li>
{% endif %}
{% endfor %}
</ul>
{% endif%}

View file

@ -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 %}<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
{% endcomment %}<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>IESG Agenda - Scribe Template</title>
</head>
<body>
{% 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 %}
<hr>
<hr/>
<h2>Appendix: Snapshot of discusses/comments</h2>
<p>(at {% now "Y-m-d H:i:s T" %})</p>