Proper pages

This commit is contained in:
Dominik V. Salonen 2015-12-24 13:46:05 +01:00
parent 47c37a9fc7
commit a5df899979
6 changed files with 165 additions and 33 deletions

4
run.py
View File

@ -99,11 +99,11 @@ def upload_file():
@app.route('/about')
def about():
return render_template('about.html')
return render_template('about.html', page=config["SITE_DATA"])
@app.route('/terms')
def terms():
return render_template('terms.html')
return render_template('terms.html', page=config["SITE_DATA"])
@app.route('/<filename>', methods=['GET'])

94
static/regular.css Normal file
View File

@ -0,0 +1,94 @@
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,300,700);
/* Being lazy 101 */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: "Open Sans", "Lato", sans-serif;
color: #ffffff;
background-color: #2d2d2d;
}
@keyframes rise {
from {margin-top: 50px;opacity:0;}
to {margin-top: 0;opacity:1;}
}
@keyframes appear {
from {opacity:0;}
to {opacity:1;}
}
.a4 {
width: 100%;
max-width: 920px;
padding: 15px;
margin-left: auto;
margin-right: auto;
animation: appear 0.75s ease-out;
}
.a4 .title {
font-size: 24pt;
font-weight: 300;
text-align: right;
margin: 0;
animation: rise 0.75s ease-out;
}
.title {
font-size: 34pt;
font-weight: 300;
margin-bottom: 20px;
text-align: center;
animation: appear 0.75s ease-out;
}
.links {
font-size: 0;
margin-top: 20px;
text-align: center;
list-style: none;
}
.links li {
font-size: 12pt;
display: inline-block;
padding: 5px;
width: 25%;
animation: rise 1s ease-out;
}
.links li a {
color: inherit;
text-decoration: none;
}
.links li a:hover {
text-decoration: underline;
}
/* Restyle with custom margins */
p {
margin-top: 5px;
margin-bottom: 10px;
}
h1 {
margin-top: 15px;
margin-bottom: 5px;
}
a {
color: inherit;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}

View File

@ -15,12 +15,12 @@ body {
@keyframes rise {
from {margin-top: 50px;opacity:0;}
to {margin-top: 0;opacity1;}
to {margin-top: 0;opacity:1;}
}
@keyframes appear {
from {opacity:0;}
to {opacity1;}
to {opacity:1;}
}
.page {

View File

@ -1,14 +1,40 @@
{% extends "regular.html" %}
{% block body %}
<html>
<head>
<title>QuadFile info</title>
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='style.css') }}">
</head>
<body>
<h1>
Temporary storage
</h1>
<p>
{{ page.title }} is now a temporary storage service.
</p>
<p>
I've shifted from permanent storage to temporary storage. The main reason being that about 93% of files uploaded to the old site were never accessed again after the first week.
</p>
<p>
Now hold your horses - We don't delete files one week after upload. We delete them one week after they were last accessed.
</p>
<p>
Meaning that if you upload a file on December 10th and someone accesses that file on the 13th. Then we won't delete the file until the 20th. If someone then visits the file on the 17th, the counter resets again and your file will stay until December 25th.
</p>
<p>
This page is not yet done, just know this: Files are cleaned at set interval, do not use this for long time storage.
</p>
<h1>
History
</h1>
<p>
{{ page.title }} was a file sharing service that ran from 2014 into mid-2015. People loved it. It was fast, free, and extremely dumb-ass-simple to use, everything you'd want.
</p>
<p>
Unfortunately, running a service like that isn't really easy, nor affordable. So it ended up shutting down.
</p>
</body>
</html>
<h1>
The new {{ page.title }}
</h1>
<p>
Christmas 2015, {{ page.title }} returned, better than ever.
</p>
<p>
It now uses a database (SQLite counts okay, don't hate me), it has been rewritten from scratch using Python, it's multi-threaded, it rocks. Resource usage is approximately one fourth that of the old site - while also being faster
</p>
{% endblock %}

17
templates/regular.html Normal file
View File

@ -0,0 +1,17 @@
<!doctype html>
<html>
<head>
<title>{{ page.title }}</title>
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='regular.css') }}">
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div class="a4">
<h1 class="title">
<a href="/">{{ page.title }}</a>
</h1>
{% block body %}{% endblock %}
</div>
</body>
</html>

View File

@ -1,19 +1,14 @@
<html>
<head>
<title>QuadFile info</title>
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='style.css') }}">
</head>
<body>
<p>This section is currently not complete, more will be added</p>
<h1 id="limits">Limits</h1>
{% extends "regular.html" %}
{% block body %}
<h1 id="limits">Terms</h1>
<ul>
<li><strong>You</strong> are responsible for the file you upload</li>
<li>The max file size is <strong>100 MB</strong></li>
<li>Files may be deleted if requested by the content owner</li>
<li>If I find illegal content (eg. CP, viruses and such) it will instantly be deleted</li>
<li>Only certain filetypes are allowed</li>
</ul>
</body>
</html>
<li><strong>You</strong> are responsible for the file you upload</li>
<li>The max file size is <strong>100 MiB</strong></li>
<li>Files are deleted when they haven't been accessed for a week.</li>
<li>Files may be deleted if requested by the content owner</li>
<li>If I find illegal content (eg. CP, viruses and such) it will instantly be deleted</li>
<li>Only certain filetypes are allowed</li>
<li>More terms may be added to this list without warning</li>
<li>TL;DR Don't be an asshole and blame me for something that happens</li>
</ul>
{% endblock %}