diff --git a/app.py b/app.py new file mode 100644 index 0000000..ad3e10f --- /dev/null +++ b/app.py @@ -0,0 +1,44 @@ +from flask import Flask, render_template, request, redirect, url_for +from os import path +from bs4 import BeautifulSoup + +app = Flask('ui', static_url_path="/static") +app.config['TEMPLATES_AUTO_RELOAD'] = True + +@app.route('/') +def slash(): + return render_template("index.html") + +@app.route("/ajout") +def ajout(): + return render_template("ajout.html") + +@app.route("/apropos") +def apropos(): + return render_template("apropos.html") + +@app.route("/bizutage", methods=["POST"]) +def bizutage(): + if request.method == "POST": + titre = request.values['titre'] + lien = request.values['lien'] + desc = request.values['desc'] + nouvLien = "

{}

Lien


{}

".format(titre, lien, desc) + nouvLienHtml = BeautifulSoup(nouvLien, "html.parser") + with open("templates/index.html", 'r') as file: + soup = BeautifulSoup(file, 'html.parser') + soup.find("hr").append(nouvLienHtml) + with open("templates/index.html", 'w') as file: + file.write(soup.prettify()) + + with open("lite/index.html", 'r') as file: + soup = BeautifulSoup(file, 'html.parser') + soup.find("hr").append(nouvLienHtml) + with open("lite/index.html", 'w') as file: + file.write(soup.prettify()) + else: + print("error") + return redirect(url_for("ajout")) + +if __name__ == "__main__": + app.run() diff --git a/lite/ajout.html b/lite/ajout.html new file mode 100644 index 0000000..71d0aa3 --- /dev/null +++ b/lite/ajout.html @@ -0,0 +1,27 @@ + + + + + + + Ajout + + + +
+ +
+ + + + +
+ + diff --git a/lite/apropos.html b/lite/apropos.html new file mode 100644 index 0000000..df3ecc7 --- /dev/null +++ b/lite/apropos.html @@ -0,0 +1,41 @@ + + + + + + + A propos + + + +
+

+ Site en alpha. Futurs ajouts : +

+ + Vous pouvez me proposer des ajouts en ouvrant un ticket sur le git ou en envoyant un mail à rick <AT> gnous <dot> eu. +

+ +

Ce site est conçu pour réunir des liens de manière efficace afin de retrouver ou de stocker facilement une url.

+ +

+ Il est codé uniquement en HTML et CSS pour le frontend et Python, avec Flask est utilisé pour le backend. Afin de pouvoir télécharger simplement ce site et de pouvoir le lancer sur son PC en local sans avoir à installer Python, une version statique est disponible ici; vous pouvez retrouver les fichiers dans le dossier lite du git. + Il est conçu afin de pouvoir durer 10 ans (du moins son frontend). +

+ +

Ce site est sous licence GPL3.0 or later et son code source est disponible sur le git de Gnous. Il est aux normes du W3C.

+
+ licence GPL3 or Later + bage de validation html5 +
+ + diff --git a/lite/img/html5-validator-badge.svg b/lite/img/html5-validator-badge.svg new file mode 100644 index 0000000..4294493 --- /dev/null +++ b/lite/img/html5-validator-badge.svg @@ -0,0 +1,271 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lite/img/licence.svg b/lite/img/licence.svg new file mode 100644 index 0000000..a62fdac --- /dev/null +++ b/lite/img/licence.svg @@ -0,0 +1,315 @@ + + + + + GPLv3 or Later + + + + image/svg+xml + + GPLv3 or Later + 2018-11-26 + + + Aryeom Han + + + + + Creative Commons by-sa + + + + + GPLv3 or Later logo made by Aryeom Han for the Free Software Foundation 2019 fundraising. +About the author, see: https://film.zemarmot.net/ + + + LILA + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lite/index.html b/lite/index.html new file mode 100644 index 0000000..b55215d --- /dev/null +++ b/lite/index.html @@ -0,0 +1,39 @@ + + + + + + + Document + + + +
+ + +
+

Titre

+

Lien

+
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed dui eros, molestie vitae dui in, porta volutpat augue. Donec fermentum efficitur ligula, ut facilisis metus ornare a. Vestibulum tempus tincidunt elit, in mattis tellus rutrum facilisis. Phasellus tempor tempus magna, quis vehicula libero commodo a. Nulla eget est euismod, aliquam est vitae, tempor enim. Etiam tincidunt cursus massa et rhoncus. Nunc ut justo mattis, dapibus diam et, viverra magna. Nulla commodo luctus lectus vitae elementum. Cras ullamcorper eu velit ut varius. Nam dictum ante ex, luctus tempor dolor scelerisque sed. Vestibulum malesuada sodales eros vel imperdiet. Cras placerat libero metus, sed mollis augue mattis vitae. Pellentesque sed quam et ligula vestibulum gravida vel vitae tortor. Proin iaculis libero a vulputate rutrum. Proin ornare bibendum tellus, sed fringilla ex posuere vitae. Ut sed lorem vel neque tempor placerat.

+

Tags:

+ +
+ + diff --git a/lite/styles/apropos.css b/lite/styles/apropos.css new file mode 100644 index 0000000..9f3cbe0 --- /dev/null +++ b/lite/styles/apropos.css @@ -0,0 +1,5 @@ +img { + width: 150px; + height: auto; + margin-right: 50px; +} \ No newline at end of file diff --git a/lite/styles/base.css b/lite/styles/base.css new file mode 100644 index 0000000..95bdf84 --- /dev/null +++ b/lite/styles/base.css @@ -0,0 +1,48 @@ +body { + background-color: black; + color: white; +} + +#menu { + display: flex; +} + +#menu h1 { + margin: 10px; + margin-right: 25%; +} + +header { + width: 100%; + margin: 10px; + display: flex; + justify-content: space-around; +} + +header a { + text-align: center; + color: white; + text-decoration: none; + margin-right: 25%; + padding: 10px; + white-space: nowrap; +} + +header a:hover { + background-color: white; + color: black; +} + +#select { + background-color: grey; +} + +#select:hover { + background-color: grey; + color: white; +} + +#lienAccueil { + text-decoration: none; + color: white; +} \ No newline at end of file diff --git a/lite/styles/index.css b/lite/styles/index.css new file mode 100644 index 0000000..bd5299f --- /dev/null +++ b/lite/styles/index.css @@ -0,0 +1,31 @@ +#categories ul { + list-style-type: none; + display: flex; + justify-content:space-around; +} + +.elem { + margin: 10px; + padding: 5px; + padding-top: 2px; + background-color: darkslategrey; +} + +.elem a { + color: white; + font-weight: bolder; +} + +.elem ul { + list-style-type: none; + margin: 0; + padding: 0; + display: flex; + justify-content: start; +} + +.elem li { + margin-right: 5px; + padding: 5px; + background-color: dimgray; +} \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..4f1a04a --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +beautifulsoup4 +flask diff --git a/static/img/html5-validator-badge.svg b/static/img/html5-validator-badge.svg new file mode 100644 index 0000000..4294493 --- /dev/null +++ b/static/img/html5-validator-badge.svg @@ -0,0 +1,271 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/static/img/licence.svg b/static/img/licence.svg new file mode 100644 index 0000000..a62fdac --- /dev/null +++ b/static/img/licence.svg @@ -0,0 +1,315 @@ + + + + + GPLv3 or Later + + + + image/svg+xml + + GPLv3 or Later + 2018-11-26 + + + Aryeom Han + + + + + Creative Commons by-sa + + + + + GPLv3 or Later logo made by Aryeom Han for the Free Software Foundation 2019 fundraising. +About the author, see: https://film.zemarmot.net/ + + + LILA + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/styles/apropos.css b/static/styles/apropos.css new file mode 100644 index 0000000..9f3cbe0 --- /dev/null +++ b/static/styles/apropos.css @@ -0,0 +1,5 @@ +img { + width: 150px; + height: auto; + margin-right: 50px; +} \ No newline at end of file diff --git a/static/styles/base.css b/static/styles/base.css new file mode 100644 index 0000000..95bdf84 --- /dev/null +++ b/static/styles/base.css @@ -0,0 +1,48 @@ +body { + background-color: black; + color: white; +} + +#menu { + display: flex; +} + +#menu h1 { + margin: 10px; + margin-right: 25%; +} + +header { + width: 100%; + margin: 10px; + display: flex; + justify-content: space-around; +} + +header a { + text-align: center; + color: white; + text-decoration: none; + margin-right: 25%; + padding: 10px; + white-space: nowrap; +} + +header a:hover { + background-color: white; + color: black; +} + +#select { + background-color: grey; +} + +#select:hover { + background-color: grey; + color: white; +} + +#lienAccueil { + text-decoration: none; + color: white; +} \ No newline at end of file diff --git a/static/styles/index.css b/static/styles/index.css new file mode 100644 index 0000000..bd5299f --- /dev/null +++ b/static/styles/index.css @@ -0,0 +1,31 @@ +#categories ul { + list-style-type: none; + display: flex; + justify-content:space-around; +} + +.elem { + margin: 10px; + padding: 5px; + padding-top: 2px; + background-color: darkslategrey; +} + +.elem a { + color: white; + font-weight: bolder; +} + +.elem ul { + list-style-type: none; + margin: 0; + padding: 0; + display: flex; + justify-content: start; +} + +.elem li { + margin-right: 5px; + padding: 5px; + background-color: dimgray; +} \ No newline at end of file diff --git a/templates/ajout.html b/templates/ajout.html new file mode 100644 index 0000000..042a9d6 --- /dev/null +++ b/templates/ajout.html @@ -0,0 +1,27 @@ + + + + + + + Ajout + + + +
+ +
+ + + + +
+ + + diff --git a/templates/apropos.html b/templates/apropos.html new file mode 100644 index 0000000..103b5a2 --- /dev/null +++ b/templates/apropos.html @@ -0,0 +1,41 @@ + + + + + + + A propos + + + +
+

+ Site en alpha. Futurs ajouts : +

+ + Vous pouvez me proposer des ajouts en ouvrant un ticket sur le git ou en envoyant un mail à rick <AT> gnous <dot> eu. +

+ +

Ce site est conçu pour réunir des liens de manière efficace afin de retrouver ou de stocker facilement une url.

+ +

+ Il est codé uniquement en HTML et CSS pour le frontend et Python, avec Flask est utilisé pour le backend. Afin de pouvoir télécharger simplement ce site et de pouvoir le lancer sur son PC en local sans avoir à installer Python, une version statique est disponible ici; vous pouvez retrouver les fichiers dans le dossier lite du git. + Il est conçu afin de pouvoir durer 10 ans (du moins son frontend). +

+ +

Ce site est sous licence GPL3.0 or later et son code source est disponible sur le git de Gnous. Il est aux normes du W3C.

+
+ licence GPL3 or Later + bage de validation html5 +
+ + diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..a8c02c3 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,24 @@ + + + + + + + Partage de liens + + + +
+ + + +