Skip to content
Open
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
MEMORY_LIMIT_ARG = ['+RTS', '-M256M', '-RTS']
PANDOC_CMD = ['pandoc']
LATEX = ['--pdf-engine=xelatex']
GEOMETRY = ['-V', 'geometry:margin=1in']
COVER_SHEET_STYLE = ['-V', 'mainfont=Arial', '-V', 'pagestyle=empty']


def generate_pdf_cover_sheet(cover_sheet_content, context):
Expand Down Expand Up @@ -43,6 +45,8 @@ def generate_pdf_cover_sheet(cover_sheet_content, context):
PANDOC_CMD
+ MEMORY_LIMIT_ARG
+ LATEX
+ GEOMETRY
+ COVER_SHEET_STYLE
+ ['-s', cover_sheet_html_path, '-t', 'pdf', '-o', cover_sheet_pdf_path, f'--resource-path={media_dir}']
)
try:
Expand Down Expand Up @@ -81,6 +85,7 @@ def generate_pdf_from_doc(file):
PANDOC_CMD
+ MEMORY_LIMIT_ARG
+ LATEX
+ GEOMETRY
+ ['-s', file_path, '-t', 'pdf', '-o', out_path]
)

Expand Down
17 changes: 8 additions & 9 deletions iso_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ def publish_repository_object_from_journal_article(article, repository, file):
file=preprint_file,
)

for author in article.frozen_authors():
repo_models.PreprintAuthor.objects.get_or_create(
preprint=preprint,
account=author.author,
order=author.order,
affiliation=author.affiliation,
)

if article.preprint.repository.crossref_enable:
preprints.deposit_doi_for_preprint_version(
repository=article.preprint.repository,
Expand Down Expand Up @@ -127,14 +135,6 @@ def publish_repository_object_from_journal_article(article, repository, file):
preprint.submission_file = preprint_file
preprint.save()

for author in article.frozen_authors():
repo_models.PreprintAuthor.objects.get_or_create(
preprint=preprint,
account=author.author,
order=author.order,
affiliation=author.affiliation
)


def recreate_version_file(article, version, file):
file_path = get_pdf_path(article.journal, article, file)
Expand Down Expand Up @@ -205,4 +205,3 @@ def publish_new_preprint_version(article, file):
# Update the version with the final file
version.file = preprint_file
version.save()

77 changes: 77 additions & 0 deletions templates/isolinear/clarity/full_preprint_list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{% extends "core/base.html" %}
{% load static %}
{% load i18n %}

{% block title %}{% trans "Full Preprint List" %}{% endblock %}

{% block body %}
<div class="row">
<div class="col-md-12">
<h1>{% trans "Full Preprint List" %}</h1>
<p class="lead">{% trans "A complete record of all preprints submitted to this journal, including those currently under review, those that have been accepted and published, and those that have been declined or withdrawn." %}</p>
</div>
<div class="col-md-8">
<section aria-label="{% trans 'Results' %}" class="py-3">
{% include "elements/sorting.html" with form_id=facet_form.id %}
{% for article in article_list %}
<article class="article-item" aria-label="{{ article.safe_title|striptags }}">
<div class="d-flex justify-content-between align-items-start">
<h2 class="article-title h5">
{% if article.preprint.preprintversion_set.first %}
<a href="{% url 'isolinear_preprint_version' article.pk article.preprint.preprintversion_set.first.version %}">{{ article.safe_title }}</a>
{% else %}
{{ article.safe_title }}
{% endif %}
</h2>
{% if article.date_declined or article.stage == 'Rejected' %}
<span class="badge badge-danger ml-2 flex-shrink-0">{% trans "Declined" %}</span>
{% elif not article.date_published and article.stage != 'preprint_published' and article.stage != 'Published' %}
<span class="badge badge-warning ml-2 flex-shrink-0">{% trans "Under Review" %}</span>
{% endif %}
</div>

{% if article.frozen_authors.all %}
<p class="mb-1">
{% for author in article.frozen_authors.all %}
{{ author.full_name }}{% if not forloop.last %}, {% endif %}
{% endfor %}
</p>
{% endif %}

<p class="small text-muted mb-2">
{% if article.preprint.date_published %}
<strong>{% trans "First posted" %}:</strong> {{ article.preprint.date_published|date:"j F Y" }}
{% endif %}
{% if article.date_accepted %}
&nbsp;&middot;&nbsp; <strong>{% trans "Accepted" %}:</strong> {{ article.date_accepted|date:"j F Y" }}
{% endif %}
{% if article.date_published %}
&nbsp;&middot;&nbsp; <strong>{% trans "Published" %}:</strong> {{ article.date_published|date:"j F Y" }}
{% endif %}
{% if article.date_declined %}
&nbsp;&middot;&nbsp; <strong>{% trans "Declined" %}:</strong> {{ article.date_declined|date:"j F Y" }}
{% endif %}
</p>

{% with versions=article.preprint.preprintversion_set.all %}
{% if versions %}
<p class="small mb-0">
<strong>{% trans "Versions" %}:</strong>
{% for version in versions %}
<a href="{% url 'isolinear_preprint_version' article.pk version.version %}">v{{ version.version }}</a>{% if not forloop.last %}, {% endif %}
{% endfor %}
</p>
{% endif %}
{% endwith %}
</article>
{% empty %}
<p class="my-4">{% trans "No preprints to display." %}</p>
{% endfor %}
{% include "elements/pagination.html" with form_id=facet_form.id %}
</section>
</div>
<section class="col-md-4" aria-label="{% trans 'Filters' %}">
{% include "elements/journal/article_list_filters.html" %}
</section>
</div>
{% endblock body %}
215 changes: 215 additions & 0 deletions templates/isolinear/clarity/preprint_version.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
{% extends "core/base.html" %}
{% load static %}
{% load hooks %}
{% load i18n %}
{% load dates %}

{% block page_title %}{% if article.preprint %}{% trans "Preprint" %} {% endif %}{% trans "Article" %}{% endblock %}

{% block title %}{{ article.frozen_authors.0.last_name|striptags }} | {% if preprint_version.title %}{{ preprint_version.title|striptags }}{% else %}{{ article.title|striptags }}{% endif %} | {{ journal_settings.general.journal_name|striptags }}{% endblock %}

{% block head %}
{% include "elements/article_meta_tags.html" %}
{% endblock %}

{% block reading_options_bar %}
{% include "common/elements/journal/reading_options_bar.html" %}
{% endblock reading_options_bar %}

{% block body %}
<div id="article_opener" class="row">
{% if not journal_settings.article.disable_article_large_image %}
<div class="col-md-12">
<div class="card">
<div class="clarity-banner">
<img class="clarity-banner-image"
src="{{ article.best_large_image_url }}"
alt="{{ article.best_large_image_alt_text }}">
</div>
<div class="article-header card-text">
<div class="text-uppercase">{{ article.section.name }}</div>
<h1 class="card-title align-text-bottom article-title">{% if preprint_version.title %}{{ preprint_version.title|safe }}{% else %}{{ article.title|safe }}{% endif %}</h1>
{% include "elements/journal/article_authors_compact.html" with limit=10 %}
</div>
</div>
</div>
{% endif %}
</div>

<div id="article_metadata" class="row">

<div class="col-md-7">
<div id="article" class="text-format-region">
{% if journal_settings.article.disable_article_large_image %}
<small>{{ article.section.name }}</small>
<h1>{% if preprint_version.title %}{{ preprint_version.title|safe }}{% else %}{{ article.title|safe }}{% endif %}</h1>
{% endif %}

<div class="alert alert-secondary" role="status">
{% if article.is_published %}
{% blocktrans with version=preprint_version.version %}This is version {{ version }} of this article. The published version can be found at:{% endblocktrans %}
{% if article.get_doi %}
<a href="{{ article.get_doi_url }}">{{ article.get_doi_url }}</a>
{% else %}
<a href="{% url 'article_view' 'id' article.pk %}">{% site_url 'article_view' 'id' article.pk %}</a>
{% endif %}
{% elif preprint_version == article.preprint.current_version %}
{% blocktrans with version=preprint_version.version %}This is version {{ version }} of this article. It is the latest version of this preprint.{% endblocktrans %}
{% else %}
{% blocktrans with version=preprint_version.version %}This is version {{ version }} of this article. A newer version is available at:{% endblocktrans %}
{% if preprint_version.get_doi %}
<a href="https://doi.org/{{ preprint_version.preprint.current_version.get_doi }}">https://doi.org/{{ preprint_version.preprint.current_version.get_doi }}</a>
{% else %}
<a href="{% site_url 'isolinear_preprint_version' article.pk preprint_version.preprint.current_version.version %}">{% site_url 'isolinear_preprint_version' article.pk preprint_version.preprint.current_version.version %}</a>
{% endif %}
{% endif %}
</div>

{% if journal_settings.general.uses_isolinear_plugin and not article.is_published %}
<p>
<strong>
{% if article.date_accepted %}
{% trans "This article is an accepted preprint. Production is underway." %}
{% elif article.date_declined %}
{% trans "This article is a preprint that has been withdrawn from submission." %}
{% elif article.stage == 'Under Revision' %}
{% trans "This article is a preprint currently under revision." %}
{% else %}
{% trans "This article is a preprint and is currently undergoing peer review." %}
{% endif %}
</strong>
</p>
{% endif %}

{% if article.abstract and article.abstract != '' %}
<h2>{% trans "Abstract" %}</h2>
{% if journal_settings.general.uses_isolinear_plugin and not article.is_published %}
<p>{{ article.abstract|safe }}</p>
{% else %}
<p>{{ article.abstract_display|safe }}</p>
{% endif %}
{% endif %}

{% if journal_settings.general.keyword_list_page %}
{% include "elements/journal/article_keywords.html" with keywords=article.keywords linked="True" %}
{% else %}
{% include "elements/journal/article_keywords.html" with keywords=article.keywords %}
{% endif %}

{% if article.rights %}
<h2>{% trans "Rights" %}</h2>
<p>{{ article.rights|safe }}</p>
{% endif %}

{% include "elements/funder_info_for_readers.html" %}

{% hook 'article_content' %}
</div>
</div>

<div class="col-md-4 offset-md-1 left-bar">
<div class="card">
<div class="card-body">
<section aria-label="{% trans 'Article Information' %}">
<div class="article-menu">
{% include "common/elements/altmetric_badges.html" with article=article %}
{% if journal_settings.article.disable_article_large_image %}
<h2>
{% blocktrans count counter=article.frozen_authors.count %}
Author
{% plural %}
Authors
{% endblocktrans %}
</h2>
{% include "common/elements/journal/article_authors_ul.html" %}
{% endif %}

<h2>{% trans "Author details" %}</h2>
{% include "common/elements/journal/article_authors_full.html" %}

<h2>{% trans "Download" %}</h2>
<ul>
<li>
<a href="{{ article.preprint.repository.site_url }}/repository/object/{{ article.preprint.pk }}/download/{{ preprint_version.file.pk }}/">
{% trans "Download PDF" %}
{% include "elements/icons/link_download.html" %}
</a>
</li>
</ul>

<h2>{% trans "Versions" %}</h2>
{% hook 'preprint_version_downloads' %}

<h2>{% trans "Information" %}</h2>
<ul>
{% if journal_settings.article.display_date_submitted and article.date_submitted %}
<li>{% trans "Submitted on" %} {{ article.date_submitted|date_human }}</li>
{% endif %}
{% if journal_settings.article.display_date_accepted and article.date_accepted %}
<li>{% trans "Accepted on" %} {{ article.date_accepted|date_human }}</li>
{% endif %}
{% if article.is_published %}
<li id="article_date_published">
{% trans "Published on" %} {{ article.date_published|date_human }}
</li>
{% endif %}
{% if journal_settings.general.uses_isolinear_plugin and not article.is_published %}
<li>{% trans "Preprint Under Review" %}</li>
{% elif article.peer_reviewed %}
<li>{% trans "Peer Reviewed" %}
<i aria-hidden="true" class="fa fa-check-circle"></i>
</li>
{% endif %}
{% if article.license %}
<li>{% trans "Licence" %}
<a href="{{ article.license.url }}" data-toggle="tooltip" data-html="true"
title="{{ article.license.text|safe }}" target="_blank">
{{ article.license.name }}
{% include "elements/icons/link_external.html" %}
</a>
</li>
{% endif %}
</ul>

{% if article.competing_interests %}
<h2>{% trans "Competing Interests" %}</h2>
<ul>
<li>{{ article.competing_interests|safe }}</li>
</ul>
{% endif %}

{% for field in article.custom_fields %}
<h2>{% trans field.field.name %}</h2>
<p>{{ field.answer|safe }}</p>
{% endfor %}

{% if article.public_reviews.count > 0 %}
<h2>{% trans "Open Peer Reviews" %}</h2>
<ul>
{% for review in article.public_reviews %}
<li>
<a href="#" data-toggle="modal" data-target="#reviewmodal-{{ review.pk }}">
{% trans 'Review by' %} {{ review.reviewer.full_name }}
{% include "elements/icons/link_modal.html" %}
</a>
</li>
{% endfor %}
</ul>
{% endif %}
</div>
{% hook 'article_sidebar' %}
</section>
</div>
</div>
</div>
</div>

{% include "elements/public_reviews.html" %}

{% endblock body %}

{% block js %}
<script type='text/javascript' src='https://d1bxh8uas1mnw7.cloudfront.net/assets/embed.js'></script>
{% hook 'article_js_block' %}
<script src="{% static "clarity/js/tooltip-init.js" %}"></script>
{% endblock js %}
Loading