datatracker/ietf/templates/person/profile.html
Lars Eggert 5598762608
fix: add more HTML validation & fixes (#3891)
* Update vnu.jar

* Fix py2 -> py3 issue

* Run pyupgrade

* test: Add default-jdk to images

* test: Add option to also validate HTML with vnu.jar

Since it's already installed in bin. Don't do this by default, since it
increases the time needed for tests by ~50%.

* fix: Stop the urlizer from urlizing in linkified mailto: text

* More HTML fixes

* More HTML validation fixes

* And more HTML fixes

* Fix floating badge

* Ignore unicode errors

* Only URLize docs that are existing

* Final fixes

* Don't URLize everything during test-crawl

* Feed HTML into vnu using python rather than Java to speed things up

* Allow test-crawl to start vnu on a different port

* Increase retry count to vnu. Restore batch size to 30.

* More HTML validation fixes

* Use urllib3 to make requests to vnu, since overriding requests_mock is tricky

* Undo commit of unmodified file

* Also urlize ftp links

* Fix matching of file name

* More HTML fixes

* Add `is_valid_url` filter

* weekday -> data-weekday

* urlencode URLs

* Add and use vnu_fmt_message. Bump vnu max buffer.

* Simplify doc_exists

* Don't add tab link to mail archive if the URL is invalid

* Run urlize_ietf_docs before linkify

Reduces the possibility of generating incorrect HTML

* Undo superfluous change

* Runner fixes

* Consolidate vnu message filtering into vnu_filter_message

* Correctly handle multiple persons with same name

* Minimze diff

* Fix HTML nits

* Print source snippet in vnu_fmt_message

* Only escape if there is something to escape

* Fix snippet

* Skip crufty old IPR declarations

* Only include modal when needed. Add handles.

* Fix wordwrap+linkification

* Update ietf/doc/templatetags/ietf_filters.py

* Update ietf/doc/templatetags/tests_ietf_filters.py

* Don't right-align second column
2022-05-03 13:55:48 -05:00

186 lines
8 KiB
HTML

{% extends "base.html" %}
{# Copyright The IETF Trust 2015, All Rights Reserved #}
{% load origin %}
{% load markup_tags %}
{% load static %}
{% load ietf_filters textfilters %}
{% load group_filters %}
{% block pagehead %}
<link rel="stylesheet" href="{% static "ietf/css/list.css" %}">
{% endblock %}
{% block title %}Profile for {{ persons.0 }}{% endblock %}
{% block content %}
{% origin %}
{% if persons|length > 1 %}
<p class="alert alert-warning my-3">
More than one person with this name has been found. Showing all.
</p>
{% endif %}
{% for person in persons %}
{% if not forloop.first %}<hr>{% endif %}
<h1>
{{ person.name }}
{% if person.ascii != person.name %}
<br>
<small class="text-muted">({{ person.ascii }})</small>
{% endif %}
</h1>
<div class="bio-text">
{% if person.photo %}
<div class="float-end ms-3 mb-3">{% include "person/photo.html" with person=person %}</div>
{% endif %}
{{ person.biography|apply_markup:"restructuredtext"|urlize_ietf_docs|linkify }}
</div>
{% if person.role_set.exists %}
<h2 class="mt-5" id="roles-{{ forloop.counter }}">Roles</h2>
{% if person.role_set.all|active_roles %}
<table class="table table-sm table-striped tablesorter">
<thead>
<tr>
<th scope="col" data-sort="role">Role</th>
<th scope="col" data-sort="group">Group</th>
<th scope="col" data-sort="email">Email</th>
</tr>
</thead>
<tbody>
{% for role in person.role_set.all|active_roles %}
<tr>
<td>{{ role.name.name }}</td>
<td>
<a href="{% url 'ietf.group.views.group_about' acronym=role.group.acronym %}">{{ role.group.name }}</a>
(<a href="{% url 'ietf.group.views.group_about' acronym=role.group.acronym %}">{{ role.group.acronym }}</a>)
</td>
<td>
<a href="mailto:{{ role.email.address }}">{{ role.email.address }}</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>{{ person.first_name }} has no active roles as of {{ today }}.</p>
{% endif %}
{% endif %}
{% if person.personextresource_set.exists %}
<h2 class="mt-5" id="extresources-{{ forloop.counter }}">External Resources</h2>
<table class="table table-sm table-striped tablesorter">
<thead>
<tr>
<th scope="col" data-sort="name">Name</th>
<th scope="col" data-sort="value">Value</th>
</tr>
</thead>
<tbody>
{% for extres in person.personextresource_set.all %}
<tr>
<td>
<span title="{{ extres.name.name }}">{% firstof extres.display_name extres.name.name %}</span>
</td>
<td>{{ extres.value|linkify }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
<h2 class="mt-5" id="rfcs-{{ forloop.counter }}">
RFCs <small class="text-muted">({{ person.rfcs|length }})</small>
</h2>
{% if person.rfcs %}
<table class="table table-sm table-striped tablesorter">
<thead>
<tr>
<th scope="col" data-sort="rfc">RFC</th>
<th scope="col" data-sort="date">Date</th>
<th scope="col" data-sort="title">Title</th>
<th scope="col" data-sort="citedby">Cited by</th>
</tr>
</thead>
<tbody>
{% for doc in person.rfcs %}
<tr>
<td>
<a class="text-nowrap" href="{{ doc.get_absolute_url }}">RFC {{ doc.rfc_number }}</a>
</td>
<td>{{ doc.pub_date|date:"b Y"|title|nbsp }}</td>
<td>{{ doc.title|urlize_ietf_docs }}</td>
<td class="text-end">
{% with doc.referenced_by_rfcs.count as refbycount %}
{% if refbycount %}
<a class="text-end"
href="{% url 'ietf.doc.views_doc.document_referenced_by' doc.canonical_name %}"
rel="nofollow">
{{ refbycount }} RFC{{ refbycount|pluralize }}
</a>
{% endif %}
{% endwith %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
{{ person.first_name }} has no RFCs as of {{ today }}.
{% endif %}
<h2 class="mt-5" id="drafts-{{ forloop.counter }}">
Active Drafts <small class="text-muted">({{ person.active_drafts|length }})</small>
</h2>
{% if person.active_drafts.exists %}
<ul>
{% for doc in person.active_drafts %}
<li>
<a href="{{ doc.get_absolute_url }}">{{ doc.canonical_name }}</a>
</li>
{% endfor %}
</ul>
{% else %}
{{ person.first_name }} has no active drafts as of {{ today }}.
{% endif %}
<h2 class="mt-5">
Expired Drafts <small class="text-muted">({{ person.expired_drafts|length }})</small>
</h2>
{% if person.expired_drafts.exists %}
<ul>
{% for doc in person.expired_drafts %}
{% if not doc.replaced_by %}
<li>
<a href="{{ doc.get_absolute_url }}">
{{ doc.canonical_name }}
</a>
</li>
{% endif %}
{% endfor %}
</ul>
(Excluding replaced drafts.)
{% else %}
{{ person.first_name }} has no expired drafts as of {{ today }}.
{% endif %}
{% if person.has_drafts %}
<h2 class="mt-5">
Draft Activity
</h2>
<div id="chart-{{ forloop.counter }}">
</div>
{% endif %}
{% endfor %}
{% endblock %}
{% block js %}
<script src="{% static "ietf/js/list.js" %}"></script>
<script src="{% static 'ietf/js/highcharts-highstock.js' %}"></script>
<script src="{% static 'ietf/js/highcharts-exporting.js' %}"></script>
<script>
$(function () {
{% for person in persons %}
$.getJSON('{% url "ietf.doc.views_stats.chart_conf_person_drafts" id=person.id %}', function (conf) {
// Create the chart
chart = Highcharts.stockChart('chart-{{ forloop.counter }}', conf);
chart.showLoading();
$.getJSON('{% url "ietf.doc.views_stats.chart_data_person_drafts" id=person.id %}', function (data) {
chart.series[0].setData(data);
chart.hideLoading();
});
});
{% endfor %}
});
</script>
{% endblock %}