Adding icons

This commit is contained in:
Víðir Valberg Guðmundsson 2017-04-29 12:23:01 +02:00
parent 9513a903a3
commit c32cde780a
4 changed files with 19 additions and 9 deletions

View file

@ -472,6 +472,7 @@ class EventInstance(CampRelatedModel):
'fg-color': '#fff' if self.event.event_type.light_text else '#000', 'fg-color': '#fff' if self.event.event_type.light_text else '#000',
'event_type': self.event.event_type.slug, 'event_type': self.event.event_type.slug,
'location': self.location.slug, 'location': self.location.slug,
'location_icon': self.location.icon,
'timeslots': self.timeslots, 'timeslots': self.timeslots,
} }

View file

@ -273,8 +273,15 @@ function render_event_instance(event_instance) {
title_element = document.createElement('p'); title_element = document.createElement('p');
title_element.innerHTML = event_instance['title']; 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(time_element);
element.appendChild(icon_element);
element.appendChild(title_element); element.appendChild(title_element);
element.onclick = openModal element.onclick = openModal
return element return element
@ -475,4 +482,3 @@ function toggleFilterBoxes(types, locations) {
return box; return box;
}); });
} }

View file

@ -54,10 +54,13 @@
<div class="btn-group"> <div class="btn-group">
<label for="location-{{ location.slug }}" class="btn btn-default" style="min-width: 200px; text-align: left;"> <label for="location-{{ location.slug }}" class="btn btn-default" style="min-width: 200px; text-align: left;">
<span class="pull-left">
<i class="fa fa-minus"></i> <i class="fa fa-minus"></i>
<i class="fa fa-plus"></i> <i class="fa fa-plus"></i>
&nbsp;&nbsp; &nbsp;&nbsp;
{{ location.name }} {{ location.name }}
</span>
<i class="pull-right fa fa-{{ location.icon }}"></i>
</label> </label>
</div> </div>

View file

@ -366,25 +366,25 @@ class Command(BaseCommand):
speakers_tent = EventLocation.objects.create( speakers_tent = EventLocation.objects.create(
name='Speakers Tent', name='Speakers Tent',
slug='speakers-tent', slug='speakers-tent',
icon='f075', icon='comment',
camp=camp camp=camp
) )
workshop_room = EventLocation.objects.create( workshop_room = EventLocation.objects.create(
name='Workshop rooms', name='Workshop rooms',
slug='workshop-rooms', slug='workshop-rooms',
icon='f0b1', icon='briefcase',
camp=camp camp=camp
) )
bar_area = EventLocation.objects.create( bar_area = EventLocation.objects.create(
name='Bar Area', name='Bar Area',
slug='bar-area', slug='bar-area',
icon='f000', icon='glass',
camp=camp camp=camp
) )
food_area = EventLocation.objects.create( food_area = EventLocation.objects.create(
name='Food Area', name='Food Area',
slug='food-area', slug='food-area',
icon='f0f5', icon='cutlery',
camp=camp camp=camp
) )