mirror of
https://github.com/Lynnesbian/FediBooks/
synced 2024-11-25 16:48:58 +00:00
Compare commits
3 commits
669babf033
...
098fd2654b
Author | SHA1 | Date | |
---|---|---|---|
098fd2654b | |||
e1d8205cfd | |||
c04cec6aa8 |
5 changed files with 114 additions and 9 deletions
|
@ -3,6 +3,8 @@ body {
|
|||
margin: 2.5%;
|
||||
background-color: #282c37;
|
||||
color: white;
|
||||
}
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
|
@ -10,7 +12,7 @@ body {
|
|||
background-color: #444a5c;
|
||||
padding:10px;
|
||||
}
|
||||
.container.light {
|
||||
.light {
|
||||
background-color: #4d5366;
|
||||
}
|
||||
.column {
|
||||
|
@ -21,6 +23,9 @@ body {
|
|||
.large {
|
||||
font-size: 1.2em;
|
||||
}
|
||||
.small {
|
||||
font-size: 0.8em;
|
||||
}
|
||||
.centred {
|
||||
text-align: center;
|
||||
}
|
||||
|
@ -37,6 +42,27 @@ body {
|
|||
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 {
|
||||
color: white;
|
||||
line-height:1.2em;
|
||||
|
@ -52,6 +78,7 @@ body {
|
|||
}
|
||||
input.button {
|
||||
font-size: 1em;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
|
@ -74,6 +101,13 @@ input.button {
|
|||
font-size: 1.6em;
|
||||
}
|
||||
|
||||
.btn-dangerous {
|
||||
background-color: #e22;
|
||||
}
|
||||
.btn-dangerous:hover {
|
||||
background-color: #c22;
|
||||
}
|
||||
|
||||
a {
|
||||
color: mediumpurple;
|
||||
text-decoration: none;
|
||||
|
@ -101,3 +135,14 @@ label.important {
|
|||
font-weight: 300;
|
||||
display:block;
|
||||
}
|
||||
input {
|
||||
width: 100%;
|
||||
font-size: 1.2em;
|
||||
line-height:1.4em;
|
||||
border: 3px grey solid;
|
||||
border-radius: none;
|
||||
padding: 3px;
|
||||
}
|
||||
input:focus {
|
||||
border: 3px mediumpurple solid;
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="column">
|
||||
<h2>Easy <i class="fas fa-check"></i></h2>
|
||||
<h2>Simple <i class="fas fa-check"></i></h2>
|
||||
<p>FediBooks is easy to use. Everything from the profile picture to the accounts learned from is customisable with an intuitive web UI.</p>
|
||||
</div>
|
||||
<div class="column">
|
||||
|
|
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" title="Turn on/off"><i class="fas fa-power-off"></i></a><a class="button btn-secondary" href="/bot/edit/insert id here" title="Edit"><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>
|
|
@ -8,19 +8,29 @@
|
|||
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1 class="thin centred">Log in</h1>
|
||||
<h1 class="thin centred">{% if signup %}Sign up{% else %}Log in{% endif %}</h1>
|
||||
</div>
|
||||
|
||||
<div class="container centred">
|
||||
<form action="/do/login" method="POST">
|
||||
<form action="/do/{% if signup %}signup{% else %}login{% endif %}" method="POST">
|
||||
<p>
|
||||
<label for="email" class="important">Email</label>
|
||||
<input type="email" name="email" placeholder="you@example.com">
|
||||
{% if signup %}
|
||||
<p class="small">
|
||||
FediBooks requires your email address in order to send you alerts when your bot stops working, and for password resets.
|
||||
</p>
|
||||
{% endif %}
|
||||
<br>
|
||||
<label for="password" class="important">Password</label>
|
||||
<input type="password" name="password" placeholder="password">
|
||||
<input type="password" name="password">
|
||||
{% if signup %}
|
||||
<p class="small">
|
||||
Passwords must be at least eight characters long.
|
||||
</p>
|
||||
<input type="submit" value="Log in" class="button btn-primary full-width">
|
||||
{% endif %}
|
||||
</p>
|
||||
<input type="submit" value="{% if signup %}Create my account{% else %}Log in{% endif %}" class="button btn-primary full-width">
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
|
13
webui.py
13
webui.py
|
@ -1,9 +1,14 @@
|
|||
from flask import Flask, render_template
|
||||
from flask import Flask, render_template, session
|
||||
|
||||
app = Flask(__name__)
|
||||
app.secret_key = "debug key"
|
||||
|
||||
@app.route("/")
|
||||
def hello():
|
||||
session['userid'] = 1
|
||||
if 'userid' in session:
|
||||
return render_template("home.html")
|
||||
else:
|
||||
return render_template("front_page.html")
|
||||
|
||||
@app.route("/welcome")
|
||||
|
@ -12,4 +17,8 @@ def welcome():
|
|||
|
||||
@app.route("/login")
|
||||
def show_login_page():
|
||||
return render_template("login.html")
|
||||
return render_template("login.html", signup = False)
|
||||
|
||||
@app.route("/signup")
|
||||
def show_signup_page():
|
||||
return render_template("login.html", signup = True)
|
||||
|
|
Loading…
Reference in a new issue