Commit eddd5a66 authored by Andreas Valder's avatar Andreas Valder

fixing html syntax in the timetable

parent c61daa81
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<input class="form-control" type="text" name="campus.{{i.id}}.url" value="{{i.url}}" id="campus-{{i.id}}-url" placeholder="url"> <input class="form-control" type="text" name="campus.{{i.id}}.url" value="{{i.url}}" id="campus-{{i.id}}-url" placeholder="url">
</span> </span>
<span class="input-group col-xs-2"> <span class="input-group col-xs-2">
<input class="form-control" type="test" name="campus.{{i.id}}.type" value="{{i.type}}" id="campus-{{i.id}}-type" placeholder="type"> <input class="form-control" type="text" name="campus.{{i.id}}.type" value="{{i.type}}" id="campus-{{i.id}}-type" placeholder="type">
</span> </span>
<span class="input-group col-xs-1 pull-right"> <span class="input-group col-xs-1 pull-right">
<button class="btn btn-default pull-right" onclick="$('#campus-{{i.id}}-url').val('')"> <button class="btn btn-default pull-right" onclick="$('#campus-{{i.id}}-url').val('')">
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<input class="form-control" type="text" name="campus.new.url" placeholder="url"> <input class="form-control" type="text" name="campus.new.url" placeholder="url">
</span> </span>
<span class="input-group col-xs-2"> <span class="input-group col-xs-2">
<input class="form-control" type="test" name="campus.new.type" placeholder="type"> <input class="form-control" type="text" name="campus.new.type" placeholder="type">
</span> </span>
<span class="input-group col-xs-1 pull-right"> <span class="input-group col-xs-1 pull-right">
<button class="btn btn-default pull-right"> <button class="btn btn-default pull-right">
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
{% set time_index = loop.index %} {% set time_index = loop.index %}
<tr{% if t.strftime("%M") == "00" %} class="hourlytime"{% endif %}> <tr{% if t.strftime("%M") == "00" %} class="hourlytime"{% endif %}>
{# display time in first row if its a full hour #} {# display time in first row if its a full hour #}
{% if ((time_index - 1) is divisibleby 4) %} <td rowspan="4" style="vertical-align: top;">{{ t.strftime("%H:%M") }}</td> {% endif %} {% if ((time_index - 1) is divisibleby 4) %} <td{% if not loop.last %} rowspan="4"{% endif %} style="vertical-align: top;">{{ t.strftime("%H:%M") }}</td>{% endif %}
{# iterate over days if if it is a working day or we have lectures on that day (optionaly skip weekends) #} {# iterate over days if if it is a working day or we have lectures on that day (optionaly skip weekends) #}
{% for d in days if (d.index < 5) or (d.lectures|length) > 0 %} {% for d in days if (d.index < 5) or (d.lectures|length) > 0 %}
{% for col in range(1,d.maxcol+1) %} {% for col in range(1,d.maxcol+1) %}
......
...@@ -24,7 +24,6 @@ def timetable(user=None): ...@@ -24,7 +24,6 @@ def timetable(user=None):
if not datesweekmonday: if not datesweekmonday:
kw = 0 kw = 0
weekofyear = str(datetime.today().year) + "-W" + str(datetime.today().isocalendar()[1])
else: else:
datesweekmonday -= timedelta(days=datesweekmonday.weekday()) datesweekmonday -= timedelta(days=datesweekmonday.weekday())
kw = int((datesweekmonday.date() - thisweekmonday.date()).days/7) kw = int((datesweekmonday.date() - thisweekmonday.date()).days/7)
...@@ -36,7 +35,7 @@ def timetable(user=None): ...@@ -36,7 +35,7 @@ def timetable(user=None):
start = date.today() - timedelta(days=date.today().weekday() -7*kw) start = date.today() - timedelta(days=date.today().weekday() -7*kw)
except: except:
start = date.today() - timedelta(days=date.today().weekday()) start = date.today() - timedelta(days=date.today().weekday())
weekofyear = str(start.year) + "-W" + str(start.isocalendar()[1]) weekofyear = '{}-W{:02d}'.format(datetime.today().year, datetime.today().isocalendar()[1])
days = [{'date': start, 'lectures': [], 'atonce':0, 'index': 0 }] days = [{'date': start, 'lectures': [], 'atonce':0, 'index': 0 }]
earlieststart=time(23,59) earlieststart=time(23,59)
latestend=time(0,0) latestend=time(0,0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment