Skip to content

Commit f75ec36

Browse files
committed
A first go at adding floor labels to the agenda pages. The placement of the labels are complicated by available whitespace beeing in different horizontal positions for different types of lines. Adding another column will push the session title out of the screen on small devices.
- Legacy-Id: 13587
1 parent ea4742a commit f75ec36

7 files changed

Lines changed: 66 additions & 4 deletions

File tree

ietf/meeting/admin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def used(self, instance):
116116
admin.site.register(ResourceAssociation, ResourceAssociationAdmin)
117117

118118
class FloorPlanAdmin(admin.ModelAdmin):
119-
list_display = ['id', 'meeting', 'name', 'order', 'image', ]
119+
list_display = ['id', 'meeting', 'name', 'short', 'order', 'image', ]
120120
raw_id_fields = ['meeting', ]
121121
admin.site.register(FloorPlan, FloorPlanAdmin)
122122

ietf/meeting/factories.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ class Meta:
112112
model = FloorPlan
113113

114114
name = factory.Sequence(lambda n: u'Venue Floor %d' % n)
115+
short = factory.Sequence(lambda n: u'%d' % n)
115116
meeting = factory.SubFactory(MeetingFactory)
116117
order = factory.Sequence(lambda n: n)
117118
image = factory.LazyAttribute(
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.10.7 on 2017-06-12 02:45
3+
from __future__ import unicode_literals
4+
5+
from django.db import migrations, models
6+
7+
8+
def forwards(apps, schema_editor):
9+
floors = {
10+
# id, meeting, name, short
11+
1: ("Berlin Intercontinental Floor 1", "1"),
12+
2: ("Berlin Intercontinental Floor 2", "2"),
13+
3: ("Berlin Intercontinental Floor 14", "14"),
14+
4: ("Seoul Conrad Floor 3", "3"),
15+
5: ("Seoul Conrad Floor 5", "5"),
16+
6: ("Seoul Conrad Floor 6", "6"),
17+
7: ("Chicago Swissotel Ballroom Level", "BL"),
18+
8: ("Chicago Swissotel Concourse Level", "CC"),
19+
9: ("Chicago Swissotel Floor 2", "2"),
20+
10:("Chicago Swissotel Floor 3", "3"),
21+
}
22+
FloorPlan = apps.get_model('meeting', "FloorPlan")
23+
for f in FloorPlan.objects.all():
24+
name, short = floors[f.pk]
25+
assert f.name == name, ("Unexpected floorplan name. Expected '%s' for FlooPlan#%s, found '%s' in the database"%(name, f.id, f.name))
26+
f.short = short
27+
f.save()
28+
29+
def backwards(apps, schema_editor):
30+
pass
31+
32+
class Migration(migrations.Migration):
33+
34+
dependencies = [
35+
('meeting', '0051_auto_20170511_0449'),
36+
]
37+
38+
operations = [
39+
migrations.AddField(
40+
model_name='floorplan',
41+
name='short',
42+
field=models.CharField(default=b'', max_length=2),
43+
),
44+
migrations.RunPython(forwards, backwards),
45+
]

ietf/meeting/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ def floorplan_path(instance, filename):
383383

384384
class FloorPlan(models.Model):
385385
name = models.CharField(max_length=255)
386+
short = models.CharField(max_length=2, default='')
386387
time = models.DateTimeField(default=datetime.datetime.now)
387388
meeting = models.ForeignKey(Meeting)
388389
order = models.SmallIntegerField()

ietf/meeting/resources.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ class Meta:
9898
filtering = {
9999
"id": ALL,
100100
"name": ALL,
101+
"short": ALL,
101102
"time": ALL,
102103
"order": ALL,
103104
"image": ALL,

ietf/static/ietf/css/ietf.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,12 @@ div.anchor-target { z-index: 0; }
120120
.panel-title { font-size: 14px }
121121

122122
/* A new type of Bootstrap label and panel*/
123-
.label-blank { color: #555; background-color: #eee; }
123+
.label-blank { color: #555; background-color: #eee; font-size: 0.9em; line-height: 0.9; padding: 0.2em 0.6em; }
124+
.label.label-wide { margin-left: 1em; margin-right: 1em; }
124125
.panel-blank { color: #555; }
125126
.panel-blank > .panel-heading { background-color: #eee; }
126127

128+
127129
/* Required form field labels - 2217 = ∗ */
128130
label.required:after { content: "\2217"; color: #a94442; font-weight: bold; }
129131

ietf/templates/meeting/agenda.html

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,12 @@ <h2>
200200
{% else %}
201201
<a href="{% url 'ietf.meeting.views.floor_plan' num=schedule.meeting.number %}?room={{ item.timeslot.get_location|xslugify }}">{{item.timeslot.get_location|split:"/"|join:"/<wbr>"}}</a>
202202
{% endif %}
203+
{% with item.timeslot.location.floorplan as floor %}
204+
{% if item.timeslot.location.floorplan %}
205+
<a href="{% url 'ietf.meeting.views.floor_plan' num=schedule.meeting.number %}#{{floor.name|xslugify}}"
206+
class="pull-right" title="{{floor.name}}"><span class="label label-blank label-wide">{{floor.short}}</span></a>
207+
{% endif %}
208+
{% endwith %}
203209
{% endif %}
204210
</td>
205211
<td>
@@ -245,8 +251,14 @@ <h2>
245251
</td>
246252

247253
{% else %}
248-
<td></td>
249-
254+
<td>
255+
{% with item.timeslot.location.floorplan as floor %}
256+
{% if item.timeslot.location.floorplan %}
257+
<a href="{% url 'ietf.meeting.views.floor_plan' num=schedule.meeting.number %}#{{floor.name|xslugify}}"
258+
class="pull-right" title="{{floor.name}}"><span class="label label-blank">{{floor.short}}</span></a>
259+
{% endif %}
260+
{% endwith %}
261+
</td>
250262
<td>
251263
{% if item.timeslot.show_location and item.timeslot.get_location %}
252264
{% if schedule.meeting.number|add:"0" < 96 %}

0 commit comments

Comments
 (0)