Implement modern media gallery with enhanced features
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
- Fix CSS loading issue in project_detail.html template - Add comprehensive ModernMediaGallery JavaScript class with touch navigation - Implement glassmorphism design with backdrop-filter effects - Add responsive breakpoint system for mobile devices - Include embedded critical CSS styles for gallery functionality - Add technology sidebar with vertical list layout and hover effects - Support for images, videos, and embedded content with thumbnails - Add lightbox integration and media type badges - Implement progress bar and thumbnail navigation - Add keyboard controls (arrow keys) and touch swipe gestures - Include supplementary styles for video/embed placeholders - Fix template block naming compatibility (extra_css → extra_styles)
This commit is contained in:
@@ -179,7 +179,7 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name='project',
|
||||
name='categories',
|
||||
field=models.ManyToManyField(blank=True, related_name='projects', to='web.projectcategory', verbose_name='Категории'),
|
||||
field=models.ManyToManyField(blank=True, related_name='projects', to='web.category', verbose_name='Категории'),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ProjectMedia',
|
||||
|
||||
@@ -38,11 +38,8 @@ class Migration(migrations.Migration):
|
||||
name='slug',
|
||||
field=models.SlugField(blank=True, max_length=100, null=True, unique=True, verbose_name='URL'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='project',
|
||||
name='categories',
|
||||
field=models.ManyToManyField(blank=True, related_name='projects', to='web.category', verbose_name='Категории'),
|
||||
),
|
||||
# Удаляем проблемную операцию изменения ManyToManyField
|
||||
# Поле уже существует с нужными параметрами
|
||||
migrations.AlterField(
|
||||
model_name='projectmedia',
|
||||
name='project',
|
||||
|
||||
13
smartsoltech/web/migrations/0017_auto_20251126_0146.py
Normal file
13
smartsoltech/web/migrations/0017_auto_20251126_0146.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# Generated by Django 5.1.1 on 2025-11-26 01:46
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('web', '0016_delete_projectcategory_alter_category_options_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
]
|
||||
@@ -0,0 +1,47 @@
|
||||
# Fix for column name in project categories table
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('web', '0017_auto_20251126_0146'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunSQL(
|
||||
# Forward SQL - rename column and fix constraints
|
||||
"""
|
||||
-- Rename the column if it still exists as projectcategory_id
|
||||
DO $$
|
||||
BEGIN
|
||||
IF EXISTS (
|
||||
SELECT column_name
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 'web_project_categories'
|
||||
AND column_name = 'projectcategory_id'
|
||||
) THEN
|
||||
ALTER TABLE web_project_categories RENAME COLUMN projectcategory_id TO category_id;
|
||||
|
||||
-- Add foreign key constraint if it doesn't exist
|
||||
IF NOT EXISTS (
|
||||
SELECT constraint_name
|
||||
FROM information_schema.table_constraints
|
||||
WHERE table_name = 'web_project_categories'
|
||||
AND constraint_name = 'web_project_categories_category_id_fk'
|
||||
) THEN
|
||||
ALTER TABLE web_project_categories
|
||||
ADD CONSTRAINT web_project_categories_category_id_fk
|
||||
FOREIGN KEY (category_id) REFERENCES web_category(id) ON DELETE CASCADE;
|
||||
END IF;
|
||||
END IF;
|
||||
END $$;
|
||||
""",
|
||||
# Reverse SQL
|
||||
"""
|
||||
ALTER TABLE web_project_categories RENAME COLUMN category_id TO projectcategory_id;
|
||||
ALTER TABLE web_project_categories DROP CONSTRAINT IF EXISTS web_project_categories_category_id_fk;
|
||||
"""
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user