diff --git a/partners/migrations/0033_auto_20171003_1512.py b/partners/migrations/0033_auto_20171003_1512.py new file mode 100644 index 0000000000000000000000000000000000000000..e665732968b38d015b34531e21e2d8262aba9d1f --- /dev/null +++ b/partners/migrations/0033_auto_20171003_1512.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.4 on 2017-10-03 13:12 +from __future__ import unicode_literals + +from django.db import migrations, models +import partners.storage + + +class Migration(migrations.Migration): + + dependencies = [ + ('partners', '0032_auto_20170829_0727'), + ] + + operations = [ + migrations.AlterField( + model_name='partnersattachment', + name='attachment', + field=models.FileField(storage=partners.storage.SecureFileStorage(), upload_to='UPLOADS/PARTNERS/ATTACHMENTS'), + ), + ] diff --git a/production/admin.py b/production/admin.py index dc5cbd236c21019ed1fb12ece7a8a9d13a89b09e..76c82159421864bfaedab50380d7221fc0cd2298 100644 --- a/production/admin.py +++ b/production/admin.py @@ -2,7 +2,7 @@ from django.contrib import admin from guardian.admin import GuardedModelAdmin -from .models import ProductionStream, ProductionEvent, ProductionUser +from .models import ProductionStream, ProductionEvent, ProductionUser, ProductionEvent def event_count(obj): @@ -31,4 +31,5 @@ class ProductionStreamAdmin(GuardedModelAdmin): admin.site.register(ProductionUser) +admin.site.register(ProductionEvent) admin.site.register(ProductionStream, ProductionStreamAdmin) diff --git a/production/migrations/0015_auto_20170914_2237.py b/production/migrations/0015_auto_20170914_2237.py index cb9ffcc83c0d5eb059cebe7d315cbc44ba31dc36..ba12a858e4277c5223dfa80d59577b1fabd94347 100644 --- a/production/migrations/0015_auto_20170914_2237.py +++ b/production/migrations/0015_auto_20170914_2237.py @@ -17,7 +17,7 @@ def contributor_to_officer(apps, schema_editor): # Transfer all Events ProductionEvent = apps.get_model('production', 'ProductionEvent') for event in ProductionEvent.objects.all(): - user = User.objects.get(contributor__id=event.noted_by_contributor.id, production_user__isnull=False) + user = User.objects.get(contributor__id=event.noted_by.user.contributor.id, production_user__isnull=False) event.noted_by.id = user.production_user.id event.save() print(' - ProductionEvents updated') diff --git a/production/migrations/0021_auto_20171003_1512.py b/production/migrations/0021_auto_20171003_1512.py new file mode 100644 index 0000000000000000000000000000000000000000..259a9b7527ea0d0bdf453ab510d63dd13adee682 --- /dev/null +++ b/production/migrations/0021_auto_20171003_1512.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.4 on 2017-10-03 13:12 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('production', '0020_auto_20170930_0156'), + ] + + operations = [ + migrations.AlterModelOptions( + name='productionstream', + options={'permissions': (('can_work_for_stream', 'Can work for stream'),)}, + ), + ] diff --git a/production/migrations/0022_auto_20171003_1525.py b/production/migrations/0022_auto_20171003_1525.py new file mode 100644 index 0000000000000000000000000000000000000000..50746ff3a864bd9e77886f4b2f700545eec0a4cc --- /dev/null +++ b/production/migrations/0022_auto_20171003_1525.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.4 on 2017-10-03 13:25 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('production', '0021_auto_20171003_1512'), + ] + + operations = [ + migrations.AlterModelOptions( + name='productionstream', + options={'permissions': (('can_work_for_stream', 'Can work for stream'), ('can_perform_supervisory_actions', 'Can perform supervisory actions'))}, + ), + ] diff --git a/production/templates/production/partials/production_stream_card.html b/production/templates/production/partials/production_stream_card.html index f1f88a5687e19c1fa867ca46cb2a9ab95de00372..8550fa1a34c12ee7acc4e8baadc082c9adee69be 100644 --- a/production/templates/production/partials/production_stream_card.html +++ b/production/templates/production/partials/production_stream_card.html @@ -9,38 +9,38 @@ <h3>Events</h3> {% include 'production/partials/production_events.html' with events=stream.events.all %} - {% if perms.scipost.can_publish_accepted_submission or perms.scipost.can_assign_production_supervisor or "can_perform_supervisory_actions" in sub_perms %} - <h3>Actions</h3> - <ul> - {% if perms.scipost.can_assign_production_supervisor and assign_supervisor_form %} - <li> - <a href="javascript:;" data-toggle="toggle" data-target="#add_supervisor_{{stream.id}}">Assign Production Supervisor to this stream</a> - <div id="add_supervisor_{{stream.id}}" style="display: none;"> - <form class="my-3" action="{% url 'production:add_supervisor' stream_id=stream.id %}" method="post"> - {% csrf_token %} - {{ assign_supervisor_form|bootstrap_inline }} - <input type="submit" class="btn btn-outline-primary" name="submit" value="Add officer"> - </form> - </div> - </li> - {% endif %} - {% if "can_perform_supervisory_actions" in sub_perms and assign_officer_form %} - <li> - <a href="javascript:;" data-toggle="toggle" data-target="#add_officer_{{stream.id}}">Assign Production Officer to this stream</a> - <div id="add_officer_{{stream.id}}" style="display: none;"> - <form class="my-3" action="{% url 'production:add_officer' stream_id=stream.id %}" method="post"> - {% csrf_token %} - {{ assign_officer_form|bootstrap_inline }} - <input type="submit" class="btn btn-outline-primary" name="submit" value="Add officer"> - </form> - </div> - </li> - {% endif %} - {% if perms.scipost.can_publish_accepted_submission %} - <li><a href="{% url 'production:mark_as_completed' stream_id=stream.id %}">Mark this stream as completed</a></li> - {% endif %} - </ul> - {% endif %} + {% if "can_perform_supervisory_actions" in sub_perms %} + <h3>Actions</h3> + <ul> + {% if perms.scipost.can_assign_production_supervisor and assign_supervisor_form %} + <li> + <a href="javascript:;" data-toggle="toggle" data-target="#add_supervisor_{{stream.id}}">Assign Production Supervisor to this stream</a> + <div id="add_supervisor_{{stream.id}}" style="display: none;"> + <form class="my-3" action="{% url 'production:add_supervisor' stream_id=stream.id %}" method="post"> + {% csrf_token %} + {{ assign_supervisor_form|bootstrap_inline }} + <input type="submit" class="btn btn-outline-primary" name="submit" value="Add officer"> + </form> + </div> + </li> + {% endif %} + {% if perms.scipost.can_assign_production_officer and assign_officer_form %} + <li> + <a href="javascript:;" data-toggle="toggle" data-target="#add_officer_{{stream.id}}">Assign Production Officer to this stream</a> + <div id="add_officer_{{stream.id}}" style="display: none;"> + <form class="my-3" action="{% url 'production:add_officer' stream_id=stream.id %}" method="post"> + {% csrf_token %} + {{ assign_officer_form|bootstrap_inline }} + <input type="submit" class="btn btn-outline-primary" name="submit" value="Add officer"> + </form> + </div> + </li> + {% endif %} + {% if perms.scipost.can_publish_accepted_submission %} + <li><a href="{% url 'production:mark_as_completed' stream_id=stream.id %}">Mark this stream as completed</a></li> + {% endif %} + </ul> + {% endif %} {% endblock %} {% block officers %} @@ -57,7 +57,7 @@ <li>Production Officer: {% if stream.officer %} <strong>{{ stream.officer }}</strong> - {% if "can_perform_supervisory_actions" in sub_perms %} + {% if perms.scipost.can_assign_production_officer and "can_perform_supervisory_actions" in sub_perms %} · <a href="{% url 'production:remove_officer' stream_id=stream.id officer_id=stream.officer.id %}" class="text-danger">Remove from stream</a> {% endif %} {% else %} diff --git a/production/views.py b/production/views.py index bcafcdbe0da5502211e0825a37054690ba9f205d..9c86ca0c9f0473030373e175da29151e893829a6 100644 --- a/production/views.py +++ b/production/views.py @@ -155,10 +155,10 @@ def add_supervisor(request, stream_id): form.save() supervisor = form.cleaned_data.get('supervisor') assign_perm('can_work_for_stream', supervisor.user, stream) + assign_perm('can_perform_supervisory_actions', supervisor.user, stream) messages.success(request, 'Supervisor {supervisor} has been assigned.'.format( supervisor=supervisor)) notify_new_stream_assignment(request.user, stream, supervisor.user) - assign_perm('can_perform_supervisory_actions', supervisor.user, stream) else: for key, error in form.errors.items(): messages.warning(request, error[0]) diff --git a/scipost/static/scipost/assets/css/_pool.scss b/scipost/static/scipost/assets/css/_pool.scss index 5a59e0df5e3c27754ad7f0804bdc167be7f4c14e..dea95e0ced53eeac71f9e825a6ba1c438a7d48eb 100644 --- a/scipost/static/scipost/assets/css/_pool.scss +++ b/scipost/static/scipost/assets/css/_pool.scss @@ -23,6 +23,10 @@ $pool-flex-width: calc(100% - 40px); .card.submission-detail { position: sticky; + position: -webkit-sticky; + position: -moz-sticky; + position: -ms-sticky; + position: -o-sticky; top: 15px; } diff --git a/scipost/templates/scipost/about.html b/scipost/templates/scipost/about.html index 9619d274fc35b73665b963e0ac5ed605b84fed55..6b849a4e6e2cf52de535e231a531c0fb0722ca94 100644 --- a/scipost/templates/scipost/about.html +++ b/scipost/templates/scipost/about.html @@ -66,7 +66,7 @@ <hr> <div class="row"> <div class="col-12"> - <h2 class="highlight">The SciPost Team</h2> + <h2 class="highlight" id="team">The SciPost Team</h2> </div> </div> <div class="row justify-content-center"> @@ -81,12 +81,31 @@ <div class="col-md-7 col-lg-6"> <h3>Code Development and Server Maintenance</h3> <ul> - <li>Lead programmer: J.-S. Caux</li> - <li>Dev team: J. de Wit, G. Kapteijns, M. Moeys and B. Ponsioen</li> + <li>J.-S. Caux</li> + <li>J. de Wit</li> </ul> + <p><em>with special thanks to M. Moeys, B. Ponsioen and G. Kapteijns</em></p> </div> </div> +<div class="row justify-content-center"> + <div class="col-md-4 col-lg-3"> + <h3>Editorial Admin</h3> + <ul> + <li>M. Vonk</li> + </ul> + </div> + <div class="col-md-7 col-lg-6"> + <h3>Production</h3> + <ul> + <li>T. Zwart</li> + <li>P. Verhagen</li> + <li>S. Sánchez López</li> + <li>T. Ritmeester</li> + </ul> + </div> +</div> + <hr> <div class="row"> <div class="col"> diff --git a/submissions/forms.py b/submissions/forms.py index 1fd5527db82fa9c742d3dc13888280e6852e2e85..ef88d0341896ece923b8c7d75697eaea8b29d8a9 100644 --- a/submissions/forms.py +++ b/submissions/forms.py @@ -665,7 +665,7 @@ class SubmissionCycleChoiceForm(forms.ModelForm): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.fields['refereeing_cycle'].default = None - other_submission = self.instance.other_versions.first() + other_submission = self.instance.other_versions_pool.first() if other_submission: self.fields['referees_reinvite'].queryset = other_submission.referee_invitations.all() diff --git a/submissions/models.py b/submissions/models.py index 401e6caef049192a906ea7e12a4d7cf2d41c4fa7..e5fb47eb4424289c7bd3dd6f6d1f1d629694db8a 100644 --- a/submissions/models.py +++ b/submissions/models.py @@ -176,6 +176,12 @@ class Submission(models.Model): @cached_property def other_versions(self): + return Submission.objects.public().filter( + arxiv_identifier_wo_vn_nr=self.arxiv_identifier_wo_vn_nr + ).exclude(pk=self.id).order_by('-arxiv_vn_nr') + + @cached_property + def other_versions_pool(self): return Submission.objects.filter( arxiv_identifier_wo_vn_nr=self.arxiv_identifier_wo_vn_nr ).exclude(pk=self.id).order_by('-arxiv_vn_nr') diff --git a/submissions/signals.py b/submissions/signals.py index 664ff585d5255a68d32b3ef6c949d79ab58edda3..d14134ba0d4753b025f251d8f2a8ca04cf406460 100644 --- a/submissions/signals.py +++ b/submissions/signals.py @@ -45,7 +45,7 @@ def notify_new_referee_invitation(sender, instance, created, **kwargs): """ Notify a Referee about a new refereeing invitation. """ - if created: + if created and instance.referee: notify.send(sender=sender, recipient=instance.referee.user, actor=instance.submission.editor_in_charge, verb=' would like to invite you to referee a Submission.', target=instance) diff --git a/submissions/templates/submissions/editorial_page.html b/submissions/templates/submissions/editorial_page.html index 1119bd13ff47ac7c57b18b65061083199f156c80..6d29d4075433e05a154953719b270919be79b224 100644 --- a/submissions/templates/submissions/editorial_page.html +++ b/submissions/templates/submissions/editorial_page.html @@ -20,7 +20,7 @@ <div class="ml-2 mt-2"> <h3>- Go to the <a href="{% url 'submissions:submission' arxiv_identifier_w_vn_nr=submission.arxiv_identifier_w_vn_nr %}">Submissions Page</a> to view Reports and Comments</h3> - {% if submission.other_versions or not submission.is_current %} + {% if submission.other_versions_pool or not submission.is_current %} <ul class="mt-3 mb-1 list-unstyled pl-4"> {% if not submission.is_current %} <li> @@ -28,10 +28,10 @@ </li> {% endif %} - {% if submission.other_versions %} + {% if submission.other_versions_pool %} <li>Other versions of this Submission exist:</li> <ul class="list-unstyled"> - {% for vn in submission.other_versions %} + {% for vn in submission.other_versions_pool %} <li>{% include 'submissions/_submission_version.html' with submission=vn editorial_page=1 %}</li> {% endfor %} </ul> diff --git a/submissions/templates/submissions/submission_detail.html b/submissions/templates/submissions/submission_detail.html index e471bbd5e786995fc619aa745daba7e181f754a1..e234d4292d5778f38c6416c809a389752e35c321 100644 --- a/submissions/templates/submissions/submission_detail.html +++ b/submissions/templates/submissions/submission_detail.html @@ -50,7 +50,7 @@ <h3 class="mt-0">- <span class="circle text-danger border-danger">!</span> You have an unfinished report for this submission, <a href="{% url 'submissions:submit_report' arxiv_identifier_w_vn_nr=submission.arxiv_identifier_w_vn_nr %}">finish your report here.</a></h3> {% endif %} - {% if submission.other_versions or not submission.is_current %} + {% if submission.other_versions and not submission.is_current %} <ul class="mt-3 mb-1 list-unstyled pl-4"> {% if not submission.is_current %} <li><h3 class="text-danger">This is not the current version.</h3></li> diff --git a/submissions/views.py b/submissions/views.py index 7007d5d231c2a9af3164314afbd0f38d241bee4b..dacf0260181b637a1c60e0869e17d23277465e28 100644 --- a/submissions/views.py +++ b/submissions/views.py @@ -1501,7 +1501,7 @@ def fix_College_decision(request, rec_id): elif recommendation.recommendation == -3: # Reject + update-reject other versions of submission submission.status = 'rejected' - for sub in submission.other_versions: + for sub in submission.other_versions_pool: sub.status = 'resubmitted_rejected' sub.save()