-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1572 from Princeton-CDH/feature/1568-people-browse
Add browse page for people (#1568)
- Loading branch information
Showing
14 changed files
with
495 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
{% extends 'base.html' %} | ||
{% load static i18n humanize %} | ||
|
||
{% block meta_title %}{{ page_title }}{% endblock meta_title %} | ||
{% block meta_description %}{{ page_description }}{% endblock meta_description %} | ||
|
||
{% block main %} | ||
<h1>{{ page_title }}</h1> | ||
<section id="person-list"> | ||
<h2> | ||
{# Translators: number of search results #} | ||
{% blocktranslate with count_humanized=paginator.count|intcomma count counter=paginator.count trimmed %} | ||
1 result | ||
{% plural %} | ||
{{ count_humanized }} results | ||
{% endblocktranslate %} | ||
</h2> | ||
{# list view table #} | ||
<table> | ||
<thead> | ||
{# Translators: Person "name" column header on the browse page #} | ||
<th>{% translate "Name" %}</th> | ||
{# Translators: Person "dates of activity" column header on the browse page #} | ||
{% comment %} <th>{% translate "Dates" %}</th> {% endcomment %} | ||
{# Translators: Person "gender" column header on the browse page #} | ||
<th>{% translate "Gender" %}</th> | ||
{# Translators: Person "social role" column header on the browse page #} | ||
<th>{% translate "Social role" %}</th> | ||
<th class="related"> | ||
<svg aria-hidden="true"><use xlink:href="{% static 'img/ui/all/all/related-documents-icon.svg' %}#related-documents" /></svg> | ||
{# Translators: Person "document count" column header on the browse page #} | ||
<span class="sr-only">{% translate "Number of related documents" %}</span> | ||
</th> | ||
<th class="related"> | ||
<svg aria-hidden="true"><use xlink:href="{% static 'img/ui/all/all/related-people-icon.svg' %}#related-people" /></svg> | ||
{# Translators: Person "related people count" column header on the browse page #} | ||
<span class="sr-only">{% translate "Number of related people" %}</span> | ||
</th> | ||
<th class="related"> | ||
<svg aria-hidden="true"><use xlink:href="{% static 'img/ui/all/all/related-places-icon.svg' %}#related-places" /></svg> | ||
{# Translators: Person "related place count" column header on the browse page #} | ||
<span class="sr-only">{% translate "Number of related places" %}</span> | ||
</th> | ||
</thead> | ||
<tbody> | ||
{% for person in people %} | ||
<tr> | ||
<td class="name"> | ||
{% if person.get_absolute_url %} | ||
<a href="{{ person.get_absolute_url }}">{{ person }}</a> | ||
{% else %} | ||
<span>{{ person }}</span> | ||
{% endif %} | ||
</td> | ||
{% comment %} <td>{{ person.documents_date_range }}</td> {% endcomment %} | ||
<td>{{ person.get_gender_display }}</td> | ||
<td>{{ person.role }}</td> | ||
<td class="related">{{ person.documents.count }}</td> | ||
<td class="related">{{ person.relationships.count }}</td> | ||
<td class="related">{{ person.personplacerelation_set.count }}</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
{# grid / mobile view #} | ||
<div class="grid"> | ||
{% for person in people %} | ||
<div class="person"> | ||
{# Translators: accessible label for section showing metadata like name, gender, etc #} | ||
<dl aria-label="{% translate 'metadata' %}"> | ||
<dt class="sr-only">{% translate "Name" %}</dt> | ||
<dd class="name"> | ||
{% if person.get_absolute_url %} | ||
<a href="{{ person.get_absolute_url }}">{{ person }}</a> | ||
{% else %} | ||
<span>{{ person }}</span> | ||
{% endif %} | ||
</dd> | ||
<dt class="sr-only">{% translate "Gender" %}</dt> | ||
<dd>{{ person.get_gender_display }}</dd> | ||
{% comment %}<dt class="sr-only">{% translate 'Dates' %}</dt><dd></dd>{% endcomment %} | ||
<dt class="sr-only">{% translate "Social role" %}</dt> | ||
<dd>{{ person.role }}</dd> | ||
{# Translators: label for person description / bio #} | ||
<dt class="sr-only">{% translate "Description / Bio" %}</dt> | ||
<dd class="description">{{ person.description|truncatewords:15 }}</dd> | ||
</dl> | ||
{# Translators: accessible label for section showing counts of entries related to an entity #} | ||
<dl class="relations" aria-label="{% translate 'Related entries' %}"> | ||
<dt class="sr-only">{% translate "Number of related people" %}</dt> | ||
<dd> | ||
<svg aria-hidden="true"><use xlink:href="{% static 'img/ui/all/all/related-people-icon.svg' %}#related-people" /></svg> | ||
<span>{{ person.relationships.count }}</span> | ||
</dd> | ||
<dt class="sr-only">{% translate "Number of related places" %}</dt> | ||
<dd> | ||
<svg aria-hidden="true"><use xlink:href="{% static 'img/ui/all/all/related-places-icon.svg' %}#related-places" /></svg> | ||
<span>{{ person.personplacerelation_set.count }}</span> | ||
</dd> | ||
<dt class="sr-only">{% translate "Number of related documents" %}</dt> | ||
<dd> | ||
<svg aria-hidden="true"><use xlink:href="{% static 'img/ui/all/all/related-documents-icon.svg' %}#related-documents" /></svg> | ||
<span>{{ person.documents.count }}</span> | ||
</dd> | ||
</dl> | ||
</div> | ||
{% endfor %} | ||
</div> | ||
</section> | ||
<div class="pagination-container"> | ||
{# Translators: range of search results on the current page, out of total #} | ||
{% blocktranslate with start=page_obj.start_index end=page_obj.end_index count_humanized=paginator.count|intcomma %} | ||
<div>{{ start }} – {{ end }} of {{ count_humanized }}</div> | ||
{% endblocktranslate %} | ||
{% include "corpus/snippets/pagination.html" %} | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.