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
4a3fdf61
Commit
4a3fdf61
authored
Apr 11, 2017
by
Julian Rother
Browse files
Restructured featured template
parent
68d58456
Changes
2
Hide whitespace changes
Inline
Side-by-side
templates/index.html
View file @
4a3fdf61
{% from 'macros.html' import preview,
course_list_item
%}
{% from 'macros.html' import preview,
featured_content
%}
{% extends "base.html" %}
{% set page_border = 0 %}
{% if ismod() %}
...
...
@@ -98,32 +98,7 @@
{% endif %}
</h1>
</div>
{% if item.type == 'image' %}
<!-- Putting image tag here makes it borderless. This should be replaced by a bootstrap-compatible solution. -->
<img
src=
"{{item.param}}"
style=
"width: 100%;"
/>
{% if ismod() %}
<p>
{{moderator_editor(('featured',item.id,'param'), item.param)}}
</p>
{% endif %}
{% endif %}
{% if item.text or ismod() %}
<div
class=
"panel-body"
>
{{ moderator_editor(('featured',item.id,'text'), item.text) }}
</div>
{% endif %}
{% if item.type == 'courses' %}
<ul
class=
"courses-list list-group"
>
{% for i in item.courses %}
{{ course_list_item(i) }}
{% endfor %}
</ul>
<div
class=
"panel-footer"
>
{% if ismod() %}
<p>
Kategorie: {{ moderator_editor(('featured',item.id,'param'), item.param) }}
</p>
<p>
Parameter: {{ moderator_editor(('featured',item.id,'param2'), item.param2) }}
</p>
{% endif %}
Die vollständige Liste findest du
<a
href=
"{{ url_for('courses') }}"
>
hier
</a>
.
</div>
{% endif %}
{{ featured_content(item) }}
</div>
{% endfor %}
</div>
...
...
templates/macros.html
View file @
4a3fdf61
...
...
@@ -306,3 +306,46 @@ $('#embedcodebtn').popover(
});
</script>
{% endmacro %}
{% macro featured_content(item) %} {# This macro is used in a panel div after the panel header #}
{% if item.type == 'image' %}
<!-- Putting image tag here makes it borderless. This should be replaced by a bootstrap-compatible solution. -->
<img
src=
"{{item.param}}"
style=
"width: 100%;"
/>
{% if ismod() %}
<p>
{{moderator_editor(('featured',item.id,'param'), item.param)}}
</p>
{% endif %}
{% if item.text or ismod() %}
<div
class=
"panel-body"
>
{{ moderator_editor(('featured',item.id,'text'), item.text) }}
</div>
{% endif %}
{% elif item.type == 'courses' %}
{% if item.text or ismod() %}
<div
class=
"panel-body"
>
{{ moderator_editor(('featured',item.id,'text'), item.text) }}
</div>
{% endif %}
<ul
class=
"courses-list list-group"
>
{% for i in item.courses %}
{{ course_list_item(i) }}
{% endfor %}
</ul>
<div
class=
"panel-footer"
>
{% if ismod() %}
<ul
class=
"list-inline"
>
<li><div
class=
"dropdown"
>
{% set params = {'semester': 'Semester', 'title': 'Veranstaltung', 'organizer': 'Dozent', 'subject': 'Kategorie'} %}
<button
class=
"btn btn-default dropdown-toggle"
type=
"button"
data-toggle=
"dropdown"
>
{{params[item.param]}}:
<span
class=
"caret"
></span></button>
<ul
class=
"dropdown-menu"
>
{% for key, name in params.items() %}
<li><a
href=
"{{url_for('edit', **{'featured.'+item.id|string+'.param': key, 'ref': request.url})}}"
>
{{name}}
</a></li>
{% endfor %}
</ul>
</div></li>
<li>
{{ moderator_editor(('featured',item.id,'param2'), item.param2) }}
</li>
</ul>
{% endif %}
Die vollständige Liste findest du
<a
href=
"{{ url_for('courses') }}"
>
hier
</a>
.
</div>
{% else %}
{% if item.text or ismod() %}
<div
class=
"panel-body"
>
{{ moderator_editor(('featured',item.id,'text'), item.text) }}
</div>
{% endif %}
{% endif %}
{% endmacro %}
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