mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-22 15:51:08 -05:00
feat: Add detailed park and ride pages with HTMX integration
- Implemented park detail page with dynamic content loading for rides and weather. - Created park list page with filters and search functionality. - Developed ride detail page showcasing ride stats, reviews, and similar rides. - Added ride list page with filtering options and dynamic loading. - Introduced search results page with tabs for parks, rides, and users. - Added HTMX tests for global search functionality.
This commit is contained in:
@@ -45,32 +45,37 @@ class Command(BaseCommand):
|
||||
]
|
||||
|
||||
if files:
|
||||
# Get the first file and update the database
|
||||
# record
|
||||
file_path = os.path.join(
|
||||
content_type, identifier, files[0]
|
||||
)
|
||||
# Get the first file and update the database record
|
||||
file_path = os.path.join(content_type, identifier, files[0])
|
||||
if os.path.exists(os.path.join("media", file_path)):
|
||||
photo.image.name = file_path
|
||||
photo.save()
|
||||
self.stdout.write(
|
||||
f"Updated path for photo {
|
||||
photo.id} to {file_path}"
|
||||
f"Updated path for photo {photo.id} to {file_path}"
|
||||
)
|
||||
else:
|
||||
# If the expected file is still missing, fall back to placeholder
|
||||
placeholder = os.path.join("placeholders", "default.svg")
|
||||
photo.image.name = placeholder
|
||||
photo.save()
|
||||
self.stdout.write(
|
||||
f"File not found for photo {
|
||||
photo.id}: {file_path}"
|
||||
f"File missing for photo {photo.id}; set placeholder {placeholder}"
|
||||
)
|
||||
else:
|
||||
# No files found for this identifier -> set placeholder
|
||||
placeholder = os.path.join("placeholders", "default.svg")
|
||||
photo.image.name = placeholder
|
||||
photo.save()
|
||||
self.stdout.write(
|
||||
f"No files found in directory for photo {
|
||||
photo.id}: {media_dir}"
|
||||
f"No files in {media_dir} for photo {photo.id}; set placeholder {placeholder}"
|
||||
)
|
||||
else:
|
||||
# Directory missing -> set placeholder
|
||||
placeholder = os.path.join("placeholders", "default.svg")
|
||||
photo.image.name = placeholder
|
||||
photo.save()
|
||||
self.stdout.write(
|
||||
f"Directory not found for photo {
|
||||
photo.id}: {media_dir}"
|
||||
f"Directory not found for photo {photo.id}: {media_dir}; set placeholder {placeholder}"
|
||||
)
|
||||
|
||||
except Exception as e:
|
||||
|
||||
@@ -49,9 +49,17 @@ class Command(BaseCommand):
|
||||
if files:
|
||||
current_path = os.path.join(old_dir, files[0])
|
||||
|
||||
# Skip if file still not found
|
||||
# If file still not found, set placeholder and continue
|
||||
if not os.path.exists(current_path):
|
||||
self.stdout.write(f"Skipping {current_name} - file not found")
|
||||
placeholder = os.path.join("placeholders", "default.svg")
|
||||
try:
|
||||
photo.image.name = placeholder
|
||||
photo.save()
|
||||
self.stdout.write(
|
||||
f"File for {current_name} not found; set placeholder {placeholder} for photo {photo.id}"
|
||||
)
|
||||
except Exception as e:
|
||||
self.stdout.write(f"Error setting placeholder for photo {photo.id}: {e}")
|
||||
continue
|
||||
|
||||
# Get content type and object
|
||||
|
||||
Reference in New Issue
Block a user