diff --git a/config/settings/environ.py b/config/settings/environ.py index 8321115..8818fed 100644 --- a/config/settings/environ.py +++ b/config/settings/environ.py @@ -15,8 +15,12 @@ if os.path.exists(env_file): SECRET_KEY = env.str("SECRET_KEY", "this-is-the-default-secret-key") DEBUG = env.bool("DEBUG", True) -CORS_ORIGIN_WHITELIST = env.str("CORS_ORIGIN_WHITELIST", "http://localhost:8000").split(",") -CSRF_TRUSTED_ORIGINS = env.str("CSRF_TRUSTED_ORIGINS", "http://localhost:8000").split(",") +CORS_ORIGIN_WHITELIST = env.str("CORS_ORIGIN_WHITELIST", "http://localhost:8000").split( + "," +) +CSRF_TRUSTED_ORIGINS = env.str("CSRF_TRUSTED_ORIGINS", "http://localhost:8000").split( + "," +) DATABASE_URL = env.db_url("DATABASE_URL", "sqlite:///db.sqlite3") diff --git a/scripts/build_static.sh b/scripts/build_static.sh index 31fb33c..01415ce 100644 --- a/scripts/build_static.sh +++ b/scripts/build_static.sh @@ -11,6 +11,8 @@ python manage.py tailwind install python manage.py tailwind build python manage.py collectstatic --noinput +# Clean npm rm -rf ~/.nvm rm -rf ~/.npm rm -rf ~/.bower +rm -rf /code/theme/static_src/node_modules/ diff --git a/web/migrations/0001_initial.py b/web/migrations/0001_initial.py index 8ee4864..b14f983 100644 --- a/web/migrations/0001_initial.py +++ b/web/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 5.1.3 on 2024-12-01 11:25 +# Generated by Django 5.1.3 on 2024-12-05 20:12 from django.db import migrations, models @@ -44,6 +44,127 @@ class Migration(migrations.Migration): verbose_name="logo de la web", ), ), + ( + "business_name", + models.CharField( + blank=True, + help_text="nombre fiscal del comercio", + max_length=128, + null=True, + verbose_name="nombre de negocio", + ), + ), + ( + "business_vat_id", + models.CharField( + blank=True, + max_length=16, + null=True, + verbose_name="CIF del negocio", + ), + ), + ( + "business_brand", + models.CharField( + blank=True, + help_text="marca o nombre comercial que se va a mostrar en la web", + max_length=64, + null=True, + verbose_name="marca de negocio", + ), + ), + ( + "business_address", + models.CharField( + blank=True, + max_length=64, + null=True, + verbose_name="dirección de negocio", + ), + ), + ( + "business_state", + models.CharField( + blank=True, + max_length=32, + null=True, + verbose_name="unidad territorial del negocio", + ), + ), + ( + "business_zip", + models.CharField( + blank=True, + max_length=16, + null=True, + verbose_name="código postal del negocio", + ), + ), + ( + "business_phone", + models.CharField( + blank=True, + max_length=16, + null=True, + verbose_name="número de teléfono de contacto", + ), + ), + ( + "business_email", + models.EmailField( + blank=True, + max_length=80, + null=True, + verbose_name="e-mail de contacto", + ), + ), + ( + "business_email_2", + models.EmailField( + blank=True, + max_length=80, + null=True, + verbose_name="e-mail secundario de contacto", + ), + ), + ( + "bg_color", + models.CharField( + blank=True, + default="", + max_length=9, + null=True, + verbose_name="color de fondo", + ), + ), + ( + "theme_color", + models.CharField( + blank=True, + default="", + max_length=9, + null=True, + verbose_name="color de tema", + ), + ), + ( + "logo_240", + models.ImageField( + blank=True, + null=True, + upload_to="assets", + verbose_name="logo 240x240", + ), + ), + ( + "logo_128", + models.ImageField( + blank=True, + null=True, + upload_to="assets", + verbose_name="logo 128x128", + ), + ), ], options={ "verbose_name": "ajustes de la web", diff --git a/web/models.py b/web/models.py index aae4eab..e6cdcbc 100644 --- a/web/models.py +++ b/web/models.py @@ -15,6 +15,73 @@ class WebSettings(SingletonModel): blank=True, null=True, upload_to="assets", verbose_name=_("logo de la web") ) + business_name = models.CharField( + max_length=128, + blank=True, + null=True, + verbose_name=_("nombre de negocio"), + help_text=_("nombre fiscal del comercio"), + ) + business_vat_id = models.CharField( + max_length=16, blank=True, null=True, verbose_name=_("CIF del negocio") + ) + business_brand = models.CharField( + max_length=64, + blank=True, + null=True, + verbose_name=_("marca de negocio"), + help_text=_("marca o nombre comercial que se va a mostrar en la web"), + ) + + business_address = models.CharField( + max_length=64, blank=True, null=True, verbose_name=_("dirección de negocio") + ) + business_state = models.CharField( + max_length=32, + blank=True, + null=True, + verbose_name=_("unidad territorial del negocio"), + ) + business_zip = models.CharField( + max_length=16, + blank=True, + null=True, + verbose_name=_("código postal del negocio"), + ) + + business_phone = models.CharField( + max_length=16, + blank=True, + null=True, + verbose_name=_("número de teléfono de contacto"), + ) + business_email = models.EmailField( + max_length=80, blank=True, null=True, verbose_name=_("e-mail de contacto") + ) + business_email_2 = models.EmailField( + max_length=80, + blank=True, + null=True, + verbose_name=_("e-mail secundario de contacto"), + ) + + bg_color = models.CharField( + max_length=9, + default="", + blank=True, + null=True, + verbose_name=_("color de fondo"), + ) + theme_color = models.CharField( + max_length=9, default="", blank=True, null=True, verbose_name=_("color de tema") + ) + logo_240 = models.ImageField( + upload_to="assets", blank=True, null=True, verbose_name=_("logo 240x240") + ) + logo_128 = models.ImageField( + upload_to="assets", blank=True, null=True, verbose_name=_("logo 128x128") + ) + class Meta: verbose_name = _("ajustes de la web") verbose_name_plural = _("ajustes de la web") diff --git a/web/templates/components/cart/cart.html b/web/templates/components/cart/cart.html index 64fe5a6..475566e 100644 --- a/web/templates/components/cart/cart.html +++ b/web/templates/components/cart/cart.html @@ -33,16 +33,13 @@