Skip to content

Commit 15de8ef

Browse files
committed
Remove the responsible AD at the top of the session info in the new
meeting editor as the information is now redundant - the AD appears as an AD constraint. - Legacy-Id: 18048
1 parent 44cbfca commit 15de8ef

3 files changed

Lines changed: 13 additions & 20 deletions

File tree

ietf/meeting/utils.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def reverse_editor_label(label):
319319
else:
320320
return reverse_sign + label
321321

322-
def preprocess_constraints_for_meeting_schedule_editor(meeting, sessions, responsible_ad_for_group):
322+
def preprocess_constraints_for_meeting_schedule_editor(meeting, sessions):
323323
# process constraint names - we synthesize extra names to be able
324324
# to treat the concepts in the same manner as the modelled ones
325325
constraint_names = {n.pk: n for n in ConstraintName.objects.all()}
@@ -356,9 +356,18 @@ def preprocess_constraints_for_meeting_schedule_editor(meeting, sessions, respon
356356
constraints = list(Constraint.objects.filter(meeting=meeting).prefetch_related('target', 'person', 'timeranges'))
357357

358358
# synthesize AD constraints - we can treat them as a special kind of 'bethere'
359+
responsible_ad_for_group = {}
360+
session_groups = set(s.group for s in sessions if s.group and s.group.parent and s.group.parent.type_id == 'area')
361+
meeting_time = datetime.datetime.combine(meeting.date, datetime.time(0, 0, 0))
362+
363+
# dig up historic AD names
364+
for group_id, history_time, pk in Person.objects.filter(rolehistory__name='ad', rolehistory__group__group__in=session_groups, rolehistory__group__time__lte=meeting_time).values_list('rolehistory__group__group', 'rolehistory__group__time', 'pk').order_by('rolehistory__group__time'):
365+
responsible_ad_for_group[group_id] = pk
366+
for group_id, pk in Person.objects.filter(role__name='ad', role__group__in=session_groups, role__group__time__lte=meeting_time).values_list('role__group', 'pk'):
367+
responsible_ad_for_group[group_id] = pk
368+
359369
ad_person_lookup = {p.pk: p for p in Person.objects.filter(pk__in=set(responsible_ad_for_group.values()))}
360-
groups_at_meeting = {s.group for s in sessions}
361-
for group in groups_at_meeting:
370+
for group in session_groups:
362371
ad = ad_person_lookup.get(responsible_ad_for_group.get(group.pk))
363372
if ad is not None:
364373
constraints.append(Constraint(meeting=meeting, source=group, person=ad, name=ad_constraint_name))

ietf/meeting/views.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -586,25 +586,11 @@ def cubehelix(i, total, hue=1.2, start_angle=0.5):
586586
p.scheduling_color = "rgb({}, {}, {})".format(*tuple(int(round(x * 255)) for x in rgb_color))
587587
p.light_scheduling_color = "rgb({}, {}, {})".format(*tuple(int(round((0.9 + 0.1 * x) * 255)) for x in rgb_color))
588588

589-
# dig out historic AD names
590-
ad_names = {}
591-
ad_pks = {}
592-
session_groups = set(s.group for s in sessions if s.group and s.group.parent and s.group.parent.type_id == 'area')
593-
meeting_time = datetime.datetime.combine(meeting.date, datetime.time(0, 0, 0))
594-
595-
for group_id, history_time, name, pk in Person.objects.filter(rolehistory__name='ad', rolehistory__group__group__in=session_groups, rolehistory__group__time__lte=meeting_time).values_list('rolehistory__group__group', 'rolehistory__group__time', 'name', 'pk').order_by('rolehistory__group__time'):
596-
ad_names[group_id] = plain_name(name)
597-
ad_pks[group_id] = pk
598-
599-
for group_id, name, pk in Person.objects.filter(role__name='ad', role__group__in=session_groups, role__group__time__lte=meeting_time).values_list('role__group', 'name', 'pk'):
600-
ad_names[group_id] = plain_name(name)
601-
ad_pks[group_id] = pk
602-
603589
# requesters
604590
requested_by_lookup = {p.pk: p for p in Person.objects.filter(pk__in=set(s.requested_by for s in sessions if s.requested_by))}
605591

606592
# constraints
607-
constraints_for_sessions, formatted_constraints_for_sessions, constraint_names = preprocess_constraints_for_meeting_schedule_editor(meeting, sessions, ad_pks)
593+
constraints_for_sessions, formatted_constraints_for_sessions, constraint_names = preprocess_constraints_for_meeting_schedule_editor(meeting, sessions)
608594

609595
sessions_for_group = defaultdict(list)
610596
for s in sessions:
@@ -625,7 +611,6 @@ def cubehelix(i, total, hue=1.2, start_angle=0.5):
625611
session_layout_margin = 0.2
626612
s.layout_width = timedelta_to_css_ems(s.requested_duration) - 2 * session_layout_margin
627613
s.parent_acronym = s.group.parent.acronym if s.group and s.group.parent else ""
628-
s.historic_group_ad_name = ad_names.get(s.group_id)
629614

630615
# compress the constraints, so similar constraint labels are
631616
# shared between the conflicting sessions they cover - the JS

ietf/templates/meeting/edit_meeting_schedule_session.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
{{ session.group.name }}
4545
{% if session.group.parent %}
4646
&middot; <span class="session-parent">{{ session.group.parent.acronym }}</span>
47-
{% if session.historic_group_ad_name %} ({{ session.historic_group_ad_name }}){% endif %}
4847
{% endif %}
4948
</div>
5049
{% endif %}

0 commit comments

Comments
 (0)