contentdb/app/templates/base.html
2018-05-17 23:14:27 +01:00

95 lines
2.6 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}title{% endblock %} - {{ config.USER_APP_NAME }}</title>
<link rel="stylesheet" type="text/css" href="/static/main.css">
{% block headextra %}{% endblock %}
</head>
<body>
<nav>
<ul class="nav navbar-nav navbar-left">
<li><a href="/"><img src="/static/logo_dark.svg" /></a></li>
{% for item in current_menu.children recursive %}
{% if item.visible %}
<li{% if item.children %} class="dropdown"{% endif %}>
<a href="{{ item.url }}"
{% if item.children %}
class="dropdown-toggle"
data-toggle="dropdown"
role="button"
aria-expanded="false"
{% endif %}>
{{ item.text }}
{% if item.children %}
<span class="caret"></span>
{% endif %}
</a>
{% if item.children %}
<ul class="dropdown-menu" role="menu">
{{ loop(item.children) }}
</ul>
{% endif %}
</li>
{% endif %}
{% endfor %}
</ul>
<ul class="nav navbar-nav navbar-right">
{% if current_user.is_authenticated %}
<li><a href="{{ url_for('notifications_page') }}">({{ current_user.notifications | length }})</a></li>
<li class="dropdown">
<a href="{{ url_for('user_profile_page', username=current_user.username) }}"
class="dropdown-toggle"
data-toggle="dropdown"
role="button"
aria-expanded="false">{{ current_user.display_name }}
<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="{{ url_for('user_profile_page', username=current_user.username) }}">Profile</a>
</li>
{% if current_user.rank == current_user.rank.ADMIN %}
<li><a href="{{ url_for('admin_page') }}">Admin</a></li>
{% endif %}
<li><a href="{{ url_for('user.logout') }}">Sign out</a></li>
</ul>
</li>
{% else %}
<li><a href="{{ url_for('user.login') }}">Sign in</a></li>
{% endif %}
</ul>
<div style="clear:both;"></div>
</nav>
{% block flash_messages %}
{%- with messages = get_flashed_messages(with_categories=true) -%}
{% if messages %}
<ul id="alerts">
{% for category, message in messages %}
<li class="box box_grey alert alert-{{category}}">
<span class="icon_message"></span>
{{ message|safe }}
<div style="clear: both;"></div>
</li>
{% endfor %}
</ul>
{% endif %}
{%- endwith %}
{% endblock %}
{% block container %}
<main>
{% block content %}
{% endblock %}
</main>
{% endblock %}
</html>