diff --git a/Dockerfile b/Dockerfile index b12bb88..ddec37e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,7 @@ WORKDIR /app COPY src/ ./ COPY requirements.txt . COPY README.md index.md +COPY version.txt . RUN pip install --no-cache-dir -r requirements.txt diff --git a/src/booking.py b/src/booking.py index e0a367a..0c9ff76 100644 --- a/src/booking.py +++ b/src/booking.py @@ -236,6 +236,14 @@ def get_markdown(): md = markdown.Markdown(extensions=["fenced_code"]) return md.convert(f.read()) +def get_version(): + """ + Get the version of the app from the version.txt file. + :return: + """ + with open(BASE_DIR / "version.txt") as f: + return f.read().strip() + @api.get("/info") def info(request): @@ -277,4 +285,5 @@ app.route("api/", include=api.urls) def home(request): return render(request, "index.html", { "content": get_markdown(), + "version": get_version(), }) diff --git a/src/static/style.css b/src/static/style.css index 2e982f9..238bd48 100644 --- a/src/static/style.css +++ b/src/static/style.css @@ -1,4 +1,9 @@ .container { width: 90%; margin: 3em auto; +} + +.footer { + text-align: center; + margin: 2em auto; } \ No newline at end of file diff --git a/src/templates/index.html b/src/templates/index.html index 470f2ee..527fa8f 100644 --- a/src/templates/index.html +++ b/src/templates/index.html @@ -10,5 +10,8 @@