]> git.lizzy.rs Git - cheatdb.git/blob - app/templates/base.html
67d83512a1793bb09e43dee44610e877a1ed9ff3
[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/bootstrap.css">
10         <link rel="stylesheet" type="text/css" href="/static/custom.css?v=13">
11         <link rel="search" type="application/opensearchdescription+xml" href="/static/opensearch.xml" title="ContentDB" />
12         <link rel="shortcut icon" href="/favicon-16.png" sizes="16x16">
13         <link rel="icon" href="/favicon-128.png" sizes="128x128">
14         <link rel="icon" href="/favicon-32.png" sizes="32x32">
15         {% block headextra %}{% endblock %}
16 </head>
17
18 <body>
19         <nav class="navbar navbar-expand-lg navbar-dark bg-primary">
20                 <div class="container">
21                         <a class="navbar-brand" href="/">{{ config.USER_APP_NAME }}</a>
22                         <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor01" aria-controls="navbarColor01" aria-expanded="false" aria-label="Toggle navigation">
23                                 <span class="navbar-toggler-icon"></span>
24                         </button>
25
26                         <div class="collapse navbar-collapse" id="navbarColor01">
27                                 <ul class="navbar-nav mr-auto">
28                                         {% for item in current_menu.children recursive %}
29                                                 {% if item.visible %}
30                                                         <li class="nav-item {% if item.children %} dropdown{% endif %}">
31                                                                 <a class="nav-link" href="{{ item.url }}"
32                                                                                 {% if item.children %}
33                                                                                         class="dropdown-toggle"
34                                                                                         data-toggle="dropdown"
35                                                                                         role="button"
36                                                                                         aria-expanded="false"
37                                                                                 {% endif %}>
38                                                                         {{ item.text }}
39                                                                         {% if item.children %}
40                                                                                 <span class="caret"></span>
41                                                                         {% endif %}
42                                                                 </a>
43                                                                 {% if item.children %}
44                                                                 <ul class="dropdown-menu" role="menu">
45                                                                         {{ loop(item.children) }}
46                                                                 </ul>
47                                                                 {% endif %}
48                                                         </li>
49                                                 {% endif %}
50                                         {% endfor %}
51                                 </ul>
52                                 <form class="form-inline my-2 my-lg-0" method="GET" action="/packages/">
53                                         {% if type %}<input type="hidden" name="type" value="{{ type }}" />{% endif %}
54                                         <input class="form-control mr-sm-2" name="q" type="text" placeholder="Search {{ title | lower or 'all packages' }}" value="{{ query or ''}}">
55                                         <input class="btn btn-secondary my-2 my-sm-0 mr-sm-2" type="submit" value="Search" />
56                                         <!-- <input class="btn btn-secondary my-2 my-sm-0"
57                                                 data-toggle="tooltip" data-placement="bottom"
58                                                 title="Go to the first found result for this query."
59                                                 type="submit" name="lucky" value="First" /> -->
60                                 </form>
61                                 <ul class="navbar-nav ml-auto">
62                                         {% if current_user.is_authenticated %}
63                                                 <li class="nav-item"><a class="nav-link notification-icon" href="{{ url_for('notifications.list_all') }}">
64                                                         {% if current_user.notifications %}
65                                                                 <i class="fas fa-bell"></i>
66                                                                 <span class="badge badge-pill badge-notify" style="font-size:10px;">{{ current_user.notifications | length }}</span>
67                                                         {% else %}
68                                                                 <i class="fas fa-bell" ></i>
69                                                         {% endif %}
70                                                 </a></li>
71                                                 <li class="nav-item"><a class="nav-link" href="{{ url_for('packages.create_edit') }}">
72                                                         <i class="fas fa-plus"></i>
73                                                 </a></li>
74                                                 <li class="nav-item dropdown">
75                                                         <a class="nav-link dropdown-toggle"
76                                                                 data-toggle="dropdown"
77                                                                 role="button"
78                                                                 aria-expanded="false">{{ current_user.display_name }}
79                                                                         <span class="caret"></span></a>
80
81                                                         <ul class="dropdown-menu dropdown-menu-right" role="menu">
82                                                                 <li class="nav-item">
83                                                                         <a class="nav-link" href="{{ url_for('users.profile', username=current_user.username) }}">Profile</a>
84                                                                 </li>
85                                                                 <li class="nav-item">
86                                                                         <a class="nav-link" href="{{ url_for('users.profile', username=current_user.username) }}#unadded-topics">Your unadded topics</a>
87                                                                 </li>
88                                                                 {% if current_user.canAccessTodoList() %}
89                                                                         <li class="nav-item"><a class="nav-link" href="{{ url_for('todo.view') }}">{{ _("Work Queue") }}</a></li>
90                                                                         <li class="nav-item"><a  class="nav-link" href="{{ url_for('users.list_all') }}">{{ _("User list") }}</a></li>
91                                                                 {% endif %}
92                                                                 <li class="nav-item">
93                                                                         <a class="nav-link" href="{{ url_for('todo.topics') }}">{{ _("All unadded topics") }}</a>
94                                                                 </li>
95                                                                 {% if current_user.rank.atLeast(current_user.rank.MODERATOR) %}
96                                                                         <li class="nav-item"><a class="nav-link" href="{{ url_for('admin.audit') }}">{{ _("Audit Log") }}</a></li>
97                                                                 {% endif %}
98                                                                 {% if current_user.rank == current_user.rank.ADMIN %}
99                                                                         <li class="nav-item"><a class="nav-link" href="{{ url_for('admin.admin_page') }}">{{ _("Admin") }}</a></li>
100                                                                 {% endif %}
101                                                                 {% if current_user.rank == current_user.rank.MODERATOR %}
102                                                                         <li class="nav-item"><a class="nav-link" href="{{ url_for('admin.tag_list') }}">{{ _("Tag Editor") }}</a></li>
103                                                                         <li class="nav-item"><a class="nav-link" href="{{ url_for('admin.license_list') }}">{{ _("License Editor") }}</a></li>
104                                                                 {% endif %}
105                                                                 <li class="nav-item"><a class="nav-link" href="{{ url_for('user.logout') }}">{{ _("Sign out") }}</a></li>
106                                                         </ul>
107                                                 </li>
108                                         {% else %}
109                                                 <li><a class="nav-link" href="{{ url_for('user.login') }}">{{ _("Sign in") }}</a></li>
110                                         {% endif %}
111                                 </ul>
112                         </div>
113                 </div>
114         </nav>
115
116         {% block flash_messages %}
117                 {%- with messages = get_flashed_messages(with_categories=true) -%}
118                         {% if messages %}
119                                 <ul id="alerts">
120                                         {% for category, message in messages %}
121                                                 <li class="alert alert-{{category}} container">
122                                                         <span class="icon_message"></span>
123
124                                                         {{ message }}
125
126                                                         <div style="clear: both;"></div>
127                                                 </li>
128                                         {% endfor %}
129                                 </ul>
130                         {% endif %}
131                 {%- endwith %}
132         {% endblock %}
133
134         {% block container %}
135         <main class="container mt-4">
136                 {% block content %}
137                 {% endblock %}
138         </main>
139         {% endblock %}
140
141         <footer class="container footer-copyright my-5 page-footer font-small text-center">
142                 ContentDB &copy; 2018-20 to <a href="https://rubenwardy.com/">rubenwardy</a> |
143                 <a href="https://github.com/minetest/contentdb">GitHub</a> |
144                 <a href="{{ url_for('flatpage', path='help') }}">{{ _("Help") }}</a> |
145                 <a href="{{ url_for('flatpage', path='policy_and_guidance') }}">{{ _("Policy and Guidance") }}</a> |
146                 <a href="{{ url_for('flatpage', path='help/reporting') }}">{{ _("Report / DMCA") }}</a> |
147                 <a href="{{ url_for('users.list_all') }}">{{ _("User List") }}</a>
148
149                 {% if debug %}
150                         <p style="color: red">
151                                 DEBUG MODE ENABLED
152                         </p>
153                 {% endif %}
154         </footer>
155
156         <script src="/static/jquery.min.js"></script>
157         <script src="/static/popper.min.js"></script>
158         <script src="/static/bootstrap.min.js"></script>
159         <script src="/static/easymde.min.js"></script>
160         <link rel="stylesheet" type="text/css" href="/static/easymde.min.css">
161         <link href="/static/fa/css/all.css" rel="stylesheet">
162         <script src="/static/markdowntextarea.js"></script>
163
164         {% block scriptextra %}{% endblock %}
165 </body>
166 </html>