Compare commits

...

5 commits
v1.1.1 ... main

Author SHA1 Message Date
OniriCorpe
7c318b3d6c a 'lang' attribute to the 'html' and fix img validity 2024-05-23 03:24:32 +02:00
OniriCorpe
bd7b91b9a7 fixes automatic language selection 2024-05-23 02:53:45 +02:00
OniriCorpe
7dd7202d81 Merge branch 'main' of https://github.com/YunoHost/pepettes 2024-05-22 23:13:10 +02:00
OniriCorpe
4efabca559 remove unused imports 2024-05-22 23:13:08 +02:00
Bram
afaf1019aa
doc(README): correctly format python code as python 2024-05-22 22:51:41 +02:00
6 changed files with 22 additions and 13 deletions

View file

@ -24,7 +24,7 @@ python3 -m pip install -r requirements.txt
Create a settings.py file with : Create a settings.py file with :
```text ```python
ENV = 'development' ENV = 'development'
PORT = 8000 PORT = 8000
DOMAIN = 'http://localhost:8000' DOMAIN = 'http://localhost:8000'

View file

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html lang="{{ lang }}">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
@ -9,7 +9,7 @@
<link rel="icon" href="{{ favicon }}" type="image/x-icon" /> <link rel="icon" href="{{ favicon }}" type="image/x-icon" />
<link href="./css/bootstrap-5.3.3.min.css" rel="stylesheet" <link href="./css/bootstrap-5.3.3.min.css" rel="stylesheet"
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous" />
<link href="./css/global.css" rel="stylesheet" /> <link href="./css/global.css" rel="stylesheet" />
<script src="./darkmode.js" defer></script> <script src="./darkmode.js" defer></script>
</head> </head>
@ -17,7 +17,7 @@
<body class="text-center"> <body class="text-center">
<main class="form-donate"> <main class="form-donate">
<div> <div>
<img src="{{ logo }}" class="mb-4" alt="{{ _('%(name)s Logo', name=name) }}" max-width="7em" /> <img src="{{ logo }}" class="mb-4" alt="{{ _('%(name)s Logo', name=name) }}" />
<h1 class="h3 mb-3 fw-normal">{{ _('Your payment was canceled') }}</h1> <h1 class="h3 mb-3 fw-normal">{{ _('Your payment was canceled') }}</h1>

View file

@ -16,6 +16,10 @@ body {
} }
} }
img {
max-width: 13em
}
.form-donate { .form-donate {
width: 100%; width: 100%;
max-width: 330px; max-width: 330px;

View file

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html lang="{{ lang }}">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
@ -9,7 +9,7 @@
<link rel="icon" href="{{ favicon }}" type="image/x-icon" /> <link rel="icon" href="{{ favicon }}" type="image/x-icon" />
<link href="./css/bootstrap-5.3.3.min.css" rel="stylesheet" <link href="./css/bootstrap-5.3.3.min.css" rel="stylesheet"
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous" />
<link href="./css/global.css" rel="stylesheet" /> <link href="./css/global.css" rel="stylesheet" />
<script src="https://js.stripe.com/v3/"></script> <script src="https://js.stripe.com/v3/"></script>
<script src="./index.js" defer></script> <script src="./index.js" defer></script>
@ -19,7 +19,7 @@
<body class="text-center"> <body class="text-center">
<main class="form-donate"> <main class="form-donate">
<div> <div>
<img src="{{ logo }}" class="mb-4" alt="{{ _('%(name)s Logo', name=name) }}" max-width="7em" /> <img src="{{ logo }}" class="mb-4" alt="{{ _('%(name)s Logo', name=name) }}" />
<h1 class="h3 mb-3 fw-normal">{{ _('I want to give to %(name)s', name=name) }}</h1> <h1 class="h3 mb-3 fw-normal">{{ _('I want to give to %(name)s', name=name) }}</h1>
<div class="input-group mb-3"> <div class="input-group mb-3">

View file

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html lang="{{ lang }}">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
@ -9,7 +9,7 @@
<link rel="icon" href="{{ favicon }}" type="image/x-icon" /> <link rel="icon" href="{{ favicon }}" type="image/x-icon" />
<link href="./css/bootstrap-5.3.3.min.css" rel="stylesheet" <link href="./css/bootstrap-5.3.3.min.css" rel="stylesheet"
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous" />
<link href="./css/global.css" rel="stylesheet" /> <link href="./css/global.css" rel="stylesheet" />
<script src="./darkmode.js" defer></script> <script src="./darkmode.js" defer></script>
</head> </head>
@ -17,7 +17,7 @@
<body class="text-center"> <body class="text-center">
<main class="form-donate"> <main class="form-donate">
<div> <div>
<img src="{{ logo }}" class="mb-4" alt="{{ _('%(name)s Logo', name=name) }}" max-width="7em" /> <img src="{{ logo }}" class="mb-4" alt="{{ _('%(name)s Logo', name=name) }}" />
<h1 class="h3 mb-3 fw-normal">{{ _('Thanks for your donation 🙂') }}</h1> <h1 class="h3 mb-3 fw-normal">{{ _('Thanks for your donation 🙂') }}</h1>

View file

@ -12,8 +12,8 @@ import os
import random import random
import string import string
from flask import Flask, render_template, jsonify, request, send_from_directory, session from flask import Flask, render_template, jsonify, request, session
from flask_babel import Babel, _ from flask_babel import Babel
from flask_simple_csrf import CSRF from flask_simple_csrf import CSRF
@ -40,7 +40,12 @@ def before_request():
@babel.localeselector @babel.localeselector
def get_locale(): def get_locale():
return "fr" # request.accept_languages.best_match(app.config['LANGUAGES']) return request.accept_languages.best_match(app.config["LANGUAGES"])
@app.context_processor
def utility_processor():
return dict(lang=babel.locale_selector_func())
@app.route("/", methods=["GET"]) @app.route("/", methods=["GET"])