]> git.lizzy.rs Git - cheatdb.git/blob - app/templates/base.html
Allow Editors to edit tags
[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
96                                                                 {% if current_user.rank.atLeast(current_user.rank.MODERATOR) %}
97                                                                         <li class="nav-item"><a class="nav-link" href="{{ url_for('admin.audit') }}">{{ _("Audit Log") }}</a></li>
98                                                                 {% endif %}
99
100                                                                 {% if current_user.rank == current_user.rank.ADMIN %}
101                                                                         <li class="nav-item"><a class="nav-link" href="{{ url_for('admin.admin_page') }}">{{ _("Admin") }}</a></li>
102                                                                 {% else %}
103                                                                         {% if check_global_perm(current_user, "EDIT_TAGS") %}
104                                                                                 <li class="nav-item"><a class="nav-link" href="{{ url_for('admin.tag_list') }}">{{ _("Tag Editor") }}</a></li>
105                                                                         {% elif check_global_perm(current_user, "CREATE_TAG") %}
106                                                                                 <li class="nav-item"><a class="nav-link" href="{{ url_for('admin.create_edit_tag') }}">{{ _("Create Tag") }}</a></li>
107                                                                         {% endif %}
108                                                                         {% if current_user.rank == current_user.rank.MODERATOR %}
109                                                                                 <li class="nav-item"><a class="nav-link" href="{{ url_for('admin.license_list') }}">{{ _("License Editor") }}</a></li>
110                                                                         {% endif %}
111                                                                 {% endif %}
112                                                                 <li class="nav-item"><a class="nav-link" href="{{ url_for('user.logout') }}">{{ _("Sign out") }}</a></li>
113                                                         </ul>
114                                                 </li>
115                                         {% else %}
116                                                 <li><a class="nav-link" href="{{ url_for('user.login') }}">{{ _("Sign in") }}</a></li>
117                                         {% endif %}
118                                 </ul>
119                         </div>
120                 </div>
121         </nav>
122
123         {% block flash_messages %}
124                 {%- with messages = get_flashed_messages(with_categories=true) -%}
125                         {% if messages %}
126                                 <ul id="alerts">
127                                         {% for category, message in messages %}
128                                                 <li class="alert alert-{{category}} container">
129                                                         <span class="icon_message"></span>
130
131                                                         {{ message }}
132
133                                                         <div style="clear: both;"></div>
134                                                 </li>
135                                         {% endfor %}
136                                 </ul>
137                         {% endif %}
138                 {%- endwith %}
139         {% endblock %}
140
141         {% block container %}
142         <main class="container mt-4">
143                 {% block content %}
144                 {% endblock %}
145         </main>
146         {% endblock %}
147
148         <footer class="container footer-copyright my-5 page-footer font-small text-center">
149                 ContentDB &copy; 2018-20 to <a href="https://rubenwardy.com/">rubenwardy</a> |
150                 <a href="https://github.com/minetest/contentdb">GitHub</a> |
151                 <a href="{{ url_for('flatpage', path='help') }}">{{ _("Help") }}</a> |
152                 <a href="{{ url_for('flatpage', path='policy_and_guidance') }}">{{ _("Policy and Guidance") }}</a> |
153                 <a href="{{ url_for('flatpage', path='help/reporting') }}">{{ _("Report / DMCA") }}</a> |
154                 <a href="{{ url_for('users.list_all') }}">{{ _("User List") }}</a>
155
156                 {% if debug %}
157                         <p style="color: red">
158                                 DEBUG MODE ENABLED
159                         </p>
160                 {% endif %}
161         </footer>
162
163         <script src="/static/jquery.min.js"></script>
164         <script src="/static/popper.min.js"></script>
165         <script src="/static/bootstrap.min.js"></script>
166         <script src="/static/easymde.min.js"></script>
167         <link rel="stylesheet" type="text/css" href="/static/easymde.min.css">
168         <link href="/static/fa/css/all.css" rel="stylesheet">
169         <script src="/static/markdowntextarea.js"></script>
170
171         {% block scriptextra %}{% endblock %}
172 </body>
173 </html>