2019-08-29 06:23:56 +00:00
|
|
|
from flask import Flask, render_template, session
|
2019-08-31 03:26:20 +00:00
|
|
|
import json
|
|
|
|
|
|
|
|
cfg = json.load(open("config.json"))
|
2019-08-27 10:36:54 +00:00
|
|
|
|
|
|
|
app = Flask(__name__)
|
2019-08-31 03:26:20 +00:00
|
|
|
app.secret_key = cfg['secret_key']
|
2019-08-27 10:36:54 +00:00
|
|
|
|
|
|
|
@app.route("/")
|
|
|
|
def hello():
|
2019-08-29 06:23:56 +00:00
|
|
|
session['userid'] = 1
|
2019-08-30 11:39:09 +00:00
|
|
|
# session.clear()
|
2019-08-29 06:23:56 +00:00
|
|
|
if 'userid' in session:
|
|
|
|
return render_template("home.html")
|
|
|
|
else:
|
|
|
|
return render_template("front_page.html")
|
2019-08-28 03:53:44 +00:00
|
|
|
|
2019-08-29 01:15:47 +00:00
|
|
|
@app.route("/welcome")
|
|
|
|
def welcome():
|
|
|
|
return render_template("welcome.html")
|
|
|
|
|
2019-08-30 12:30:59 +00:00
|
|
|
@app.route("/about")
|
|
|
|
def about():
|
|
|
|
return render_template("about.html")
|
|
|
|
|
2019-08-28 03:53:44 +00:00
|
|
|
@app.route("/login")
|
|
|
|
def show_login_page():
|
2019-08-29 05:08:11 +00:00
|
|
|
return render_template("login.html", signup = False)
|
|
|
|
|
|
|
|
@app.route("/signup")
|
|
|
|
def show_signup_page():
|
|
|
|
return render_template("login.html", signup = True)
|
2019-08-29 13:51:31 +00:00
|
|
|
|
2019-08-30 03:56:28 +00:00
|
|
|
@app.route("/settings")
|
|
|
|
def settings():
|
|
|
|
return render_template("settings.html")
|
|
|
|
|
2019-08-29 13:51:31 +00:00
|
|
|
@app.route("/bot/edit/<id>")
|
|
|
|
def bot_edit(id):
|
|
|
|
return render_template("bot_edit.html")
|
2019-08-30 08:52:13 +00:00
|
|
|
|
2019-08-30 11:28:34 +00:00
|
|
|
@app.route("/bot/delete/<id>")
|
|
|
|
def bot_delete(id):
|
|
|
|
return render_template("bot_delete.html")
|
|
|
|
|
2019-09-01 04:02:42 +00:00
|
|
|
@app.route("/bot/accounts/<id>")
|
|
|
|
def bot_accounts(id):
|
|
|
|
return render_template("bot_accounts.html")
|
|
|
|
|
2019-09-01 04:41:33 +00:00
|
|
|
@app.route("/bot/accounts/add")
|
|
|
|
def bot_accounts_add():
|
|
|
|
return render_template("bot_accounts_add.html")
|
|
|
|
|
2019-08-30 08:52:13 +00:00
|
|
|
@app.route("/bot/create/")
|
|
|
|
def bot_create():
|
2019-08-30 09:24:58 +00:00
|
|
|
session['step'] = 4
|
2019-08-30 09:02:48 +00:00
|
|
|
session['instance'] = "botsin.space"
|
|
|
|
session['instance_type'] = "Mastodon"
|
2019-08-30 08:52:13 +00:00
|
|
|
return render_template("bot_create.html")
|