From 8391840015cad6654629cef39cdaf7d3c057acf5 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz <henrik@levkowetz.com> Date: Mon, 22 Jun 2015 20:37:07 +0000 Subject: [PATCH] Merged in [9663] from rjsparks@nostrum.com: Try a different way of wrapping ballot/comment fields and shepherd writeups. Related to #1673. - Legacy-Id: 9679 Note: SVN reference [9663] has been migrated to Git commit 3c03290a52e80c2d855d4a7b291ac0747e3d8681 --- ietf/templates/doc/document_ballot_content.html | 4 ++-- ietf/templates/doc/shepherd_writeup.html | 3 ++- static/css/ietf.css | 7 +++++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ietf/templates/doc/document_ballot_content.html b/ietf/templates/doc/document_ballot_content.html index 375e35480..4d35727d1 100644 --- a/ietf/templates/doc/document_ballot_content.html +++ b/ietf/templates/doc/document_ballot_content.html @@ -97,7 +97,7 @@ <div class="panel-heading"> <h5 class="panel-title"><b>{{ p.pos.name }}</b> ({{ p.discuss_time|date:"Y-m-d" }}{% if not p.for_current_revision %} for -{{ p.get_dochistory.rev}}{% endif %})</h5> </div> - <div class="panel-body"><pre class="ballot">{{ p.discuss|wrap_text:80|escape|urlize }}</pre></div> + <div class="panel-body"><pre class="ballot pasted">{{ p.discuss|escape|urlize }}</pre></div> </div> {% endif %} @@ -106,7 +106,7 @@ <div class="panel-heading"> <h5 class="panel-title"><b>Comment</b> ({{ p.comment_time|date:"Y-m-d" }}{% if not p.for_current_revision %} for -{{ p.get_dochistory.rev}}{% endif %})</h5> </div> - <div class="panel-body"><pre class="ballot">{{ p.comment|wrap_text:80|escape|urlize }}</pre></div> + <div class="panel-body"><pre class="ballot pasted">{{ p.comment|escape|urlize }}</pre></div> </div> {% endif %} {% endfor %} diff --git a/ietf/templates/doc/shepherd_writeup.html b/ietf/templates/doc/shepherd_writeup.html index f2b4ec63b..b3feb1242 100644 --- a/ietf/templates/doc/shepherd_writeup.html +++ b/ietf/templates/doc/shepherd_writeup.html @@ -1,6 +1,7 @@ {% extends "base.html" %} {# Copyright The IETF Trust 2015, All Rights Reserved #} {% load origin %} +{% load ietf_filters %} {% block title %} Shepherd writeup for {{ doc.canonical_name }}-{{ doc.rev }} @@ -10,7 +11,7 @@ {% origin %} <h1>Shepherd writeup<br><small>{{ doc.canonical_name }}-{{ doc.rev }}</small></h1> - <pre>{{writeup}}</pre> + <pre class="pasted">{{writeup|escape|urlize}}</pre> {% if can_edit %} <a class="btn btn-primary" href="{% url "doc_edit_shepherd_writeup" name=doc.name %}">Edit</a> diff --git a/static/css/ietf.css b/static/css/ietf.css index 92f87aee2..65874824f 100644 --- a/static/css/ietf.css +++ b/static/css/ietf.css @@ -195,6 +195,13 @@ pre { white-space: pre; } +/* Some chunks of text are likely to be pasted into fields from other editing environments + which do various things with line-wrapping. Preserve whitespace to the extent possible. */ +.pasted { + white-space: pre-wrap; + word-break: keep-all; +} + /* Make ampersands pretty */ /* This sets ampersand in a different font than the rest of the text. Fancy, but it's really better to select a pretty font in the first place. Additionally, _which_ 'pretty'