]> git.lizzy.rs Git - cheatdb.git/blob - app/templates/base.html
Add redirect to full user URL
[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/style.css">
10 </head>
11
12 <body>
13         <nav>
14                 <ul class="nav navbar-nav">
15                         <li><a href="/">{{ config.USER_APP_NAME }}</a></li>
16                         {% for item in current_menu.children recursive %}
17                                 <li{% if item.children %} class="dropdown"{% endif %}>
18                                         <a href="{{ item.url }}"
19                                                         {% if item.children %}
20                                                                 class="dropdown-toggle"
21                                                                 data-toggle="dropdown"
22                                                                 role="button"
23                                                                 aria-expanded="false"
24                                                         {% endif %}>
25                                                 {{ item.text }}
26                                                 {% if item.children %}
27                                                         <span class="caret"></span>
28                                                 {% endif %}
29                                         </a>
30                                         {% if item.children %}
31                                         <ul class="dropdown-menu" role="menu">
32                                                 {{ loop(item.children) }}
33                                         </ul>
34                                         {% endif %}
35                                 </li>
36                         {% endfor %}
37                 </ul>
38                 <ul class="nav navbar-nav navbar-right">
39                         {% if current_user.is_authenticated %}
40                                 <li><a href="{{ url_for('user_profile_page', username=current_user.username) }}">{{ current_user.display_name }}</a></li>
41                                 <li><a href="{{ url_for('user.logout') }}">Sign out</a></li>
42                         {% else %}
43                                 <li><a href="{{ url_for('user.login') }}">Sign in</a></li>
44                         {% endif %}
45                 </ul>
46                 <div style="clear:both;"></div>
47         </nav>
48
49
50         {% block flash_messages %}
51                 {%- with messages = get_flashed_messages(with_categories=true) -%}
52                         {% if messages %}
53                                 <ul id="alerts">
54                                         {% for category, message in messages %}
55                                                 <li class="box box_grey alert alert-{{category}}">
56                                                         <span class="icon_message"></span>
57
58                                                         {{ message|safe }}
59
60                                                         <div style="clear: both;"></div>
61                                                 </li>
62                                         {% endfor %}
63                                 </ul>
64                         {% endif %}
65                 {%- endwith %}
66         {% endblock %}
67
68         {% block container %}
69         <main>
70                 {% block content %}
71                 {% endblock %}
72         </main>
73         {% endblock %}
74 </html>