Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions essenza/essenza/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@

STATIC_URL = 'static/'
STATICFILES_DIRS = [BASE_DIR / 'static']
STATIC_ROOT = BASE_DIR / 'staticfiles'

MEDIA_URL = '/media/'
MEDIA_ROOT = BASE_DIR / 'media'

# Default primary key field type
# https://docs.djangoproject.com/en/5.2/ref/settings/#default-auto-field

Expand Down
7 changes: 6 additions & 1 deletion essenza/essenza/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@
from django.urls import path, include
from info.views import info_view
from product.views import DashboardView
from django.conf import settings
from django.conf.urls.static import static

urlpatterns = [
path('info/', info_view, name='info-home'),
path("user/", include("user.urls")),
path('admin/', admin.site.urls),
path('', DashboardView.as_view(), name='dashboard')
]
]

if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Binary file added essenza/media/profile_pics/admin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion essenza/product/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Product(models.Model):
category = models.CharField(max_length=20, choices=Category.choices)
brand = models.CharField(max_length=255)
price = models.DecimalField(max_digits=10, decimal_places=2)
photo = models.ImageField(upload_to='profile_pics/', null=True, blank=True)
photo = models.ImageField(upload_to='products/', null=True, blank=True)
stock = models.IntegerField()
is_active = models.BooleanField(default=False)

Expand Down
40 changes: 20 additions & 20 deletions essenza/product/sample/sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"category": "maquillaje",
"brand": "L'Oréal",
"price": 19.99,
"photo": "https://example.com/images/maquillaje_base.jpg",
"photo": "products/maquillaje_base.jpg",
"stock": 50,
"is_active": true
}
Expand All @@ -22,7 +22,7 @@
"category": "tratamiento",
"brand": "Pantene",
"price": 6.99,
"photo": "https://example.com/images/shampoo_reconstructivo.jpg",
"photo": "products/shampoo_reconstructivo.jpg",
"stock": 100,
"is_active": true
}
Expand All @@ -36,7 +36,7 @@
"category": "herramienta",
"brand": "Braun",
"price": 45.99,
"photo": "https://example.com/images/secador_pelo.jpg",
"photo": "products/secador_pelo.jpg",
"stock": 30,
"is_active": true
}
Expand All @@ -50,7 +50,7 @@
"category": "perfume",
"brand": "Chanel",
"price": 79.99,
"photo": "https://example.com/images/perfume_floral.jpg",
"photo": "products/perfume_floral.jpg",
"stock": 20,
"is_active": true
}
Expand All @@ -64,7 +64,7 @@
"category": "tratamiento",
"brand": "Nivea",
"price": 12.99,
"photo": "https://example.com/images/crema_hidratante.jpg",
"photo": "products/crema_hidratante.jpg",
"stock": 150,
"is_active": true
}
Expand All @@ -78,7 +78,7 @@
"category": "herramienta",
"brand": "Remington",
"price": 29.99,
"photo": "https://example.com/images/rizador_pelo.jpg",
"photo": "products/rizador_pelo.jpg",
"stock": 40,
"is_active": true
}
Expand All @@ -92,7 +92,7 @@
"category": "tratamiento",
"brand": "Dettol",
"price": 4.99,
"photo": "https://example.com/images/gel_antibacterial.jpg",
"photo": "products/gel_antibacterial.jpg",
"stock": 200,
"is_active": true
}
Expand All @@ -106,7 +106,7 @@
"category": "tratamiento",
"brand": "Head & Shoulders",
"price": 7.99,
"photo": "https://example.com/images/shampoo_anticaspa.jpg",
"photo": "products/shampoo_anticaspa.jpg",
"stock": 90,
"is_active": true
}
Expand All @@ -120,7 +120,7 @@
"category": "tratamiento",
"brand": "Argan Oil",
"price": 15.99,
"photo": "https://example.com/images/aceite_capilar.jpg",
"photo": "products/aceite_capilar.jpg",
"stock": 60,
"is_active": true
}
Expand All @@ -134,7 +134,7 @@
"category": "cabello",
"brand": "Garnier",
"price": 8.99,
"photo": "https://example.com/images/tinte_cabello.jpg",
"photo": "products/tinte_cabello.jpg",
"stock": 110,
"is_active": true
}
Expand All @@ -148,7 +148,7 @@
"category": "tratamiento",
"brand": "L'Oréal",
"price": 18.99,
"photo": "https://example.com/images/mascarilla_facial.jpg",
"photo": "products/mascarilla_facial.jpg",
"stock": 80,
"is_active": true
}
Expand All @@ -162,7 +162,7 @@
"category": "tratamiento",
"brand": "TRESemmé",
"price": 5.99,
"photo": "https://example.com/images/shampoo_voluminizador.jpg",
"photo": "products/shampoo_voluminizador.jpg",
"stock": 120,
"is_active": true
}
Expand All @@ -176,7 +176,7 @@
"category": "cabello",
"brand": "Schwarzkopf",
"price": 10.99,
"photo": "https://example.com/images/laca_pelo.jpg",
"photo": "products/laca_pelo.jpg",
"stock": 70,
"is_active": true
}
Expand All @@ -190,7 +190,7 @@
"category": "tratamiento",
"brand": "Hawaiian Tropic",
"price": 14.99,
"photo": "https://example.com/images/crema_solar.jpg",
"photo": "products/crema_solar.jpg",
"stock": 40,
"is_active": true
}
Expand All @@ -204,7 +204,7 @@
"category": "tratamiento",
"brand": "Olay",
"price": 25.99,
"photo": "https://example.com/images/crema_antiedad.jpg",
"photo": "products/crema_antiedad.jpg",
"stock": 30,
"is_active": true
}
Expand All @@ -218,7 +218,7 @@
"category": "tratamiento",
"brand": "Dove",
"price": 3.99,
"photo": "https://example.com/images/desodorante.jpg",
"photo": "products/desodorante.jpg",
"stock": 150,
"is_active": true
}
Expand All @@ -232,7 +232,7 @@
"category": "tratamiento",
"brand": "Neutrogena",
"price": 4.49,
"photo": "https://example.com/images/toallitas_desmaquillantes.jpg",
"photo": "products/toallitas_desmaquillantes.jpg",
"stock": 90,
"is_active": true
}
Expand All @@ -246,7 +246,7 @@
"category": "maquillaje",
"brand": "Real Techniques",
"price": 12.99,
"photo": "https://example.com/images/pincel_maquillaje.jpg",
"photo": "products/pincel_maquillaje.jpg",
"stock": 110,
"is_active": true
}
Expand All @@ -260,7 +260,7 @@
"category": "tratamiento",
"brand": "Eucerin",
"price": 9.99,
"photo": "https://example.com/images/crema_pies.jpg",
"photo": "products/crema_pies.jpg",
"stock": 80,
"is_active": true
}
Expand All @@ -274,7 +274,7 @@
"category": "tratamiento",
"brand": "Neutrogena",
"price": 7.49,
"photo": "https://example.com/images/limpieza_facial.jpg",
"photo": "products/limpieza_facial.jpg",
"stock": 130,
"is_active": true
}
Expand Down
Binary file removed essenza/profile_pics/img1.jpg
Binary file not shown.
5 changes: 5 additions & 0 deletions essenza/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
asgiref==3.10.0
Django==5.2.8
pillow==12.0.0
sqlparse==0.5.3
tzdata==2025.2
Binary file added essenza/static/images/default_user.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion essenza/templates/product/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@

{% if user.is_authenticated %}

<a href="/info">Mi perfil</a>
<a href="{% url 'profile' %}">Mi perfil</a>
<form action="{% url 'logout' %}" method="post" style="margin:0;">
{% csrf_token %}
<button type="submit" class="dropdown-logout-btn">Log out</button>
Expand Down
101 changes: 101 additions & 0 deletions essenza/templates/user/confirm_delete_profile.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{% load static %}
<!doctype html>
<html lang="es">
<head>
<meta charset="utf-8">
<title>Eliminar Cuenta · Essenza</title>
<meta name="viewport" content="width=device-width, initial-scale=1">

<style>
body {
/* --- Variables de Color --- */
--color-principal: #c06b3e;
--color-principal-hover: #a35a34;
--color-fondo: #faf7f2;
--color-fondo-tarjeta: #fff;
--color-texto-base: #333;
--color-borde-claro: #eee;
--color-error: #b00020;
--color-error-hover: #8e0019;
--color-foco-sombra: rgba(192, 107, 62, 0.2);

background-color: var(--color-fondo);
margin: 0;
font-family: 'Segoe UI', Arial, sans-serif;
}
.page {
min-height:100dvh;
display:flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap:2rem;
}
.brand {
color: var(--color-principal);
font-size: 48px;
margin-bottom: 10px;
text-align: center;
}
.form-card {
width: min(420px, 88vw);
background: var(--color-fondo-tarjeta);
border: 2px solid var(--color-error); /* Borde rojo de advertencia */
border-radius: 16px;
box-shadow: 0 12px 28px rgba(0, 0, 0, 0.06);
padding: 22px 24px;
box-sizing: border-box;
text-align: center; /* Centramos el contenido */
}

/* Botón de peligro (copiado de .btn-primary) */
.btn-danger {
width: 100%;
margin-top: 14px;
padding: 10px 12px;
border-radius: 10px;
background: var(--color-error); /* Color rojo */
color: var(--color-fondo-tarjeta);
border: none;
cursor: pointer;
transition: background-color 0.3s;
}
.btn-danger:hover {
background-color: var(--color-error-hover); /* Rojo más oscuro */
}
.login-link {
margin-top: 15px;
text-align: center;
font-size: 13px;
}
.login-link a {
color: var(--color-principal);
text-decoration: underline;
}
</style>
</head>
<body>
<div class="page">
<h1 class="brand">ESSENZA</h1>
<div class="form-card">
<h2 style="color: var(--color-error); margin-top: 0;">Eliminar Cuenta</h2>
<p style="color: var(--color-texto-base); font-size: 16px;">
¿Estás seguro de que quieres eliminar tu cuenta permanentemente?
</p>
<p style="color: var(--color-texto-base); font-size: 14px; font-weight: bold;">
Toda tu información será borrada y esta acción no se puede deshacer.
</p>

<form method="post">
{% csrf_token %}

<button type="submit" class="btn-danger">Sí, eliminar mi cuenta ahora</button>
</form>

<p class="login-link">
<a href="{% url 'profile' %}">No, cancelar y volver a mi perfil</a>
</p>
</div>
</div>
</body>
</html>
Loading