]> git.ipfire.org Git - ipfire.org.git/blob - src/templates/base.html
base: Add search to navigation when on docs
[ipfire.org.git] / src / templates / base.html
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4 <title>{{ hostname }} - {% block title %}{{ _("No title given") }}{% end block %}</title>
5 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6 <meta name="author" content="IPFire.org - IPFire Development Team" />
7
8 <meta name="keywords" content="Linux, Firewall, IPFire, Security, IPCop, Open Source, Free, ARM, VPN, Proxy, IDS, IPS" />
9
10 <link rel="icon" sizes="192x192" href="{{ static_url("img/apple-touch-icon-192x192-precomposed.png") }}">
11 {% for res in ("72x72", "76x76", "120x120", "144x144", "152x152", "180x180") %}
12 <link rel="apple-touch-icon-precomposed" sizes="{{ res }}" href="{{ static_url("img/apple-touch-icon-%s-precomposed.png" % res )}}">
13 {% end %}
14 <link rel="apple-touch-icon-precomposed" href="{{ static_url("img/apple-touch-icon-60x60-precomposed.png") }}">
15
16 <!-- styling stuff -->
17 <link rel="stylesheet" type="text/css" href="{{ static_url("main.css") }}" />
18 <meta name="viewport" content="width=device-width, initial-scale=1.0">
19
20 {% block head %}{% end block %}
21 </head>
22
23 <body>
24 <nav class="navbar" role="navigation" aria-label="main navigation">
25 <div class="container">
26 <div class="navbar-brand">
27 <a class="navbar-item is-size-4" href="/">
28 <strong>
29 IPFire<span class="has-text-primary">_</span>
30
31 {% if hostname.startswith("fireinfo.") %}
32 {{ _("Fireinfo") }}
33 {% elif hostname.startswith("nopaste.") %}
34 {{ _("Nopaste") }}
35 {% elif hostname.startswith("location.") %}
36 {{ _("Location") }}
37 {% elif hostname.startswith("wiki.") %}
38 {{ _("Wiki") }}
39 {% end %}
40 </strong>
41 </a>
42
43 <a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="navbarMainMenu">
44 <span aria-hidden="true"></span>
45 <span aria-hidden="true"></span>
46 <span aria-hidden="true"></span>
47 </a>
48 </div>
49 <div class="navbar-menu" id="navbarMainMenu">
50 {% block menu %}
51 {% if hostname.startswith("www.") or hostname.startswith("dev.") %}
52 <div class="navbar-end">
53 {# Show a search bar for docs #}
54 {% if request.path.startswith("/docs") %}
55 <div class="navbar-item">
56 <form action="/docs/search" method="GET">
57 <div class="field">
58 <div class="control has-icons-left">
59 <input class="input" type="text"
60 name="q" {% if "q" in locals() and q %}value="{{ q }}"{% end %}
61 placeholder="{{ _("Search Docs...") }}">
62 <span class="icon is-small is-left">
63 <i class="fas fa-search"></i>
64 </span>
65 </div>
66 </div>
67 </form>
68 </div>
69 {% end %}
70
71 <a class="navbar-item {% if request.path == "/about" %}is-active{% end %}" href="/about">{{ _("About") }}</a>
72
73 <a class="navbar-item {% if request.path.startswith("/download") %}is-active{% end %}" href="/download">{{ _("Download") }}</a>
74
75 <a class="navbar-item {% if request.path.startswith("/blog") %}is-active{% end %}" href="/blog">{{ _("Blog") }}</a>
76
77 <a class="navbar-item {% if request.path == "/help" %}is-active{% end %}" href="/help">{{ _("Help") }}</a>
78
79 <div class="navbar-item">
80 <a class="button is-lwl has-text-weight-bold is-uppercase"
81 href="https://store.lightningwirelabs.com/?utm_source={{ hostname }}&utm_medium=navigation">
82 {{ _("Buy") }}
83 </a>
84 </div>
85
86 <div class="navbar-item">
87 <a class="button is-primary has-text-weight-bold is-uppercase"
88 href="https://www.ipfire.org/donate">
89 {{ _("Donate") }}
90 </a>
91 </div>
92 </div>
93 {% elif hostname == "fireinfo.ipfire.org" %}
94 <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar"
95 aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
96 <span class="fas fa-bars"></span>
97 </button>
98
99 <div class="collapse navbar-collapse" id="navbar">
100 <ul class="navbar-nav ml-auto">
101 {% if current_user and current_user.is_staff() %}
102 <li class="nav-item">
103 <a class="nav-link {% if request.path.startswith("/admin") %}is-active{% end %}" href="/admin">
104 {{ _("Admin") }}
105 </a>
106 </li>
107 {% end %}
108
109 <li class="nav-item">
110 <a class="nav-link {% if request.path.startswith("/vendors") %}is-active{% end %}" href="/vendors">
111 {{ _("Vendors") }}
112 </a>
113 </li>
114 </ul>
115 </div>
116 {% elif hostname == "location.ipfire.org" %}
117 <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar"
118 aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
119 <span class="fas fa-bars"></span>
120 </button>
121
122 <div class="collapse navbar-collapse" id="navbar">
123 <ul class="navbar-nav ml-auto">
124 <li class="nav-item">
125 <a class="nav-link {% if request.path == "/how-to-use" %}is-active{% end %}" href="/how-to-use">
126 {{ _("How To Use") }}
127 </a>
128 </li>
129
130 <li class="nav-item">
131 <a class="nav-link {% if request.path == "/download" %}is-active{% end %}" href="/download">
132 {{ _("Download") }}
133 </a>
134 </li>
135 </ul>
136
137 <a class="btn btn-primary ml-lg-2" href="https://www.ipfire.org/donate">
138 {{ _("Donate") }}
139 </a>
140 </div>
141 {% elif hostname == "nopaste.ipfire.org" %}
142 <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar"
143 aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
144 <span class="fas fa-bars"></span>
145 </button>
146
147 <div class="collapse navbar-collapse" id="navbar">
148 <ul class="navbar-nav ml-auto">
149 <li class="nav-item">
150 <a class="nav-link" href="/?mode=upload">{{ _("Upload File") }}</a>
151 </li>
152 </ul>
153 </div>
154 {% elif hostname == "wiki.ipfire.org" %}
155 <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar"
156 aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
157 <span class="fas fa-bars"></span>
158 </button>
159
160 <div class="collapse navbar-collapse" id="navbar">
161 <form class=" ml-auto my-2 my-lg-0" action="/search" method="GET">
162 <input class="form-control form-control-sm" type="search" name="q"
163 placeholder="{{ _("Search...") }}" aria-label="{{ _("Search") }}" value="{% try %}{{ q }}{% except %}{% end %}">
164 </form>
165
166 <a class="btn btn-primary ml-lg-2" href="https://www.ipfire.org/donate">
167 {{ _("Donate") }}
168 </a>
169 </div>
170 {% end %}
171 {% end block %}
172 </div>
173 </div>
174 </nav>
175
176 {% block container %}
177 <div class="container">
178 {% block content %}{% end block %}
179 </div>
180 {% end block %}
181
182 {% block footer %}
183 <footer class="footer">
184 <div class="container">
185 <div class="columns">
186 <div class="column is-two-fifths">
187 {# Show some profile information for users who are logged in #}
188 {% if current_user %}
189 <h4 class="title is-4 mb-0">{{ _("Hello, %s!") % current_user }}</h4>
190
191 <div class="level is-mobile">
192 <div class="level-left">
193 <a class="level-item" href="/users/{{ current_user.uid }}">
194 {{ _("My Profile") }}
195 </a>
196
197 <a class="level-item" href="/logout">
198 {{ _("Logout") }}
199 </a>
200 </div>
201 </div>
202
203 {# Otherwise encourage people to join #}
204 {% else %}
205 <p class="is-size-4">
206 <span class="has-text-weight-bold">IPFire</span><span class="has-text-primary has-text-weight-bold">_</span>People
207 </p>
208
209 <p>
210 Join the community and sign up for our newsletter
211 </p>
212
213 <a class="button is-primary is-outlined is-medium
214 has-text-black has-text-weight-bold" href="/register">
215 JOIN NOW
216 </a>
217 {% end %}
218 </div>
219
220 <div class="column is-one-fifth">
221 <ul>
222 <li>
223 <a href="/about">
224 {{ _("About") }}
225 </a>
226 </li>
227 <li>
228 <a href="https://wiki.ipfire.org">
229 {{ _("Wiki") }}
230 </a>
231 </li>
232 <li>
233 <a href="/help">
234 {{ _("Help") }}
235 </a>
236 </li>
237 <li>
238 <a href="https://wiki.ipfire.org/devel">
239 {{ _("Development") }}
240 </a>
241 </li>
242 </ul>
243 </div>
244
245 <div class="column is-one-fifth">
246 <ul>
247 <li>
248 <a href="/download">
249 {{ _("Download") }}
250 </a>
251 </li>
252 <li>
253 <a href="/blog">
254 {{ _("Blog") }}
255 </a>
256 </li>
257 <li>
258 <a href="https://community.ipfire.org/">
259 {{ _("Community") }}
260 </a>
261 </li>
262 <li>
263 <a href="/legal">
264 {{ _("Legal") }}
265 </a>
266 </li>
267 </ul>
268 </div>
269
270 <div class="column is-one-fifth">
271 <div class="block">
272 <a class="button is-primary is-fullwidth is-medium has-text-weight-bold is-uppercase"
273 href="https://www.ipfire.org/donate">
274 {{ _("Donate") }}
275 </a>
276 </div>
277
278 <div class="block">
279 <div class="level is-mobile">
280 <div class="level-item">
281 <a href="https://twitter.com/ipfire">
282 <i class="fa-brands fa-twitter"></i>
283 </a>
284 </div>
285 <div class="level-item">
286 <a href="https://linkedin.com/company/ipfire">
287 <i class="fa-brands fa-linkedin-in"></i>
288 </a>
289 </dif>
290 </div>
291 </div>
292 </div>
293 </div>
294 </div>
295 </footer>
296 {% end block %}
297
298 <script src="{{ static_url("js/jquery-3.6.0.min.js") }}"></script>
299 <script src="{{ static_url("js/site.js") }}"></script>
300 {% block javascript %}{% end block %}
301 </body>
302 </html>