|
|
@ -2,7 +2,7 @@ import sys |
|
|
|
|
|
|
|
from flask import Flask, render_template, request, redirect |
|
|
|
|
|
|
|
from items import get_items |
|
|
|
from items import get_items, get_worlds |
|
|
|
|
|
|
|
from random import choice, sample |
|
|
|
|
|
|
@ -24,24 +24,6 @@ def index(): |
|
|
|
|
|
|
|
return render_template('index.html',featureType=featureType,featureText=item) |
|
|
|
|
|
|
|
""" |
|
|
|
@app.route('/add') |
|
|
|
def addPage(): |
|
|
|
return render_template('add.html') |
|
|
|
|
|
|
|
@app.route('/addContent', methods=['POST']) |
|
|
|
def addContent(): |
|
|
|
bucket = request.form['bucket'] |
|
|
|
text = request.form['entry'] |
|
|
|
title = text.partition('\n')[0].lower().replace(".","").replace("/","").replace(" ","_").strip() |
|
|
|
if bucket in ["Items","Places","Characters","Spells"]: |
|
|
|
f = open("../" + bucket + "/" + title + ".txt",'x') |
|
|
|
f.write(text) |
|
|
|
f.close() |
|
|
|
return render_template('add.html') |
|
|
|
else: |
|
|
|
return "<h1>bruh</h1><p><b>Pls no.</b></p>" |
|
|
|
""" |
|
|
|
|
|
|
|
@app.route('/search', methods=['POST']) |
|
|
|
def search(): |
|
|
@ -75,6 +57,15 @@ def search(): |
|
|
|
|
|
|
|
return render_template('index.html',featureType=featureType,featureText=item, searchResults=results) |
|
|
|
|
|
|
|
@app.route("/marches") |
|
|
|
def marches(): |
|
|
|
return render_template('marches.html', worlds=get_worlds()) |
|
|
|
|
|
|
|
@app.route("/marches/worlds/<world>") |
|
|
|
def marchWorld(world): |
|
|
|
worldDir = "../Worlds/"+world |
|
|
|
return render_template("marchWorld.html",worldname=world) |
|
|
|
|
|
|
|
def bucket_route(uri, dir, sing=None): |
|
|
|
if sing is None: |
|
|
|
sing = dir[:-1] # minus "s" |
|
|
|