diff --git a/core/settings.py b/core/settings.py index 0d18a76..c837795 100644 --- a/core/settings.py +++ b/core/settings.py @@ -105,7 +105,7 @@ STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' CSRF_TRUSTED_ORIGINS = os.environ.get('CSRF_TRUSTED_ORIGINS', 'http://localhost:8000').split(',') # Redis cache -REDIS_URL = os.environ.get('REDIS_URL', 'redis://localhost:6379/0') +REDIS_URL = os.environ.get('REDIS_URL', 'redis://192.168.1.2:6379/0') CACHES = { 'default': { diff --git a/justfile b/justfile index 2a13b19..eccf33e 100644 --- a/justfile +++ b/justfile @@ -27,14 +27,14 @@ dev: #!/usr/bin/env bash set -eu source .venv/bin/activate - uv run manage.py tailwind start & + npm run dev & TAILWIND_PID=$! trap "kill $TAILWIND_PID 2>/dev/null" EXIT uv run manage.py runserver 0.0.0.0:8000 # Run Tailwind CSS in watch mode (standalone) tailwind: - source .venv/bin/activate && uv run manage.py tailwind start + npm run dev # ── Database ────────────────────────────────────────────────────────────────── @@ -60,9 +60,21 @@ superuser: # ── Static Assets ───────────────────────────────────────────────────────────── +# Copy vendor JS/CSS from node_modules to static/vendor/ +vendor: + node scripts/copy-vendor.js + # Build Tailwind CSS (minified, for production) build-css: - source .venv/bin/activate && uv run manage.py tailwind build + npm run build:css + +# Build the React search component with Vite +build-search: + npm run build:search + +# Build all frontend assets: vendor copy + Tailwind + Vite (full production build) +build: + npm run build # Collect all static files into staticfiles/ collectstatic: diff --git a/links/collection_views.py b/links/collection_views.py index 8a08bca..80b88b3 100644 --- a/links/collection_views.py +++ b/links/collection_views.py @@ -11,6 +11,11 @@ class CollectionListView(ListView): context_object_name = 'collections' paginate_by = 12 + def get_template_names(self): + if self.request.headers.get('HX-Request'): + return ['links/includes/collection_list_items.html'] + return [self.template_name] + class CollectionDetailView(DetailView): model = ImageCollection template_name = 'links/collection_detail.html' diff --git a/links/page_views.py b/links/page_views.py index 50eb334..e7af0e9 100644 --- a/links/page_views.py +++ b/links/page_views.py @@ -68,6 +68,11 @@ class PageListView(ListView): context_object_name = 'pages' paginate_by = 10 + def get_template_names(self): + if self.request.headers.get('HX-Request'): + return ['links/includes/page_list_items.html'] + return [self.template_name] + class PageDetailView(DetailView): model = Page template_name = 'links/page_detail.html' diff --git a/links/post_views.py b/links/post_views.py index a11e8a7..f6ed2e1 100644 --- a/links/post_views.py +++ b/links/post_views.py @@ -20,6 +20,11 @@ class PostListView(ListView): context_object_name = 'posts' paginate_by = 10 + def get_template_names(self): + if self.request.headers.get('HX-Request'): + return ['links/includes/post_list_items.html'] + return [self.template_name] + def get_queryset(self): queryset = Post.objects.all().order_by('-created_at') diff --git a/links/templates/links/collection_detail.html b/links/templates/links/collection_detail.html index 70914de..8dacef7 100644 --- a/links/templates/links/collection_detail.html +++ b/links/templates/links/collection_detail.html @@ -3,7 +3,8 @@ {% load static %} {% block extra_css %} - + + {% endblock %} @@ -561,4 +560,3 @@ function jobsManager() { } {% endblock %} - diff --git a/links/templates/links/link_detail.html b/links/templates/links/link_detail.html index 5579d11..895ec52 100644 --- a/links/templates/links/link_detail.html +++ b/links/templates/links/link_detail.html @@ -223,7 +223,8 @@ {% endblock %} {% block extra_js %} - + + - + {# jQuery and Select2 are loaded globally from vendor in base.html #} + + @@ -99,7 +98,7 @@
+ {result.description || result.summary} +
+ )} + +Search through all Links, Pages, and Posts
+Try adjusting your search terms or filters
++ Enter a search query to find links, pages, and posts. + You can search by title, content, URL, or tags. +
+