mirror of
https://github.com/YunoHost/pepettes.git
synced 2024-09-03 20:06:20 +02:00
Compare commits
5 commits
Author | SHA1 | Date | |
---|---|---|---|
|
7c318b3d6c | ||
|
bd7b91b9a7 | ||
|
7dd7202d81 | ||
|
4efabca559 | ||
|
afaf1019aa |
6 changed files with 22 additions and 13 deletions
|
@ -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'
|
||||||
|
|
|
@ -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>
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,10 @@ body {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
max-width: 13em
|
||||||
|
}
|
||||||
|
|
||||||
.form-donate {
|
.form-donate {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 330px;
|
max-width: 330px;
|
||||||
|
|
|
@ -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">
|
||||||
|
|
|
@ -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>
|
||||||
|
|
||||||
|
|
11
server.py
11
server.py
|
@ -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"])
|
||||||
|
|
Loading…
Add table
Reference in a new issue