Commit 02be1c95 authored by Julian Rother's avatar Julian Rother
Browse files

Fixed date formatting, closes #288

parent e1a3c418
......@@ -288,6 +288,10 @@ def human_semester(s, long=False):
def human_date(d):
return d.strftime('%d.%m.%Y')
@app.template_filter(name='fulldate')
def human_fulldate(d):
return d.strftime('%a, %d.%m.%Y, %H:%M Uhr')
@app.template_filter(name='time')
def human_time(d):
return d.strftime('%H:%M')
......
......@@ -13,7 +13,7 @@
<div class="col-xs-4">
<span><strong>{{ lecture.course.short }}</strong> {{livelabel(0, lecture.livehandle)}}{% if ismod() %} <i>({{lecture.course_id}})</i>{% endif %}</span><br>
<span>{% if ismod() %}ID: {{lecture.id}}{% endif %}</span><br>
<span>{{ lecture['time'] }}</span>
<span>{{ lecture['time']|fulldate }}</span>
{% if lecture['speaker'] %}
<div class="small">Gehalten von {{ lecture['speaker']|safe }} </div>
{% endif %}
......@@ -32,7 +32,7 @@
<strong>{{ lecture.course.title }}</strong>
{{livelabel(0, lecture.livehandle)}}
</li>
<li>{{ lecture['time'] }}</li>
<li>{{ lecture['time']|fulldate }}</li>
{% if lecture['speaker'] %}
<li>
<span class="small">Gehalten von {{ lecture['speaker']|safe }} </span>
......@@ -218,10 +218,12 @@ $('#embedcodebtn').popover(
<ul class="list-unstyled col-sm-3 col-xs-12">
<li>{{ moderator_editor(['lectures',lecture.id,'title'], lecture.title) }}{{livelabel((lecture.live and lecture.time > datetime.now()-timedelta(days=1)), videos|selectattr("livehandle")|list|length)}}</li>
{% if lecture.speaker or ismod() %}<li>Gehalten von {{ moderator_editor(['lectures',lecture.id,'speaker'], lecture.speaker) }}</li>{% endif %}
<li>{{ moderator_editor(['lectures',lecture.id,'time'], lecture.time) }} </li>
{% if ismod() %}
<li>{{ moderator_editor(['lectures',lecture.id,'time'], lecture.time) }} </li>
<li>Dauer: {{ moderator_editor(['lectures',lecture.id,'duration'], lecture.duration) }} min</li>
<li>ID: <a href="{{url_for('course',handle=lecture.course.handle)}}#lecture-{{lecture.id}}">{{lecture.id}}</a></li>
{% else %}
<li>{{ lecture.time|fulldate }}</li>
{% endif %}
</ul>
<ul class="list-unstyled col-sm-3 col-xs-12">
......@@ -261,7 +263,11 @@ $('#embedcodebtn').popover(
<li>{{ moderator_editor(['lectures',lecture.id,'title'], lecture.title) }}{{livelabel((lecture.live and lecture.time > datetime.now()-timedelta(days=1)), videos|selectattr("livehandle")|list|length)}}</li>
</ul>
<ul class="list-unstyled col-sm-3 col-xs-12">
{% if ismod() %}
<li>{{ moderator_editor(['lectures',lecture.id,'time'], lecture.time) }} </li>
{% else %}
<li>{{ lecture.time|fulldate }}</li>
{% endif %}
</ul>
<ul class="list-inline col-sm-4 col-xs-12">
<li>{{ moderator_editor(['lectures',lecture.id,'comment'], lecture.comment) }}</li>
......
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