From d378b2ff614220c422e96c16093e9e37173429f1 Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Wed, 3 Jan 2024 11:32:41 +0000 Subject: [PATCH] Idea for new search page --- app/search/routes.py | 11 + app/templates/search/catalogue-new.html | 408 ++++++++++++++++++++++++ src/styles/modules/_search.scss | 53 +++ 3 files changed, 472 insertions(+) create mode 100644 app/templates/search/catalogue-new.html diff --git a/app/search/routes.py b/app/search/routes.py index beb3a20c..9ce1661b 100644 --- a/app/search/routes.py +++ b/app/search/routes.py @@ -32,6 +32,17 @@ def catalogue(): ) +@bp.route("/catalogue-new/") +@cache.cached(key_prefix=cache_key_prefix) +def catalogue_new(): + query = request.args["q"] if "q" in request.args else "" + return render_template( + "search/catalogue-new.html", + query=query, + search_path="/search/catalogue/", + ) + + @bp.route("/website/") @cache.cached(key_prefix=cache_key_prefix) def website(): diff --git a/app/templates/search/catalogue-new.html b/app/templates/search/catalogue-new.html new file mode 100644 index 00000000..23272837 --- /dev/null +++ b/app/templates/search/catalogue-new.html @@ -0,0 +1,408 @@ +{% extends 'search/base.html' %} + +{%- from 'components/button/macro.html' import tnaButton -%} +{%- from 'components/checkboxes/macro.html' import tnaCheckboxes -%} +{%- from 'components/date-input/macro.html' import tnaDateInput -%} +{%- from 'components/pagination/macro.html' import tnaPagination -%} +{%- from 'components/select/macro.html' import tnaSelect -%} +{%- from 'components/text-input/macro.html' import tnaTextInput -%} +{%- from 'macros/feedback.html' import feedback -%} + +{% block pageTitle %}Search our catalogue - {{ super() }}{% endblock %} + +{% block skipLink %} +{{ tnaSkipLink({ + 'href': 'search-results', + 'text': 'Skip to search results' +}) }} +{{ super() }} +{% endblock %} + +{% block content %} +{% set show_tabs = False %} +{% include 'search/elements/header.html' %} +
+ {% include 'search/elements/sort-view.html' %} +
+
+
+

Search filters

+
+

Type

+ +
+
+ {{ tnaTextInput({ + 'label': 'Refine results', + 'headingLevel': 3, + 'headingSize': 's', + 'hint': 'Search within results' + }) }} +
+ {{ tnaButton({ + 'text': 'Update', + 'small': True, + 'buttonElement': True, + 'buttonType': 'submit', + 'attributes': { + 'form': 'search-form' + } + }) }} +
+
+
+

Covering date

+ {{ tnaDateInput({ + 'label': 'From', + 'headingLevel': 4, + 'headingSize': 'xs', + 'id': 'date-from', + 'name': 'date-from', + 'hint': 'For example, 27 3 2007 or 2007', + 'classes': 'tna-!--no-margin-top' + }) }} + {{ tnaDateInput({ + 'label': 'To', + 'headingLevel': 4, + 'headingSize': 'xs', + 'id': 'date-to', + 'name': 'date-to', + 'classes': 'tna-!--margin-top-s' + }) }} +
+ {{ tnaButton({ + 'text': 'Update', + 'small': True, + 'buttonElement': True, + 'buttonType': 'submit', + 'attributes': { + 'form': 'search-form' + } + }) }} +
+
+
+ {{ tnaCheckboxes({ + 'label': 'Digitised records', + 'headingLevel': 3, + 'headingSize': 's', + 'id': 'digitised', + 'name': 'digitised', + 'items': [ + { + 'text': 'Digitised records', + 'value': 'true' + } + ], + 'small': True + }) }} +
+ {{ tnaButton({ + 'text': 'Update', + 'small': True, + 'buttonElement': True, + 'buttonType': 'submit', + 'attributes': { + 'form': 'search-form' + } + }) }} +
+
+
+ {{ tnaCheckboxes({ + 'label': 'Collections', + 'headingLevel': 3, + 'headingSize': 's', + 'id': 'collections', + 'name': 'collections', + 'items': [ + { + 'text': 'Admiralty, Navy, Royal Marines, and Coastguard', + 'value': 'ADM' + }, + { + 'text': 'Air Ministry and Royal Air Force records', + 'value': 'AIR' + }, + { + 'text': 'Board of Trade and successors', + 'value': 'BT' + }, + { + 'text': 'Chancery, the Wardrobe, Royal Household, Exchequer and various commissions', + 'value': 'C' + }, + { + 'text': 'Colonial Office, Commonwealth and Foreign and Commonwealth Offices', + 'value': 'CO' + }, + { + 'text': 'Exchequer, Office of First Fruits and Tenths, and the Court of Augmentations', + 'value': 'E' + }, + { + 'text': 'Foreign Office', + 'value': 'FO' + }, + { + 'text': 'Home Office', + 'value': 'HO' + }, + { + 'text': 'Prerogative Court of Canterbury', + 'value': 'PROB' + }, + { + 'text': 'War Office, Armed Forces, Judge Advocate General, and related bodies', + 'value': 'WO' + } + ], + 'small': True + }) }} +

More collections…

+
+ {{ tnaButton({ + 'text': 'Update', + 'small': True, + 'buttonElement': True, + 'buttonType': 'submit', + 'attributes': { + 'form': 'search-form' + } + }) }} +
+
+
+ {{ tnaCheckboxes({ + 'label': 'Level', + 'headingLevel': 3, + 'headingSize': 's', + 'id': 'level', + 'name': 'level', + 'items': [ + { + 'text': 'Division', + 'value': 'a' + }, + { + 'text': 'Item', + 'value': 'b' + }, + { + 'text': 'Lettercode', + 'value': 'c' + }, + { + 'text': 'Piece', + 'value': 'd' + }, + { + 'text': 'Series', + 'value': 'e' + }, + { + 'text': 'Sub-series', + 'value': 'f' + }, + { + 'text': 'Sub-sub-series', + 'value': 'g' + } + ], + 'small': True + }) }} +
+ {{ tnaButton({ + 'text': 'Update', + 'small': True, + 'buttonElement': True, + 'buttonType': 'submit', + 'attributes': { + 'form': 'search-form' + } + }) }} +
+
+
+ {{ tnaCheckboxes({ + 'label': 'Closure Status', + 'headingLevel': 3, + 'headingSize': 's', + 'id': 'closure-status', + 'name': 'closure-status', + 'items': [ + { + 'text': 'Closed Or Retained Document, Closed Description', + 'value': 'a' + }, + { + 'text': 'Closed Or Retained Document, Open Description', + 'value': 'b' + }, + { + 'text': 'Open Document, Open Description', + 'value': 'c' + } + ], + 'small': True + }) }} +
+ {{ tnaButton({ + 'text': 'Update', + 'small': True, + 'buttonElement': True, + 'buttonType': 'submit', + 'attributes': { + 'form': 'search-form' + } + }) }} +
+
+
+

Record opening date

+ {{ tnaDateInput({ + 'label': 'From', + 'headingLevel': 4, + 'headingSize': 'xs', + 'id': 'opening-date-from', + 'name': 'opening-date-from', + 'hint': 'For example, 27 3 2007 or 2007', + 'classes': 'tna-!--no-margin-top' + }) }} + {{ tnaDateInput({ + 'label': 'To', + 'headingLevel': 4, + 'headingSize': 'xs', + 'id': 'opening-date-to', + 'name': 'opening-date-to', + 'classes': 'tna-!--margin-top-s' + }) }} +
+ {{ tnaButton({ + 'text': 'Update', + 'small': True, + 'buttonElement': True, + 'buttonType': 'submit', + 'attributes': { + 'form': 'search-form' + } + }) }} +
+
+
+
+

Search results

+
+ {% for i in range(10) %} + +
+ {% endfor %} +
+ {{ tnaPagination({ + 'previous': { + 'href': "#" + }, + 'items': [ + { + 'number': 1, + 'href': "#" + }, + { + 'ellipsis': True + }, + { + 'number': 6, + 'href': "#" + }, + { + 'number': 7, + 'current': True, + 'href': "#" + }, + { + 'number': 8, + 'href': "#" + }, + { + 'ellipsis': True + }, + { + 'number': 42, + 'href': "#" + } + ], + 'next': { + 'href': "#" + } + }) }} +
+
+
+{{ feedback() }} +{% endblock %} + +{% block bodyEnd %} +{{ super() }} + +{% endblock %} diff --git a/src/styles/modules/_search.scss b/src/styles/modules/_search.scss index a9822f86..32cd243e 100644 --- a/src/styles/modules/_search.scss +++ b/src/styles/modules/_search.scss @@ -240,3 +240,56 @@ html.tna-template @include colour.colour-border("keyline", 1px); } } + +.etna-ul-hierarchy { + $hierarchy-keyline-width: 1.5px; + + list-style: none; + + ul { + margin-left: 0.5rem; + + list-style: none; + + li { + padding-left: 1rem; + + position: relative; + + &::before, + &::after { + display: block; + + position: absolute; + + @include colour.colour-background("keyline"); + + content: ""; + } + + &::before { + width: $hierarchy-keyline-width; + + top: 0; + bottom: 0; + left: 0; + } + + &::after { + width: 0.5rem; + height: $hierarchy-keyline-width; + + top: 1rem; + left: $hierarchy-keyline-width; + } + + &:last-child { + &::before { + height: calc(1rem + $hierarchy-keyline-width); + + bottom: auto; + } + } + } + } +}