diff --git a/SciPost_v1/settings/base.py b/SciPost_v1/settings/base.py index 039ab666f28ab92e6511fb56e184874182b2806d..0f3ea5de4bd041519094eb14dc7baf163ca6a74f 100644 --- a/SciPost_v1/settings/base.py +++ b/SciPost_v1/settings/base.py @@ -86,7 +86,7 @@ INSTALLED_APPS = ( 'sphinxdoc', 'commentaries', 'comments', - 'finance', + 'finances', 'journals', 'mails', 'mailing_lists', diff --git a/SciPost_v1/urls.py b/SciPost_v1/urls.py index 51db0f8ca9c7f23c99b67853d116c853340354b9..ab3ea6f377dc701332e17b0f0a9f4152416c6126 100644 --- a/SciPost_v1/urls.py +++ b/SciPost_v1/urls.py @@ -33,7 +33,7 @@ urlpatterns = [ url(r'^commentary/', include('commentaries.urls', namespace="_commentaries")), url(r'^comments/', include('comments.urls', namespace="comments")), url(r'^funders/', include('funders.urls', namespace="funders")), - url(r'^finance/', include('finance.urls', namespace="finance")), + url(r'^finances/', include('finances.urls', namespace="finances")), url(r'^journals/', include('journals.urls.general', namespace="journals")), url(r'^mailing_list/', include('mailing_lists.urls', namespace="mailing_lists")), url(r'^submissions/', include('submissions.urls', namespace="submissions")), diff --git a/finance/apps.py b/finance/apps.py deleted file mode 100644 index 06859cb9726ebbb2563e70983781af4f2672ec6a..0000000000000000000000000000000000000000 --- a/finance/apps.py +++ /dev/null @@ -1,5 +0,0 @@ -from django.apps import AppConfig - - -class FinanceConfig(AppConfig): - name = 'finance' diff --git a/finance/__init__.py b/finances/__init__.py similarity index 100% rename from finance/__init__.py rename to finances/__init__.py diff --git a/finance/admin.py b/finances/admin.py similarity index 100% rename from finance/admin.py rename to finances/admin.py diff --git a/finances/apps.py b/finances/apps.py new file mode 100644 index 0000000000000000000000000000000000000000..4a1db0117b5f1f8dca3c5ba77a8b9c55a9201f34 --- /dev/null +++ b/finances/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class FinancesConfig(AppConfig): + name = 'finances' diff --git a/finance/migrations/__init__.py b/finances/migrations/__init__.py similarity index 100% rename from finance/migrations/__init__.py rename to finances/migrations/__init__.py diff --git a/finance/models.py b/finances/models.py similarity index 100% rename from finance/models.py rename to finances/models.py diff --git a/finance/templates/finance/timesheets.html b/finances/templates/finances/timesheets.html similarity index 96% rename from finance/templates/finance/timesheets.html rename to finances/templates/finances/timesheets.html index 29ce3fa27a1acfd10e29e124f5d23712785c289e..63d43519a766bf7535bedf40f08346554eb7c837 100644 --- a/finance/templates/finance/timesheets.html +++ b/finances/templates/finances/timesheets.html @@ -14,7 +14,7 @@ <div class="col-12"> <h1 class="highlight">Team Timesheets</h1> - <form method="get" action="{% url 'finance:timesheets' %}"> + <form method="get" action="{% url 'finances:timesheets' %}"> {{ form|bootstrap }} <input type="submit" class="btn btn-primary" value="Filter"> </form> diff --git a/finance/tests.py b/finances/tests.py similarity index 100% rename from finance/tests.py rename to finances/tests.py diff --git a/finance/urls.py b/finances/urls.py similarity index 100% rename from finance/urls.py rename to finances/urls.py diff --git a/finance/views.py b/finances/views.py similarity index 88% rename from finance/views.py rename to finances/views.py index 1f46a444d76e1a96f2bba7fe2600243ac2b97a87..b967443f18581bfd581f6710541e6f73e46fbf4f 100644 --- a/finance/views.py +++ b/finances/views.py @@ -17,4 +17,4 @@ def timesheets(request): # if form.is_valid(): context['totals'] = form.get_totals() - return render(request, 'finance/timesheets.html', context) + return render(request, 'finances/timesheets.html', context) 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 00de781beffebe4af20c88d3195249f9a977dabe..747832fc6a6b177c1ac443b97b92578006fb05ae 100644 --- a/production/admin.py +++ b/production/admin.py @@ -37,4 +37,5 @@ class ProductionProofsAdmin(admin.ModelAdmin): admin.site.register(Proof, ProductionProofsAdmin) admin.site.register(ProductionUser) +admin.site.register(ProductionEvent) admin.site.register(ProductionStream, ProductionStreamAdmin) diff --git a/production/forms.py b/production/forms.py index eec0356a52d23ec47b72bb8992548862bc1edb6e..0ec7169e7c27e77e3fc40f76d5fc106d4eb34a7a 100644 --- a/production/forms.py +++ b/production/forms.py @@ -1,6 +1,7 @@ import datetime from django import forms +from django.contrib.auth import get_user_model from django.utils.dates import MONTHS from django.db.models import Sum @@ -126,6 +127,11 @@ class UserToOfficerForm(forms.ModelForm): 'user', ) + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.fields['user'].queryset = self.fields['user'].queryset.filter( + production_user__isnull=True).order_by('last_name') + class ProductionUserMonthlyActiveFilter(forms.Form): month = forms.ChoiceField(choices=[(k, v) for k, v in MONTHS.items()]) 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 d171c8b6e08bafd630b193866200228b78670494..88ef14836b867fee1a4d97692198423ec00de3da 100644 --- a/production/templates/production/partials/production_stream_card.html +++ b/production/templates/production/partials/production_stream_card.html @@ -8,7 +8,7 @@ <h3>Events</h3> {% include 'production/partials/production_events.html' with events=stream.events.all %} - {% if prodevent_form and "can_work_for_stream" in sub_perms %} + {% if "can_work_for_stream" in sub_perms and prodevent_form %} <h3>Add message and/or hours to the Stream</h3> <form action="{% url 'production:add_event' stream_id=stream.id %}" method="post" class="mb-2"> {% csrf_token %} @@ -17,9 +17,7 @@ </form> {% endif %} - - {% if "can_work_for_stream" in sub_perms %} - {% if perms.scipost.can_publish_accepted_submission or perms.scipost.can_assign_production_supervisor or perms.scipost.can_assign_production_officer or perms.scipost.can_upload_proofs %} + {% if "can_perform_supervisory_actions" in sub_perms %} <h3>Actions</h3> <ul> {% if perms.scipost.can_assign_production_supervisor and assign_supervisor_form %} diff --git a/production/templates/production/production.html b/production/templates/production/production.html index 01c76f6ea21e4e5792449aec9d3419035892a57b..e7d636b8073362968c604d6dd3730f12f380fc3d 100644 --- a/production/templates/production/production.html +++ b/production/templates/production/production.html @@ -30,7 +30,7 @@ </li> {% if perms.scipost.can_promote_user_to_production_officer %} <li class="nav-item btn btn-secondary"> - <a href="#officers" class="nav-link" data-toggle="tab">Production Officers</a> + <a href="#officers" class="nav-link" data-toggle="tab">Production Team</a> </li> {% endif %} </ul> @@ -134,7 +134,7 @@ <div class="col-12"> <h2 class="highlight">My Timesheet</h2> {% if perms.scipost.can_view_timesheets %} - <a href="{% url 'finance:timesheets' %}">See team timesheets</a> + <a href="{% url 'finances:timesheets' %}">See team timesheets</a> {% endif %} </div> </div> @@ -168,8 +168,8 @@ {% if perms.scipost.can_promote_user_to_production_officer %} <div class="tab-pane" id="officers" role="tabpanel"> - <h2 class="highlight">Production Officers</h2> - <h3>Current Production Officers</h3> + <h2 class="highlight">Production Tream</h2> + <h3>Current Production Team</h3> <ul> {% for officer in production_officers %} <li>{{ officer }}</li> diff --git a/scipost/static/scipost/assets/css/_pool.scss b/scipost/static/scipost/assets/css/_pool.scss index e6844d82062a5c19b3b07fa1af5482dc3d427f6a..1b2ac64b648a293df03462ee9e84fbfc45e227bb 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/scipost/templates/scipost/personal_page.html b/scipost/templates/scipost/personal_page.html index 452aa0f624a504832fb1df5e6a438fa5f05f400e..ccdef253c64c9c545f4c960d931331a336ad1e7f 100644 --- a/scipost/templates/scipost/personal_page.html +++ b/scipost/templates/scipost/personal_page.html @@ -264,7 +264,7 @@ {% if perms.scipost.can_view_timesheets %} <h3>Finance</h3> <ul> - <li><a href="{% url 'finance:timesheets' %}">Production Team Timesheets</a></li> + <li><a href="{% url 'finances:timesheets' %}">Production Team Timesheets</a></li> </ul> {% endif %} </div> 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/partials/submissions/pool/submission_details.html b/submissions/templates/partials/submissions/pool/submission_details.html index 7d8014f7785485d4fa6f3c248cba41d7e122d13a..4b45732367b38ee70410bf1231deabbc75c5fc9e 100644 --- a/submissions/templates/partials/submissions/pool/submission_details.html +++ b/submissions/templates/partials/submissions/pool/submission_details.html @@ -7,18 +7,20 @@ {% include 'submissions/_submission_card_fellow_content.html' with submission=submission %} <div class="card-body"> - {% if submission.remarks.all %} - <h4>Remarks on this submission:</h4> - <ul> - {% for rem in submission.remarks.all %} - {% include 'scipost/_remark_li.html' with remark=rem %} - {% endfor %} - </ul> - {% endif %} - + <h3>Remarks on this submission:</h3> {% if remark_form %} {% include 'submissions/_remark_add_form.html' with submission=submission form=remark_form auto_show=1 %} {% endif %} + <p class="mb-1">Current remarks:</p> + <ul> + {% for rem in submission.remarks.all %} + {% include 'scipost/_remark_li.html' with remark=rem %} + {% empty %} + <li>No Remarks found.</li> + {% endfor %} + </ul> + + {% get_obj_perms request.user for submission as "sub_perms" %} {% if "can_take_editorial_actions" in sub_perms or is_ECAdmin %} 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/pool/pool.html b/submissions/templates/submissions/pool/pool.html index 19c631f12703eca9fef69d3178c20d06b74c0d6f..f304a5068691ef1752024a24e507eb474d131f58 100644 --- a/submissions/templates/submissions/pool/pool.html +++ b/submissions/templates/submissions/pool/pool.html @@ -57,7 +57,6 @@ <h3>Filter by status</h3> <form method="get" class="auto-submit mb-3"> {{ search_form|bootstrap:'12,12' }} - <input type="submit" class="btn btn-secondary btn-sm" value="Filter"> </form> {% endif %} diff --git a/submissions/templates/submissions/submission_detail.html b/submissions/templates/submissions/submission_detail.html index 95d99674d508869036de848e75412f16996b0fcd..9e8c837bc96a0ebf9693afbbe1a8d4594fff2665 100644 --- a/submissions/templates/submissions/submission_detail.html +++ b/submissions/templates/submissions/submission_detail.html @@ -51,7 +51,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 60443b71abd0f8937e2c09daa609124dd896aacd..a5c852c5544512e2d70ce4acaffb71930ab4797b 100644 --- a/submissions/views.py +++ b/submissions/views.py @@ -1507,7 +1507,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()