diff --git a/proceedings/forms.py b/proceedings/forms.py index 179305ab8fa74fcd7658b19aa632a96a5b3e500f..d83f9c21c25598e6de584be368a9e02315bc0a4c 100644 --- a/proceedings/forms.py +++ b/proceedings/forms.py @@ -12,6 +12,7 @@ class ProceedingsForm(forms.ModelForm): model = Proceedings fields = ( 'issue', + 'minimum_referees', 'event_name', 'event_suffix', 'event_description', diff --git a/proceedings/migrations/0002_proceedings_minimum_referees.py b/proceedings/migrations/0002_proceedings_minimum_referees.py new file mode 100644 index 0000000000000000000000000000000000000000..bc8873d31f83865de3b4aa901ff067212b63d65a --- /dev/null +++ b/proceedings/migrations/0002_proceedings_minimum_referees.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.4 on 2018-09-19 07:11 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('proceedings', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='proceedings', + name='minimum_referees', + field=models.PositiveSmallIntegerField(blank=True, help_text='Require an explicit minimum number of referees for the default ref cycle.', null=True), + ), + ] diff --git a/proceedings/models.py b/proceedings/models.py index c2809ff46a4af2a3678de994ae03da01c89380c7..abff3df6b1c8749c04ae2845c884b7fcf10ee919 100644 --- a/proceedings/models.py +++ b/proceedings/models.py @@ -18,9 +18,12 @@ class Proceedings(TimeStampedModel): A Proceeding is a special kind of Journal Issue. """ # Link to the actual Journal platform - issue = models.OneToOneField('journals.Issue', related_name='proceedings', - limit_choices_to={ - 'in_volume__in_journal__name': 'SciPostPhysProc'}) + issue = models.OneToOneField( + 'journals.Issue', related_name='proceedings', + limit_choices_to={'in_volume__in_journal__name': 'SciPostPhysProc'}) + minimum_referees = models.PositiveSmallIntegerField( + help_text='Require an explicit minimum number of referees for the default ref cycle.', + blank=True, null=True) # Event the Proceedings is for event_name = models.CharField(max_length=256, blank=True) diff --git a/proceedings/templates/partials/proceedings/summary.html b/proceedings/templates/partials/proceedings/summary.html index 19ef5615cc6689e391ee66cd3aaf286b09d7d03a..56a2c6ea954c6b279b7958f330c9e4b421af08c6 100644 --- a/proceedings/templates/partials/proceedings/summary.html +++ b/proceedings/templates/partials/proceedings/summary.html @@ -1,6 +1,6 @@ -<table class="proceedings summary"> +<table class="proceedings summary table table-borderless"> <tr> - <th>Event name</th> + <th style="min-width: 200px;">Event name</th> <td>{{ proceedings.event_name }}</td> </tr> <tr> diff --git a/proceedings/templates/proceedings/proceedings_details.html b/proceedings/templates/proceedings/proceedings_details.html index b24d3bf14e6866f09d2a9c7b06c1d8bc5ad5627b..546baa99be4fcf2054615eff715a66d6b362523d 100644 --- a/proceedings/templates/proceedings/proceedings_details.html +++ b/proceedings/templates/proceedings/proceedings_details.html @@ -11,6 +11,7 @@ {% block content %} <h1>Proceedings details</h1> <h2 class="text-primary">{{ proceedings }}</h2> + <a href="{% url 'proceedings:proceedings_edit' proceedings.id %}" class="breadcrumb-item">Edit Proceedings</a> <br> {% include 'partials/proceedings/summary.html' with proceedings=proceedings %} diff --git a/proceedings/templates/proceedings/proceedings_edit.html b/proceedings/templates/proceedings/proceedings_edit.html index 6b837910a45764d72eb469526df95ceb5560f006..c4245ec1d20e2f4f834a222162f95d0283c73b36 100644 --- a/proceedings/templates/proceedings/proceedings_edit.html +++ b/proceedings/templates/proceedings/proceedings_edit.html @@ -5,7 +5,7 @@ {% block breadcrumb_items %} {{ block.super }} <a href="{% url 'proceedings:proceedings' %}" class="breadcrumb-item">Proceedings</a> - <span class="breadcrumb-item">Edit new</span> + <span class="breadcrumb-item">Edit {{ proceedings.event_name }}</span> {% endblock %} {% block pagetitle %}: Edit Proceedings{% endblock pagetitle %} diff --git a/submissions/utils.py b/submissions/utils.py index d50204b336cdf8463f60ab164ccdd8df3d4c2216..d0251fe227607b0a514752f5f867d67f62319c2d 100644 --- a/submissions/utils.py +++ b/submissions/utils.py @@ -153,6 +153,14 @@ class BaseRefereeSubmissionCycle(BaseSubmissionCycle): This *abstract* submission cycle adds the specific actions needed for submission cycles that require referees to be invited. """ + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + if self.submission.proceedings: + # Check if proceedings has overwritten the `minimum_referees` + if self.submission.proceedings.minimum_referees: + self.minimum_referees = self.submission.proceedings.minimum_referees + def update_status(self): if self.submission.status == STATUS_INCOMING and self.submission.is_resubmission: from .models import Submission