Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Video AG Infrastruktur
website
Commits
84dda40b
Commit
84dda40b
authored
Sep 10, 2016
by
Andreas Valder
Browse files
made "featured" editable
parent
0faf4fbd
Changes
3
Hide whitespace changes
Inline
Side-by-side
server.py
View file @
84dda40b
...
...
@@ -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
:
...
...
templates/base.html
View file @
84dda40b
...
...
@@ -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>
...
...
templates/index.html
View file @
84dda40b
...
...
@@ -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>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment