From c32cde780ac21231d4b557be5199c1a6cf065417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=AD=C3=B0ir=20Valberg=20Gu=C3=B0mundsson?= Date: Sat, 29 Apr 2017 12:23:01 +0200 Subject: [PATCH] Adding icons --- src/program/models.py | 1 + src/program/static/js/event_instance_websocket.js | 8 +++++++- src/program/templates/schedule_base.html | 11 +++++++---- src/utils/management/commands/bootstrap-devsite.py | 8 ++++---- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/program/models.py b/src/program/models.py index f76588a8..ea4a4729 100644 --- a/src/program/models.py +++ b/src/program/models.py @@ -472,6 +472,7 @@ class EventInstance(CampRelatedModel): 'fg-color': '#fff' if self.event.event_type.light_text else '#000', 'event_type': self.event.event_type.slug, 'location': self.location.slug, + 'location_icon': self.location.icon, 'timeslots': self.timeslots, } diff --git a/src/program/static/js/event_instance_websocket.js b/src/program/static/js/event_instance_websocket.js index 0d18b218..76c05a6a 100644 --- a/src/program/static/js/event_instance_websocket.js +++ b/src/program/static/js/event_instance_websocket.js @@ -273,8 +273,15 @@ function render_event_instance(event_instance) { title_element = document.createElement('p'); title_element.innerHTML = event_instance['title']; + icon_element = document.createElement('i'); + icon_element.classList.add('fa-' + event_instance['location_icon']); + icon_element.classList.add('fa'); + icon_element.classList.add('pull-right'); + element.appendChild(time_element); + element.appendChild(icon_element); element.appendChild(title_element); + element.onclick = openModal return element @@ -475,4 +482,3 @@ function toggleFilterBoxes(types, locations) { return box; }); } - diff --git a/src/program/templates/schedule_base.html b/src/program/templates/schedule_base.html index ef950e7b..eb95bf4c 100644 --- a/src/program/templates/schedule_base.html +++ b/src/program/templates/schedule_base.html @@ -54,10 +54,13 @@
diff --git a/src/utils/management/commands/bootstrap-devsite.py b/src/utils/management/commands/bootstrap-devsite.py index e65f4df8..90462d6a 100644 --- a/src/utils/management/commands/bootstrap-devsite.py +++ b/src/utils/management/commands/bootstrap-devsite.py @@ -366,25 +366,25 @@ class Command(BaseCommand): speakers_tent = EventLocation.objects.create( name='Speakers Tent', slug='speakers-tent', - icon='f075', + icon='comment', camp=camp ) workshop_room = EventLocation.objects.create( name='Workshop rooms', slug='workshop-rooms', - icon='f0b1', + icon='briefcase', camp=camp ) bar_area = EventLocation.objects.create( name='Bar Area', slug='bar-area', - icon='f000', + icon='glass', camp=camp ) food_area = EventLocation.objects.create( name='Food Area', slug='food-area', - icon='f0f5', + icon='cutlery', camp=camp )