Skip to content

Commit b9c5152

Browse files
committed
Provide more consistent links to people pages. Fixes ietf-tools#2918. Commit ready for merge.
- Legacy-Id: 17557
1 parent 53de504 commit b9c5152

5 files changed

Lines changed: 36 additions & 10 deletions

File tree

ietf/group/templatetags/group_filters.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,22 @@ def active_nomcoms(user):
2525
state__slug='active').distinct().select_related("type"))
2626

2727
return groups
28+
29+
@register.inclusion_tag('person_link.html')
30+
def person_link(linkee, **kwargs):
31+
title = ""
32+
if 'title' in kwargs:
33+
title = kwargs['title']
34+
if title == "Area Director":
35+
name = linkee.name
36+
plain_name = name
37+
email = linkee.email_address
38+
elif title == "Shepherd":
39+
name = linkee.person.name
40+
plain_name = name
41+
email = linkee
42+
else:
43+
name = linkee.person.name
44+
plain_name = linkee.person.plain_name
45+
email = linkee.email.address
46+
return {'name': name, 'plain_name': plain_name, 'email': email, 'title': title}

ietf/templates/doc/search/search_result_row.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
{% load widget_tweaks %}
33
{% load ietf_filters %}
44
{% load ballot_icon %}
5+
{% load group_filters %}
56

67
<tr {% spaceless %}
78
{% if color_row_positions %}
@@ -120,9 +121,9 @@
120121
{% if ad_name == None or ad_name != doc.ad.plain_name %}
121122
<td class="area-director">
122123
{% if doc.ad %}
123-
<a title="Area Director" href="mailto:{{ doc.ad.email_address|urlencode }}">{{ doc.ad }}</a><br>
124+
{% person_link doc.ad title="Area Director" %}<br>
124125
{% endif %}
125-
{% if doc.shepherd %}<a title="Shepherd" href="mailto:{{doc.shepherd}}"><small class="text-muted">{{doc.shepherd.person.name}}</small></a>{% endif %}
126+
{% if doc.shepherd %}{% person_link doc.shepherd title="Shepherd" size="small" %}{% endif %}
126127
</td>
127128
{% endif %}
128129

ietf/templates/group/active_wgs.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% extends "base.html" %}
22
{# Copyright The IETF Trust 2015, All Rights Reserved #}
3-
{% load origin staticfiles %}
3+
{% load origin staticfiles group_filters %}
44

55
{% block pagehead %}
66
<link rel="stylesheet" href="{% static "jquery.tablesorter/css/theme.bootstrap.min.css" %}">
@@ -70,10 +70,9 @@ <h3>{{ area.acronym }} active WG{{ area.groups|pluralize}} ({{area.groups.count}
7070
<td>{{ group.name }}</td>
7171
<td>
7272
{% for chair in group.chairs %}
73-
<a href="{% url 'ietf.person.views.profile' email_or_name=chair.person.name %}">{{ chair.person.plain_name }}</a>
74-
<a href="mailto:{{ chair.email.address }}"><span class="fa fa-envelope-o tiny"></span></a>{% if not forloop.last %} , {% endif %}
75-
{% endfor %}
76-
{% if group.ad_out_of_area %}(Assigned AD: <a href="mailto:{{ group.ad_role.email.address }}">{{ group.ad_role.person.plain_name }}</a>){% endif %}
73+
{% person_link chair %}{% if not forloop.last %} , {% endif %}
74+
{% endfor %}
75+
{% if group.ad_out_of_area %}(Assigned AD: {% person_link group.ad_role %}){% endif %}
7776
</td>
7877
</tr>
7978
{% endfor %}

ietf/templates/group/group_about.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{% load origin %}
44
{% load ietf_filters %}
55
{% load markup_tags %}
6-
{% load textfilters %}
6+
{% load textfilters group_filters %}
77

88
{% block group_content %}
99
{% origin %}
@@ -158,8 +158,7 @@
158158

159159

160160
{% for r in roles %}
161-
<span class="fa fa-envelope-o"></span>
162-
<a href="mailto:{{ r.email.address }}">{{ r.person.plain_name }}</a>
161+
{% person_link r %}
163162
<br>
164163
{% endfor %}
165164
</td>

ietf/templates/person_link.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{# Copyright The IETF Trust 2020, All Rights Reserved #}
2+
3+
{% load origin staticfiles %}
4+
5+
<a {% if title != "" %}title="{{ title }}"{% endif %} href="{% url 'ietf.person.views.profile' email_or_name=name %}">
6+
{% if title == "Shepherd" %}<small class="text-muted">{% endif %}{{ plain_name }}
7+
{% if title == "Shepherd" %}</small>{% endif %}</a>
8+
<a href="mailto:{{ email|urlencode }}"><span class="fa fa-envelope-o tiny"></span></a>

0 commit comments

Comments
 (0)