mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 08:51:09 -05:00
feat: Add PrimeProgress, PrimeSelect, and PrimeSkeleton components with customizable styles and props
- Implemented PrimeProgress component with support for labels, helper text, and various styles (size, variant, color). - Created PrimeSelect component with dropdown functionality, custom templates, and validation states. - Developed PrimeSkeleton component for loading placeholders with different shapes and animations. - Updated index.ts to export new components for easy import. - Enhanced PrimeVueTest.vue to include tests for new components and their functionalities. - Introduced a custom ThrillWiki theme for PrimeVue with tailored color schemes and component styles. - Added ambient type declarations for various components to improve TypeScript support.
This commit is contained in:
@@ -4,7 +4,7 @@ Park-specific media models for ThrillWiki.
|
||||
This module contains media models specific to parks domain.
|
||||
"""
|
||||
|
||||
from typing import Any, Optional, cast
|
||||
from typing import Any, List, Optional, cast
|
||||
from django.db import models
|
||||
from django.conf import settings
|
||||
from apps.core.history import TrackedModel
|
||||
@@ -105,10 +105,10 @@ class ParkPhoto(TrackedModel):
|
||||
return None
|
||||
|
||||
@property
|
||||
def dimensions(self) -> Optional[tuple]:
|
||||
"""Get image dimensions as (width, height)."""
|
||||
def dimensions(self) -> Optional[List[int]]:
|
||||
"""Get image dimensions as [width, height]."""
|
||||
try:
|
||||
return (self.image.width, self.image.height)
|
||||
return [self.image.width, self.image.height]
|
||||
except (ValueError, OSError):
|
||||
return None
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ from django.db import models
|
||||
from django.urls import reverse
|
||||
from django.utils.text import slugify
|
||||
from django.core.exceptions import ValidationError
|
||||
from typing import Tuple, Optional, Any, TYPE_CHECKING
|
||||
from typing import Optional, Any, TYPE_CHECKING, List
|
||||
import pghistory
|
||||
from apps.core.history import TrackedModel
|
||||
|
||||
@@ -192,14 +192,16 @@ class Park(TrackedModel):
|
||||
return ""
|
||||
|
||||
@property
|
||||
def coordinates(self) -> Optional[Tuple[float, float]]:
|
||||
"""Returns coordinates as a tuple (latitude, longitude)"""
|
||||
def coordinates(self) -> Optional[List[float]]:
|
||||
"""Returns coordinates as a list [latitude, longitude]"""
|
||||
if hasattr(self, "location") and self.location:
|
||||
return self.location.coordinates
|
||||
coords = self.location.coordinates
|
||||
if coords and isinstance(coords, (tuple, list)):
|
||||
return list(coords)
|
||||
return None
|
||||
|
||||
@classmethod
|
||||
def get_by_slug(cls, slug: str) -> Tuple["Park", bool]:
|
||||
def get_by_slug(cls, slug: str) -> tuple["Park", bool]:
|
||||
"""Get park by current or historical slug"""
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from apps.core.history import HistoricalSlug
|
||||
|
||||
Reference in New Issue
Block a user