Skip to content
Snippets Groups Projects
Commit a4c6e2d7 authored by Andreas Valder's avatar Andreas Valder
Browse files

reded download button and video deletion/editor. closes #90

parent 989a7eae
No related branches found
No related tags found
No related merge requests found
.videopreview > li:nth-child(even) { background: #f5f5f5; } .videopreview > li:nth-child(even) { background: #f5f5f5; }
.courses-list li:nth-child(even) { background: #fAfAfA; } .courses-list li:nth-child(even) { background: #fAfAfA; }
.playpreviewbtn {
text-decoration: none;
width: 100%;
left: 0px;
color: lightgrey;
position: absolute;
font-size: 3em;
text-align: center;
line-height: 130px;
}
.thumbnailimg {
height: 130px;
position: relative;
margin-bottom: 10px;
background-size: contain;
background-repeat: no-repeat;
background-position: 50% 50%;
}
@media (min-width: 767px) { @media (min-width: 767px) {
.list-group-item-condensed { padding-top: 2px !important; padding-bottom: 2px !important; } .list-group-item-condensed { padding-top: 2px !important; padding-bottom: 2px !important; }
} }
......
...@@ -83,21 +83,29 @@ $('#videoplayer').css("width"); ...@@ -83,21 +83,29 @@ $('#videoplayer').css("width");
{% endmacro %} {% endmacro %}
{% macro video_download_btn(videos) %} {% macro video_download_btn(videos) %}
{% if not ismod() %}
<span class="btn btn-default dropdown-toggle{% if videos|length is equalto 0 %} disabled{% endif %}" type="button" data-toggle="dropdown">Download <span class="caret"></span></span> <span class="btn btn-default dropdown-toggle{% if videos|length is equalto 0 %} disabled{% endif %}" type="button" data-toggle="dropdown">Download <span class="caret"></span></span>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
{% for v in videos|sort(attribute='prio', reverse=True) %} {% for v in videos|sort(attribute='prio', reverse=True) if v.downloadable%}
{% if v.downloadable or ismod() %} <li><a href="{{ config.VIDEOPREFIX }}/{{v.path}}">{{v.format_description}} ({{v.file_size|filesizeformat(true)}})</a></li>
<li><a href="{{ config.VIDEOPREFIX }}/{{v.path}}">{{ moderator_checkbox(['videos',v.id,'visible'], v.visible) }} {{v.format_description}} ({{v.file_size|filesizeformat(true)}}) {{moderator_delete(['videos',v.id,'deleted'])}} </a></li>
{% endif %}
{% endfor %} {% endfor %}
</ul> </ul>
{% endif %}
{% if not ismod() %}
<noscript> <noscript>
{% else %}
<span>
{% endif %}
<ul class="pull-right list-unstyled" style="margin-left:10px;"> <ul class="pull-right list-unstyled" style="margin-left:10px;">
{% for v in videos|sort(attribute='prio', reverse=True) %} {% for v in videos|sort(attribute='prio', reverse=True) if v.downloadable %}
<li><a href="{{ config.VIDEOPREFIX }}/{{v.path}}">{{v.format_description}} ({{v.file_size|filesizeformat(true)}})</a></li> <li>{{moderator_delete(['videos',v.id,'deleted'])}} {{ moderator_checkbox(['videos',v.id,'visible'], v.visible) }} <a href="{{ config.VIDEOPREFIX }}/{{v.path}}">{{v.format_description}} ({{v.file_size|filesizeformat(true)}})</a></li>
{% endfor %} {% endfor %}
</ul> </ul>
{% if not ismod() %}
</noscript> </noscript>
{% else %}
</span>
{% endif %}
{% endmacro %} {% endmacro %}
{%macro video_embed_btn(lectureid) %} {%macro video_embed_btn(lectureid) %}
...@@ -119,7 +127,13 @@ $('#embedcodebtn').popover( ...@@ -119,7 +127,13 @@ $('#embedcodebtn').popover(
{% macro lecture_list_item(lecture,videos,global_permissions) %} {% macro lecture_list_item(lecture,videos,global_permissions) %}
<li class="list-group-item" id="lecture-{{lecture.id}}"> <li class="list-group-item" id="lecture-{{lecture.id}}">
<div class="row"> <div class="row">
<img style="margin-bottom: 10px" class="col-sm-2 col-xs-12"src="{{ config.VIDEOPREFIX }}/{{lecture.titlefile}}" alt="Vorschaubild" onerror="this.src='{{url_for('static',filename='no-thumbnail.png')}}'; this.onerror=''; "> <div style="background-image: url('{% if not lecture.titlefile %}{{url_for('static',filename='no-thumbnail.png')}}{% else %}{{ config.VIDEOPREFIX }}/{{lecture.titlefile}}'){% endif %}" class="col-sm-2 col-xs-12 thumbnailimg">
{% if not videos|length is equalto 0 %}
<a href="{{url_for('lecture', id=lecture.id)}}">
<span class="glyphicon glyphicon-play-circle playpreviewbtn"></span>
</a>
{% endif %}
</div>
<span class="col-sm-3 col-xs-12"> <span class="col-sm-3 col-xs-12">
<ul class="list-unstyled"> <ul class="list-unstyled">
<li>{{ moderator_editor(['lectures',lecture.id,'title'], lecture.title) }}</li> <li>{{ moderator_editor(['lectures',lecture.id,'title'], lecture.title) }}</li>
...@@ -142,22 +156,16 @@ $('#embedcodebtn').popover( ...@@ -142,22 +156,16 @@ $('#embedcodebtn').popover(
</ul> </ul>
</span> </span>
<div class="col-sm-4 col-xs-12"> <div class="col-sm-4 col-xs-12">
<ul class="pull-right list-inline"> <ul class="list-inline">
<li class="dropdown"> <li class="dropdown">
{{ video_download_btn(videos) }} {{ video_download_btn(videos) }}
</li> </li>
<li> <li class="pull-right">
<a href="{{url_for('lecture', id=lecture.id)}}" class="btn btn-default {% if videos|length is equalto 0 %}disabled{% endif %}"> {{ moderator_permissioneditor('lecture', lecture.id, lecture.perm, global_permissions) }}
<span class="glyphicon glyphicon-play"></span>
Play
</a>
</li> </li>
<li> <li class="pull-right">
{{ moderator_delete(['lectures',lecture.id,'deleted']) }} {{ moderator_delete(['lectures',lecture.id,'deleted']) }}
</li> </li>
<li>
{{ moderator_permissioneditor('lecture', lecture.id, lecture.perm, global_permissions) }}
</li>
</ul> </ul>
</div> </div>
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment