]> git.lizzy.rs Git - cheatdb.git/blob - app/templates/base.html
Reduce access restrictions on user list
[cheatdb.git] / app / templates / base.html
1 <!DOCTYPE html>
2 <html>
3
4 <head>
5         <meta charset="utf-8">
6         <meta http-equiv="X-UA-Compatible" content="IE=edge">
7         <meta name="viewport" content="width=device-width, initial-scale=1">
8         <title>{% block title %}title{% endblock %} - {{ config.USER_APP_NAME }}</title>
9         <link rel="stylesheet" type="text/css" href="/static/main.css">
10         {% block headextra %}{% endblock %}
11 </head>
12
13 <body>
14         <nav>
15                 <div class="container">
16                         <ul class="nav navbar-nav navbar-left">
17                                 <li><a href="/"><img src="/static/logo_dark.svg" /></a></li>
18                                 {% for item in current_menu.children recursive %}
19                                         {% if item.visible %}
20                                                 <li{% if item.children %} class="dropdown"{% endif %}>
21                                                         <a href="{{ item.url }}"
22                                                                         {% if item.children %}
23                                                                                 class="dropdown-toggle"
24                                                                                 data-toggle="dropdown"
25                                                                                 role="button"
26                                                                                 aria-expanded="false"
27                                                                         {% endif %}>
28                                                                 {{ item.text }}
29                                                                 {% if item.children %}
30                                                                         <span class="caret"></span>
31                                                                 {% endif %}
32                                                         </a>
33                                                         {% if item.children %}
34                                                         <ul class="dropdown-menu" role="menu">
35                                                                 {{ loop(item.children) }}
36                                                         </ul>
37                                                         {% endif %}
38                                                 </li>
39                                         {% endif %}
40                                 {% endfor %}
41                         </ul>
42                         <ul class="nav navbar-nav navbar-right">
43                                 {% if current_user.is_authenticated %}
44                                         <li><a href="{{ url_for('notifications_page') }}">
45                                                 <img src="/static/notification{% if current_user.notifications %}_alert{% endif %}.svg" />
46                                         </a></li>
47                                         <li><a href="{{ url_for('create_edit_package_page') }}">+</a></li>
48                                         <li class="dropdown">
49                                                 <a href="{{ url_for('user_profile_page', username=current_user.username) }}"
50                                                         class="dropdown-toggle"
51                                                         data-toggle="dropdown"
52                                                         role="button"
53                                                         aria-expanded="false">{{ current_user.display_name }}
54                                                                 <span class="caret"></span></a>
55
56                                                 <ul class="dropdown-menu" role="menu">
57                                                         <li>
58                                                                 <a href="{{ url_for('user_profile_page', username=current_user.username) }}">Profile</a>
59                                                         </li>
60                                                         {% if current_user.canAccessTodoList() %}
61                                                                 <li><a href="{{ url_for('todo_page') }}">Work Queue</a></li>
62                                                                 <li><a href="{{ url_for('user_list_page') }}">User list</a></li>
63                                                         {% endif %}
64                                                         {% if current_user.rank == current_user.rank.ADMIN %}
65                                                                 <li><a href="{{ url_for('admin_page') }}">Admin</a></li>
66                                                         {% endif %}
67                                                         <li><a href="{{ url_for('user.logout') }}">Sign out</a></li>
68                                                 </ul>
69                                         </li>
70                                 {% else %}
71                                         <li><a href="{{ url_for('user.login') }}">Sign in</a></li>
72                                 {% endif %}
73                         </ul>
74                         <div class="clearboth"></div>
75                 </div>
76         </nav>
77
78         {% block flash_messages %}
79                 {%- with messages = get_flashed_messages(with_categories=true) -%}
80                         {% if messages %}
81                                 <ul id="alerts">
82                                         {% for category, message in messages %}
83                                                 <li class="box box_grey alert alert-{{category}}">
84                                                         <span class="icon_message"></span>
85
86                                                         {{ message|safe }}
87
88                                                         <div style="clear: both;"></div>
89                                                 </li>
90                                         {% endfor %}
91                                 </ul>
92                         {% endif %}
93                 {%- endwith %}
94         {% endblock %}
95
96         {% block container %}
97         <main>
98                 {% block content %}
99                 {% endblock %}
100         </main>
101         {% endblock %}
102
103         <footer>
104                 Copyright &copy; 2018 to <a href="https://rubenwardy.com/">rubenwardy</a> |
105                 <a href="{{ url_for('flatpage', path='help') }}">Help</a> |
106                 <a href="https://github.com/minetest/contentdb">GitHub</a>
107         </footer>
108 </html>