From cef5939d5d9c304bb491bf4238852a8d0206ab86 Mon Sep 17 00:00:00 2001 From: David Morris Date: Fri, 29 Sep 2023 15:49:12 +0100 Subject: [PATCH] Army number search tool page. --- cmp/urls.py | 2 +- cmp/views.py | 3 +++ core/settings.py | 2 +- templates/base.html | 20 ++++++++++++++++++++ templates/cmp/army-number-search.html | 12 ++++++++++++ 5 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 templates/base.html create mode 100644 templates/cmp/army-number-search.html diff --git a/cmp/urls.py b/cmp/urls.py index bbf6ee2..34c9f04 100644 --- a/cmp/urls.py +++ b/cmp/urls.py @@ -5,6 +5,6 @@ urlpatterns = [ path("", views.index, name="index"), path("sentry-debug/", views.trigger_error ), - path("tools/army-number-search", views.original_unit, name="army-number-search" ), + path("tools/army-number-search", views.army_number_search, name="army-number-search" ), path("tools/army-number-search/" , views.original_unit, name="army-number-search" ), ] diff --git a/cmp/views.py b/cmp/views.py index 3cf5054..c8ecc98 100644 --- a/cmp/views.py +++ b/cmp/views.py @@ -9,6 +9,9 @@ def index(request): return HttpResponse("home") +def army_number_search(request): + return render(request, 'cmp/army-number-search.html') + def trigger_error(request): """error for Sentry""" division_by_zero = 1 / 0 diff --git a/core/settings.py b/core/settings.py index 9c7a0e5..1c3bad4 100644 --- a/core/settings.py +++ b/core/settings.py @@ -78,7 +78,7 @@ TEMPLATES = [ { "BACKEND": "django.template.backends.django.DjangoTemplates", - "DIRS": [], + "DIRS": [os.path.join( BASE_DIR, 'templates' )], "APP_DIRS": True, "OPTIONS": { "context_processors": [ diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..8f3a3a4 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,20 @@ +{% load static %} + + + + + + + CMP {% block title %} {% endblock %} + + + + + {% block styles %}{% endblock %} + + + {% block content %}{% endblock %} + {% block scripts %}{% endblock %} + + + \ No newline at end of file diff --git a/templates/cmp/army-number-search.html b/templates/cmp/army-number-search.html new file mode 100644 index 0000000..1edf2b0 --- /dev/null +++ b/templates/cmp/army-number-search.html @@ -0,0 +1,12 @@ +{% extends "base.html" %} +{% block title %}Army Number Search{% endblock %} +{% block content %} +
+

+This search tool can match army numbers from the 1920's to the end of World War 2 which was based on the regiment that a soldier joined initially, and the post war numbering system which is army wide. Pre 1920's, soldiers had regimental numbers so this site cannot be used for matching those. +

+

+Enter an army number to find out what unit/regiment block the number was assigned from (upto WW2) or approximately when the soldier joined the army (post WW2). +

+
+{% endblock %} \ No newline at end of file