File tree Expand file tree Collapse file tree 4 files changed +15
-0
lines changed
Expand file tree Collapse file tree 4 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,10 @@ def homepage():
1414
1515@app .route ('/catalog' )
1616def catalogpage ():
17+ tag = flask .request .args .get ("tag" )
1718 games = requests .get (app .config ["DEVCADE_API_URI" ] + "games/" ).json ()
19+ if tag :
20+ games = list (filter (lambda g : tag in map (lambda t : t ['name' ], g ['tags' ]), games ))
1821 return flask .render_template ('catalog.html' , gamelist = games )
1922
2023@app .route ('/user' )
Original file line number Diff line number Diff line change 55from flask_sqlalchemy import SQLAlchemy
66from flask_pyoidc .flask_pyoidc import OIDCAuthentication
77from flask_pyoidc .provider_configuration import ProviderConfiguration , ClientMetadata
8+ from urllib .parse import quote_plus
89
910
1011app = flask .Flask (__name__ )
12+ app .jinja_env .filters ['quote_plus' ] = lambda u : quote_plus (u )
1113try :
1214 app .config .from_pyfile (os .path .join (os .getcwd (), "config.py" ))
1315except :
Original file line number Diff line number Diff line change 11{% extends "header.html" %} {% block headertext %} Game Catalog {%endblock%} {%
22block content %}
3+ < div class ="card-wrapper ">
4+ {% for tag in tags %}
5+ < a class ="btn btn-red " href ="/catalog?tag={{tag.name|quote_plus}} "> {{tag.name}}</ a >
6+ {% endfor %}
7+ </ div >
38< div class ="card-wrapper ">
49 {% for i in range(0,gamelist|length) %}
510 {% if "CSH Only" not in gamelist[i].tags|map(attribute="name") or current_user.user_type == "CSH" %}
Original file line number Diff line number Diff line change 11{% extends "header.html" %} {% block title %}Devcade - {{game.name}}
22{%endblock %} {% block content %}
33< div class ="card-wrapper "> {{ gamecard(game) }}</ div >
4+ < div class ="card-wrapper ">
5+ {% for tag in game.tags %}
6+ < a class ="btn btn-red " href ="/catalog?tag={{tag.name|quote_plus}} "> {{tag.name}}</ a >
7+ {% endfor %}
8+ </ div >
49< div class ="card-wrapper ">
510 < a class ="btn btn-red " href ="/download/{{ game.id }} "> Download Game</ a >
611</ div >
You can’t perform that action at this time.
0 commit comments