Commit 84dda40b authored by Andreas Valder's avatar Andreas Valder

made "featured" editable

parent 0faf4fbd
......@@ -260,7 +260,8 @@ def edit(prefix="", ignore=[]):
'internal', 'speaker', 'place', 'time', 'duration', 'jumplist','deleted']),
'videos': ('videos_data', 'id', ['visible','deleted']),
'chapters': ('chapters', 'id', ['time', 'text', 'visible', 'deleted']),
'announcements': ('announcements', 'id', ['text', 'internal', 'level', 'visible', 'deleted'])
'announcements': ('announcements', 'id', ['text', 'internal', 'level', 'visible', 'deleted']),
'featured': ('featured', 'id', ['text', 'title', 'visible', 'deleted'])
}
modify('BEGIN')
if request.is_json:
......
......@@ -102,11 +102,13 @@
{% endfor %}
{% for msg in get_announcements(min_announcement_level) if (not request.cookies['alert-info-'+msg.id|string]) or ismod() %}
<div class="alert alert-{{announcement_levels.get(msg.level, 'info')}}" role="alert">
<a href="#" class="close" data-dismiss="alert" aria-label="close" onclick="Cookies.set('alert-info-{{msg.id}}', '1');">&times;</a>
{% if not ismod() %}
<a href="#" class="close" data-dismiss="alert" aria-label="close" onclick="Cookies.set('alert-info-{{msg.id}}', '1');">&times;</a>
{% endif %}
<ul class="list-unstyled">
<li>{{ valueeditor(('announcements',msg.id,'text'), msg.text|safe) }}</li>
{% if ismod() %}
<li class="pull-right">{{ valuedeletebtn(('announcements',msg.id,'deleted')) }}</li>
{% if ismod() %}
<li>{{ valueeditor(('announcements',msg.id,'internal'), msg.internal) }}</li>
<li class="pull-right">Sichtbar: {{ valuecheckbox(('announcements',msg.id,'visible'),msg.visible) }}</li>
<li>Level: {{ valueeditor(('announcements',msg.id,'level'), msg.level) }}</li>
......
......@@ -7,10 +7,10 @@
<div class="col-xs-12">
<ul class="list-inline pull-right">
{% if ismod() %}
<li style="padding-right: 0px;">
<a class="btn btn-default" href="{{ url_for('new_announcement', ref=request.url) }}">Neue Ankündigung</a>
</li>
{% endif %}
<li style="padding-right: 0px;">
<a class="btn btn-default" href="{{ url_for('new_announcement', ref=request.url) }}">Neue Ankündigung</a>
</li>
{% endif %}
</ul>
</div>
</div>
......@@ -30,35 +30,48 @@
</p>
</div>
</div>
{% if featured|length > 0 %}
{% if (featured|length > 0) or ismod() %}
<div class="panel panel-default">
<div class="panel-heading">
<h1 class="panel-title">Featured</h1>
<h1 class="panel-title">Featured
{% if ismod() %}
<a class="btn btn-default" href="{{ url_for('new_featured', ref=request.url) }}">Neue Empfehlung</a>
{% endif %}
</h1>
</div>
<div class="panel-body">
<div id="myCarousel" class="carousel slide" data-ride="carousel" style="background-color: #EEE; min-height: 400px;">
<!-- Indicators -->
<div id="myCarousel" class="carousel slide" data-ride="carousel" style="background-color: #EEE; min-height: 400px;" {% if ismod() %}data-interval="false"{% endif %}>
<ol class="carousel-indicators">
{% for i in featured %}
<li data-target="#myCarousel" data-slide-to="0" {% if loop.first %} class="active" {% endif %}></li>
<li data-target="#myCarousel" data-slide-to="{{ loop.index0 }}" {% if loop.first %} class="active" {% endif %}></li>
{% endfor %}
</ol>
<div class="carousel-inner" role="listbox">
{% for i in featured %}
<div class="item {% if loop.first %}active{% endif %}">
{{ i.text|safe }}
<div class="carousel-caption"><h1>{{ i.title }}</h1></div>
{% if ismod() %}
<div class="center-block">
{{ valueeditor(('featured',i.id,'text'), i.text) }}
{{ valueeditor(('featured',i.id,'title'), i.title) }}
{{ valuecheckbox(('featured',i.id,'visible'),i.visible) }}
</div>
{% else %}
{{i.text|safe}}
{% endif %}
<div class="carousel-caption">{{ i.title }}</div>
</div>
{% endfor %}
</div>
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
{% if not ismod() %}
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
{% endif %}
</div>
</div>
</div>
......
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