Added a warning to the draft submission page about upcoming submission cut-offs. Added a value in settings.py for the number of days before the first cut-off to display the waring.

- Legacy-Id: 7233
This commit is contained in:
Henrik Levkowetz 2014-02-11 19:28:59 +00:00
parent 07e93b599b
commit e593d9d640
2 changed files with 7 additions and 1 deletions

View file

@ -335,6 +335,8 @@ IDSUBMIT_ANNOUNCE_LIST_EMAIL = 'i-d-announce@ietf.org'
FIRST_CUTOFF_DAYS = 19 # Days from meeting to cut off dates on submit
SECOND_CUTOFF_DAYS = 12
CUTOFF_HOUR = 00 # midnight UTC
CUTOFF_WARNING_DAYS = 21 # Number of days before cutoff to start showing the cutoff date
SUBMISSION_START_DAYS = -90
SUBMISSION_CUTOFF_DAYS = 33
SUBMISSION_CORRECTION_DAYS = 52

View file

@ -42,12 +42,16 @@ class UploadForm(forms.Form):
self.parsed_draft = None
def set_cutoff_warnings(self):
from datetime import timedelta
now = datetime.datetime.utcnow()
first_cut_off = Meeting.get_first_cut_off()
second_cut_off = Meeting.get_second_cut_off()
ietf_monday = Meeting.get_ietf_monday()
if now.date() >= first_cut_off and now.date() < second_cut_off: # We are in the first_cut_off
if now.date() >= (first_cut_off-timedelta(days=settings.CUTOFF_WARNING_DAYS)) and now.date() < first_cut_off:
self.cutoff_warning = ( 'The pre-meeting cut-off date for new documents (i.e., version -00 Internet-Drafts) is %s at %02sh UTC.<br/>' % (first_cut_off, settings.CUTOFF_HOUR) +
'The pre-meeting cut-off date for revisions to existing documents is %s at %02sh UTC.<br/>' % (second_cut_off, settings.CUTOFF_HOUR) )
elif now.date() >= first_cut_off and now.date() < second_cut_off: # We are in the first_cut_off
if now.date() == first_cut_off and now.hour < settings.CUTOFF_HOUR:
self.cutoff_warning = 'The pre-meeting cut-off date for new documents (i.e., version -00 Internet-Drafts) is %s, at %02sh UTC. After that, you will not be able to submit a new document until %s, at %sh UTC' % (first_cut_off, settings.CUTOFF_HOUR, ietf_monday, settings.CUTOFF_HOUR, )
else: # No 00 version allowed