Skip to content

Commit

Permalink
#1286: Display issue/volume numbers in citations only if present
Browse files Browse the repository at this point in the history
  • Loading branch information
mauromsl authored and ajrbyers committed Oct 23, 2019
1 parent 40472ee commit 1046d49
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions src/themes/OLH/templates/elements/journal/citation_modals.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@ <h2 id="HarvardModalTitle">Harvard-Style Citation</h2>
<p>{% for author in article.authors.all %}{% if not forloop.first and not forloop.last %}, {% elif forloop.last and not forloop.first %}& {% endif %}{{ author.last_name }},
{{ author.first_name|slice:"1" }}{% if forloop.last %}.{% endif %} {% endfor %}
({{ article.date_published.year }}) '{{ article.title|safe }}',
<i>{% if journal.name %}{{ journal.name }}{% else %}{{ request.press.name }} Preprints{% endif %}</i>. {% if article.issue %}{{ article.issue.volume }}({{ article.issue.issue }}){% endif %}{% if article.page_numbers %}:{{ article.page_numbers }}.{% endif %}
<i>{% if journal.name %}{{ journal.name }}{% else %}{{ request.press.name }} Preprints{% endif %}</i>.
{% if article.issue and article.issue.issue and article.issue.volume %}
{{ article.issue.volume }}({{ article.issue.issue }})
{% elif article.issue and article.issue.issue %}
{{ article.issue.issue }}
{% elif article.issue and article.issue.volume %}
{{ article.issue.volume }}
{% endif %}
{% if article.page_numbers %}:{{ article.page_numbers }}.{% endif %}
{% if article.identifier.id_type == 'doi' %}doi: {{ article.identifier.identifier }}{% endif %}</p>
<p>Show: <a data-open="VancouverModal">Vancouver Citation Style</a> | <a data-open="APAModal">APA Citation
Style</a></p>
Expand All @@ -18,7 +26,15 @@ <h2 id="HarvardModalTitle">Harvard-Style Citation</h2>
<h2 id="VancouverModalTitle">Vancouver-Style Citation</h2>
<p>{% for author in article.authors.all %}{% if not forloop.first and not forloop.last %}, {% elif forloop.last and not forloop.first %}& {% endif %}{{ author.last_name }},
{{ author.first_name|slice:"1" }}{% if forloop.last %}.{% endif %} {% endfor %}
{{ article.title|safe }}. {% if journal.name %}{{ journal.name }}{% else %}{{ request.press.name }} Preprints{% endif %}. {{ article.date_published.year }} {{ article.date_published.month }};{% if article.issue %}{{ article.issue.volume }}({{ article.issue.issue }}){% endif %}{% if article.page_numbers %}:{{ article.page_numbers }}.{% endif %}
{{ article.title|safe }}. {% if journal.name %}{{ journal.name }}{% else %}{{ request.press.name }} Preprints{% endif %}. {{ article.date_published.year }} {{ article.date_published.month }};
{% if article.issue and article.issue.issue and article.issue.volume %}
{{ article.issue.volume }}({{ article.issue.issue }})
{% elif article.issue and article.issue.issue %}
{{ article.issue.issue }}
{% elif article.issue and article.issue.volume %}
{{ article.issue.volume }}
{% endif %}
{% if article.page_numbers %}:{{ article.page_numbers }}.{% endif %}
{% if article.identifier.id_type == 'doi' %}doi: {{ article.identifier.identifier }}{% endif %}</p>
<p>Show: <a data-open="HarvardModal">Harvard Citation Style</a> | <a data-open="APAModal">APA Citation Style</a>
</p>
Expand All @@ -34,11 +50,18 @@ <h2 id="APAModalTitle">APA-Style Citation</h2>
&amp; {% endif %}{% endif %}{{ author.last_name }},
{{ author.first_name|slice:"1" }}{% if forloop.last %}.{% endif %} {% endfor %}
({{ article.date_published.year }}, {{ article.date_published.month }} {{ article.date_published.day }}). {{ article.title|safe }}.
<i>{% if journal.name %}{{ journal.name }}{% else %}{{ request.press.name }} Preprints{% endif %}</i> {% if article.issue %}{{ article.issue.volume }}({{ article.issue.issue }}){% endif %}{% if article.page_numbers %}:{{ article.page_numbers }}.{% endif %}
<i>{% if journal.name %}{{ journal.name }}{% else %}{{ request.press.name }} Preprints{% endif %}</i>
{% if article.issue and article.issue.issue and article.issue.volume %}
{{ article.issue.volume }}({{ article.issue.issue }})
{% elif article.issue and article.issue.issue %}
{{ article.issue.issue }}
{% elif article.issue and article.issue.volume %}
{{ article.issue.volume }}
{% if article.page_numbers %}:{{ article.page_numbers }}.{% endif %}
{% if article.identifier.id_type == 'doi' %}doi: {{ article.identifier.identifier }}{% endif %}</p>
<p>Show: <a data-open="HarvardModal">Harvard Citation Style</a> | <a data-open="VancouverModal">Vancouver
Citation Style</a></p>
<button class="close-button" data-close aria-label="Close modal" type="button">
<span aria-hidden="true">&times;</span>
</button>
</div>
</div>

0 comments on commit 1046d49

Please sign in to comment.