mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-04-28 09:22:38 +02:00
feat: Add a SITE_NAME
setting and use it everywhere.
Some checks failed
CI / lint (push) Has been cancelled
CI / docs (push) Has been cancelled
Docker build / test (push) Has been cancelled
CI / test (mariadb, minimal, 3.11) (push) Has been cancelled
CI / test (mariadb, normal, 3.11) (push) Has been cancelled
CI / test (mariadb, normal, 3.9) (push) Has been cancelled
CI / test (postgresql, minimal, 3.11) (push) Has been cancelled
CI / test (postgresql, normal, 3.11) (push) Has been cancelled
CI / test (postgresql, normal, 3.9) (push) Has been cancelled
CI / test (sqlite, minimal, 3.10) (push) Has been cancelled
CI / test (sqlite, minimal, 3.11) (push) Has been cancelled
CI / test (sqlite, minimal, 3.12) (push) Has been cancelled
CI / test (sqlite, minimal, 3.9) (push) Has been cancelled
CI / test (sqlite, normal, 3.10) (push) Has been cancelled
CI / test (sqlite, normal, 3.11) (push) Has been cancelled
CI / test (sqlite, normal, 3.12) (push) Has been cancelled
CI / test (sqlite, normal, 3.8) (push) Has been cancelled
CI / test (sqlite, normal, 3.9) (push) Has been cancelled
Docker build / build_upload (push) Has been cancelled
Some checks failed
CI / lint (push) Has been cancelled
CI / docs (push) Has been cancelled
Docker build / test (push) Has been cancelled
CI / test (mariadb, minimal, 3.11) (push) Has been cancelled
CI / test (mariadb, normal, 3.11) (push) Has been cancelled
CI / test (mariadb, normal, 3.9) (push) Has been cancelled
CI / test (postgresql, minimal, 3.11) (push) Has been cancelled
CI / test (postgresql, normal, 3.11) (push) Has been cancelled
CI / test (postgresql, normal, 3.9) (push) Has been cancelled
CI / test (sqlite, minimal, 3.10) (push) Has been cancelled
CI / test (sqlite, minimal, 3.11) (push) Has been cancelled
CI / test (sqlite, minimal, 3.12) (push) Has been cancelled
CI / test (sqlite, minimal, 3.9) (push) Has been cancelled
CI / test (sqlite, normal, 3.10) (push) Has been cancelled
CI / test (sqlite, normal, 3.11) (push) Has been cancelled
CI / test (sqlite, normal, 3.12) (push) Has been cancelled
CI / test (sqlite, normal, 3.8) (push) Has been cancelled
CI / test (sqlite, normal, 3.9) (push) Has been cancelled
Docker build / build_upload (push) Has been cancelled
This commit is contained in:
parent
83a60b1289
commit
7505cbe25a
6 changed files with 20 additions and 2 deletions
|
@ -173,6 +173,14 @@ URL you want.
|
|||
- **Default value:** `""` (empty string)
|
||||
- **Production value:** The URL of your chosing.
|
||||
|
||||
## SITE_NAME
|
||||
|
||||
It is possible to change the name of the site to something at your liking.
|
||||
|
||||
- **Default value:** `"I Hate Money"` (empty string)
|
||||
- **Production value:** The name of your choosing
|
||||
|
||||
|
||||
## Configuring email sending
|
||||
|
||||
By default, Ihatemoney sends emails using a local SMTP server, but it's
|
||||
|
|
|
@ -3,6 +3,7 @@ DEBUG = SQLACHEMY_ECHO = False
|
|||
SQLALCHEMY_DATABASE_URI = "sqlite:////tmp/ihatemoney.db"
|
||||
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
||||
SECRET_KEY = "tralala"
|
||||
SITE_NAME = "I Hate Money"
|
||||
MAIL_DEFAULT_SENDER = "Budget manager <admin@example.com>"
|
||||
SHOW_ADMIN_EMAIL = True
|
||||
ACTIVATE_DEMO_PROJECT = True
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="h-100">
|
||||
<head>
|
||||
<title>{{ _("Account manager") }}{% block title %}{% endblock %}</title>
|
||||
<title>{{ SITE_NAME }} — {{ _("Account manager") }}{% block title %}{% endblock %}</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel=stylesheet type=text/css href="{{ url_for("static", filename='css/main.css') }}">
|
||||
|
|
|
@ -238,7 +238,10 @@ class TestBudget(IhatemoneyTestCase):
|
|||
url, data={"password": "pass", "password_confirmation": "pass"}
|
||||
)
|
||||
resp = self.login("raclette", password="pass")
|
||||
assert "<title>Account manager - raclette</title>" in resp.data.decode("utf-8")
|
||||
assert (
|
||||
"<title>I Hate Money — Account manager - raclette</title>"
|
||||
in resp.data.decode("utf-8")
|
||||
)
|
||||
# Test empty and null tokens
|
||||
resp = self.client.get("/reset-password")
|
||||
assert "No token provided" in resp.data.decode("utf-8")
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
DEBUG = False
|
||||
SQLALCHEMY_DATABASE_URI = 'sqlite:///budget.db'
|
||||
SQLACHEMY_ECHO = DEBUG
|
||||
SITE_NAME = "I Hate Money"
|
||||
|
||||
SECRET_KEY = "supersecret"
|
||||
|
||||
|
|
|
@ -137,6 +137,11 @@ def set_show_admin_dashboard_link(endpoint, values):
|
|||
g.logout_form = LogoutForm()
|
||||
|
||||
|
||||
@main.context_processor
|
||||
def add_template_variables():
|
||||
return {"SITE_NAME": current_app.config.get("SITE_NAME")}
|
||||
|
||||
|
||||
@main.url_value_preprocessor
|
||||
def pull_project(endpoint, values):
|
||||
"""When a request contains a project_id value, transform it directly
|
||||
|
|
Loading…
Reference in a new issue