diff --git a/journals/forms.py b/journals/forms.py index 688ade7e6c2f450da0473aeadc48cabb756c1dff..3883c6af3ad372e3489770a8ea5b00f3cfe6e822 100644 --- a/journals/forms.py +++ b/journals/forms.py @@ -11,7 +11,7 @@ from submissions.models import Submission class InitiatePublicationForm(forms.Form): accepted_submission = forms.ModelChoiceField(queryset=Submission.objects.accepted()) to_be_issued_in = forms.ModelChoiceField( - queryset=Issue.objects.filter(until_date__gt=timezone.now())) + queryset=Issue.objects.filter(until_date__gte=timezone.now())) def __init__(self, *args, **kwargs): super(InitiatePublicationForm, self).__init__(*args, **kwargs) diff --git a/journals/templates/journals/journal_issue_detail.html b/journals/templates/journals/journal_issue_detail.html index c15afdb79d285325108d0deea87cec3ed6452ca5..6b646613d4d4de29b67a170ad2c1d32a6e20dbf2 100644 --- a/journals/templates/journals/journal_issue_detail.html +++ b/journals/templates/journals/journal_issue_detail.html @@ -27,6 +27,10 @@ {{block.super}} {% endwith %} + {% if issue.proceedings %} + {% include 'partials/proceedings/description.html' with proceedings=issue.proceedings %} + {% endif %} + <div class="row"> <div class="col-12"> <ul class="list-unstyled"> diff --git a/journals/templates/journals/publication_detail.html b/journals/templates/journals/publication_detail.html index a3f4acd26f431be4c3c53f37d2a446c3bb910aa9..53c447c82c78b08347973e2d255191381fd71afa 100644 --- a/journals/templates/journals/publication_detail.html +++ b/journals/templates/journals/publication_detail.html @@ -49,6 +49,14 @@ {% include 'journals/_publication_details.html' with publication=publication %} + {% if publication.in_issue.proceedings %} + <div class="card"> + <div class="card-body"> + {% include 'partials/proceedings/description.html' with proceedings=publication.in_issue.proceedings %} + </div> + </div> + {% endif %} + <hr> {% if publication.citedby|length >= 1 %} diff --git a/journals/views.py b/journals/views.py index 160cee4591d95f60e4eb99ae58df0604dab09bfa..792062e6b868e99ac9f1f681f05f768a39ded83f 100644 --- a/journals/views.py +++ b/journals/views.py @@ -245,7 +245,6 @@ def validate_publication(request): publication = validate_publication_form.save() # Fill in remaining data - #publication.pdf_file = request.FILES['pdf_file'] submission = publication.accepted_submission publication.authors.add(*submission.authors.all()) if publication.first_author: diff --git a/proceedings/forms.py b/proceedings/forms.py index 478c752c43378134c9f2a8f27bc661e69a5fda25..bd8be93f0fc8c85e6fe364db1c978d2ea4da9c4b 100644 --- a/proceedings/forms.py +++ b/proceedings/forms.py @@ -8,7 +8,6 @@ class ProceedingsForm(forms.ModelForm): model = Proceedings fields = ( 'issue', - 'issue_name', 'event_name', 'event_description', 'event_start_date', diff --git a/proceedings/migrations/0002_remove_proceedings_issue_name.py b/proceedings/migrations/0002_remove_proceedings_issue_name.py new file mode 100644 index 0000000000000000000000000000000000000000..0045b112d3a41eec21b759ac43ec1ae0f049070f --- /dev/null +++ b/proceedings/migrations/0002_remove_proceedings_issue_name.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.4 on 2017-10-21 12:56 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('proceedings', '0001_initial'), + ] + + operations = [ + migrations.RemoveField( + model_name='proceedings', + name='issue_name', + ), + ] diff --git a/proceedings/models.py b/proceedings/models.py index 53a4fbefafef3f9ffc7ff40f986cde399ae469cf..83408cac946556362879ca29e7787118a50c2e6b 100644 --- a/proceedings/models.py +++ b/proceedings/models.py @@ -16,7 +16,6 @@ class Proceedings(TimeStampedModel): issue = models.OneToOneField('journals.Issue', related_name='proceedings', limit_choices_to={ 'in_volume__in_journal__name': 'SciPostPhysProc'}) - issue_name = models.CharField(max_length=256) # Event the Proceedings is for event_name = models.CharField(max_length=256, blank=True) @@ -42,7 +41,7 @@ class Proceedings(TimeStampedModel): default_related_name = 'proceedings' def __str__(self): - return self.issue_name + return self.event_name def get_absolute_url(self): return reverse('proceedings:proceedings_details', args=(self.id,)) diff --git a/proceedings/templates/partials/proceedings/description.html b/proceedings/templates/partials/proceedings/description.html new file mode 100644 index 0000000000000000000000000000000000000000..038474ca7039369f707797110c2384a04a68e803 --- /dev/null +++ b/proceedings/templates/partials/proceedings/description.html @@ -0,0 +1,3 @@ +<h3>Event: {{ proceedings.event_name }}</h3> +<h4 class="pt-0 text-muted">From {{ proceedings.event_start_date }} until {{ proceedings.event_end_date }}</h4> +<p class="mt-1">{{ proceedings.event_description|linebreaksbr }}</p> diff --git a/proceedings/templates/partials/proceedings/summary.html b/proceedings/templates/partials/proceedings/summary.html index 7f3434a89fc45cc1d7aa9b64ca4a5227f6f04f85..b7b2e7e513de253e68314826a955d30752d14e04 100644 --- a/proceedings/templates/partials/proceedings/summary.html +++ b/proceedings/templates/partials/proceedings/summary.html @@ -1,8 +1,4 @@ <table class="proceedings summary"> - <tr> - <th>Issue name</th> - <td>{{ proceedings.issue_name }}</td> - </tr> <tr> <th>Event name</th> <td>{{ proceedings.event_name }}</td> diff --git a/proceedings/templates/proceedings/proceedings.html b/proceedings/templates/proceedings/proceedings.html index baef7543de41d82ea81f4191dc8360070268ca9a..cbfac16b9d5a503543dc4ccada6e305a90a54922 100644 --- a/proceedings/templates/proceedings/proceedings.html +++ b/proceedings/templates/proceedings/proceedings.html @@ -9,12 +9,11 @@ {% block content %} <h1>Manage Proceedings</h1> - <a href="{% url 'proceedings:proceedings' %}">Add new Proceedings</a> + <a href="{% url 'proceedings:proceedings_add' %}">Add new Proceedings</a> <table class="table mt-3"> <thead> <tr> - <th>Issue name</th> <th>Event name</th> <th>Submission Deadline</th> <th>Guest Fellowships</th> @@ -25,7 +24,6 @@ <tbody> {% for proc in proceedings %} <tr> - <td>{{ proc.issue_name }}</td> <td>{{ proc.event_name }}</td> <td>{{ proc.submissions_deadline }}</td> <td>{{ proc.fellowships.count }}</td> @@ -36,7 +34,7 @@ </tr> {% empty %} <tr> - <td class="text-danger py-2" colspan="4">There are no Proceedings!</td> + <td class="text-danger py-2" colspan="5">There are no Proceedings!</td> </tr> {% endfor %} </tbody> diff --git a/submissions/forms.py b/submissions/forms.py index 57002b09169df5adee2c7fb6f458eca9dbdf7278..e842a0f401dba25997d8173e5185f1d5f5020e36 100644 --- a/submissions/forms.py +++ b/submissions/forms.py @@ -2,12 +2,9 @@ import re from django import forms from django.conf import settings -from django.contrib.auth.models import Group from django.db import transaction from django.utils import timezone -from guardian.shortcuts import assign_perm - from .constants import ASSIGNMENT_BOOL, ASSIGNMENT_REFUSAL_REASONS, STATUS_RESUBMITTED,\ REPORT_ACTION_CHOICES, REPORT_REFUSAL_CHOICES, STATUS_REVISION_REQUESTED,\ STATUS_REJECTED, STATUS_REJECTED_VISIBLE, STATUS_RESUBMISSION_INCOMING,\ @@ -46,7 +43,8 @@ class SubmissionSearchForm(forms.Form): class SubmissionPoolFilterForm(forms.Form): status = forms.ChoiceField( - choices=((None, 'All in refereeing phase'),) + SUBMISSION_STATUS, required=False) + choices=((None, 'All submissions currently under evaluation'),) + SUBMISSION_STATUS, + required=False) editor_in_charge = forms.BooleanField( label='Show only Submissions for which I am editor in charge.', required=False) @@ -280,8 +278,7 @@ class RequestSubmissionForm(SubmissionChecks, forms.ModelForm): self.fields['submitted_to_journal'].choices = filter( filter_proceedings, self.fields['submitted_to_journal'].choices) - # self.fields['submitted_to_journal'].choices += ( - # (SCIPOST_JOURNAL_PHYSICS_PROC, 'SciPost Proceedings'),) + del self.fields['proceedings'] # Update placeholder for the other fields self.fields['arxiv_link'].widget.attrs.update({ @@ -474,7 +471,7 @@ class SetRefereeingDeadlineForm(forms.Form): class VotingEligibilityForm(forms.ModelForm): - eligible_Fellows = forms.ModelMultipleChoiceField( + eligible_fellows = forms.ModelMultipleChoiceField( queryset=Contributor.objects.none(), widget=forms.CheckboxSelectMultiple({'checked': 'checked'}), required=True, label='Eligible for voting') @@ -487,15 +484,15 @@ class VotingEligibilityForm(forms.ModelForm): super().__init__(*args, **kwargs) # Do we need this discipline filter still with the new Pool construction??? # -- JdW; Oct 20th, 2017 - self.fields['eligible_Fellows'].queryset = Contributor.objects.filter( + self.fields['eligible_fellows'].queryset = Contributor.objects.filter( fellowships__pool=self.instance.submission, discipline=self.instance.submission.discipline, - expertises__contains=self.instance.submission.subject_area + expertises__contains=[self.instance.submission.subject_area] ).order_by('user__last_name') def save(self, commit=True): recommendation = self.instance - recommendation.eligible_to_vote = self.cleaned_data['eligible_Fellows'] + recommendation.eligible_to_vote = self.cleaned_data['eligible_fellows'] submission = self.instance.submission submission.status = 'put_to_EC_voting' diff --git a/submissions/migrations/0079_auto_20171021_1456.py b/submissions/migrations/0079_auto_20171021_1456.py new file mode 100644 index 0000000000000000000000000000000000000000..a9f4d043d2750ff0b5afcbb95cedf99c14e98f73 --- /dev/null +++ b/submissions/migrations/0079_auto_20171021_1456.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.4 on 2017-10-21 12:56 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('submissions', '0078_auto_20171020_1054'), + ] + + operations = [ + migrations.AlterModelOptions( + name='report', + options={'ordering': ['-date_submitted']}, + ), + migrations.AlterModelOptions( + name='submission', + options={}, + ), + ] diff --git a/submissions/templates/submissions/new_submission.html b/submissions/templates/submissions/new_submission.html index d24b3357b9bb8a133664c791db758719e423a86b..0a12296251de12a1a80c8b11b4d396942437f47a 100644 --- a/submissions/templates/submissions/new_submission.html +++ b/submissions/templates/submissions/new_submission.html @@ -10,14 +10,14 @@ $(document).ready(function(){ $('select#id_submitted_to_journal').on('change', function (){ var selection = $(this).val(); - $("#id_proceeding, #id_submission_type").parents('.form-group').hide() + $("#id_proceedings, #id_submission_type").parents('.form-group').hide() switch(selection){ case "SciPostPhys": $("#id_submission_type").parents('.form-group').show() break; case "SciPostPhysProc": - $("#id_proceeding").parents('.form-group').show() + $("#id_proceedings").parents('.form-group').show() break; } }).trigger('change'); diff --git a/submissions/templates/submissions/prepare_for_voting.html b/submissions/templates/submissions/prepare_for_voting.html index 0b26ca06cda441e3dab3c9a70ed28bf06b4c9940..ce9a61aef742d4234b1f147f4e0e2f79e5d97c39 100644 --- a/submissions/templates/submissions/prepare_for_voting.html +++ b/submissions/templates/submissions/prepare_for_voting.html @@ -57,8 +57,8 @@ <div class="col-md-6"> <p>Fellows with expertise matching the Submission's subject area:</p> <ul> - {% for Fellow in Fellows_with_expertise %} - <li>{{ Fellow.user.last_name }}</li> + {% for fellow in fellows_with_expertise %} + <li>{{ fellow.contributor.user.last_name }}</li> {% endfor %} </ul> </div> diff --git a/submissions/views.py b/submissions/views.py index f0492ddd8ad9661cde2e1e6741615c27c051e8fe..8b3e2172fe670cfc0ee5960b70d430833dd8917c 100644 --- a/submissions/views.py +++ b/submissions/views.py @@ -1376,7 +1376,7 @@ def prepare_for_voting(request, rec_id): EICRecommendation.objects.filter(submission__in=submissions), id=rec_id) fellows_with_expertise = recommendation.submission.fellows.filter( - expertises__contains=recommendation.submission.subject_area) + contributor__expertises__contains=[recommendation.submission.subject_area]) coauthorships = {} @@ -1401,18 +1401,18 @@ def prepare_for_voting(request, rec_id): for author in recommendation.submission.metadata['entries'][0]['authors'][1:]: sub_auth_boolean_str += '+OR+' + author['name'].split()[-1] sub_auth_boolean_str += ')+AND+' - search_str = sub_auth_boolean_str + fellow.user.last_name + ')' + search_str = sub_auth_boolean_str + fellow.contributor.user.last_name + ')' queryurl = ('http://export.arxiv.org/api/query?search_query=au:%s' % search_str + '&sortBy=submittedDate&sortOrder=descending' '&max_results=5') arxivquery = feedparser.parse(queryurl) queryresults = arxivquery if queryresults.entries: - coauthorships[fellow.user.last_name] = queryresults + coauthorships[fellow.contributor.user.last_name] = queryresults context = { 'recommendation': recommendation, - 'Fellows_with_expertise': fellows_with_expertise, + 'fellows_with_expertise': fellows_with_expertise, 'coauthorships': coauthorships, 'eligibility_form': eligibility_form, }