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
This commit is contained in:
parent
ea4742a7b6
commit
f75ec3622a
|
@ -116,7 +116,7 @@ class ResourceAssociationAdmin(admin.ModelAdmin):
|
|||
admin.site.register(ResourceAssociation, ResourceAssociationAdmin)
|
||||
|
||||
class FloorPlanAdmin(admin.ModelAdmin):
|
||||
list_display = ['id', 'meeting', 'name', 'order', 'image', ]
|
||||
list_display = ['id', 'meeting', 'name', 'short', 'order', 'image', ]
|
||||
raw_id_fields = ['meeting', ]
|
||||
admin.site.register(FloorPlan, FloorPlanAdmin)
|
||||
|
||||
|
|
|
@ -112,6 +112,7 @@ class FloorPlanFactory(factory.DjangoModelFactory):
|
|||
model = FloorPlan
|
||||
|
||||
name = factory.Sequence(lambda n: u'Venue Floor %d' % n)
|
||||
short = factory.Sequence(lambda n: u'%d' % n)
|
||||
meeting = factory.SubFactory(MeetingFactory)
|
||||
order = factory.Sequence(lambda n: n)
|
||||
image = factory.LazyAttribute(
|
||||
|
|
45
ietf/meeting/migrations/0052_floorplan_short.py
Normal file
45
ietf/meeting/migrations/0052_floorplan_short.py
Normal file
|
@ -0,0 +1,45 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.7 on 2017-06-12 02:45
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
def forwards(apps, schema_editor):
|
||||
floors = {
|
||||
# id, meeting, name, short
|
||||
1: ("Berlin Intercontinental Floor 1", "1"),
|
||||
2: ("Berlin Intercontinental Floor 2", "2"),
|
||||
3: ("Berlin Intercontinental Floor 14", "14"),
|
||||
4: ("Seoul Conrad Floor 3", "3"),
|
||||
5: ("Seoul Conrad Floor 5", "5"),
|
||||
6: ("Seoul Conrad Floor 6", "6"),
|
||||
7: ("Chicago Swissotel Ballroom Level", "BL"),
|
||||
8: ("Chicago Swissotel Concourse Level", "CC"),
|
||||
9: ("Chicago Swissotel Floor 2", "2"),
|
||||
10:("Chicago Swissotel Floor 3", "3"),
|
||||
}
|
||||
FloorPlan = apps.get_model('meeting', "FloorPlan")
|
||||
for f in FloorPlan.objects.all():
|
||||
name, short = floors[f.pk]
|
||||
assert f.name == name, ("Unexpected floorplan name. Expected '%s' for FlooPlan#%s, found '%s' in the database"%(name, f.id, f.name))
|
||||
f.short = short
|
||||
f.save()
|
||||
|
||||
def backwards(apps, schema_editor):
|
||||
pass
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('meeting', '0051_auto_20170511_0449'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='floorplan',
|
||||
name='short',
|
||||
field=models.CharField(default=b'', max_length=2),
|
||||
),
|
||||
migrations.RunPython(forwards, backwards),
|
||||
]
|
|
@ -383,6 +383,7 @@ def floorplan_path(instance, filename):
|
|||
|
||||
class FloorPlan(models.Model):
|
||||
name = models.CharField(max_length=255)
|
||||
short = models.CharField(max_length=2, default='')
|
||||
time = models.DateTimeField(default=datetime.datetime.now)
|
||||
meeting = models.ForeignKey(Meeting)
|
||||
order = models.SmallIntegerField()
|
||||
|
|
|
@ -98,6 +98,7 @@ class FloorPlanResource(ModelResource):
|
|||
filtering = {
|
||||
"id": ALL,
|
||||
"name": ALL,
|
||||
"short": ALL,
|
||||
"time": ALL,
|
||||
"order": ALL,
|
||||
"image": ALL,
|
||||
|
|
|
@ -120,10 +120,12 @@ div.anchor-target { z-index: 0; }
|
|||
.panel-title { font-size: 14px }
|
||||
|
||||
/* A new type of Bootstrap label and panel*/
|
||||
.label-blank { color: #555; background-color: #eee; }
|
||||
.label-blank { color: #555; background-color: #eee; font-size: 0.9em; line-height: 0.9; padding: 0.2em 0.6em; }
|
||||
.label.label-wide { margin-left: 1em; margin-right: 1em; }
|
||||
.panel-blank { color: #555; }
|
||||
.panel-blank > .panel-heading { background-color: #eee; }
|
||||
|
||||
|
||||
/* Required form field labels - 2217 = ∗ */
|
||||
label.required:after { content: "\2217"; color: #a94442; font-weight: bold; }
|
||||
|
||||
|
|
|
@ -200,6 +200,12 @@
|
|||
{% else %}
|
||||
<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>
|
||||
{% endif %}
|
||||
{% with item.timeslot.location.floorplan as floor %}
|
||||
{% if item.timeslot.location.floorplan %}
|
||||
<a href="{% url 'ietf.meeting.views.floor_plan' num=schedule.meeting.number %}#{{floor.name|xslugify}}"
|
||||
class="pull-right" title="{{floor.name}}"><span class="label label-blank label-wide">{{floor.short}}</span></a>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
|
@ -245,8 +251,14 @@
|
|||
</td>
|
||||
|
||||
{% else %}
|
||||
<td></td>
|
||||
|
||||
<td>
|
||||
{% with item.timeslot.location.floorplan as floor %}
|
||||
{% if item.timeslot.location.floorplan %}
|
||||
<a href="{% url 'ietf.meeting.views.floor_plan' num=schedule.meeting.number %}#{{floor.name|xslugify}}"
|
||||
class="pull-right" title="{{floor.name}}"><span class="label label-blank">{{floor.short}}</span></a>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
</td>
|
||||
<td>
|
||||
{% if item.timeslot.show_location and item.timeslot.get_location %}
|
||||
{% if schedule.meeting.number|add:"0" < 96 %}
|
||||
|
|
Loading…
Reference in a new issue