From c23225750be3ba20939c880a482e300330e93370 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Fern=C3=A1ndez?= Date: Wed, 13 Dec 2023 23:58:13 +0100 Subject: [PATCH] feat(frontend): finish delivery MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fernando Fernández --- .docker/nginx.conf | 5 +-- .docker/run.sh | 2 +- backend/traineerbook/settings.py | 2 +- .../src/components/layout/CarritoHeader.vue | 11 +++--- .../pages/clase/ComentariosActividad.vue | 33 +++++++++++++++-- .../components/pages/clase/TablaActividad.vue | 19 +++++++--- frontend/src/composables/use-cart.ts | 16 ++++++--- frontend/src/pages/cart.vue | 36 +++++++++++++++++++ frontend/src/pages/clase/[id].vue | 9 +++-- frontend/src/pages/index.vue | 2 -- frontend/src/pages/register.vue | 2 -- frontend/src/plugins/server/index.ts | 3 +- frontend/types/global/components.d.ts | 1 + frontend/types/global/routes.d.ts | 1 + 14 files changed, 112 insertions(+), 30 deletions(-) create mode 100644 frontend/src/pages/cart.vue diff --git a/.docker/nginx.conf b/.docker/nginx.conf index 6502937..78b1135 100644 --- a/.docker/nginx.conf +++ b/.docker/nginx.conf @@ -24,8 +24,9 @@ server { } location /admin/ { - rewrite ^/admin/(.*) /admin/$1 break; - proxy_pass http://127.0.0.1:8080/; + #rewrite ^/admin/(.*) /admin/$1 break; + #rewrite ^/admin/(.*) /$1 break; + proxy_pass http://127.0.0.1:8080/$request_uri; include uwsgi_params; uwsgi_param UWSGI_SCHEME $scheme; proxy_pass_request_headers on; diff --git a/.docker/run.sh b/.docker/run.sh index 04c9794..71237c5 100644 --- a/.docker/run.sh +++ b/.docker/run.sh @@ -4,4 +4,4 @@ echo "Starting TraineerBook.." echo "" service nginx start echo "" -exec python manage.py runserver 127.0.0.1:8080 +exec python manage.py runserver 0.0.0.0:8080 diff --git a/backend/traineerbook/settings.py b/backend/traineerbook/settings.py index db39921..524ed2f 100644 --- a/backend/traineerbook/settings.py +++ b/backend/traineerbook/settings.py @@ -81,7 +81,7 @@ CORS_ALLOW_ALL_ORIGINS = True CORS_ALLOW_CREDENTIALS = True CORS_ALLOW_PRIVATE_NETWORK = True -CSRF_TRUSTED_ORIGINS=['http://*', 'https://*'] +CSRF_TRUSTED_ORIGINS=['https://localhost:80', 'https://*'] MIDDLEWARE = [ 'traineerbook.middlewares.AddHeaderMiddleware', diff --git a/frontend/src/components/layout/CarritoHeader.vue b/frontend/src/components/layout/CarritoHeader.vue index 0833cd8..35cd43b 100644 --- a/frontend/src/components/layout/CarritoHeader.vue +++ b/frontend/src/components/layout/CarritoHeader.vue @@ -3,18 +3,15 @@ v-slot="{ navigate }" to="/cart" custom> - + - {{ cart.length }} + {{ cart.cart.length }} - + diff --git a/frontend/src/components/pages/clase/ComentariosActividad.vue b/frontend/src/components/pages/clase/ComentariosActividad.vue index 1962524..a1582ee 100644 --- a/frontend/src/components/pages/clase/ComentariosActividad.vue +++ b/frontend/src/components/pages/clase/ComentariosActividad.vue @@ -1,5 +1,7 @@