mirror of
https://github.com/Lynnesbian/FediBooks/
synced 2024-11-25 16:48:58 +00:00
created 'home' page where users can manage their bots
This commit is contained in:
parent
c04cec6aa8
commit
e1d8205cfd
3 changed files with 77 additions and 3 deletions
|
@ -12,7 +12,7 @@ body {
|
||||||
background-color: #444a5c;
|
background-color: #444a5c;
|
||||||
padding:10px;
|
padding:10px;
|
||||||
}
|
}
|
||||||
.container.light {
|
.light {
|
||||||
background-color: #4d5366;
|
background-color: #4d5366;
|
||||||
}
|
}
|
||||||
.column {
|
.column {
|
||||||
|
@ -42,6 +42,27 @@ body {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bot-icon {
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
background: center/contain url("https://lynnesbian.space/img/bune.png");
|
||||||
|
}
|
||||||
|
.bot-icon, .bot-text, .bot-actions {
|
||||||
|
display: inline-block;
|
||||||
|
align-self: center;
|
||||||
|
}
|
||||||
|
.bot-text {
|
||||||
|
flex-grow: 1;
|
||||||
|
margin: 0 10px;
|
||||||
|
}
|
||||||
|
.bot-name {
|
||||||
|
font-size: 1.8em;
|
||||||
|
margin: 10px 0;
|
||||||
|
}
|
||||||
|
.bot-actions {
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
.button {
|
.button {
|
||||||
color: white;
|
color: white;
|
||||||
line-height:1.2em;
|
line-height:1.2em;
|
||||||
|
@ -80,6 +101,13 @@ input.button {
|
||||||
font-size: 1.6em;
|
font-size: 1.6em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.btn-dangerous {
|
||||||
|
background-color: #e22;
|
||||||
|
}
|
||||||
|
.btn-dangerous:hover {
|
||||||
|
background-color: #c22;
|
||||||
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: mediumpurple;
|
color: mediumpurple;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|
41
templates/home.html
Normal file
41
templates/home.html
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>FediBooks</title>
|
||||||
|
{% include 'imports.html' %}
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container light">
|
||||||
|
<h1 class='thin centred'>Home</h1>
|
||||||
|
<p class="centred large">Hi there! You have 1 bots, all of which are currently active.</p>
|
||||||
|
<p class="centred" style="margin: 50px 0;">
|
||||||
|
<a class="button btn-primary btn-large" href="/bot/new" role="button"><i class="fas fa-robot"></i> New bot</a>
|
||||||
|
<a class="button btn-secondary btn-large" href="/settings" role="button"><i class="fas fa-cog"></i> Account settings</a>
|
||||||
|
<a class="button btn-secondary btn-large" href="/do/signout" role="button"><i class="fas fa-sign-out-alt"></i> Sign out</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="container" style="min-height: 300px;">
|
||||||
|
<div class="row light">
|
||||||
|
<div class="bot-icon"></div>
|
||||||
|
<div class="bot-text">
|
||||||
|
<div class="bot-name">My bot!!</div>
|
||||||
|
<div class="bot-status">Online, learning from 3 accounts, 12345 posts in database</div>
|
||||||
|
</div>
|
||||||
|
<div class="bot-actions">
|
||||||
|
<a class="button btn-dangerous" href="/bot/toggle/insert id here"><i class="fas fa-power-off"></i></a><a class="button btn-secondary" href="/bot/edit/insert id here"><i class="fas fa-pencil-alt"></i></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<h2>Support the author <i class="fas fa-heart"></i></h2>
|
||||||
|
<p>FediBooks is a passion project I develop and maintain in my free time. If you'd like to contribute, you can do so here.</p>
|
||||||
|
<a class="button btn-primary" href="https://patreon.com/Lynnesbian" role="button"><i class="fab fa-patreon"></i> Patreon</a>
|
||||||
|
<a class="button btn-primary" href="https://paypal.me/Lynnesbian" role="button"><i class="fab fa-paypal"></i> PayPal</a>
|
||||||
|
<a class="button btn-primary" href="https://ko-fi.com/Lynnesbian" role="button"><i class="fas fa-coffee"></i> Ko-fi</a>
|
||||||
|
</div>
|
||||||
|
{% include 'footer.html' %}
|
||||||
|
</body>
|
||||||
|
</html>
|
7
webui.py
7
webui.py
|
@ -1,9 +1,14 @@
|
||||||
from flask import Flask, render_template
|
from flask import Flask, render_template, session
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
app.secret_key = "debug key"
|
||||||
|
|
||||||
@app.route("/")
|
@app.route("/")
|
||||||
def hello():
|
def hello():
|
||||||
|
session['userid'] = 1
|
||||||
|
if 'userid' in session:
|
||||||
|
return render_template("home.html")
|
||||||
|
else:
|
||||||
return render_template("front_page.html")
|
return render_template("front_page.html")
|
||||||
|
|
||||||
@app.route("/welcome")
|
@app.route("/welcome")
|
||||||
|
|
Loading…
Reference in a new issue