Skip to content

Commit 3f4a243

Browse files
committed
Add Tags to Game Upload
1 parent 2382bca commit 3f4a243

File tree

4 files changed

+511
-3
lines changed

4 files changed

+511
-3
lines changed

src/app.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,14 @@ def uploadgame():
4040
icon = flask.request.files['icon']
4141
title = flask.request.form['title']
4242
description = flask.request.form['description']
43+
tags = flask.request.form['tags']
4344
author = current_user.id
4445
file = {
4546
'game': ("game.zip", game.stream, "application/zip"),
4647
'banner': ("banner", banner.stream, banner.mimetype),
4748
'icon': ("icon", icon.stream, icon.mimetype)
4849
}
49-
fields = {'title': title, 'description': description, 'author':author}
50+
fields = {'title': title, 'description': description, 'author': author, 'tags': tags}
5051
r = requests.post(app.config["DEVCADE_API_URI"] + "games/", files=file, data=fields, headers={"frontend_api_key":app.config["FRONTEND_API_KEY"]})
5152
if r.status_code == 201:
5253
return flask.redirect('/catalog')
@@ -58,12 +59,13 @@ def uploadpage():
5859
usergames = []
5960
try:
6061
games = requests.get(app.config["DEVCADE_API_URI"] + "games/").json()
62+
tags = requests.get(app.config["DEVCADE_API_URI"] + "tags/").json()
6163
for i in games:
6264
if i['author'] == current_user.id:
6365
usergames.append(i)
6466
except(Exception):
6567
print("api offline")
66-
return flask.render_template('upload.html', title='Devcade - Upload', gamelist=usergames)
68+
return flask.render_template('upload.html', title='Devcade - Upload', gamelist=usergames, tags=tags)
6769

6870
@app.route('/download/<id>')
6971
def download(id):

src/static/css/devcade.css

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,3 +418,53 @@ a:hover {
418418
width: unset;
419419
}
420420
}
421+
422+
multi-checkbox {
423+
/* Element */
424+
--mc-border: 1px solid #000000;
425+
--mc-border-radius: 2px;
426+
--mc-display: inline-block;
427+
--mc-font: 400 0.9em Arial;
428+
--mc-vertical-align: middle;
429+
/* Dropdown */
430+
--mc-dropdown-background: #efefef;
431+
--mc-dropdown-box-shadow: 3px 3px 5px 1px rgba(0,0,0,0.35);
432+
--mc-dropdown-width: 209px;
433+
/* Input */
434+
--mc-target-background: #efefef;
435+
--mc-target-color: #000000;
436+
--mc-target-cursor: default;
437+
--mc-target-height: 28px;
438+
--mc-target-margin: 0;
439+
--mc-target-max-height: default;
440+
--mc-target-min-height: default;
441+
--mc-target-max-width: default;
442+
--mc-target-min-width: default;
443+
--mc-target-padding: 0px 0px 0px 3px;
444+
--mc-target-outline: none;
445+
--mc-target-width: 175px;
446+
/* Dropdown Line Items */
447+
--mc-dropdown-color: #000000;
448+
--mc-dropdown-line-height: 2em;
449+
--mc-ul-margin: 5px;
450+
--mc-ul-padding: 0;
451+
/* Toggle Button */
452+
--mc-toggle-button-background: #ffffff;
453+
--mc-toggle-button-color: #000000;
454+
--mc-toggle-button-cursor: pointer;
455+
--mc-toggle-button-height: 30px;
456+
--mc-toggle-button-outline: none;
457+
--mc-toggle-button-width: 30px;
458+
/* Close Button */
459+
--mc-close-button-background: #efefef;
460+
--mc-close-button-border: none;
461+
--mc-close-button-border-radius: default;
462+
--mc-close-button-color: #000000;
463+
--mc-close-button-cursor: pointer;
464+
--mc-close-button-display: block;
465+
--mc-close-button-height: 30px;
466+
--mc-close-button-margin: 5px auto;
467+
--mc-close-button-outline: none;
468+
--mc-close-button-width: 30px;
469+
--fg: #000000;
470+
}

0 commit comments

Comments
 (0)