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
3f28e3b8
Commit
3f28e3b8
authored
Oct 14, 2017
by
Julian Rother
Browse files
Put announcements into their own block to be overwritten on main page, closes
#327
parent
56861916
Changes
2
Hide whitespace changes
Inline
Side-by-side
templates/base.html
View file @
3f28e3b8
...
...
@@ -128,12 +128,14 @@
{% else %}
<div
class=
"col-xs-12 col-md-offset-{{ page_border }} col-md-{{ 12-(2*page_border) }}"
>
{% endif %}
{% block announcements %}
{% for msg in get_announcements(min_announcement_level) if (not request.cookies['alert-info-'+msg.id|string]) %}
<div
class=
"hidden-print alert alert-{{levels.get(msg.level, ('info', ''))[0]}}"
role=
"alert"
>
<a
href=
"#"
class=
"close"
data-dismiss=
"alert"
aria-label=
"close"
onclick=
"Cookies.set('alert-info-{{msg.id}}', '1');"
>
×
</a>
{{ msg.text|safe }}
</div>
{% endfor %}
{% endblock %}
{% block alerts %}
{% for msg in get_flashed_messages(category_filter=["message"]) %}
<div
class=
"hidden-print alert alert-danger"
role=
"alert"
>
{{ msg|safe }}
</div>
...
...
templates/index.html
View file @
3f28e3b8
{% from 'macros.html' import preview, featured_content, livelabel %}
{% extends "base.html" %}
{% set page_border = 0 %}
{% if ismod() %}
{# Little hack to not show annoucements twice #}
{% set min_announcement_level = 999 %}
{% else %}
{% set min_announcement_level = 0 %}
{% endif %}
{% block content %}
{% set min_announcement_level = 0 %}
{% block announcements %}
{% if ismod() %}
<div
class=
"row"
>
<div
class=
"col-xs-12"
>
...
...
@@ -50,6 +45,12 @@
{% endfor %}
</div>
</div>
{% else %}
{{ super() }}
{% endif %}
{% endblock %}
{% block content %}
{% if ismod() %}
<div
class=
"row"
>
<div
class=
"col-xs-12"
>
<ul
class=
"list-inline pull-right"
>
...
...
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