aboutsummaryrefslogtreecommitdiff
path: root/app/templates/base.html
blob: 126f56fd4804842edcb12346134a68a6e9c57c6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<!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>
		<div class="container">
			<ul class="nav navbar-nav navbar-left">
				<li><a href="/">{{ config.USER_APP_NAME }}</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') }}">
						<img src="/static/notification{% if current_user.notifications %}_alert{% endif %}.svg" />
					</a></li>
					<li><a href="{{ url_for('create_edit_package_page') }}">+</a></li>
					<li class="dropdown">
						<a 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.canAccessTodoList() %}
								<li><a href="{{ url_for('todo_page') }}">Work Queue</a></li>
								<li><a href="{{ url_for('user_list_page') }}">User list</a></li>
							{% endif %}
							{% if current_user.rank == current_user.rank.ADMIN %}
								<li><a href="{{ url_for('admin_page') }}">Admin</a></li>
							{% endif %}
							{% if current_user.rank == current_user.rank.MODERATOR %}
								<li><a href="{{ url_for('tag_list_page') }}">Tag Editor</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 class="clearboth"></div>
		</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 %}

	<footer>
		ContentDB &copy; 2018 to <a href="https://rubenwardy.com/">rubenwardy</a> |
		<a href="https://github.com/minetest/contentdb">GitHub</a> |
		<a href="{{ url_for('flatpage', path='help') }}">Help</a> |
		<a href="{{ url_for('flatpage', path='help/reporting') }}">Report / DMCA</a>
	</footer>
</html>