diff --git a/SciPost_v1/settings/base.py b/SciPost_v1/settings/base.py index 62c8ff2aa6d133346ce7476f8fcb4e83617fbba7..111867e4473dd4d17f4dd15a0612fb9ca9d27da4 100644 --- a/SciPost_v1/settings/base.py +++ b/SciPost_v1/settings/base.py @@ -276,6 +276,7 @@ JOURNALS_DIR = 'journals' CROSSREF_LOGIN_ID = '' CROSSREF_LOGIN_PASSWORD = '' +CROSSREF_DEBUG = True DOAJ_API_KEY = '' # Google reCaptcha with Google's global test keys diff --git a/SciPost_v1/settings/local_jorran.py b/SciPost_v1/settings/local_jorran.py index b458216b2d898d444ce1e586d892d86c76c97410..677612094fb8295095ffc0a2e560a3041ad1c1b7 100644 --- a/SciPost_v1/settings/local_jorran.py +++ b/SciPost_v1/settings/local_jorran.py @@ -30,3 +30,7 @@ ITHENTICATE_PASSWORD = get_secret('ITHENTICATE_PASSWORD') # Logging LOGGING['handlers']['scipost_file_arxiv']['filename'] = '/Users/jorranwit/Develop/SciPost/SciPost_v1/logs/arxiv.log' LOGGING['handlers']['scipost_file_doi']['filename'] = '/Users/jorranwit/Develop/SciPost/SciPost_v1/logs/doi.log' + +# Other +CROSSREF_LOGIN_ID = get_secret("CROSSREF_LOGIN_ID") +CROSSREF_LOGIN_PASSWORD = get_secret("CROSSREF_LOGIN_PASSWORD") diff --git a/SciPost_v1/settings/production.py b/SciPost_v1/settings/production.py index 4d6bb7a6c1f88119eebe06c08b530fb341c53450..c1592375415f1163635ac06b7d5ac8628cede44a 100644 --- a/SciPost_v1/settings/production.py +++ b/SciPost_v1/settings/production.py @@ -36,6 +36,7 @@ SERVER_EMAIL = get_secret("SERVER_EMAIL") # Other CROSSREF_LOGIN_ID = get_secret("CROSSREF_LOGIN_ID") CROSSREF_LOGIN_PASSWORD = get_secret("CROSSREF_LOGIN_PASSWORD") +CROSSREF_DEBUG = False DOAJ_API_KEY = get_secret("DOAJ_API_KEY") HAYSTACK_CONNECTIONS['default']['PATH'] = '/home/scipost/webapps/scipost/SciPost_v1/whoosh_index' MAILCHIMP_API_USER = get_secret("MAILCHIMP_API_USER") diff --git a/SciPost_v1/settings/staging_release.py b/SciPost_v1/settings/staging_release.py index a9290b92b0524e7a61c13d6322275fcd9d6dfe4f..5962728ad4ce750a697b5c614aef535d886b7c1a 100644 --- a/SciPost_v1/settings/staging_release.py +++ b/SciPost_v1/settings/staging_release.py @@ -22,3 +22,7 @@ WEBPACK_LOADER['DEFAULT']['BUNDLE_DIR_NAME'] = '/home/jdewit/webapps/scipost_sta # Error reporting ADMINS = MANAGERS = (('J. de Wit', 'jorrandewit@outlook.com'), ) + +# Logging +LOGGING['handlers']['scipost_file_arxiv']['filename'] = '/home/jdewit/webapps/scipost/logs/arxiv.log' +LOGGING['handlers']['scipost_file_doi']['filename'] = '/home/jdewit/webapps/scipost/logs/doi.log' diff --git a/commentaries/templates/commentaries/commentary_detail.html b/commentaries/templates/commentaries/commentary_detail.html index 4d0160aa6a71bb8447f9fcb3fd1aed472e771f25..710c058dba581f1db8c6edccfc684991f0f0838e 100644 --- a/commentaries/templates/commentaries/commentary_detail.html +++ b/commentaries/templates/commentaries/commentary_detail.html @@ -21,7 +21,10 @@ <h3>Abstract:</h3> <p>{{ commentary.pub_abstract }}</p> -{% include 'scipost/comments_block.html' with comments=commentary.comments.vetted type_of_object='Commentary' %} +{% if commentary.comments.vetted %} + <hr class="divider"> + {% include 'scipost/comments_block.html' with comments=commentary.comments.vetted type_of_object='Commentary' %} +{% endif %} {% include 'comments/new_comment.html' with object_id=commentary.id type_of_object='commentary' open_for_commenting=commentary.open_for_commenting %} diff --git a/comments/models.py b/comments/models.py index 9f52ca8d076f678dac5ebf7ad686960205dc22f8..e138ca39ad2b9a7fefc8d3f7606207bdfc176df5 100644 --- a/comments/models.py +++ b/comments/models.py @@ -233,3 +233,20 @@ class Comment(TimeStampedModel): return relation return None + + @property + def citation(self): + citation = '' + if self.doi_string: + if self.anonymous: + citation += 'Anonymous, ' + else: + citation += '%s %s, ' % (self.author.user.first_name, self.author.user.last_name) + + if self.is_author_reply: + citation += 'SciPost Author Replies, ' + else: + citation += 'SciPost Comments, ' + citation += 'Delivered %s, ' % self.date_submitted.strftime('%Y-%m-%d') + citation += 'doi: %s' % self.doi_string + return citation diff --git a/comments/templates/comments/_comment_identifier.html b/comments/templates/comments/_comment_identifier.html index 2d518ecedeea4fe7dd83cdf87755bd40e115d019..5eb681610a2fd2e657a5d71fcea0a9d1656e16f3 100644 --- a/comments/templates/comments/_comment_identifier.html +++ b/comments/templates/comments/_comment_identifier.html @@ -17,7 +17,7 @@ <a href="{{comment.author.get_absolute_url}}">{{comment.author.user.first_name}} {{comment.author.user.last_name}}</a> on {{comment.date_submitted|date:'Y-m-d'}} {% endif %} - {% if comment.doi_string %} <small>doi: {{ comment.doi_string }}</small>{% endif %} + {% if comment.doi_string %} <small>{{ comment|citation }}</small>{% endif %} </h3> diff --git a/journals/migrations/0004_auto_20180122_2109.py b/journals/migrations/0004_auto_20180122_2109.py new file mode 100644 index 0000000000000000000000000000000000000000..de58b2237846e33f49e27fca994656b72c05371a --- /dev/null +++ b/journals/migrations/0004_auto_20180122_2109.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.4 on 2018-01-22 20:09 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('journals', '0003_auto_20180117_2323'), + ] + + operations = [ + migrations.AlterField( + model_name='publication', + name='accepted_submission', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='publication', to='submissions.Submission'), + ), + ] diff --git a/journals/templates/journals/metadata_xml_deposit.html b/journals/templates/journals/metadata_xml_deposit.html index a6e405b3c01252b3b7b659446258325597ad1f30..0f40882d3e4f459ebd331fc81fcf12d3a708f4e8 100644 --- a/journals/templates/journals/metadata_xml_deposit.html +++ b/journals/templates/journals/metadata_xml_deposit.html @@ -28,6 +28,7 @@ <div class="row"> <div class="col-12"> + {% if errormessage %} <h2 class="text-danger">{{ errormessage }}</h2> {% endif %} @@ -38,7 +39,9 @@ </div> <h3 class="mt-3">Response text:</h3> - <p>{{ response_text|linebreaks }}</p> + <div> + <pre><code>{{ response_text|linebreaks }}</code></pre> + </div> <h3><a href="{{publication.get_absolute_url}}">return to the publication's page</a>, to the <a href="{% url 'journals:manage_metadata' %}">general metadata management page</a> or to <a href="{% url 'journals:manage_metadata' doi_label=publication.doi_label %}">this publication's metadata management page</a></h3> diff --git a/journals/views.py b/journals/views.py index a7b7d052e382a57cdd9c8c2886fd1da063f8f6ba..4194b507906cb1c1adf6397cded78c9074589492 100644 --- a/journals/views.py +++ b/journals/views.py @@ -1180,7 +1180,8 @@ def generic_metadata_xml_deposit(request, **kwargs): '</dataset></database>\n' '</body></doi_batch>' ) - if not settings.DEBUG: + + if not settings.CROSSREF_DEBUG: # CAUTION: Debug is False, production goes for real deposit!!! url = 'http://doi.crossref.org/servlet/deposit' else: diff --git a/scipost/static/scipost/SciPost.css b/scipost/static/scipost/SciPost.css index 59a65ec9ace010ea561c03571b2d1dc1cf80645e..44e1b4c27a9f5f124ba0bfed164a4ffca84c4685 100644 --- a/scipost/static/scipost/SciPost.css +++ b/scipost/static/scipost/SciPost.css @@ -486,32 +486,6 @@ table.tablePadded10 td { background-color: #990000; } -.reportRatings { - font-family: 'Merriweather Sans'; - font-size: 11px; - margin: 0 4px; - padding: 0; - display: inline-block; - box-shadow: 0 1px 0 1px #ccc; - background: #f4f4f4; -} -.reportRatings ul { - display: inline-block; - font-family: 'Merriweather Sans'; - margin: 0; - padding: 2px 1px; -} -.reportRatings ul li { - border: 1px solid #002b49; - display: inline-block; - font-family: 'Merriweather Sans'; - margin: 0 3px; - padding: 4px 7px; - border-radius: 1px; - background-color: #f1f1f1; -} - - article { background-color:#eeeeee; border: 1px solid grey; border-radius:5px; diff --git a/scipost/static/scipost/assets/css/_reports.scss b/scipost/static/scipost/assets/css/_reports.scss new file mode 100644 index 0000000000000000000000000000000000000000..5202c697961d007b3d75528d2f25c13cc6d648c4 --- /dev/null +++ b/scipost/static/scipost/assets/css/_reports.scss @@ -0,0 +1,16 @@ +.report { + ul.clickables { + display: inline-block; + list-style: none; + margin: 0.5rem 0 0 0; + padding: 0; + + li { + padding: 0 0 0.25rem 0; + } + + .citation { + font-style: italic; + } + } +} diff --git a/scipost/static/scipost/assets/css/_submissions.scss b/scipost/static/scipost/assets/css/_submissions.scss index 3dae5291ec7064cdbdbe6ec349c416222af1106b..f41deda48852a0f3e890647e5527955234e42e60 100644 --- a/scipost/static/scipost/assets/css/_submissions.scss +++ b/scipost/static/scipost/assets/css/_submissions.scss @@ -17,7 +17,7 @@ table.submission_header { box-shadow: 0 1px 0 0 $card-shadow-color; border: 1px solid; border-color: $card-grey-border-color; - z-index: -1; + z-index: 1; border-radius: $border-radius 0 $border-radius $border-radius; } @@ -37,34 +37,6 @@ table.submission_header { } } -.reportRatings { - font-size: 10px; - margin: 0.5rem 0 1rem; - padding: 0.3rem 0.5rem 0.4rem; - display: inline-block; - box-shadow: 0 1px 0 0 #ccc; - background: #f9f9f9; - border: 1px solid; - border-color: #ececec #ececec #d0d1d5; - border-radius: 2px; - - ul { - margin: 0; - padding: 0; - - li { - border: 1px solid; - display: inline-block; - margin: 0.1rem; - padding: 0.25rem 0.5rem; - border-color: #e5e6e9 #dfe0e4 #d0d1d5; - border-radius: 2px; - background: #fff; - box-shadow: 0 1px 0 0 #ccc; - } - } -} - .required-actions { padding: 0.5rem; background-color: $red; diff --git a/scipost/static/scipost/assets/css/_tables.scss b/scipost/static/scipost/assets/css/_tables.scss index 8873b93c394e15c1ef958f4509818a1f193e5c59..978a10b859c8d1258d781984409e1ae2e5639f96 100644 --- a/scipost/static/scipost/assets/css/_tables.scss +++ b/scipost/static/scipost/assets/css/_tables.scss @@ -28,3 +28,17 @@ table.contributor-info { vertical-align: top; } } + +.ratings { + background-color: $body-bg; + padding: 0.5rem; + display: inline-block; + border: 1px solid #ddd; + text-transform: capitalize; + + th { + min-width: 120px; + text-align: right; + padding: 0.1rem 1rem; + } +} diff --git a/scipost/static/scipost/assets/css/_type.scss b/scipost/static/scipost/assets/css/_type.scss index 52798b0cc849833716e0725dcdda5b0687be69a6..f6eef699ad9eada0e0f37bebe7f9b58259e326c0 100644 --- a/scipost/static/scipost/assets/css/_type.scss +++ b/scipost/static/scipost/assets/css/_type.scss @@ -67,10 +67,9 @@ h5 { } .highlight { - background-color: #f4f4f4; + background-color: $body-bg; border-radius: $card-border-radius; - border: 1px solid #ececec; - box-shadow: 0 1px 0 0 $card-shadow-color; + border: 1px solid #ddd; &.tight { display: inline-block; @@ -119,6 +118,18 @@ hr.hr12 { &.small { height: 1px; } + + &.divider { + height: 10px; + border-radius: 0; + background-color: $body-bg; + margin-left: -$grid-gutter-width; + margin-right: -$grid-gutter-width; + margin-top: 1.5rem; + margin-bottom: 1.5rem; + box-shadow: none; + width: auto; + } } .text-blue { diff --git a/scipost/static/scipost/assets/css/scipost-physics.scss b/scipost/static/scipost/assets/css/scipost-physics.scss index 816d3a46be9e8b8e21cd44e3bc375fee10233b2b..381822f4dfd9e0796319f1ec57093e9eb95c18a5 100644 --- a/scipost/static/scipost/assets/css/scipost-physics.scss +++ b/scipost/static/scipost/assets/css/scipost-physics.scss @@ -32,7 +32,7 @@ &.active { color: #002b49; background: rgba(255, 255, 255, 0.5); - box-shadow: 0 1px 0 0 #ccc; + box-shadow: 0 1px 0 0 #ddd; } } } diff --git a/scipost/static/scipost/assets/css/style.scss b/scipost/static/scipost/assets/css/style.scss index ddd9fc91b2ca14722ee634cfe12ee1f75cb090a8..6e6fca92a968ba2d2d382a858ba4c5e410042741 100644 --- a/scipost/static/scipost/assets/css/style.scss +++ b/scipost/static/scipost/assets/css/style.scss @@ -48,6 +48,7 @@ @import "icons"; @import "journals"; @import "personal_page"; +@import "reports"; @import "submissions"; diff --git a/scipost/templates/scipost/comments_block.html b/scipost/templates/scipost/comments_block.html index bc60d0b67be828c920578e4ae16aa2194351bb3c..d3fa22a5a38ba0bf1a51739ff35d9ebc1250258e 100644 --- a/scipost/templates/scipost/comments_block.html +++ b/scipost/templates/scipost/comments_block.html @@ -1,19 +1,19 @@ {% if comments %} -<hr> -<div class="row"> - <div class="col-12"> - <div class="card card-grey"> - <div class="card-body"> - <h2 class="card-title mb-0">Comments{% if type_of_object %} on this {{type_of_object}}{% endif %}</h2> - <a href="javascript:;" data-toggle="toggle" data-target="#commentslist">Toggle comments view</a> + + <div class="row"> + <div class="col-12"> + <div class="card card-grey"> + <div class="card-body"> + <h2 class="card-title mb-0">Comments{% if type_of_object %} on this {{type_of_object}}{% endif %}</h2> + <a href="javascript:;" data-toggle="toggle" data-target="#commentslist">Toggle comments view</a> + </div> </div> </div> </div> -</div> -<div id="commentslist"> - {% for comment in comments %} - {% include 'comments/_single_comment_with_link.html' with comment=comment perms=perms user=request.user %} - {% endfor %} -</div> + <div id="commentslist"> + {% for comment in comments %} + {% include 'comments/_single_comment_with_link.html' with comment=comment perms=perms user=request.user %} + {% endfor %} + </div> {% endif %} diff --git a/submissions/admin.py b/submissions/admin.py index 0f52fe45e9c9a0c93e0579f4b2e6f1ce8ca05596..0466fba0ced8fc05b6e32063d5ef07e9deb1ed97 100644 --- a/submissions/admin.py +++ b/submissions/admin.py @@ -184,7 +184,7 @@ class ReportAdminForm(forms.ModelForm): class ReportAdmin(admin.ModelAdmin): search_fields = ['author__user__last_name', 'submission'] - list_display = ('author', 'status', submission_short_title, 'date_submitted', ) + list_display = ('author', 'status', 'doi_label', submission_short_title, 'date_submitted', ) list_display_links = ('author',) date_hierarchy = 'date_submitted' list_filter = ('status',) diff --git a/submissions/models.py b/submissions/models.py index 14408d47ceb109d9a4f0304cfb144de369f16191..d1cb44825c61c19b4d04f94db7907121b2f086c8 100644 --- a/submissions/models.py +++ b/submissions/models.py @@ -452,16 +452,6 @@ class Report(SubmissionRelatedObjectMixin, models.Model): return (self.author.user.first_name + ' ' + self.author.user.last_name + ' on ' + self.submission.title[:50] + ' by ' + self.submission.author_list[:50]) - def save(self, *args, **kwargs): - # Control Report count per Submission. - if not self.report_nr: - self.report_nr = self.submission.reports.count() + 1 - return super().save(*args, **kwargs) - - def create_doi_label(self): - self.doi_label = 'SciPost.Report.' + str(self.id) - self.save() - def get_absolute_url(self): return self.submission.get_absolute_url() + '#report_' + str(self.report_nr) @@ -473,8 +463,7 @@ class Report(SubmissionRelatedObjectMixin, models.Model): def doi_string(self): if self.doi_label: return '10.21468/' + self.doi_label - else: - return None + return '' @cached_property def title(self): @@ -484,7 +473,7 @@ class Report(SubmissionRelatedObjectMixin, models.Model): """ return self.submission.title - @cached_property + @property def is_followup_report(self): """ Check if current Report is a `FollowupReport`. A Report is a `FollowupReport` if the @@ -494,6 +483,16 @@ class Report(SubmissionRelatedObjectMixin, models.Model): submission__arxiv_identifier_wo_vn_nr=self.submission.arxiv_identifier_wo_vn_nr, submission__arxiv_vn_nr__lt=self.submission.arxiv_vn_nr).exists()) + def save(self, *args, **kwargs): + # Control Report count per Submission. + if not self.report_nr: + self.report_nr = self.submission.reports.count() + 1 + return super().save(*args, **kwargs) + + def create_doi_label(self): + self.doi_label = 'SciPost.Report.' + str(self.id) + self.save() + def latest_report_from_series(self): """ Get latest Report from the same author for the Submission series. @@ -523,6 +522,19 @@ class Report(SubmissionRelatedObjectMixin, models.Model): return None + @property + def citation(self): + citation = '' + if self.doi_string: + if self.anonymous: + citation += 'Anonymous, ' + else: + citation += '%s %s, ' % (self.author.user.first_name, self.author.user.last_name) + citation += 'Report on arXiv:%s, ' % self.submission.arxiv_identifier_w_vn_nr + citation += 'delivered %s, ' % self.date_submitted.strftime('%Y-%m-%d') + citation += 'doi: %s' % self.doi_string + return citation + ########################## # EditorialCommunication # diff --git a/submissions/templates/submissions/_single_public_report_without_comments.html b/submissions/templates/submissions/_single_public_report_without_comments.html index 5f0a3cf451b00d72550a7e9da77a25270fbf617c..c44564cfa4180fe97c0310f148bc508d635b586b 100644 --- a/submissions/templates/submissions/_single_public_report_without_comments.html +++ b/submissions/templates/submissions/_single_public_report_without_comments.html @@ -7,18 +7,28 @@ {% if user.contributor == submission.editor_in_charge or user|is_in_group:'Editorial Administrators' and user|is_not_author_of_submission:submission.arxiv_identifier_w_vn_nr %} <div class="reportid"> - <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' }} + <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' }} </h3> - <ul class="publicationClickables"> - {% if report.doi_string %}<li>doi: {{ report.doi_string }}</li>{% endif %} - {% if report.pdf_report %} - <li><a href="{% url 'submissions:report_detail_pdf' report.submission.arxiv_identifier_w_vn_nr report.report_nr %}" target="_blank">Download as PDF</a></li> - {% endif %} - {% if perms.scipost.can_manage_reports %} - <li><a href="{% url 'submissions:report_pdf_compile' report.id %}">Update/Compile the Report pdf</a></li> - {% endif %} - </ul> + <ul class="clickables"> + {% if report.doi_string %} + <li>Cite as: <span class="citation">{{ report|citation }}</span></li> + {% endif %} + {% if report.pdf_report %} + <li> + <a href="{% url 'submissions:report_detail_pdf' report.submission.arxiv_identifier_w_vn_nr report.report_nr %}" target="_blank"><i class="fa fa-download"></i> Download as PDF</a> + </li> + {% endif %} + </ul> + {% if perms.scipost.can_manage_reports %} + <h3 class="mt-2">Administration</h3> + <ul> + <li><a href="{% url 'submissions:report_pdf_compile' report.id %}">Update/Compile the Report pdf</a></li> + <li>Mark DOI as <a href="{% url 'journals:mark_report_doi_needed' report_id=report.id needed=1 %}">needed</a> / <a href="{% url 'journals:mark_report_doi_needed' report_id=report.id needed=0 %}">not needed</a></li> + <li><a href="{% url 'journals:generic_metadata_xml_deposit' type_of_object='report' object_id=report.id %}">Create the metadata and deposit it to Crossref</a></li> + </ul> + {% endif %} </div> {% if report.flagged %} @@ -49,17 +59,27 @@ </div> {% else %} <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 %} + <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> </h3> - <ul class="publicationClickables"> - {% if report.doi_string %}<li>doi: {{ report.doi_string }}</li>{% endif %} - {% if report.pdf_report %} - <li><a href="{% url 'submissions:report_detail_pdf' report.submission.arxiv_identifier_w_vn_nr report.report_nr %}" target="_blank">Download as PDF</a></li> - {% endif %} - {% if perms.scipost.can_manage_reports %} - <li><a href="{% url 'submissions:report_pdf_compile' report.id %}">Update/Compile the Report pdf</a></li> - {% endif %} + <ul class="clickables"> + {% if report.doi_string %} + <li>Cite as: <span class="citation">{{ report|citation }}</span></li> + {% endif %} + {% if report.pdf_report %} + <li> + <a href="{% url 'submissions:report_detail_pdf' report.submission.arxiv_identifier_w_vn_nr report.report_nr %}" target="_blank"><i class="fa fa-download"></i> Download as PDF</a> + </li> + {% endif %} + {% if perms.scipost.can_manage_reports %} + <h3 class="mt-2">Administration</h3> + <ul> + <li><a href="{% url 'submissions:report_pdf_compile' report.id %}">Update/Compile the Report pdf</a></li> + <li>Mark DOI as <a href="{% url 'journals:mark_report_doi_needed' report_id=report.id needed=1 %}">needed</a> / <a href="{% url 'journals:mark_report_doi_needed' report_id=report.id needed=0 %}">not needed</a></li> + <li><a href="{% url 'journals:generic_metadata_xml_deposit' type_of_object='report' object_id=report.id %}">Create the metadata and deposit it to Crossref</a></li> + </ul> + {% endif %} </ul> </div> diff --git a/submissions/templates/submissions/_single_report_ratings.html b/submissions/templates/submissions/_single_report_ratings.html index f5280e13d6be622a957562e602a698ea460647d4..5eeb8dcf8dac45be87c3152eb7ebb5adbe903d8b 100644 --- a/submissions/templates/submissions/_single_report_ratings.html +++ b/submissions/templates/submissions/_single_report_ratings.html @@ -1,10 +1,32 @@ -<div class="reportRatings mt-2"> - <ul> - <li>validity: {{report.get_validity_display}}</li> - <li>significance: {{report.get_significance_display}}</li> - <li>originality: {{report.get_originality_display}}</li> - <li>clarity: {{report.get_clarity_display}}</li> - <li>formatting: {{report.get_formatting_display}}</li> - <li>grammar: {{report.get_grammar_display}}</li> - </ul> +<div class="ratings"> + <table> + <tr> + <th>Validity</th> + <td>{{ report.get_validity_display }}</td> + </tr> + <tr> + <th>Significance</th> + <td>{{ report.get_significance_display }}</td> + </tr> + <tr> + <th>Validity</th> + <td>{{ report.get_grammar_display }}</td> + </tr> + <tr> + <th>Originality</th> + <td>{{ report.get_originality_display }}</td> + </tr> + <tr> + <th>Clarity</th> + <td>{{ report.get_clarity_display }}</td> + </tr> + <tr> + <th>Formatting</th> + <td>{{ report.get_formatting_display }}</td> + </tr> + <tr> + <th>Grammar</th> + <td>{{ report.get_grammar_display }}</td> + </tr> + </table> </div> diff --git a/submissions/templates/submissions/submission_detail.html b/submissions/templates/submissions/submission_detail.html index a98239cdfab58ee3005ba7820c2c6c8ee2eb8b6d..6cfb4f77b8cca9c30b2acd2bed508075ee731ad2 100644 --- a/submissions/templates/submissions/submission_detail.html +++ b/submissions/templates/submissions/submission_detail.html @@ -10,10 +10,8 @@ <div class="container-outside breadcrumb-nav"> <div class="container"> <nav class="breadcrumb"> - - <a href="{% url 'submissions:submissions' %}" class="breadcrumb-item">Submissions</a> - <span class="breadcrumb-item">{{submission.arxiv_identifier_w_vn_nr}}</span> - + <a href="{% url 'submissions:submissions' %}" class="breadcrumb-item">Submissions</a> + <span class="breadcrumb-item">{{submission.arxiv_identifier_w_vn_nr}}</span> </nav> </div> </div> @@ -170,8 +168,10 @@ {% endif %} {% if invited_reports %} -{# <hr>#} -<div class="row mt-4"> + +<hr class="divider"> + +<div class="row"> <div class="col-12"> <div class="card card-grey"> <div class="card-body"> @@ -191,8 +191,9 @@ {% endif %} {% if contributed_reports %} -{# <hr>#} -<div class="row mt-4"> +<hr class="divider"> + +<div class="row"> <div class="col-12"> <div class="card card-grey"> <div class="card-body"> @@ -219,7 +220,10 @@ {% endif %} {% endif %} -{% include 'scipost/comments_block.html' with comments=submission.comments.vetted %} +{% if submission.comments.vetted %} + <hr class="divider"> + {% include 'scipost/comments_block.html' with comments=submission.comments.vetted %} +{% endif %} {# This is an apparent redundant logic block; however, it makes sure the "login to ..." links wouldn't be shown twice! #} diff --git a/submissions/templatetags/submissions_extras.py b/submissions/templatetags/submissions_extras.py index 97943119c4c443baf69fdaf9b1a477d53a550475..f63b5843f7d9be03df5dda65ef157acd102588cd 100644 --- a/submissions/templatetags/submissions_extras.py +++ b/submissions/templatetags/submissions_extras.py @@ -24,9 +24,18 @@ def is_viewable_by_authors(recommendation): @register.filter def user_is_referee(submission, user): + if not user.is_authenticated: + return False return submission.referee_invitations.filter(referee__user=user).exists() @register.filter def is_voting_fellow(submission, user): + if not user.is_authenticated: + return False return submission.voting_fellows.filter(contributor__user=user).exists() + + +@register.filter +def citation(citable): + return citable.citation diff --git a/theses/templates/theses/thesis_detail.html b/theses/templates/theses/thesis_detail.html index 7ed53d775a8bdfde69e842e8803cd6b4d6ec91a9..46df60782bdd374301843c0145bdabdaa51799af 100644 --- a/theses/templates/theses/thesis_detail.html +++ b/theses/templates/theses/thesis_detail.html @@ -14,7 +14,10 @@ </div> </div> -{% include 'scipost/comments_block.html' with comments=thesislink.comments.vetted type_of_object='ThesisLink' %} +{% if thesislink.comments.vetted %} + <hr class="divider"> + {% include 'scipost/comments_block.html' with comments=thesislink.comments.vetted type_of_object='ThesisLink' %} +{% endif %} {% include 'comments/new_comment.html' with object_id=thesislink.id type_of_object='thesislink' open_for_commenting=thesislink.open_for_commenting %}