mirror of
https://github.com/minetest/contentdb.git
synced 2024-11-14 03:23:46 +01:00
20 lines
529 B
Python
20 lines
529 B
Python
|
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)
|