diff options
author | rubenwardy <rw@rubenwardy.com> | 2018-03-19 18:08:41 +0000 |
---|---|---|
committer | rubenwardy <rw@rubenwardy.com> | 2018-03-19 18:08:41 +0000 |
commit | 358fc4e5da67d5ebbb667d6bcafba7c7fa83ca97 (patch) | |
tree | 1a61b188daee7f582dcbad27b6592c11e2d51cef /app/views/mods.py | |
parent | 84f123a0ab529ac8a649e0e0ca4a49fd0c828db3 (diff) | |
download | cheatdb-358fc4e5da67d5ebbb667d6bcafba7c7fa83ca97.tar.xz |
Add package list and package view
Diffstat (limited to 'app/views/mods.py')
-rw-r--r-- | app/views/mods.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/views/mods.py b/app/views/mods.py new file mode 100644 index 0000000..ca349ea --- /dev/null +++ b/app/views/mods.py @@ -0,0 +1,19 @@ +from flask import * +from flask_user import * +from flask.ext import menu +from app import app +from app.models import * + +@app.route('/mods/') +@menu.register_menu(app, '.mods', 'Mods') +def mods_page(): + packages = Mod.query.all() + return render_template('packages.html', title="Mods", packages=packages) + +@app.route("/<type>s/<author>/<name>/") +def package_page(type, author, name): + package = Mod.query.filter_by(name=name).first() + if package is None: + abort(404) + + return render_template('package_details.html', package=package) |