forked from Good-Old-Downloads/sg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.twig
463 lines (445 loc) · 18.9 KB
/
main.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
{#
SceneGames
Copyright (C) 2018 GoodOldDownloads
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
<!--
Scene Games
_____ ______________
/ / / /
/ / /_____________/
/ /
/ /
/ /____ _____________
/____ / / |
/ / /__________ |
/ / | |
/ / _____________| |
/ / / z |
/____/ /__________________|
Translators:
German - Venom, knabberfee
Spanish - .Rar
Russian - Haoose
Greek - MnSXx
Arabic - ahmadmob
Estonian - Timo654
French (soon tm) - Julien
Brazilian/Portuguese (soon tm) - Matheus
-->
{% set baseUrl = base_url()|replace({'http://': '', 'https://': ''}) %}
{% if base_url()|slice(0, 5) == "http:" %}
{% set urlScheme = "http://" %}
{% elseif base_url()|slice(0, 5) == "https" %}
{% set urlScheme = "https://" %}
{% endif %}
<!DOCTYPE html>
<html lang="{% if language and language['ISO-639-1'] != 'hodor' %}{{ language['ISO-639-1'] }}{% else %}en{% endif %}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no, user-scalable=no">
<title>{% block title %}{% endblock title %} | Good Old Downloads</title>
{{ loadCSS(['/static/css/style.css'], []) }}
<link rel="icon" type="image/png" href="/static/img/favicon-16.png" sizes="16x16">
<link rel="icon" type="image/png" href="/static/img/favicon-32.png" sizes="32x32">
<link rel="icon" type="image/png" href="/static/img/favicon-96.png" sizes="96x96">
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Scene Games Search - Good Old Downloads">
<link rel="apple-touch-icon" href="/static/img/apple-120.png">
<link rel="apple-touch-icon" sizes="180x180" href="/static/img/apple-180.png">
<link rel="apple-touch-icon" sizes="152x152" href="/static/img/apple-152.png">
<link rel="apple-touch-icon" sizes="167x167" href="/static/img/apple-167.png">
<meta name="theme-color" content="#ffd943">
<meta property="twitter:site" content="@goddownloads">
<meta property="og:type" content="website">
<meta property="og:site_name" content="GoodOldDownloads.com">
<meta property="og:title" content="{{ block('title') }}">
{% block meta %}
<meta property="og:image" content="{{ base_url() }}/static/img/apple-180.png">
{% endblock meta %}
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body class="no-js">
{# Template for search box javascript additions #}
{% verbatim %}
<script id="tpl-search" type="text/template">
<div class="game">
<b><a href="/game/{{ gameSlug }}/">{{ gameName }}</a></b>
<div class="releases">
{{#releases}}
<span class="release">{{ name }} <a href="#" data-nfo="{{ name }}">[NFO]</a></span>
{{/releases}}
</div>
</div>
</script>
{% endverbatim %}
<div id="darken" data-hide-autocomplete="hidden"></div>
<div id="search-results">
<div class="inner"></div>
</div>
<div id="navigation" class="headroom">
<div class="container nomargin">
<div id="logo">
<a href="/" title="{{'Home'|trans}}"><img src="/static/img/logo.svg"></a>
</div>
<form id="search-bar" action="/search/" method="get">
<input type="search" name="s" autocomplete="off" placeholder="{{'Search'|trans}}" {% if term is defined and isGroup == false %}value="{{ term }}"{% endif %}>
<button type="submit" id="search-btn">
<i class="fas fa-search fa-fw"></i>
</button>
</form>
<div class="othersite">
<a href="{{ urlScheme ~ 'goggames.' ~ baseUrl|replace({'scenegames.': ''}) }}" title="{{ 'Go to GOG Games'|trans }}"><img src="/static/img/logo_god.svg"></a>
</div>
<div class="dropdown hide-until-sm">
<button>{{'Explore'|trans}}<i class="fas fa-right fa-caret-down"></i></button>
<label>
<input type="checkbox">
<ul>
<li><a href="/search/all/">{{'All Games'|trans}}</a></li>
{# <li>{{'P2P (Soon™?)'|trans}}</li> #}
<li class="divider"></li>
{% for genre in glob_genres %}
<li><a href="/search/all/?genres={{ genre.slug }}">{{ genre.name }}</a></li>
{% endfor %}
</ul>
</label>
</div>
<a class="btn hide-until-sm" href="/faq">{{'FAQ'|trans}}</a>
<a class="btn hide-until-sm" href="/queue">{{'QUEUE'|trans}}</a>
<div class="dropdown hide-until-sm" title="{{'RSS Feeds'|trans}}">
<button><i class="fas fa-fw fa-norm fa-rss"></i><i class="fas fa-right fa-caret-down"></i></button>
<label>
<input type="checkbox">
<ul>
<li><a href="/rss/releases" title="{{'Feed for RSS readers'|trans}}">{{'RSS Feed'|trans}}</a></li>
<li><a href="/rss/torrents" title="{{'Feed for torrent clients to auto download'|trans}}">{{'Torrent Clients'|trans}}</a></li>
</ul>
</label>
</div>
{% if was_user and user == false %}
<a class="btn hide-until-sm" href="/login">{{'Login'|trans}}</a>
{% endif %}
{% if user %}
{% if user.class == 'ADMIN' %}
<a class="btn hide-until-sm" href="/admin">{{'Admin'|trans}}</a>
{% endif %}
<a class="btn hide-until-sm" href="/logout">{{'Logout'|trans}}</a>
{% endif %}
<div class="dropdown hide-until-sm" title="{{'Change Language'|trans}}">
<button><i class="fas fa-fw fa-lg fa-language"></i><i class="fas fa-right fa-caret-down"></i></button>
<label>
<input type="checkbox">
<ul>
<form method="post">
<li><button type="submit" value="de_DE" name="setlang">Deutsch</button></li>
<li><button type="submit" value="et_EE" name="setlang">Eesti</button></li>
<li><button type="submit" value="en_US" name="setlang">English</button></li>
<li><button type="submit" value="es_ES" name="setlang">Español</button></li>
<li><button type="submit" value="el_GR" name="setlang">Ελληνικά</button></li>
<li><button type="submit" value="ru_RU" name="setlang">Русский</button></li>
<li><button type="submit" value="ar_SA" name="setlang">العربية</button></li>
<li><button type="submit" value="en_CA" name="setlang">{{'Hodor'|trans}}</button></li>
</form>
</ul>
</label>
</div>
</div>
</div>
<div id="navigation-mobile" class="headroom">
<a {% if currentPage == 'home' %}href="#"{% else %}href="/"{% endif %} class="nav-item{% if currentPage == 'home' %} active{% endif %}">
<div class="icon"><i class="fas fa-home"></i></div>
<div class="label">{{'Home'|trans}}</div>
</a>
<a {% if currentPage == 'search' %}href="#"{% else %}href="/search/all/"{% endif %} class="nav-item{% if currentPage == 'search' %} active{% endif %}">
<div class="icon"><i class="fas fa-th"></i></div>
<div class="label">{{'Browse'|trans}}</div>
</a>
<a {% if currentPage == 'queue' %}href="#"{% else %}href="/queue/"{% endif %} class="nav-item{% if currentPage == 'queue' %} active{% endif %}">
<div class="icon"><i class="fas fa-list-ol"></i></div>
<div class="label">{{'Queue'|trans}}</div>
</a>
<a {% if currentPage == 'faq' %}href="#"{% else %}href="/faq/"{% endif %} class="nav-item{% if currentPage == 'faq' %} active{% endif %}">
<div class="icon"><i class="fas fa-question"></i></div>
<div class="label">{{'FAQ'|trans}}</div>
</a>
{% if was_user and user == false %}
<a href="/login" class="nav-item">
<div class="icon"><i class="fas fa-sign-in-alt"></i></div>
<div class="label">{{'Login'|trans}}</div>
</a>
{% endif %}
{% if user %}
{% if user.class == 'ADMIN' %}
<a {% if currentPage == 'admin' %}href="#"{% else %}href="/admin/"{% endif %} class="nav-item{% if currentPage == 'admin' %} active{% endif %}">
<div class="icon"><i class="fas fa-cogs"></i></div>
<div class="label">{{'Admin'|trans}}</div>
</a>
{% endif %}
{% endif %}
</div>
{% if user and user.class == 'ADMIN' %}
{# Template for search box javascript additions #}
{% verbatim %}
<script id="tpl-editgame" type="text/template">
<h3>Edit Releases</h3>
<table class="releases">
<thead>
<tr>
<td><input type="checkbox" class="releases-select-all"></td>
<td>
<form method="post" enctype="multipart/form-data" class="releases-batch-edit">
<select name="action" class="releases-batch-action">
<option value="move">Move</option>
<option value="delete">Delete</option>
</select>
<div class="game-autocomplete">
<input name="game_to" type="text" autocomplete="off" placeholder="Game ID or Start Typing...">
<ul></ul>
</div>
<input type="hidden" name="game_id" value="{{ id }}">
<button type="submit">Do it!</button>
</form>
</td>
</tr>
</thead>
<tbody>
{{#releases}}
<tr>
<td class="batch-checkbox">
<input type="checkbox" class="release-check" value="{{ id }}">
</td>
<td>
<details>
<summary>{{ name }}</summary>
<div>
<form method="post" enctype="multipart/form-data" class="form-release-edit">
<div class="form-input small">
<b>Name:</b> <input type="text" name="name" value="{{ name }}">
</div>
<div class="form-input small">
<b>Group:</b> <code>{{ group }}</code>
</div>
<div class="form-input small">
<b>P2P:</b> <input type="checkbox" name="p2p" {{#is_p2p}}checked{{/is_p2p}}>
</div>
<div class="form-input small">
<b>Date:</b> <input type="date" name="date" value="{{#renderDate}}{{ date }}{{/renderDate}}">
</div>
<div class="form-input small">
<b>Torrent:</b> <input type="text" name="torrent" value="{{ torrent }}">
</div>
<div class="form-input small">
<b>Magnet: (Can also just put in a torrent hash)</b> <input type="text" name="magnet" value="{{ magnet }}">
</div>
<div class="form-input small">
<b>State:</b>
<select name="state">
<option value="COMPLETE" {{#ifselected}}{"status":"{{ state }}", "value":"COMPLETE"}{{/ifselected}}>COMPLETE</option>
<option value="UPLOADING" {{#ifselected}}{"status":"{{ state }}", "value":"UPLOADING"}{{/ifselected}}>UPLOADING</option>
</select>
</div>
<input type="hidden" name="release_id" value="{{ id }}">
<input type="hidden" name="edit_type" value="release">
<button type="submit">Save</button>
</form>
<form method="post" enctype="multipart/form-data" class="form-release-editnfo">
<div class="form-input small">
<b>NFO:</b> <input type="file" name="nfo" accept=".txt,.nfo">
<input type="hidden" name="rlsName" value="{{ name }}">
<button type="submit">Update NFO</button>
</div>
</form>
<b>Links:</b>
<table class="links">
<tbody>
<tr>
<td><input type="checkbox" class="links-select-all"></td>
<td>
<button class="btn links-delete-batch">Delete</button>
</td>
</tr>
{{#links}}
<tr>
<td class="batch-checkbox">
<input type="checkbox" class="link-check" value="{{ id }}">
</td>
<td>
<details>
<summary>{{ link }}</summary>
<div>
<form method="post" enctype="multipart/form-data" class="form-release-editlink">
<div class="form-input small">
<b>File Name:</b> <input type="text" name="filename" value="{{ file_name }}">
<b>Link:</b> <input type="text" name="link" value="{{ link }}">
<b>Status:</b>
<select name="status">
<option value="DONE" {{#if}}{"status":"{{ status }}", "value":"DONE"}{{/if}}>Done</option>
<option value="UPLOADING" {{#ifselected}}{"status":"{{ status }}", "value":"UPLOADING"}{{/ifselected}}>Uploading</option>
</select>
<br>
<input type="hidden" name="id" value="{{ id }}">
<button type="submit">Update Link</button>
</div>
</form>
</div>
</details>
</td>
</tr>
{{/links}}
</tbody>
</table>
</div>
</details>
</td>
</tr>
{{/releases}}
</tbody>
</table>
<hr>
<h3>Edit Game</h3>
<form method="post" enctype="multipart/form-data" class="form-game-edit">
<b>Title:</b>
<div class="form-input small">
<input type="text" name="name" placeholder="Game Name" value="{{ name }}">
</div>
<b>Description:</b>
<div class="form-input small">
<textarea name="description" rows="5">{{ description }}</textarea>
</div>
<b>URL Slug:</b>
<div class="form-input small">
<input type="text" name="slug" value="{{ slug }}">
</div>
<b>Site URL:</b>
<div class="form-input small">
<input type="url" name="site" value="{{ site }}">
</div>
<b>Steam AppID:</b>
<div class="form-input small">
<input type="number" name="steam_id" value="{{ steam_id }}">
</div>
<input type="hidden" name="game_id" value="{{ id }}">
<input type="hidden" name="edit_type" value="game">
<button type="submit">Save</button>
</form>
<hr>
<h3>Edit Images</h3>
<p>Backgrounds will be resized to 1080p & 720p.<br>Posters width will be resized to 264px.</p>
<form method="post" enctype="multipart/form-data" class="form-images-edit">
<table>
<thead>
<tr>
<th>Cover ID</th>
<th>Screen ID</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>{{ cover_id }}</code></td>
<td><code>{{ screen_id }}</code></td>
</tr>
<tr>
<td>TGDB: <button type="button" class="form-images-edit-tgdb" data-game-name="{{ name }}" data-search-type="poster">Search</button></td>
<td>TGDB: <button type="button" class="form-images-edit-tgdb" data-game-name="{{ name }}" data-search-type="background">Search</button></td>
</tr>
<tr>
<td>URL: <input name="cover_url" type="text"></td>
<td>URL: <input name="screen_url" type="text"></td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="2"><div id="tgdb-selector-container"></div></td>
</tr>
</tfoot>
</table>
<input type="hidden" name="edit_type" value="images">
<input type="hidden" name="game_id" value="{{ id }}">
<button type="submit">Save</button>
</form>
<hr>
<h3>Other Info:</h3>
<table>
<thead>
<tr>
<th>ID</th>
<th>IGDB ID</th>
<th>Slug</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>{{ id }}</code></td>
<td><code>{{ igdb_id }}</code></td>
<td><code>{{ slug }}</code></td>
</tr>
</tbody>
</table>
</script>
{% endverbatim %}
{# Edit Box #}
<input class="modal-state" id="modal-editgame" type="checkbox">
<div class="modal">
<label class="modal__bg" for="modal-editgame"></label>
<div class="modal__inner">
<label class="modal__close" for="modal-editgame"></label>
<div class="editgame-container"></div>
</div>
</div>
{% endif %}
{# Captcha #}
<input class="modal-state" id="modal-captcha" type="checkbox">
<div class="modal">
<label class="modal__bg" for="modal-captcha"></label>
<div class="modal__inner nopad">
<label class="modal__close" for="modal-captcha"></label>
<div id="vote-captcha-success">
<h1>Successfully voted!</h1>
<p>Check the <a href="/queue">Queue</a> to see it's position!</p>
</div>
<div id="vote-captcha"></div>
<div id="vote-captcha-message"></div>
<div class="txt-center">
<button class="btn green hidden __vote">VOTE</button>
</div>
</div>
</div>
{# NFO Box #}
<input class="modal-state" id="modal-nfo" type="checkbox">
<div class="modal">
<label class="modal__bg" for="modal-nfo"></label>
<div class="modal__inner">
<label class="modal__close" for="modal-nfo"></label>
<div class="nfo-container">
<pre class="nfo">{{'Loading...'|trans}}</pre>
</div>
</div>
</div>
{% block content %}{% endblock content %}
{% if user %}
<script nonce="{{ nonce.script }}">
var __APIKEY = "{{ user.apikey }}";
</script>
{% endif %}
{{ loadJS(['/static/js/libs.min.js'], []) }}
{% if language %}<script nonce="{{ nonce.script }}">moment.locale("{{ language['ISO-639-1'] }}");</script>{% endif %}
{% if language['ISO-639-1'] == 'hodor' %}
{{ loadJS(['/static/js/moment.locale.hodor.js'], []) }}
{% endif %}
{{ loadJS(['/static/js/main.min.js'], []) }}
{% block scripts %}{% endblock scripts %}
</body>
</html>