Replace schedule_overview.html with schedule_overview_elm.html.

This commit is contained in:
Vidir Valberg Gudmundsson 2017-07-16 14:23:35 +02:00
parent b49a0ad556
commit db14e7d80e
4 changed files with 14053 additions and 31 deletions

File diff suppressed because it is too large Load diff

View file

@ -1,22 +1,24 @@
{% extends 'schedule_base.html' %} {% extends 'program_base.html' %}
{% load commonmark %} {% load commonmark %}
{% load staticfiles %} {% load staticfiles %}
{% block schedule_content %} {% block program_content %}
<div id="schedule-container"></div> <div id="schedule-container"></div>
<script src="{% static "channels/js/websocketbridge.js" %}"></script> <script src="{% static "js/elm_based_schedule.js" %}"></script>
<script src="{% static "js/event_instance_websocket.js" %}"></script>
<script> <script>
init( var container = document.getElementById('schedule-container');
Elm.Main.embed(
container,
{ 'schedule_timeslot_length_minutes': Number('{{ schedule_timeslot_length_minutes }}') { 'schedule_timeslot_length_minutes': Number('{{ schedule_timeslot_length_minutes }}')
, 'schedule_midnight_offset_hours': Number('{{ schedule_midnight_offset_hours }}') , 'schedule_midnight_offset_hours': Number('{{ schedule_midnight_offset_hours }}')
, 'ics_button_href': "{% url 'ics_view' camp_slug=camp.slug %}" , 'ics_button_href': "{% url 'ics_view' camp_slug=camp.slug %}"
, 'camp_slug': "{{ camp.slug }}"
} }
); );
</script> </script>
{% endblock schedule_content %} {% endblock %}

View file

@ -1,24 +0,0 @@
{% extends 'program_base.html' %}
{% load commonmark %}
{% load staticfiles %}
{% block program_content %}
<div id="schedule-container"></div>
<script src="{% static "js/elm_based_schedule.js" %}"></script>
<script>
var container = document.getElementById('schedule-container');
Elm.Main.embed(
container,
{ 'schedule_timeslot_length_minutes': Number('{{ schedule_timeslot_length_minutes }}')
, 'schedule_midnight_offset_hours': Number('{{ schedule_midnight_offset_hours }}')
, 'ics_button_href': "{% url 'ics_view' camp_slug=camp.slug %}"
, 'camp_slug': "{{ camp.slug }}"
}
);
</script>
{% endblock %}

View file

@ -264,7 +264,7 @@ class EventDetailView(CampViewMixin, DetailView):
class ScheduleView(CampViewMixin, TemplateView): class ScheduleView(CampViewMixin, TemplateView):
template_name = 'schedule_overview_elm.html' template_name = 'schedule_overview.html'
def get_context_data(self, *args, **kwargs): def get_context_data(self, *args, **kwargs):
context = super(ScheduleView, self).get_context_data(**kwargs) context = super(ScheduleView, self).get_context_data(**kwargs)