SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit baa6b1fa authored by Jean-Sébastien Caux's avatar Jean-Sébastien Caux
Browse files

Change display of report metadata manage page

parent 8f46ada5
No related branches found
No related tags found
No related merge requests found
......@@ -26,8 +26,9 @@ event: "focusin"
<thead class="thead-default">
<tr>
<th>Submission</th>
<th>Associated doi</th>
<th>Report nr</th>
<th>Needs doi</th>
<th>Needs own doi</th>
<th>Latest successful Crossref deposit</th>
<th>Deposit needs updating?</th>
</tr>
......@@ -37,13 +38,14 @@ event: "focusin"
{% for report in reports %}
<tr data-toggle="collapse" data-parent="#accordion" href="#collapse{{ report.id }}" aria-expanded="true" aria-controls="collapse{{ report.id }}" style="cursor: pointer;">
<td>{{ report.submission.arxiv_identifier_w_vn_nr }}</td>
<td>{{ report.associated_published_doi }}</td>
<td>{{ report.report_nr }}</td>
<td>{{ report.needs_doi }}</td>
<td>{{ report|latest_successful_crossref_deposit_report }}</td>
<td>{{ report.doideposit_needs_updating }}</td>
</tr>
<tr id="collapse{{ report.id }}" class="collapse" role="tabpanel" aria-labelledby="heading{{ report.id }}" style="background-color: #fff;">
<td colspan="5">
<td colspan="6">
<p><a href="{{ report.submission.get_absolute_url }}">{{ report.submission.arxiv_identifier_w_vn_nr }}</a>, <a href="{{ report.get_absolute_url }}">{{ report.report_nr }}</a></p>
<h2 class="ml-3">Actions</h2>
......
......@@ -502,6 +502,21 @@ class Report(SubmissionRelatedObjectMixin, models.Model):
submission__arxiv_identifier_wo_vn_nr=self.submission.arxiv_identifier_wo_vn_nr)
.order_by('submission__arxiv_identifier_wo_vn_nr').last())
@property
def associated_published_doi(self):
"""
Check if the Report relates to a SciPost-published object.
If it is, return the doi of the published object.
"""
try:
publication = Publication.objects.get(
accepted_submission__arxiv_identifier_wo_vn_nr=self.submission.arxiv_identifier_wo_vn_nr)
except Publication.DoesNotExist:
return None
return publication.doi_string
@property
def relation_to_published(self):
"""
......@@ -509,19 +524,20 @@ class Report(SubmissionRelatedObjectMixin, models.Model):
If it is, return a dict with info on relation to the published object,
based on Crossref's peer review content type.
"""
publication = Publication.objects.get(
accepted_submission__arxiv_identifier_wo_vn_nr=self.submission.arxiv_identifier_wo_vn_nr)
if publication:
relation = {
'isReviewOfDOI': publication.doi_string,
'stage': 'pre-publication',
'type': 'referee-report',
'title': 'Report on ' + self.submission.arxiv_identifier_w_vn_nr,
'contributor_role': 'reviewer',
}
return relation
try:
publication = Publication.objects.get(
accepted_submission__arxiv_identifier_wo_vn_nr=self.submission.arxiv_identifier_wo_vn_nr)
except Publication.DoesNotExist:
return None
return None
relation = {
'isReviewOfDOI': publication.doi_string,
'stage': 'pre-publication',
'type': 'referee-report',
'title': 'Report on ' + self.submission.arxiv_identifier_w_vn_nr,
'contributor_role': 'reviewer',
}
return relation
##########################
......
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