use config class for desc strings
This commit is contained in:
parent
e4fd9af325
commit
299c7fc7d7
4 changed files with 17 additions and 11 deletions
|
@ -6,7 +6,18 @@ from utils.misc import exist
|
||||||
|
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
|
# App name
|
||||||
name = "Sand"
|
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"
|
uploads_dir = "uploads"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,4 +6,4 @@ router = Blueprint("index", __name__)
|
||||||
|
|
||||||
@router.route("")
|
@router.route("")
|
||||||
def index() -> str:
|
def index() -> str:
|
||||||
return render_template("index.html", name=Config.name)
|
return render_template("index.html", config=Config)
|
||||||
|
|
|
@ -6,4 +6,4 @@ router = Blueprint("uploaded", __name__)
|
||||||
|
|
||||||
@router.route("")
|
@router.route("")
|
||||||
def uploaded() -> str:
|
def uploaded() -> str:
|
||||||
return render_template("index.html", name=Config.name)
|
return render_template("index.html", config=Config)
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<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" />
|
<link rel="stylesheet" href="../styles/style.css" />
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<header class="text-center">
|
<header class="text-center">
|
||||||
<h1 class="text-title">{{ name }}</h1>
|
<h1 class="text-title">{{ config.name }}</h1>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
|
@ -20,13 +20,8 @@
|
||||||
<input id="upload" type="file" />
|
<input id="upload" type="file" />
|
||||||
</div>
|
</div>
|
||||||
<div class="desc-area">
|
<div class="desc-area">
|
||||||
<h2>Projet</h2>
|
<h2>{{ config.title_desc }}</h2>
|
||||||
<p>
|
<p>{{ config.desc | safe }}</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>
|
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
Reference in a new issue