Commit 3f28e3b8 authored by Julian Rother's avatar Julian Rother
Browse files

Put announcements into their own block to be overwritten on main page, closes #327

parent 56861916
...@@ -128,12 +128,14 @@ ...@@ -128,12 +128,14 @@
{% else %} {% else %}
<div class="col-xs-12 col-md-offset-{{ page_border }} col-md-{{ 12-(2*page_border) }}"> <div class="col-xs-12 col-md-offset-{{ page_border }} col-md-{{ 12-(2*page_border) }}">
{% endif %} {% endif %}
{% block announcements %}
{% for msg in get_announcements(min_announcement_level) if (not request.cookies['alert-info-'+msg.id|string]) %} {% 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"> <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');">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close" onclick="Cookies.set('alert-info-{{msg.id}}', '1');">&times;</a>
{{ msg.text|safe }} {{ msg.text|safe }}
</div> </div>
{% endfor %} {% endfor %}
{% endblock %}
{% block alerts %} {% block alerts %}
{% for msg in get_flashed_messages(category_filter=["message"]) %} {% for msg in get_flashed_messages(category_filter=["message"]) %}
<div class="hidden-print alert alert-danger" role="alert">{{ msg|safe }}</div> <div class="hidden-print alert alert-danger" role="alert">{{ msg|safe }}</div>
......
{% from 'macros.html' import preview, featured_content, livelabel %} {% from 'macros.html' import preview, featured_content, livelabel %}
{% extends "base.html" %} {% extends "base.html" %}
{% set page_border = 0 %} {% set page_border = 0 %}
{% if ismod() %} {% set min_announcement_level = 0 %}
{# Little hack to not show annoucements twice #} {% block announcements %}
{% set min_announcement_level = 999 %}
{% else %}
{% set min_announcement_level = 0 %}
{% endif %}
{% block content %}
{% if ismod() %} {% if ismod() %}
<div class="row"> <div class="row">
<div class="col-xs-12"> <div class="col-xs-12">
...@@ -50,6 +45,12 @@ ...@@ -50,6 +45,12 @@
{% endfor %} {% endfor %}
</div> </div>
</div> </div>
{% else %}
{{ super() }}
{% endif %}
{% endblock %}
{% block content %}
{% if ismod() %}
<div class="row"> <div class="row">
<div class="col-xs-12"> <div class="col-xs-12">
<ul class="list-inline pull-right"> <ul class="list-inline pull-right">
......
Supports Markdown
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