SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 4dd2e704 authored by George Katsikas's avatar George Katsikas :goat:
Browse files

make report recommendation publicly visible

only affects new reports

fixes #59
parent 62d0ed78
No related branches found
No related tags found
No related merge requests found
# Generated by Django 4.2.10 on 2024-04-09 10:55
from django.db import migrations, models
def set_existing_reports_publicly_invisible(apps, schema_editor):
Report = apps.get_model("submissions", "Report")
Report.objects.update(recommendation_publicly_visible=False)
class Migration(migrations.Migration):
dependencies = [
("submissions", "0150_submission_code_metadata"),
]
operations = [
migrations.AddField(
model_name="report",
name="recommendation_publicly_visible",
field=models.BooleanField(default=True),
),
migrations.RunPython(
set_existing_reports_publicly_invisible,
reverse_code=migrations.RunPython.noop,
),
]
...@@ -110,6 +110,7 @@ class Report(SubmissionRelatedObjectMixin, models.Model): ...@@ -110,6 +110,7 @@ class Report(SubmissionRelatedObjectMixin, models.Model):
) )
recommendation = models.SmallIntegerField(null=True, blank=True, choices=REPORT_REC) recommendation = models.SmallIntegerField(null=True, blank=True, choices=REPORT_REC)
recommendation_publicly_visible = models.BooleanField(default=True)
remarks_for_editors = models.TextField( remarks_for_editors = models.TextField(
blank=True, verbose_name="optional remarks for the Editors only" blank=True, verbose_name="optional remarks for the Editors only"
) )
......
...@@ -38,8 +38,22 @@ ...@@ -38,8 +38,22 @@
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<h3 class="highlight tight">Attachment</h3> <h3 class="highlight tight">Attachment</h3>
<div class="ps-md-4">{% include 'bi/download.html' %} <a href="{{ report.get_attachment_url }}">Download attachment</a></div> <div class="ps-md-4">
<br> {% include 'bi/download.html' %}
<a href="{{ report.get_attachment_url }}">Download attachment</a>
</div>
<br />
</div>
</div>
{% endif %}
{% if report.recommendation_publicly_visible %}
<div class="row">
<div class="col-12">
<h3 class="highlight tight">Recommendation</h3>
<div class="ps-md-4">
<p>{{ report.get_recommendation_display }}</p>
</div>
</div> </div>
</div> </div>
{% endif %} {% endif %}
......
...@@ -106,13 +106,6 @@ ...@@ -106,13 +106,6 @@
</div> </div>
{% endif %} {% endif %}
{% if user.contributor == submission.editor_in_charge or user|is_in_group:'Editorial Administrators' and not user|is_possible_author_of_submission:submission %}
<div class="m-2 p-2 border border-danger">
<h3 class="highlight tight">Recommendation</h3>
<div class="ps-md-4">{{ report.get_recommendation_display }}</div>
</div>
{% endif %}
{% block single_report_footer %}{% endblock %} {% block single_report_footer %}{% endblock %}
</div> </div>
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment