Merge "Allow for overriding title"

This commit is contained in:
Zuul 2021-06-30 06:54:23 +00:00 committed by Gerrit Code Review
commit ce0c909125
3 changed files with 10 additions and 1 deletions

6
README
View File

@ -64,3 +64,9 @@ Now start the development server::
python manage.py runserver python manage.py runserver
Enjoy! Enjoy!
Environment Settings
====================
LODGEIT_TITLE_OVERRIDE : <string>
Arbitrary string to override the main heading for site customisation

View File

@ -8,6 +8,7 @@
:license: BSD :license: BSD
""" """
import base64 import base64
import os
import re import re
import time import time
from os import path from os import path
@ -45,6 +46,8 @@ def url_for(endpoint, external=False, **values):
jinja_environment.globals['url_for'] = url_for jinja_environment.globals['url_for'] = url_for
jinja_environment.globals['title'] = \
os.getenv('LODGEIT_TITLE_OVERRIDE', 'Lodge It')
def generate_user_hash(): def generate_user_hash():

View File

@ -18,7 +18,7 @@
<body> <body>
<div class="page"> <div class="page">
<div id="header"> <div id="header">
<h1>Lodge It</h1> <h1>{{ title }}</h1>
</div> </div>
<ul id="navigation"> <ul id="navigation">
{%- for href, id, caption in [ {%- for href, id, caption in [