diff --git a/journals/views.py b/journals/views.py index 8fe74e5972b623afe6dd833521441438b757bb2c..caeb73efdef08d019f1a8b88ac5387d077c4fbc4 100644 --- a/journals/views.py +++ b/journals/views.py @@ -281,7 +281,7 @@ class DraftPublicationUpdateView(PermissionsMixin, UpdateView): try: publication = Publication.objects.get( accepted_submission__preprint__identifier_w_vn_nr=self.kwargs.get( - 'preprint__identifier_w_vn_nr')) + 'identifier_w_vn_nr')) except Publication.DoesNotExist: if Submission.objects.accepted().filter(preprint__identifier_w_vn_nr=self.kwargs.get( 'identifier_w_vn_nr')).exists(): diff --git a/production/forms.py b/production/forms.py index 07b9b20af7e26bf8a05050e0ce61333f9f0006ca..350e1bc6276ab7b57c386823d0fbf508ca12ac80 100644 --- a/production/forms.py +++ b/production/forms.py @@ -5,6 +5,7 @@ __license__ = "AGPL v3" import datetime from django import forms +from django.contrib.auth import get_user_model from . import constants from .models import ProductionUser, ProductionStream, ProductionEvent, Proofs,\ @@ -126,7 +127,15 @@ class StreamStatusForm(forms.ModelForm): return stream +class UserModelChoiceField(forms.ModelChoiceField): + def label_from_instance(self, obj): + return '{}, {} ({})'.format(obj.last_name, obj.first_name, obj.email) + + class UserToOfficerForm(forms.ModelForm): + user = UserModelChoiceField(queryset=get_user_model().objects.filter( + production_user__isnull=True).order_by('last_name')) + class Meta: model = ProductionUser fields = ( diff --git a/production/templates/production/production.html b/production/templates/production/production.html index 57f40db1fa14160965e598088669d7216f752d6b..a5821b1321a5a893982faf731f00b9328dc2ad7e 100644 --- a/production/templates/production/production.html +++ b/production/templates/production/production.html @@ -25,7 +25,7 @@ <div class="tab-nav-inner"> <ul class="nav btn-group personal-page-nav" role="tablist"> <li class="nav-item btn btn-outline-secondary"> - <a href="#summary" class="nav-link active" data-toggle="tab">Summary</a> + <a href="#summary" class="nav-link active" data-toggle="tab">Production streams</a> </li> <li class="nav-item btn btn-outline-secondary"> <a href="#mytimesheet" class="nav-link" data-toggle="tab">My Timesheet</a> @@ -45,12 +45,12 @@ <div class="tab-pane active" id="summary" role="tabpanel"> <div class="row"> <div class="col-12"> - <h2 class="highlight">Streams summary</h2> + <h2 class="highlight">Production streams</h2> <table class="table table-fixed"> <thead> <tr> <th style="width: 30%;">Submission</th> - <th>Target Journal<br/>(Tier)</th> + <th>Target Journal<br/>(Tier)</th> <th>Status</th> <th class="py-1"> Latest activity @@ -75,7 +75,7 @@ </td> <td>{{ stream.submission.submitted_to }}{% for rec in stream.submission.eicrecommendations.all %}<br/>({{ rec|Tier }}){% endfor %}</td> <td> - <div class="label label-{% if stream.status == 'initiated' %}outline-danger{% else %}secondary{% endif %} label-sm">{{ stream.get_status_display }}</div> + <div class="label label-{% if stream.status == 'initiated' %}outline-danger{% else %}secondary{% endif %}">{{ stream.get_status_display }}</div> </td> <td> {{ stream.latest_activity|timesince }} ago diff --git a/scipost/management/commands/add_groups_and_permissions.py b/scipost/management/commands/add_groups_and_permissions.py index c8f3fdf54204861c1df382f308db7252c1432fb7..975560f7acf876c7a27c9fdf27e6183ef3354acc 100644 --- a/scipost/management/commands/add_groups_and_permissions.py +++ b/scipost/management/commands/add_groups_and_permissions.py @@ -345,11 +345,11 @@ class Command(BaseCommand): can_fix_College_decision, can_promote_user_to_production_officer, can_view_production, + can_view_all_production_streams, + can_promote_to_production_team, can_attend_VGMs, can_view_timesheets, can_manage_mailchimp, - can_view_all_production_streams, - can_promote_to_production_team, can_manage_affiliations, can_view_statistics, can_create_profiles, @@ -380,7 +380,6 @@ class Command(BaseCommand): can_prepare_recommendations_for_voting, can_manage_college_composition, can_fix_College_decision, - can_view_production, can_view_timesheets, can_publish_accepted_submission, can_draft_publication, @@ -390,6 +389,8 @@ class Command(BaseCommand): can_manage_reports, can_assign_production_supervisor, can_view_all_production_streams, + can_view_production, + can_promote_user_to_production_officer, can_take_decisions_related_to_proofs, can_upload_proofs, can_run_proofs_by_authors, diff --git a/submissions/forms.py b/submissions/forms.py index 416ce4ee7f13354bdde5dd346b85b065cfd4af1a..502d32f70adbe8a57da26a3538d3c44d32d36207 100644 --- a/submissions/forms.py +++ b/submissions/forms.py @@ -7,7 +7,7 @@ import re from django import forms from django.conf import settings -from django.contrib.postgres.search import TrigramSimilarity +# from django.contrib.postgres.search import TrigramSimilarity from django.db import transaction from django.db.models import Q from django.forms.formsets import ORDERING_FIELD_NAME @@ -914,9 +914,11 @@ class RefereeSearchForm(forms.Form): 'placeholder': 'Search for a referee in the SciPost Profiles database'})) def search(self): - return Profile.objects.annotate( - similarity=TrigramSimilarity('last_name', self.cleaned_data['last_name']), - ).filter(similarity__gt=0.3).order_by('-similarity') + return Profile.objects.filter( + last_name__icontains=self.cleaned_data['last_name']) + # return Profile.objects.annotate( + # similarity=TrigramSimilarity('last_name', self.cleaned_data['last_name']), + # ).filter(similarity__gt=0.3).order_by('-similarity') class ConsiderRefereeInvitationForm(forms.Form): diff --git a/submissions/migrations/0050_auto_20181219_0825.py b/submissions/migrations/0050_auto_20181219_0825.py new file mode 100644 index 0000000000000000000000000000000000000000..96aa0a24aab7ff47caa5cbab304ef021b33ea4a5 --- /dev/null +++ b/submissions/migrations/0050_auto_20181219_0825.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.4 on 2018-12-19 07:25 +from __future__ import unicode_literals + +from django.db import migrations +# from django.contrib.postgres.operations import TrigramExtension + + +class Migration(migrations.Migration): + + dependencies = [ + ('submissions', '0049_auto_20181204_2040'), + ] + + operations = [ + # TrigramExtension(), + ] diff --git a/templates/email/eic/inform_eic_comment_received.html b/templates/email/eic/inform_eic_comment_received.html index b4e2c780466369e3196e6478cdb40ee125bd6de4..59c2a17f1ce6af795873972dc86b12793a86bc62 100644 --- a/templates/email/eic/inform_eic_comment_received.html +++ b/templates/email/eic/inform_eic_comment_received.html @@ -9,7 +9,7 @@ by {{ comment.core_content_object.author_list }}. </p> <p> - Please vet this Comment on <a href="https://scipost.org{% url 'submissions:editorial_page' comment.core_content_object.preprint.identifier_w_vn_nr %}">the editorial page</a>. + This Comment now requires vetting, which you can perform from <a href="https://scipost.org{% url 'submissions:editorial_page' comment.core_content_object.preprint.identifier_w_vn_nr %}">the editorial page</a> (please be careful when doing this, avoiding for example to vet doubly-submitted comments, or comments with improper language etc; in case you have any doubt, please contact our <a href="mailto:edadmin@scipost.org">editorial administration</a>). </p> <p> Many thanks in advance for your collaboration,<br>