Commit 93f6c09e authored by Andreas Valder's avatar Andreas Valder
Browse files

added view counter per lecture

parent 046b572e
......@@ -83,4 +83,23 @@
{% endfor %}
</ul>
</div>
<script>
$.ajax({
method: "GET",
url: "{{url_for('stats_generic', req="lecture_views", param=course.id)}}",
dataType: "json",
success: function (traces) {
var dates={};
var t = traces[0]
for (var i=0; i<t.x.length; i++) {
dates[t.x[i]] = t.y[i];
}
var counter = $(".viewcounter");
for (var i=0; i<counter.length; i++) {
$(counter[i]).text(dates[$(counter[i]).data("lecturedate")]);
}
}
});
</script>
{% endblock %}
......@@ -226,16 +226,25 @@ $('#embedcodebtn').popover(
<li>Hörsaal: {{ moderator_editor(['lectures',lecture.id,'place'], lecture.place) }} </li>
{% endif %}
</ul>
<ul class="list-inline col-sm-4 col-xs-12">
<li class="dropdown">
{{ video_download_btn(videos) }}
</li>
<li class="pull-right">
{{ moderator_permissioneditor('lecture', lecture.id, lecture.perm, global_permissions) }}
<ul class="col-sm-4 col-xs-12 list-unstyled">
<li>
<ul class="list-inline">
<li class="dropdown">
{{ video_download_btn(videos) }}
</li>
<li class="pull-right">
{{ moderator_permissioneditor('lecture', lecture.id, lecture.perm, global_permissions) }}
</li>
<li class="pull-right">
{{ moderator_delete(['lectures',lecture.id,'deleted']) }}
</li>
</ul>
</li>
{% if ismod() %}
<li class="pull-right">
{{ moderator_delete(['lectures',lecture.id,'deleted']) }}
<p>Zuschauer: <span data-lectureid="{{ lecture.id }}" data-lecturedate="{{ lecture.time }}" class="viewcounter">loading...</span></p>
</li>
{% endif %}
</ul>
{% else %}
<div class="col-sm-2 col-xs-12">
......
Supports Markdown
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