diff options
| author | rubenwardy <rw@rubenwardy.com> | 2018-03-20 00:44:47 +0000 |
|---|---|---|
| committer | rubenwardy <rw@rubenwardy.com> | 2018-03-20 00:44:47 +0000 |
| commit | bc88027fbe2039aa509de6c958a1ab3939909539 (patch) | |
| tree | 8484e23292dea6bc01268dbe0b8a6ef598b264bc /app/views | |
| parent | ae600582a0ca98a1eb70971ee74640f7b59f1a9d (diff) | |
| download | cheatdb-bc88027fbe2039aa509de6c958a1ab3939909539.tar.xz | |
Add package types
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/__init__.py | 4 | ||||
| -rw-r--r-- | app/views/packages.py | 14 |
2 files changed, 15 insertions, 3 deletions
diff --git a/app/views/__init__.py b/app/views/__init__.py index 1c126c1..ed90875 100644 --- a/app/views/__init__.py +++ b/app/views/__init__.py @@ -14,9 +14,9 @@ cache = SimpleCache() def send_static(path): return send_from_directory('static', path) -import users, githublogin, mods - @app.route('/') @menu.register_menu(app, '.', 'Home') def home_page(): return render_template('index.html') + +from . import users, githublogin, packages diff --git a/app/views/packages.py b/app/views/packages.py index 10b3689..73c9edd 100644 --- a/app/views/packages.py +++ b/app/views/packages.py @@ -7,9 +7,21 @@ from app.models import * @app.route('/mods/') @menu.register_menu(app, '.mods', 'Mods') def mods_page(): - packages = Package.query.all() + packages = Package.query.filter_by(type=PackageType.MOD).all() return render_template('packages.html', title="Mods", packages=packages) +@app.route('/games/') +@menu.register_menu(app, '.games', 'Games') +def games_page(): + packages = Package.query.filter_by(type=PackageType.GAME).all() + return render_template('packages.html', title="Games", packages=packages) + +@app.route('/texturepacks/') +@menu.register_menu(app, '.txp', 'Texture Packs') +def txp_page(): + packages = Package.query.filter_by(type=PackageType.TXP).all() + return render_template('packages.html', title="Texture Packs", packages=packages) + @app.route("/<type>s/<author>/<name>/") def package_page(type, author, name): package = Package.query.filter_by(name=name).first() |
