From b302a0f860ff0f236e82e10c67fe75a6bfe36205 Mon Sep 17 00:00:00 2001 From: Jorran de Wit <jorrandewit@outlook.com> Date: Tue, 23 Jan 2018 22:12:46 +0100 Subject: [PATCH] Finish post-publication reports v1 --- submissions/forms.py | 5 +++-- .../_single_public_report_without_comments.html | 8 +++++++- .../templates/submissions/submit_report.html | 15 ++++++++++++--- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/submissions/forms.py b/submissions/forms.py index c9f3ac636..4e3ce90c7 100644 --- a/submissions/forms.py +++ b/submissions/forms.py @@ -519,6 +519,8 @@ class ReportPDFForm(forms.ModelForm): class ReportForm(forms.ModelForm): + report_type = REPORT_NORMAL + class Meta: model = Report fields = ['qualification', 'strengths', 'weaknesses', 'report', 'requested_changes', @@ -582,8 +584,6 @@ class ReportForm(forms.ModelForm): if self.submission.status in POST_PUBLICATION_STATUSES: self.report_type = REPORT_POST_PUBLICATION - else: - self.report_type = REPORT_NORMAL def save(self): """ @@ -591,6 +591,7 @@ class ReportForm(forms.ModelForm): Possibly overwrite the default status if user asks for saving as draft. """ report = super().save(commit=False) + report.report_type = self.report_type report.submission = self.submission report.date_submitted = timezone.now() diff --git a/submissions/templates/submissions/_single_public_report_without_comments.html b/submissions/templates/submissions/_single_public_report_without_comments.html index cd14902fb..1d268af9d 100644 --- a/submissions/templates/submissions/_single_public_report_without_comments.html +++ b/submissions/templates/submissions/_single_public_report_without_comments.html @@ -10,6 +10,9 @@ <h3> {% if report.anonymous %}(chose public anonymity) {% endif %}<a href="{{report.author.get_absolute_url}}">{{ report.author.user.first_name }} {{ report.author.user.last_name }}</a> on {{ report.date_submitted|date:'Y-n-j' }} + {% if report.report_type == 'report_post_pub' %} + <small><label class="label label-outline-primary ml-2">Post-publication Report</label></small> + {% endif %} </h3> {% if report.doi_string or report.pdf_report %} <ul class="clickables"> @@ -63,7 +66,10 @@ <div class="reportid"> <h3> {% if report.anonymous %}Anonymous Report {{report.report_nr}}{% else %}<a href="{{report.author.get_absolute_url}}">{{ report.author.user.first_name }} {{ report.author.user.last_name }}</a>{% endif %} - on {{ report.date_submitted|date:'Y-n-j' }}</h3> + on {{ report.date_submitted|date:'Y-n-j' }} + {% if report.report_type == 'report_post_pub' %} + <small><label class="label label-outline-primary ml-2">Post-publication Report</label></small> + {% endif %} </h3> {% if report.doi_string or report.pdf_report %} <ul class="clickables"> diff --git a/submissions/templates/submissions/submit_report.html b/submissions/templates/submissions/submit_report.html index b7e1b97a5..dbfc759f8 100644 --- a/submissions/templates/submissions/submit_report.html +++ b/submissions/templates/submissions/submit_report.html @@ -82,9 +82,6 @@ <div class="card card-grey"> <div class="card-body"> <h1>Your {% if form.instance.is_followup_report %}followup {% endif %}report:</h1> - {% if form.report_type == 'report_post_pub' %} - <p class="text-warning">The Editorial Recommendation for this Submission has already been formulated. Therefore, your report will be flagged as <label class="label label-outline-warning">Post-publication Report</label>.</p> - {% endif %} <p>A preview of text areas will appear below as you type (you can use LaTeX \$...\$ for in-text equations or \ [ ... \ ] for on-line equations).</p> <p class="mb-0">Any fields with an asterisk (*) are required.</p> {% if form.instance.is_followup_report %} @@ -94,12 +91,24 @@ {% endif %} </div> </div> + {% if form.report_type == 'report_post_pub' %} + <div class="card border-warning my-4"> + <div class="card-body">The Editorial Recommendation for this Submission has already been formulated. Therefore, your report will be flagged as <label class="label label-warning">Post-publication Report</label>. + </div> + </div> + {% endif %} <form action="{% url 'submissions:submit_report' arxiv_identifier_w_vn_nr=submission.arxiv_identifier_w_vn_nr %}" method="post"> {% csrf_token %} {{ form|bootstrap:'3,9' }} <p>Any fields with an asterisk (*) are required.</p> <input class="btn btn-primary" type="submit" name="save_submit" value="Submit your report"/> <input class="btn btn-secondary ml-2" type="submit" name="save_draft" value="Save your report as draft"/> + {% if form.report_type == 'report_post_pub' %} + <div class="card border-warning mt-4"> + <div class="card-body">The Editorial Recommendation for this Submission has already been formulated. Therefore, your report will be flagged as <label class="label label-warning">Post-publication Report</label>. + </div> + </div> + {% endif %} <div class="my-4"> <em>By clicking on Submit, you state that you abide by the <a href="{% url 'journals:journals_terms_and_conditions' %}#referee_code_of_conduct">referee code of conduct</a>.</em> </div> -- GitLab