In order to make it possible to enter meeting important dates and have the IESG see and approve them before they are generally visible, a flag has been added to the Meeting model, and code has been added to show the important dates as appropriate. A menu link to the important dates has also been added.

- Legacy-Id: 14315
This commit is contained in:
Henrik Levkowetz 2017-11-06 17:20:21 +00:00
parent 348738046a
commit 9369255764
4 changed files with 45 additions and 3 deletions

View file

@ -0,0 +1,34 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-11-06 08:26
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
def forwards(apps, schema_editor):
Meeting = apps.get_model('meeting', 'Meeting')
stop_date = datetime.date.today() + datetime.timedelta(days=180)
for m in Meeting.objects.filter(show_important_dates=False):
if m.date < today:
m.show_important_dates = True
m.save()
def backwards(apps, schema_editor):
pass
class Migration(migrations.Migration):
dependencies = [
('meeting', '0058_set_new_field_meeting_days_values'),
]
operations = [
migrations.AddField(
model_name='meeting',
name='show_important_dates',
field=models.BooleanField(default=False),
),
migrations.RunPython(forwards, backwards),
]

View file

@ -93,6 +93,7 @@ class Meeting(models.Model):
proceedings_final = models.BooleanField(default=False, help_text=u"Are the proceedings for this meeting complete?")
acknowledgements = models.TextField(blank=True, help_text="Acknowledgements for use in meeting proceedings. Use ReStructuredText markup.")
overview = models.ForeignKey(DBTemplate, related_name='overview', null=True, editable=False)
show_important_dates = models.BooleanField(default=False)
def __unicode__(self):
if self.type_id == "ietf":

View file

@ -2181,16 +2181,22 @@ def api_import_recordings(request, number):
def important_dates(request, num=None):
assert num is None or num.isdigit()
preview_roles = ['Area Director', 'Secretariat', 'IETF Chair', 'IAD', ]
meeting = get_ietf_meeting(num)
if not meeting:
raise Http404
base_num = int(meeting.number)
meetings=[meeting]
user = request.user
today = datetime.date.today()
meetings = []
if meeting.show_important_dates or meeting.date < today:
meetings.append(meeting)
for i in range(1,3):
future_meeting = get_ietf_meeting(base_num+i)
if future_meeting:
if future_meeting and ( future_meeting.show_important_dates
or (user and user.is_authenticated and has_role(user, preview_roles))):
meetings.append(future_meeting)
context={'meetings':meetings}

View file

@ -96,7 +96,8 @@
<li><a href="/meeting/agenda/">Agenda</a></li>
<li><a href="/meeting/materials/">Materials</a></li>
<li><a href="/meeting/floor-plan/">Floor Plan</a></li>
<li><a href="/meeting/floor-plan/">Floor plan</a></li>
<li><a href="{% url 'ietf.meeting.views.important_dates' %}">Important dates</a></li>
<li><a href="https://www.ietf.org/meeting/proceedings.html">Past proceedings</a></li>
<li><a href="/meeting/upcoming">Upcoming</a></li>
<li><a href="/meeting/past">Past</a></li>