use config class for desc strings

This commit is contained in:
Mylloon 2022-10-27 17:29:23 +02:00
parent e4fd9af325
commit 299c7fc7d7
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
4 changed files with 17 additions and 11 deletions

View file

@ -6,7 +6,18 @@ from utils.misc import exist
class Config:
# App name
name = "Sand"
# Title of the desc in the index page
title_desc = "Partage de petits fichiers"
# Desc of the index page
desc = "Sand permet le partage de fichiers. Attention, je n'accepte que \
les petits fichiers de quelques <code>ko</code> car je chiffre ton \
fichier via RSA 🙂."
# Directory name where the uploads are stored
uploads_dir = "uploads"

View file

@ -6,4 +6,4 @@ router = Blueprint("index", __name__)
@router.route("")
def index() -> str:
return render_template("index.html", name=Config.name)
return render_template("index.html", config=Config)

View file

@ -6,4 +6,4 @@ router = Blueprint("uploaded", __name__)
@router.route("")
def uploaded() -> str:
return render_template("index.html", name=Config.name)
return render_template("index.html", config=Config)

View file

@ -4,14 +4,14 @@
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{{ name }}</title>
<title>{{ config.name }}</title>
<link rel="stylesheet" href="../styles/style.css" />
</head>
<body>
<header class="text-center">
<h1 class="text-title">{{ name }}</h1>
<h1 class="text-title">{{ config.name }}</h1>
</header>
<main>
@ -20,13 +20,8 @@
<input id="upload" type="file" />
</div>
<div class="desc-area">
<h2>Projet</h2>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed
do eiusmod tempor incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip ex ea commodo consequat.
</p>
<h2>{{ config.title_desc }}</h2>
<p>{{ config.desc | safe }}</p>
</div>
</main>