From 4089f1c4f0ae886539d2f4eaaa4f60b91ea11c99 Mon Sep 17 00:00:00 2001 From: Jorran de Wit <jorrandewit@outlook.com> Date: Sat, 8 Jul 2017 00:00:22 +0200 Subject: [PATCH] Minor tweaks --- .../_single_public_report_without_comments.html | 6 ++++++ .../templates/submissions/_submission_summary.html | 6 +++++- .../templates/submissions/reports_pdf_compile.html | 1 + submissions/templates/submissions/submission_detail.html | 8 ++++++++ .../submissions/treated_submission_pdf_compile.html | 3 ++- submissions/views.py | 3 +-- 6 files changed, 23 insertions(+), 4 deletions(-) diff --git a/submissions/templates/submissions/_single_public_report_without_comments.html b/submissions/templates/submissions/_single_public_report_without_comments.html index 0d6e9a92f..9ffe7650c 100644 --- a/submissions/templates/submissions/_single_public_report_without_comments.html +++ b/submissions/templates/submissions/_single_public_report_without_comments.html @@ -13,6 +13,9 @@ {% if report.pdf_report %} <a href="{% url 'submissions:report_detail_pdf' report.submission.arxiv_identifier_w_vn_nr report.report_nr %}" target="_blank">Download as PDF</a> {% endif %} + {% if perms.scipost.can_manage_reports %} + {% if report.pdf_report %}· {% endif %}<a href="{% url 'submissions:report_pdf_compile' report.id %}"{% if not report.pdf_report %}class="btn btn-warning btn-sm"{% endif %}>Update/Compile the Report pdf</a> + {% endif %} </div> {% if report.flagged %} @@ -48,6 +51,9 @@ {% if report.pdf_report %} <a href="{% url 'submissions:report_detail_pdf' report.submission.arxiv_identifier_w_vn_nr report.report_nr %}" target="_blank">Download as PDF</a> {% endif %} + {% if perms.scipost.can_manage_reports %} + {% if report.pdf_report %}· {% endif %}<a href="{% url 'submissions:report_pdf_compile' report.id %}"{% if not report.pdf_report %}class="btn btn-warning btn-sm"{% endif %}>Update/Compile the Report pdf</a> + {% endif %} </div> {% include 'submissions/_single_report_content.html' with report=report %} diff --git a/submissions/templates/submissions/_submission_summary.html b/submissions/templates/submissions/_submission_summary.html index bd73de899..613cc023f 100644 --- a/submissions/templates/submissions/_submission_summary.html +++ b/submissions/templates/submissions/_submission_summary.html @@ -1,7 +1,11 @@ {% extends 'submissions/_submission_summary_short.html' %} {% block submission_summary_footer %} - <a href="{% url 'submissions:refereeing_package_pdf' submission.arxiv_identifier_w_vn_nr %}" target="_blank">Download pdf package</a> + {% if submission.pdf_refereeing_pack %} + <p class="mt-3"> + <a href="{% url 'submissions:refereeing_package_pdf' submission.arxiv_identifier_w_vn_nr %}" target="_blank" class="btn btn-outline-primary">Download Refereeing Package</a> + </p> + {% endif %} <h3 class="mt-3">Abstract</h3> <p>{{submission.abstract}}</p> {% endblock %} diff --git a/submissions/templates/submissions/reports_pdf_compile.html b/submissions/templates/submissions/reports_pdf_compile.html index 9f75ef0ea..cd32e70f1 100644 --- a/submissions/templates/submissions/reports_pdf_compile.html +++ b/submissions/templates/submissions/reports_pdf_compile.html @@ -24,6 +24,7 @@ <div class="row"> <div class="col-12"> <h3>Please process this code in your Tex Compiler:</h3> + <p>To compile, one needs the SciPost Refereeing Latex Package. Please <a href="mailto: info@scipost.org">contact SciPost</a> if you did not receive it.</p> <pre class="clickfocus" style="max-height: 200px;"><code>{% include 'submissions/_report_tex_template.html' with report=report %}</code></pre> </div> </div> diff --git a/submissions/templates/submissions/submission_detail.html b/submissions/templates/submissions/submission_detail.html index f255cf191..cb310f015 100644 --- a/submissions/templates/submissions/submission_detail.html +++ b/submissions/templates/submissions/submission_detail.html @@ -139,6 +139,14 @@ <li>Commenting on this Submission is closed.</li> {% endif %} </ul> + {% if perms.scipost.can_manage_reports %} + <h3>Admin Actions</h3> + <ul> + <li> + <a href="{% url 'submissions:treated_submission_pdf_compile' submission.arxiv_identifier_w_vn_nr %}">Update the Refereeing Package pdf</a> + </li> + <ul> + {% endif %} </div> </div> {% endif %} diff --git a/submissions/templates/submissions/treated_submission_pdf_compile.html b/submissions/templates/submissions/treated_submission_pdf_compile.html index aeb5e32c2..0eee256f8 100644 --- a/submissions/templates/submissions/treated_submission_pdf_compile.html +++ b/submissions/templates/submissions/treated_submission_pdf_compile.html @@ -23,7 +23,8 @@ <div class="row"> <div class="col-12"> <h3>Please process this code in your Tex Compiler:</h3> - <p>Don't forget you may need to compile twice because of the Table of Content.</p> + <p>You may need to compile twice because of the Table of Content.</p> + <p>To compile, one needs the SciPost Refereeing Latex Package. Please <a href="mailto: info@scipost.org">contact SciPost</a> if you did not receive it.</p> <pre class="clickfocus" style="max-height: 200px;"><code>{% include 'submissions/_refereeing_pack_tex_template.html' with submission=submission %}</code></pre> </div> </div> diff --git a/submissions/views.py b/submissions/views.py index 0b34e4570..8a449d19a 100644 --- a/submissions/views.py +++ b/submissions/views.py @@ -240,8 +240,7 @@ def submission_refereeing_package_pdf(request, arxiv_identifier_w_vn_nr): The merging takes places every time its downloaded to make sure all available report PDF's are included and the EdColAdmin doesn't have to compile the package every time again. """ - submission = get_object_or_404(Submission.objects.public(), - pdf_refereeing_pack__isnull=False, + submission = get_object_or_404(Submission.objects.public().exclude(pdf_refereeing_pack=''), arxiv_identifier_w_vn_nr=arxiv_identifier_w_vn_nr) response = HttpResponse(submission.pdf_refereeing_pack.read(), content_type='application/pdf') filename = '%s-refereeing-package.pdf' % submission.arxiv_identifier_w_vn_nr -- GitLab