- Добавлено поле slug в модель Product с автоматической транслитерацией кириллицы
- Обновлена логика генерации slug в Product и ProductKit с использованием unidecode
- Изменена логика обработки изображений: теперь используется slug вместо sku
- Улучшен UX формы создания комплекта: блок загрузки фото доступен сразу при создании
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Adjusted modal image display to fit properly in viewport:
- Reduced min-height from 80vh to 60vh for header+navigation space
- Reduced max-height from 85vh to 75vh to ensure bottom controls visible
- Kept max-width: 85vw for large square image display
- Images now properly contained within modal with visible controls
Result: Images display large but modals fit completely on screen without scrolling.
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
- Increased modal height from 70vh to 85vh for larger display
- Expanded min-height from 60vh to 80vh for more breathing room
- Changed modal-dialog-centered modal-lg to modal-xl in productkit_detail
- Images now display at nearly full screen size for 1200x1200 large images
- Improved background color and layout for modal-body
Better user experience:
- Images display closer to their full 1200x1200 resolution
- More space for image viewing without scrolling
- Consistent styling across product and productkit modals
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
- product_list.html: Use thumbnail (200x200) for list display with proper sizing
- product_detail.html: Use thumbnail for gallery grid, large for modal view
- productkit_list.html: Use thumbnail (200x200) for list display
- productkit_detail.html: Use thumbnail for grid preview instead of medium
- category_detail.html: Use thumbnail for category photos display
- All image containers now use object-fit: cover for proper display
Optimization:
- Thumbnail (200x200, WebP, 80% quality) loads faster for lists
- Large (1200x1200, WebP, 90% quality) displays in modal/detail view
- Reduces bandwidth and improves page load performance
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
- Added default_storage import to ImageService
- Implemented fallback logic in get_url() method
- First tries new format (.webp for non-original, .jpg for original)
- Falls back to old format (all .jpg) for backward compatibility
- Ensures old photos continue to work with new configuration
- Prevents broken links when migrating to new format
This allows gradual transition from old to new image format without breaking existing image links.
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
Refactored image processing system to use centralized configuration in settings.IMAGE_PROCESSING_CONFIG instead of hardcoded values.
Changes:
- Added IMAGE_PROCESSING_CONFIG to settings with configurable sizes, formats, and quality
- Rewrote ImageProcessor to use dynamic configuration from settings
- Added support for multiple image formats (JPEG, WebP, PNG)
- Updated _save_image_version() to handle different formats and quality levels
- Added original image scaling (max 2160×2160) and square aspect ratio
- Updated ImageService to work with different file extensions (.jpg, .webp, .png)
- All parameters now easily configurable without code changes
Configuration:
- Original: JPEG, quality 100, max 2160×2160 (always square)
- Large: WebP, quality 90, 1200×1200
- Medium: WebP, quality 85, 600×600
- Thumbnail: WebP, quality 80, 200×200
Benefits:
- Flexible and maintainable configuration
- Smaller file sizes (WebP for resized images)
- Maximum quality for originals (JPEG 100)
- Square aspect ratio for better consistency
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
- Override Django's delete_selected action to enforce soft deletion
(calls .delete() on each object instead of queryset.delete())
- Add hard_delete_selected action for safe permanent deletion
- Checks for dangerous relations (KitItem, etc.) before deleting
- Only allows deletion if no critical dependencies exist
- Safely deletes photos from media/ folder by explicitly calling
ProductPhoto.delete() which triggers ImageProcessor cleanup
- Add delete() and hard_delete() method overrides to ProductTag model
(Product, ProductKit, ProductCategory already had these)
- Integrate all three actions into admin classes:
ProductCategoryAdmin, ProductTagAdmin, ProductAdmin, ProductKitAdmin
- Add get_queryset() and get_deleted_status() methods to admin classes
for proper soft delete support
Now when admin clicks "Delete":
1. Regular "Удалить" = soft delete (is_deleted=True, stays in DB)
2. "Безопасно удалить" = hard delete (only if no dependencies, removes from DB)
3. "Восстановить" = restores soft-deleted items
Fixes issue where items were hard-deleted from admin instead of soft-deleted.
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
- Update all_products_list.html: Use thumbnail_url for list previews
- Update product_list.html: Use thumbnail_url for product thumbnails (50x50)
- Update productkit_list.html: Use thumbnail_url for kit thumbnails (50x50)
- Update product_detail.html:
* Use thumbnail_url for thumbnail grid (cards)
* Use large_url for carousel/modal gallery display (800x800)
- Update productkit_detail.html:
* Use medium_url for side panel thumbnails (400x400)
* Use large_url for modal fullscreen display (800x800)
- Update category_detail.html: Use medium_url for category photo display (400x400)
Image sizes now follow best practices:
- Lists: thumbnail (150x150) - 438B - fast loading
- Cards: medium (400x400) - 2.9K - good quality for previews
- Galleries: large (800x800) - 5.6K - high quality for viewing
- Full screen: original - for print/download
This reduces bandwidth by 90% for thumbnails while maintaining quality for detailed views.
- Keep only single photo preview per inline (large version 800x800)
- Removed all_versions_preview display from photo inlines
- Cleaner, more focused admin interface
- Confirmed all sizes are stored correctly:
* Large (800x800) verified
* Medium (400x400) verified
* Originals verified
- Use large_url() for preview in admin (best quality/size balance)
- Added 'sku' field to ProductKitForm meta fields list
- Added SKU label in form labels
- Added SKU widget styling in __init__ method with helpful placeholder
- Updated productkit_form.html template to display SKU field after name, before description
- Updated form field filtering to exclude 'sku' from dynamic loop to prevent duplication
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
- Repositioned the category field to appear after the name field in both product and kit creation forms
- Added a quick-link button to create a new category that opens in a new tab
- Updated form field rendering logic to properly display categories in the correct position
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>