Provide more consistent links to people pages. Fixes #2918. Commit ready for merge.

- Legacy-Id: 17557
This commit is contained in:
Jim Fenton 2020-03-28 19:07:40 +00:00
parent 53de5047b3
commit b9c5152714
5 changed files with 36 additions and 10 deletions

View file

@ -25,3 +25,22 @@ def active_nomcoms(user):
state__slug='active').distinct().select_related("type"))
return groups
@register.inclusion_tag('person_link.html')
def person_link(linkee, **kwargs):
title = ""
if 'title' in kwargs:
title = kwargs['title']
if title == "Area Director":
name = linkee.name
plain_name = name
email = linkee.email_address
elif title == "Shepherd":
name = linkee.person.name
plain_name = name
email = linkee
else:
name = linkee.person.name
plain_name = linkee.person.plain_name
email = linkee.email.address
return {'name': name, 'plain_name': plain_name, 'email': email, 'title': title}

View file

@ -2,6 +2,7 @@
{% load widget_tweaks %}
{% load ietf_filters %}
{% load ballot_icon %}
{% load group_filters %}
<tr {% spaceless %}
{% if color_row_positions %}
@ -120,9 +121,9 @@
{% if ad_name == None or ad_name != doc.ad.plain_name %}
<td class="area-director">
{% if doc.ad %}
<a title="Area Director" href="mailto:{{ doc.ad.email_address|urlencode }}">{{ doc.ad }}</a><br>
{% person_link doc.ad title="Area Director" %}<br>
{% endif %}
{% if doc.shepherd %}<a title="Shepherd" href="mailto:{{doc.shepherd}}"><small class="text-muted">{{doc.shepherd.person.name}}</small></a>{% endif %}
{% if doc.shepherd %}{% person_link doc.shepherd title="Shepherd" size="small" %}{% endif %}
</td>
{% endif %}

View file

@ -1,6 +1,6 @@
{% extends "base.html" %}
{# Copyright The IETF Trust 2015, All Rights Reserved #}
{% load origin staticfiles %}
{% load origin staticfiles group_filters %}
{% block pagehead %}
<link rel="stylesheet" href="{% static "jquery.tablesorter/css/theme.bootstrap.min.css" %}">
@ -70,10 +70,9 @@
<td>{{ group.name }}</td>
<td>
{% for chair in group.chairs %}
<a href="{% url 'ietf.person.views.profile' email_or_name=chair.person.name %}">{{ chair.person.plain_name }}</a>
<a href="mailto:{{ chair.email.address }}"><span class="fa fa-envelope-o tiny"></span></a>{% if not forloop.last %} , {% endif %}
{% endfor %}
{% if group.ad_out_of_area %}(Assigned AD: <a href="mailto:{{ group.ad_role.email.address }}">{{ group.ad_role.person.plain_name }}</a>){% endif %}
{% person_link chair %}{% if not forloop.last %} , {% endif %}
{% endfor %}
{% if group.ad_out_of_area %}(Assigned AD: {% person_link group.ad_role %}){% endif %}
</td>
</tr>
{% endfor %}

View file

@ -3,7 +3,7 @@
{% load origin %}
{% load ietf_filters %}
{% load markup_tags %}
{% load textfilters %}
{% load textfilters group_filters %}
{% block group_content %}
{% origin %}
@ -158,8 +158,7 @@
{% for r in roles %}
<span class="fa fa-envelope-o"></span>
<a href="mailto:{{ r.email.address }}">{{ r.person.plain_name }}</a>
{% person_link r %}
<br>
{% endfor %}
</td>

View file

@ -0,0 +1,8 @@
{# Copyright The IETF Trust 2020, All Rights Reserved #}
{% load origin staticfiles %}
<a {% if title != "" %}title="{{ title }}"{% endif %} href="{% url 'ietf.person.views.profile' email_or_name=name %}">
{% if title == "Shepherd" %}<small class="text-muted">{% endif %}{{ plain_name }}
{% if title == "Shepherd" %}</small>{% endif %}</a>
<a href="mailto:{{ email|urlencode }}"><span class="fa fa-envelope-o tiny"></span></a>