Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -78,7 +78,8 @@ def login():
|
|
| 78 |
else:
|
| 79 |
error = "β Password errata. Riprova."
|
| 80 |
|
| 81 |
-
|
|
|
|
| 82 |
<!DOCTYPE html>
|
| 83 |
<html>
|
| 84 |
<head>
|
|
@@ -138,9 +139,14 @@ def login():
|
|
| 138 |
<div class="login-form">
|
| 139 |
<h2>π Accesso Protetto</h2>
|
| 140 |
<p style="text-align: center; color: #666;">Inserisci la password per accedere al sito</p>
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 144 |
<form method="POST">
|
| 145 |
<input type="password" name="password" placeholder="Inserisci la password" required>
|
| 146 |
<button type="submit">π Accedi</button>
|
|
@@ -148,7 +154,9 @@ def login():
|
|
| 148 |
</div>
|
| 149 |
</body>
|
| 150 |
</html>
|
| 151 |
-
"""
|
|
|
|
|
|
|
| 152 |
|
| 153 |
@app.route('/logout')
|
| 154 |
def logout():
|
|
|
|
| 78 |
else:
|
| 79 |
error = "β Password errata. Riprova."
|
| 80 |
|
| 81 |
+
# Costruisci l'HTML dinamicamente
|
| 82 |
+
html_content = """
|
| 83 |
<!DOCTYPE html>
|
| 84 |
<html>
|
| 85 |
<head>
|
|
|
|
| 139 |
<div class="login-form">
|
| 140 |
<h2>π Accesso Protetto</h2>
|
| 141 |
<p style="text-align: center; color: #666;">Inserisci la password per accedere al sito</p>
|
| 142 |
+
"""
|
| 143 |
+
|
| 144 |
+
# Aggiungi la sezione error se presente
|
| 145 |
+
if error:
|
| 146 |
+
html_content += f'<div class="error">{error}</div>'
|
| 147 |
+
|
| 148 |
+
# Aggiungi il form
|
| 149 |
+
html_content += """
|
| 150 |
<form method="POST">
|
| 151 |
<input type="password" name="password" placeholder="Inserisci la password" required>
|
| 152 |
<button type="submit">π Accedi</button>
|
|
|
|
| 154 |
</div>
|
| 155 |
</body>
|
| 156 |
</html>
|
| 157 |
+
"""
|
| 158 |
+
|
| 159 |
+
return html_content
|
| 160 |
|
| 161 |
@app.route('/logout')
|
| 162 |
def logout():
|