Files
octopus/myproject/static/css/quality_indicator.css
Andrey Smakotin 2d344ef53c feat: Фаза 3 - Добавить индикаторы качества фото на фронтенд
Реализовано:
- Создан набор переиспользуемых шаблонных тегов для отображения качества
  - quality_badge_mini: маленький значок в углу фото
  - quality_badge_full: полный индикатор с размером фото
  - quality_indicator: включаемый тег с позиционированием
  - quality_icon_only: только символ качества для списков

- Добавлены шаблонные теги в:
  - product_detail.html: индикатор в углу миниатюр + в модальной галерее
  - product_list.html: иконка качества в таблице товаров
  - productkit_detail.html: индикатор в углу фото комплектов

- Создан CSS с ненавязчивыми стилями:
  - Полупрозрачные индикаторы (opacity: 0.8)
  - Компактные размеры (не отвлекает от фото)
  - Отзывчивость на мобильных устройствах
  - Анимации при наведении

- Обновлена админ панель:
  - Добавлены 3 новых экшена для поиска товаров по качеству
  - show_poor_quality_photos: фильтр на товары требующие обновления
  - show_excellent_quality_photos: фильтр на товары с хорошим качеством
  - show_all_quality_levels: статистика распределения качества

Интеграция в базу template tags:
- myproject/products/templatetags/quality_tags.py (новый файл)
- myproject/static/css/quality_indicator.css (новый файл)
- myproject/products/templates/products/includes/quality_badge.html (новый файл)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 15:13:49 +03:00

193 lines
4.3 KiB
CSS
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* Стили для индикаторов качества фотографий товаров
* Ненавязчивое отображение в углу фото без отвлечения внимания
*/
/* Миниатюрный индикатор в правом верхнем углу фото */
.quality-badge-mini {
display: inline-block;
font-size: 1rem;
opacity: 0.8;
transition: opacity 0.2s ease-in-out;
cursor: help;
}
.quality-badge-mini:hover {
opacity: 1;
}
/* Контейнер с позиционированием для индикатора качества */
.quality-indicator {
font-size: 0.9rem;
z-index: 10;
pointer-events: none; /* Не блокирует клики на фото */
}
.quality-indicator .badge {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0.4rem 0.6rem;
font-size: 0.85rem;
font-weight: 500;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
border-radius: 4px;
}
.quality-indicator .badge.fs-5 {
font-size: 1.2rem !important;
}
.quality-indicator .badge.fs-6 {
font-size: 1rem !important;
}
/* Фотографии в сетке на странице товара */
.photo-card-with-quality {
position: relative;
overflow: hidden;
border-radius: 4px;
}
.photo-card-with-quality .photo-container {
position: relative;
width: 100%;
height: 150px;
display: flex;
align-items: center;
justify-content: center;
background-color: #f8f9fa;
cursor: pointer;
overflow: hidden;
}
.photo-card-with-quality .photo-container img {
max-width: 100%;
max-height: 100%;
object-fit: contain;
}
.photo-card-with-quality .quality-indicator {
pointer-events: none;
}
/* В списках товаров - компактный вид */
.photo-list-item {
position: relative;
display: inline-block;
}
.photo-list-item img {
width: 60px;
height: 60px;
object-fit: cover;
border-radius: 4px;
}
.photo-list-item .quality-icon {
position: absolute;
top: -4px;
right: -4px;
font-size: 0.9rem;
display: inline-block;
background: white;
border-radius: 50%;
width: 20px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
/* Для таблиц - строка со статусом качества */
.quality-status-row {
display: flex;
align-items: center;
gap: 0.5rem;
margin-top: 0.25rem;
font-size: 0.75rem;
}
.quality-status-row .badge {
padding: 0.25rem 0.5rem;
font-size: 0.65rem;
}
/* Tooltip для качества */
.bs-tooltip-top .tooltip-inner {
background-color: rgba(33, 37, 41, 0.95);
padding: 0.5rem 0.75rem;
border-radius: 4px;
font-size: 0.875rem;
}
.bs-tooltip-auto[data-popper-placement^="top"] .tooltip-arrow::before,
.bs-tooltip-top .tooltip-arrow::before {
border-top-color: rgba(33, 37, 41, 0.95);
}
/* Ненавязчивые цвета для indirectных уровней качества */
.quality-indicator .badge.bg-success {
background-color: #28a745 !important;
}
.quality-indicator .badge.bg-info {
background-color: #17a2b8 !important;
}
.quality-indicator .badge.bg-warning {
background-color: #ffc107 !important;
color: #333 !important;
}
.quality-indicator .badge.bg-danger {
background-color: #dc3545 !important;
}
/* Адаптивность для мобильных устройств */
@media (max-width: 576px) {
.quality-indicator {
font-size: 0.8rem;
}
.quality-indicator .badge {
padding: 0.3rem 0.5rem;
font-size: 0.75rem;
}
.photo-list-item .quality-icon {
width: 18px;
height: 18px;
font-size: 0.8rem;
}
}
/* Анимация при наведении для модальной галереи */
.carousel-item .quality-indicator {
animation: fadeIn 0.3s ease-in-out;
}
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
/* Для скрытия warning значка если фото в порядке */
.quality-indicator .badge.bg-danger:not(:has(.badge)) {
animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
0%, 100% {
opacity: 0.8;
}
50% {
opacity: 1;
}
}