Titivillus/jinja2/base.html

54 lines
2.1 KiB
HTML
Raw Permalink Normal View History

2018-09-25 11:58:07 -04:00
{% set vars = {} %}
2018-08-10 08:39:51 -04:00
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
2018-08-10 08:39:51 -04:00
<title>{% block title %}{% endblock %} - Titivillus</title>
<link rel="stylesheet" type="text/css" href="{{ static('base.css') }}">
2018-09-19 15:56:59 -04:00
<script type="text/javascript" src="{{ static('base.js') }}"></script>
2018-09-20 13:09:24 -04:00
<script>
const api_url = '{{ url("api:index") }}';
2018-09-20 13:09:24 -04:00
const csrf_token = '{{ csrf_token }}';
</script>
2018-08-10 08:39:51 -04:00
{% block head %}{% endblock %}
</head>
<body>
2018-09-19 15:56:59 -04:00
<div id="globalWrapper">
2018-09-30 01:30:50 -04:00
<div id="header" class="header" style="{% if request.session.get("hide_header") == True %}display:none;{% else %}display:flex;{% endif %}">
<span><a onclick="toggle_header();" href="javascript:void(0);"></a></span>
<span><a href="{{ url('homepage:index') }}">Home</a></span>
{% if request.user.is_authenticated %}
<span id="profileLink"><a href="{{ url('user:profile', args=[request.user.id]) }}">{{ request.user.username }}</a></span>
<span id="subscriptions">
<button id="subbtn" class={% if get_sub_msgs(request=request) %}"newSubs"{% else %}"noNewSubs"{% endif %}>{{ get_sub_msgs(request=request)|length }}</button>
<div id="subscriptionsContent">
{% for sub in get_sub_msgs(request=request) %}
<div id="notification-{{ sub.id }}" >
{{ sub.created_at.strftime('%Y-%m-%d') }} <a href="{{ sub.meta.url }}">{{ sub }}</a>
<a href="javascript:void(0);" onclick="clear_notification({{ sub.id }})">X</a>
<br>
</div>
{% endfor %}
{% if not get_sub_msgs(request=request) %}
<span id="noNewSubs">No new notifications</span>
{% endif %}
</div>
</span>
{% endif %}
2018-09-19 15:56:59 -04:00
{% block header %}{% endblock %}
2018-09-30 01:30:50 -04:00
</div>
2018-10-02 11:35:39 -04:00
<div id="headerHidden" class="header" style="{% if request.session.get("hide_header") == True %}display:flex;{% else %}display:none;{% endif %}">
2018-09-30 01:30:50 -04:00
<span><a onclick="toggle_header();" href="javascript:void(0);"></a></span>
</div>
2018-09-19 15:56:59 -04:00
<ul id="alerts">
2018-10-12 10:34:57 -04:00
{% for message in get_messages(request=request) %}
{% if "subscription" not in message.tags %}
<li class="{{ message.tags }}">{{ message }}</li>
{% endif %}
{% endfor %}
</ul>
2018-09-19 15:56:59 -04:00
<div id="content">{% block content %}{% endblock %}</div>
</div>
2018-08-10 08:39:51 -04:00
</body>
</html>