From b3df0bf2498047b3da4bcd4bd654b074771e45c0 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Thu, 21 Mar 2024 10:07:09 +0000 Subject: [PATCH] Implement boilerplate search widget/page view --- app/urls.py | 4 +- core/templates/base.html | 3 + .../templates/window-content/drug_search.html | 68 +++++++++++++++++++ core/templates/window-content/main.html | 6 +- core/views/search.py | 29 ++++++++ mxs/common.py | 0 6 files changed, 106 insertions(+), 4 deletions(-) create mode 100644 core/templates/window-content/drug_search.html create mode 100644 core/views/search.py create mode 100644 mxs/common.py diff --git a/app/urls.py b/app/urls.py index dcf1237..75e70e2 100644 --- a/app/urls.py +++ b/app/urls.py @@ -20,7 +20,7 @@ from django.contrib.auth.views import LogoutView from django.urls import include, path from two_factor.urls import urlpatterns as tf_urls -from core.views import base, demo, drugs, notifications +from core.views import base, demo, drugs, notifications, search urlpatterns = [ path("__debug__/", include("debug_toolbar.urls")), @@ -66,4 +66,6 @@ urlpatterns = [ drugs.DrugPullMerge.as_view(), name="drug_pull_merge", ), + # Drug search + path("search//", search.Search.as_view(), name="search"), ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) diff --git a/core/templates/base.html b/core/templates/base.html index c8319d2..e843a29 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -218,6 +218,9 @@ {% endif %} {% if user.is_authenticated %} + + Search +