-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: hide creator if name is missing in source
Otherwise it uselessly shows up as N/A. Works around data source issue https://github.com/ietf-ribose/relaton-data-misc/issues/3
- Loading branch information
1 parent
ed35930
commit 48055f6
Showing
1 changed file
with
20 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,23 @@ | ||
{% load relaton %} | ||
{% if val.role %} | ||
<small class="text-xs opacity-50">{{ val.role|as_list|join:", " }}</small> | ||
{% endif %} | ||
|
||
{% if val.organization %} | ||
{% with org_name=val.organization.name|as_list|first link=val|substruct_search_link:'{"contributor": [%s]};as_list=yes;only=organization.abbreviation,organization.name' %} | ||
<a class="link" href="{{ link }}"> | ||
{{ val.organization.abbreviation|default:org_name|default:"N/A" }} | ||
</a> | ||
{% endwith %} | ||
{% elif val.person.name %} | ||
{% with link=val|substruct_search_link:'{"contributor": [%s]};as_list=yes;only=person.name.completename.content,person.name.surname.content,person.name.forename[*].content' %} | ||
<a class="link" href="{{ link }}"> | ||
{% include "relaton/person_name.html" with val=val.person.name %} | ||
</a> | ||
{% endwith %} | ||
{% else %} | ||
{% include "deflist/entry_recursivedict.html" with key_sr_only=True key=val.role|default:"contributor"|as_list|join:", " val=c %} | ||
{% if val.organization.abbreviation or org_name or val.person.name %} | ||
|
||
{% if val.role %} | ||
<small class="text-xs opacity-50">{{ val.role|as_list|join:", " }}</small> | ||
{% endif %} | ||
|
||
{% if val.organization.abbreviation or org_name %} | ||
{% with org_name=val.organization.name|as_list|first link=val|substruct_search_link:'{"contributor": [%s]};as_list=yes;only=organization.abbreviation,organization.name' %} | ||
<a class="link" href="{{ link }}"> | ||
{{ val.organization.abbreviation|default:org_name|default:"N/A" }} | ||
</a> | ||
{% endwith %} | ||
{% elif val.person.name %} | ||
{% with link=val|substruct_search_link:'{"contributor": [%s]};as_list=yes;only=person.name.completename.content,person.name.surname.content,person.name.forename[*].content' %} | ||
<a class="link" href="{{ link }}"> | ||
{% include "relaton/person_name.html" with val=val.person.name %} | ||
</a> | ||
{% endwith %} | ||
{% endif %} | ||
|
||
{% endif %} |