Compare commits
3 commits
main
...
ada/better
Author | SHA1 | Date | |
---|---|---|---|
67cad30e87 | |||
97ac3b1175 | |||
190e4ac2b9 |
6 changed files with 125 additions and 21 deletions
|
@ -87,3 +87,7 @@ def get_content(path: str) -> str:
|
|||
return render_template("content.html.j2")
|
||||
|
||||
return abort(404)
|
||||
|
||||
@home.route("/about")
|
||||
def about() -> str:
|
||||
return render_template("about.html.j2")
|
65
paste/static/css/main.css
Normal file
65
paste/static/css/main.css
Normal file
|
@ -0,0 +1,65 @@
|
|||
:root {
|
||||
--main-width: 85vw;
|
||||
--bg-color: white;
|
||||
--text-color: #212121;
|
||||
--a-color: #7e22ce;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--bg-color: #212121;
|
||||
--text-color: white;
|
||||
}
|
||||
}
|
||||
|
||||
/* large screen */
|
||||
@media only screen and (min-width: 868px) {
|
||||
:root {
|
||||
--main-width: 50vw;
|
||||
}
|
||||
}
|
||||
|
||||
html {
|
||||
font-family: sans-serif;
|
||||
scroll-behavior: smooth;
|
||||
color: var(--text-color);
|
||||
}
|
||||
|
||||
|
||||
body {
|
||||
max-width: var(--main-width);
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
background-color: var(--bg-color);
|
||||
line-height: 1.65
|
||||
}
|
||||
|
||||
.menu ul {
|
||||
list-style-type: none;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.menu {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.menu li {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--a-color);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: black;
|
||||
border-bottom: .2rem solid dimgrey;
|
||||
}
|
||||
|
||||
textarea {
|
||||
background-color: transparent;
|
||||
resize: none;
|
||||
width: 100%;
|
||||
height: 80vh;
|
||||
}
|
4
paste/templates/about.html.j2
Normal file
4
paste/templates/about.html.j2
Normal file
|
@ -0,0 +1,4 @@
|
|||
{% extends "base.html.j2" %}
|
||||
{% block content %}
|
||||
<p>Gnous/Paste</p>
|
||||
{% endblock %}
|
22
paste/templates/base.html.j2
Normal file
22
paste/templates/base.html.j2
Normal file
|
@ -0,0 +1,22 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Gnous/Paste</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}"/>
|
||||
</head>
|
||||
<body>
|
||||
<nav class="menu">
|
||||
<ul class="menu">
|
||||
<li class="menu" {% if request.path == "/" %}><a href="{{ url_for("home.about") }}">About</a>{% elif request.path == "/about" %}<a href="{{ url_for("home.homepage") }}">Home</a>{% endif %}</li>
|
||||
|
|
||||
<li class="menu"><a href="https://git.gnous.eu/gnouseu/paste">Source</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<main>
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
|
@ -1,16 +1,12 @@
|
|||
<form id="paste-content" method="POST" accept-charset="UTF-8" action="{{ url_for('home.create') }}">
|
||||
<textarea name="content" form="paste-content">Enter text here...</textarea>
|
||||
<label for="time">Time in second</label>
|
||||
<input id="time" name="time">
|
||||
<input type="submit">
|
||||
</form>
|
||||
{% extends "base.html.j2" %}
|
||||
{% block content %}
|
||||
{% with messages = get_flashed_messages(category_filter=["create"]) %}
|
||||
<div class="infobox">
|
||||
{% if messages[0] %}
|
||||
<p>Paste available at : <a href="{{ request.base_url }}{{ messages[0] }}">{{ messages[0] }}</a></p>
|
||||
{% endif %}
|
||||
{% if messages[1] %}
|
||||
<p>You can delete paste with : <a href="{{ request.base_url }}delete/{{ messages[0] }}?secret={{ messages[1] }}">delete</a></p>
|
||||
<p>Paste : <a href="{{ request.base_url }}{{ messages[0] }}">{{ messages[0] }}</a> | <a
|
||||
href="{{ request.base_url }}delete/{{ messages[0] }}?secret={{ messages[1] }}">delete</a></p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endwith %}
|
||||
|
||||
{% with messages = get_flashed_messages(category_filter=["delete"]) %}
|
||||
|
@ -18,4 +14,18 @@
|
|||
<p>Paste {{ messages[0] }} deleted </p>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
<form class="container" id="paste-content" method="POST" accept-charset="UTF-8"
|
||||
action="{{ url_for('home.create') }}">
|
||||
<textarea name="content" form="paste-content" placeholder="Enter your text here"></textarea>
|
||||
<input list="time" name="time">
|
||||
<datalist id="time">
|
||||
<option value="604800">7 days</option>
|
||||
<option value="86400">1 day</option>
|
||||
<option value="43200">12 hours</option>
|
||||
<option value="21600">6 hours</option>
|
||||
<option value="3600">1 hour</option>
|
||||
<option value="600">10 minutes</option>
|
||||
</datalist>
|
||||
<input type="submit">
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
|
|
@ -59,7 +59,6 @@ exclude = [
|
|||
"instances",
|
||||
"schema.sql"
|
||||
]
|
||||
format = "grouped"
|
||||
|
||||
[tool.isort]
|
||||
profile = "black"
|
||||
|
|
Reference in a new issue