Skip to content

Commit d5e98c9

Browse files
committed
Add mail to link to Secretariat on country page in case people are
missing a country or alias, adjust wording a bit on status page. - Legacy-Id: 12866
1 parent 6964337 commit d5e98c9

6 files changed

Lines changed: 36 additions & 4 deletions

File tree

ietf/settings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,8 @@ def skip_unreadable_post(record):
518518

519519
IANA_EVAL_EMAIL = "drafts-eval@icann.org"
520520

521+
SECRETARIAT_TICKET_EMAIL = "ietf-action@ietf.org"
522+
521523
# Put real password in settings_local.py
522524
IANA_SYNC_PASSWORD = "secret"
523525
IANA_SYNC_CHANGES_URL = "https://datatracker.iana.org:4443/data-tracker/changes"

ietf/stats/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class CountryAlias(models.Model):
3030
"""Records that alias should be treated as country for statistical
3131
purposes."""
3232

33-
alias = models.CharField(max_length=255, help_text="Note that lower-case aliases are matched case-insensitive while aliases with at least one uppercase letter is matched case-sensitive.")
33+
alias = models.CharField(max_length=255, help_text="Note that lower-case aliases are matched case-insensitive while aliases with at least one uppercase letter is matched case-sensitive. So 'United States' is best entered as 'united states' so it both matches 'United States' and 'United states' and 'UNITED STATES', whereas 'US' is best entered as 'US' so it doesn't accidentally match an ordinary word like 'us'.")
3434
country = models.ForeignKey(CountryName, max_length=255)
3535

3636
def __unicode__(self):

ietf/stats/utils.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,3 +190,18 @@ def clean_country_name(country_name):
190190
return country_name
191191

192192
return ""
193+
194+
195+
def compute_hirsch_index(citation_counts):
196+
"""Computes the h-index given a sequence containing the number of
197+
citations for each document."""
198+
199+
i = 0
200+
201+
for count in sorted(citation_counts, reverse=True):
202+
if i + 1 > count:
203+
break
204+
205+
i += 1
206+
207+
return i

ietf/stats/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,8 @@ def known_countries_list(request, stats_type=None, acronym=None):
536536
c.aliases = sorted(c.countryalias_set.all(), key=lambda a: a.pk)
537537

538538
return render(request, "stats/known_countries_list.html", {
539-
"countries": countries
539+
"countries": countries,
540+
"ticket_email_address": settings.SECRETARIAT_TICKET_EMAIL,
540541
})
541542

542543

ietf/templates/stats/known_countries_list.html

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99

1010
<h1>{% block title %}Countries known to the Datatracker{% endblock %}</h1>
1111

12+
<p>In case you think a country or an alias is missing from the list, you can <a href="mailto:{{ ticket_email_address }}">file a ticket</a>.</p>
13+
14+
{% if request.user.is_staff %}
15+
<p>Note: since you're an admin, the country names are linked to their corresponding admin page.</p>
16+
{% endif %}
17+
1218
<table class="table table-condensed table-striped">
1319
<thead>
1420
<tr>
@@ -19,7 +25,15 @@ <h1>{% block title %}Countries known to the Datatracker{% endblock %}</h1>
1925
<tbody>
2026
{% for c in countries %}
2127
<tr>
22-
<td>{{ c.name }}</td>
28+
<td>
29+
{% if request.user.is_staff %}
30+
<a href="{% url "admin:name_countryname_change" c.pk %}">
31+
{% endif %}
32+
{{ c.name }}
33+
{% if request.user.is_staff %}
34+
</a>
35+
{% endif %}
36+
</td>
2337
<td>
2438
{% for a in c.aliases %}
2539
{{ a.alias }}{% if not forloop.last %},{% endif %}

ietf/templates/submit/submission_status.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ <h2>Meta-data from the submission</h2>
223223

224224
{% if author.country and not author.cleaned_country %}
225225
<br>
226-
<b class="text-warning">Unrecognized country: "{{ author.country }}"</b>: Please use a <a href="{% url "ietf.stats.views.known_countries_list" %}">recognized country name</a>.
226+
<b class="text-warning">Unrecognized country: "{{ author.country }}"</b>: See <a href="{% url "ietf.stats.views.known_countries_list" %}">recognized country names</a>.
227227
{% endif %}
228228

229229
</td>

0 commit comments

Comments
 (0)