Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor dataset citation template to use safe dictionary access #115

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@

<div class="citation">
<div id="citation-status">
{% if (pkg['author'] and pkg['title']) or pkg['resources'] %}
{% if (pkg.get('author') and pkg.get('title')) or pkg.get('resources') %}
<h3>{{ _('Cite as') }}</h3>
<div class="citation-string">
<p>
{% set authors = pkg['author'].split(';') %}
{% set authors = pkg.get('author', '') %}
{% set authors = authors.split(';') if authors else [] %}
{% for author in authors %}
{{ format_element(author, loop.last, true) }}
{% endfor %}
Expand Down Expand Up @@ -44,7 +45,7 @@ <h3>{{ _('Cite as') }}</h3>
<img id="clipboard-icon" src="{{ h.url_for_static('/images/default/clipboard.svg') }}" class="clipboard-icon" alt="Clipboard Icon">
</div>
{% endif %}
{% if pkg['private'] and not doi %}
{% if pkg.get('private') and not doi %}
<div class="pad-v">
<span class="dataset-private label label-inverse"
title="This DOI has not yet been published">
Expand Down
Loading