diff --git a/ietf/idrfc/views_doc.py b/ietf/idrfc/views_doc.py index 15f3243f8..f01a48a4a 100644 --- a/ietf/idrfc/views_doc.py +++ b/ietf/idrfc/views_doc.py @@ -50,7 +50,7 @@ from ietf.idrfc import markup_txt from ietf.idrfc.models import RfcIndex, DraftVersions from ietf.idrfc.idrfc_wrapper import BallotWrapper, IdWrapper, RfcWrapper from ietf.ietfworkflows.utils import get_full_info_for_draft -from ietf.doc.models import Document, DocEvent, NewRevisionDocEvent, WriteupDocEvent +from ietf.doc.models import Document, DocEvent, NewRevisionDocEvent, WriteupDocEvent, TelechatDocEvent from ietf.doc.utils import get_chartering_type from ietf.utils.history import find_history_active_at from ietf.ietfauth.decorators import has_role @@ -121,17 +121,11 @@ def document_main(request, name, rev=None): if doc.type_id == "charter": - # FIXME: add editing of charters/telechat date - # FIXME: check sanity of edit buttons "Recharter" - # FIXME: clean up wgcharter code redundant with this - filename = doc.name + "-" + doc.rev + ".txt" content = _get_html(filename, os.path.join(settings.CHARTER_PATH, filename), split=False) - telechat = None - if not snapshot: - telechat = doc.latest_event(type="scheduled_for_telechat") + telechat = doc.latest_event(TelechatDocEvent, type="scheduled_for_telechat") return render_to_response("idrfc/document_charter.html", dict(doc=doc, @@ -202,12 +196,6 @@ def document_history(request, name): e.rev = cur_rev - # add snippets - for e in events: - e.desc_snippet = truncatewords_html(format_textarea(fill(e.desc, 80)), 3) - if not e.desc_snippet.endswith("..."): - e.desc_snippet = None - return render_to_response("idrfc/document_history.html", dict(doc=doc, top=top, diff --git a/ietf/idtracker/templatetags/ietf_filters.py b/ietf/idtracker/templatetags/ietf_filters.py index 4bb35bc49..70ce079db 100644 --- a/ietf/idtracker/templatetags/ietf_filters.py +++ b/ietf/idtracker/templatetags/ietf_filters.py @@ -445,9 +445,9 @@ def ad_area(user): def format_history_text(text): """Run history text through some cleaning and add ellipsis if it's too long.""" full = mark_safe(sanitize_html(keep_spacing(linebreaksbr(urlize(mark_safe(text)))))) - snipped = truncatewords_html(format_textarea(fill(text, 80)), 25) - if snipped[-3:] == "...": - return mark_safe(u'
%s
[show all]
' % (snipped, full)) + snippet = truncatewords_html(format_textarea(fill(text, 80)), 25) + if snippet[-3:] == "...": + return mark_safe(u'
%s[show all]
' % (snippet, full)) return full @register.filter diff --git a/ietf/templates/idrfc/document_history.html b/ietf/templates/idrfc/document_history.html index f6060c57c..8c2e789da 100644 --- a/ietf/templates/idrfc/document_history.html +++ b/ietf/templates/idrfc/document_history.html @@ -68,21 +68,13 @@ {{ e.time|date:"Y-m-d" }} {{ e.rev }} {{ e.by|escape }} - {% if e.desc_snippet %} -
{{ e.desc_snippet|safe }} [show all]
- - {% else %} - {{ e.desc|fill:"80"|safe|urlize|linebreaksbr|keep_spacing|sanitize_html|safe }} - {% endif %} + {{ e.desc|format_history_text }} {% endfor %} - {% endblock content %} {% block content_end %} - + {% endblock content_end %} diff --git a/static/css/base2.css b/static/css/base2.css index ef0dd7706..0a4c06428 100644 --- a/static/css/base2.css +++ b/static/css/base2.css @@ -133,6 +133,8 @@ table.ballot_icon td.ballot_icon_my { border: 3px outset black;} .ietf-highlight-r { padding:0 2px;background:#ffa0a0;} .ietf-divider { background: #2647a0; color: white; font-size:116%; padding:0.5em 1em; } +table.history .snippet .showAll { color: blue; cursor: pointer; } + .error-text { font-size: 1.095em; width: 48em; diff --git a/static/js/doc-history.js b/static/js/history.js similarity index 100% rename from static/js/doc-history.js rename to static/js/history.js