diff --git a/server.py b/server.py index fd16e2b3c5715a47c173b35e13200dfc6ec57471..6c458ea16181fdaa627ee54870933786e1521313 100755 --- a/server.py +++ b/server.py @@ -411,3 +411,4 @@ def sortlog(): import feeds import importer import schedule +import sorter diff --git a/sorter.py b/sorter.py new file mode 100644 index 0000000000000000000000000000000000000000..fb63e16101307ed6b1bb7d4f8b16296ae2216f51 --- /dev/null +++ b/sorter.py @@ -0,0 +1,3 @@ +from server import * + + diff --git a/templates/base.html b/templates/base.html index 768065449edddebf64a868636988e15d1a221d2b..79ef4d8d9705b4d799ea8efbf265d8120646f6aa 100644 --- a/templates/base.html +++ b/templates/base.html @@ -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');">×</a> + {% if not ismod() %} + <a href="#" class="close" data-dismiss="alert" aria-label="close" onclick="Cookies.set('alert-info-{{msg.id}}', '1');">×</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> diff --git a/templates/index.html b/templates/index.html index 51f74e1f3c12c93fd67ee2bc26e6ee71fd82ce92..8426f5d0b4580fc3fcf81b09dcf2d786cf799710 100644 --- a/templates/index.html +++ b/templates/index.html @@ -7,9 +7,9 @@ <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('create', table='announcements', ref=request.url) }}">Neue Ankündigung</a> - </li> + <li style="padding-right: 0px;"> + <a class="btn btn-default" href="{{ url_for('create', table='announcements', ref=request.url) }}">Neue Ankündigung</a> + </li> {% endif %} </ul> </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('create', table='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>