diff --git a/TODO b/TODO deleted file mode 100644 index d29b001..0000000 --- a/TODO +++ /dev/null @@ -1,13 +0,0 @@ -Nastylovat: -- lazyload načítat o něco dříve (neli zrušit alespoň mimo galerii) -- mobilní verze - -Frontend: -- přidat v galerii zvětsovač na obrázky -- notyfi - -Naplánovat: -- kurzy + cena: vyskakovací okno na rezervaci s jménem lekce? jak to vyřešit s kalendářem? (stránka /rezervace) - -Backend: -- přidat posílání mailu panu vrchnímu \ No newline at end of file diff --git a/services/backend/backend/settings.py b/services/backend/backend/settings.py index 05b3445..27d4705 100644 --- a/services/backend/backend/settings.py +++ b/services/backend/backend/settings.py @@ -20,6 +20,9 @@ env = environ.Env() # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent +MEDIA_URL = '/media/' + +MEDIA_ROOT = os.path.join(BASE_DIR, 'media') # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/ @@ -162,9 +165,6 @@ STATIC_URL = '/static/' # os.path.join(BASE_DIR, 'static') # ] -MEDIA_URL = '/media/' - -MEDIA_ROOT = os.path.join(BASE_DIR, 'media') # Default primary key field type # https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field diff --git a/services/backend/tko/serializers.py b/services/backend/tko/serializers.py index 101d0e6..389d103 100644 --- a/services/backend/tko/serializers.py +++ b/services/backend/tko/serializers.py @@ -19,7 +19,7 @@ class ArticleImageSerializer(serializers.ModelSerializer): @staticmethod def get_title(obj): - return obj.article.title + return obj.article.title if obj.article else '' class ArticleListSerializer(serializers.ModelSerializer): @@ -38,7 +38,8 @@ class ArticleListSerializer(serializers.ModelSerializer): @staticmethod def get_image(obj): main_image = obj.images.order_by("main").first() - return main_image.image.url if main_image else None + url = 'http://localhost:8000' + return f"{url}{main_image.image.url}" if main_image else None class EventListSerializer(serializers.ModelSerializer): diff --git a/services/backend/tko/views.py b/services/backend/tko/views.py index 0c1e33e..5b7a8bc 100644 --- a/services/backend/tko/views.py +++ b/services/backend/tko/views.py @@ -4,6 +4,7 @@ from django.db.models import Q from post_office import mail from rest_framework.generics import ListAPIView, CreateAPIView +from rest_framework.permissions import IsAuthenticated, AllowAny from rest_framework.response import Response from tko.models import Article, Event, ArticleImage @@ -49,6 +50,7 @@ class AllArticleListView(ListAPIView): class GalleryView(ListAPIView): + permission=[AllowAny] queryset = ArticleImage.objects.all().order_by("-article_id", "main") serializer_class = ArticleImageSerializer diff --git a/services/frontend/assets/css/main.css b/services/frontend/assets/css/main.css index 3b41625..2fd442c 100644 --- a/services/frontend/assets/css/main.css +++ b/services/frontend/assets/css/main.css @@ -6,7 +6,6 @@ } h1 { - font-family: 'Futura', sans-serif; font-size: 3rem; color: #333; text-align: center; @@ -16,15 +15,14 @@ h1 { } h2 { - font-family: 'Futura', sans-serif; font-size: 1.5rem; color: #CF3476; text-align: center; + word-break: break-word; margin-bottom: 2rem; } h3 { - font-family: 'Futura', sans-serif; font-size: 1.5rem; color: #666; text-align: center; @@ -32,7 +30,6 @@ h3 { } h4 { - font-family: 'Futura', sans-serif; font-size: 1rem; color: #666; text-align: center; @@ -40,7 +37,6 @@ h4 { } h5 { - font-family: 'Futura', sans-serif; font-size: 1rem; color: #aaa; margin-top: 1rem; @@ -48,7 +44,7 @@ h5 { @media (max-width: 600px) { h1 { - font-size: 2rem; /* Smaller size for mobile */ + font-size: 1.8rem; /* Smaller size for mobile */ margin-top: 1.5rem; } @@ -61,6 +57,7 @@ h5 { min-width: 25rem; margin-left: calc(20% - 2.5rem); margin-right: calc(20% - 2.5rem); + margin-bottom: 3rem; } .app__logo { @@ -69,30 +66,25 @@ h5 { } .app__title { - font-family: 'Futura', sans-serif; font-size: 2rem; color: #333; } .app__tab { - font-family: 'Futura', sans-serif; font-size: 2rem; color: #CF3476; } .to_left { - font-family: 'Futura', sans-serif; font-size: 1rem; } .to_right { - font-family: 'Futura', sans-serif; float: right; } .contact { margin: 20px calc(20% - 40px) 50px; - min-width: 25rem; border-radius: 15px; box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3); } @@ -102,12 +94,10 @@ h5 { font-size: 3rem; color: #333; margin-bottom: 1rem; - font-family: 'Futura', sans-serif; font-weight: bold; } .contact__dialog__title { - font-family: 'Futura', sans-serif; font-size: 2rem; color: #333; margin-bottom: 1rem; @@ -121,6 +111,16 @@ h5 { } @media (max-width: 600px) { + .contact__title { + font-size: 1.5rem; + } + + .contact { + min-width: unset; + margin: 10px; + padding: 1rem; + } + .v-dialog > .v-card { border-radius: 0 !important; height: 100vh; @@ -134,61 +134,47 @@ h5 { } .articles { - margin-left: calc(20% - 2.5rem); - margin-right: calc(20% - 2.5rem); + display: flex; + justify-content: center; + margin: 0 auto; + max-width: 1200px; } .article { - padding: 10px; + padding: 1rem; min-width: 40%; - border-radius: 15px; - box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3); + border-radius: 0; + box-shadow: 0 0 0 rgba(0, 0, 0, 0); margin-bottom: 1rem; } -.article__image { - border-radius: 0.5rem; -} - -.carousel__image img { - border-radius: 0.5rem; - object-fit: contain !important; - padding: 1rem; -} - .article__title { - font-family: 'Futura', sans-serif; - font-size: 1.5rem; + font-size: 1.4rem; color: #CF3476; - text-align: left; - margin-top: 0.1rem; font-weight: bold; } .article__date { - font-family: 'Futura', sans-serif; font-size: 0.8rem; text-align: left; } .article__text { - font-family: 'Futura', sans-serif; font-size: 1rem; - text-align: left; - min-height: 6rem; - color: #666; + color: #333; + line-height: 1.5; + padding: 0.5rem; + margin-bottom: 1rem; } .article__sign { - font-family: 'Futura', sans-serif; + text-align: right; font-size: 1rem; - float: right; - padding-right: 1rem; - color: #333; + font-style: italic; + color: #555; } .show_more { - font-family: 'Futura', sans-serif; text-align: center; color: #CF3476; background: transparent; @@ -243,7 +229,6 @@ h5 { } .pricing__price { - font-family: 'Futura', sans-serif; font-size: 3rem; font-weight: bold; color: #CF3476; @@ -251,9 +236,9 @@ h5 { } .pricing__subtitle { - font-family: 'Futura', sans-serif; font-size: 1rem; color: #555; + word-break: break-word; margin-bottom: 0.5rem; } @@ -262,9 +247,12 @@ h5 { min-width: 100%; } - .pricing-title, + .pricing-title { + font-size: 1.4rem; + } + .pricing-desc { - min-height: unset; /* Removes forced height to prevent breakage */ + min-height: unset; } } @@ -298,7 +286,6 @@ h5 { overflow: hidden; } -/* Mobile Styles */ @media (max-width: 600px) { .trainers__parallax { max-height: 30rem; @@ -326,7 +313,6 @@ h5 { } .advantage__title { - font-family: 'Futura', sans-serif; padding: 0.5rem 0; color: #CF3476; font-size: 1.5rem; @@ -335,7 +321,6 @@ h5 { } .advantage__text { - font-family: 'Futura', sans-serif; padding-bottom: 1rem; font-size: 1rem; color: #333; @@ -362,7 +347,7 @@ h5 { .about { background: transparent; box-shadow: none; - height: 100%; + height: auto; max-width: 80%; margin: 0 auto; text-align: center; @@ -370,7 +355,7 @@ h5 { } .about__parallax { - max-height: 30rem; + max-height: 28rem; margin-top: 2rem; } @@ -381,57 +366,55 @@ h5 { @media (max-width: 600px) { .history__parallax { - max-height: 45rem; + max-height: 58rem; } } .about__title { - font-family: 'Futura', sans-serif; - font-size: 3rem; - text-align: center; - width: 100%; - display: block; + font-size: 2.5rem; color: #fff; margin-top: 1rem; font-weight: bold; + word-break: break-word; + white-space: normal; } .about__subtitle { - font-family: 'Futura', sans-serif; color: #FF3D8C; - font-size: 1.3rem; - text-align: center; - width: 100%; - display: block; - margin-bottom: 0.5rem; + font-size: 1.25rem; + margin-bottom: 1rem; + word-break: break-word; font-weight: bold; } .about__text { - font-family: 'Futura', sans-serif; color: #ddd; - font-size: 1rem; - text-align: center; + font-size: 1.125rem; padding: 0 1rem; + line-height: 1.6; } @media (max-width: 600px) { .about { - max-width: 100%; + max-width: 95%; padding: 1rem; } + .about__parallax { + min-height: 32rem; + } + .about__title { font-size: 1.5rem; } .about__subtitle { font-size: 1rem; + word-break: break-word; } .about__text { - font-size: 1rem; - padding: 0 10px; + font-size: 0.95rem; } } diff --git a/services/frontend/components/About.vue b/services/frontend/components/About.vue index ed4ec5a..d250128 100644 --- a/services/frontend/components/About.vue +++ b/services/frontend/components/About.vue @@ -7,9 +7,9 @@ Vítejte v tanečním klubu! - Vítejte na webu Tanečního klubu Ostrava! + Objevte kouzlo tance s námi! - Objevte kouzlo tance s námi! Ať už jste začátečník nebo zkušený tanečník, v našem klubu najdete místo, kde se můžete rozvíjet, bavit a sdílet svou vášeň pro pohyb. Nabízíme kurzy pro všechny věkové kategorie, od společenských tanců po moderní styly. + Ať už jste začátečník nebo zkušený tanečník, v našem klubu najdete místo, kde se můžete rozvíjet, bavit a sdílet svou vášeň pro pohyb. Nabízíme kurzy pro všechny věkové kategorie, od společenských tanců po moderní styly.

Přidejte se k nám a nechte tanec proměnit váš život! 💃🕺

diff --git a/services/frontend/components/Advantages.vue b/services/frontend/components/Advantages.vue index 4a978fb..1ec836f 100644 --- a/services/frontend/components/Advantages.vue +++ b/services/frontend/components/Advantages.vue @@ -1,6 +1,6 @@ \ No newline at end of file diff --git a/services/frontend/components/menu/Header.vue b/services/frontend/components/menu/Header.vue index 0291c3e..22f91b2 100644 --- a/services/frontend/components/menu/Header.vue +++ b/services/frontend/components/menu/Header.vue @@ -1,76 +1,58 @@ \ No newline at end of file diff --git a/services/frontend/pages/aktuality.vue b/services/frontend/pages/aktuality.vue index f816bd9..b54870d 100644 --- a/services/frontend/pages/aktuality.vue +++ b/services/frontend/pages/aktuality.vue @@ -1,70 +1,3 @@ - - - \ No newline at end of file + \ No newline at end of file diff --git a/services/frontend/pages/galerie.vue b/services/frontend/pages/galerie.vue index b35309b..64f5de5 100644 --- a/services/frontend/pages/galerie.vue +++ b/services/frontend/pages/galerie.vue @@ -47,12 +47,20 @@ interface ArticleImage { const gallery = ref([]); -const { error, data } = await useAPI('load-gallery/', {method: "GET"}); +loadImages(); -if ( data.value ){ +async function loadImages(){ + const { error, data } = await useAPI('load-gallery/', {method: "GET"}); + + if ( data.value ){ gallery.value = data.value as ArticleImage[]; + } + else if (error.value) { + console.error("Error loading gallery:", error.value); + } } -else if (error.value) { - console.error("Error loading gallery:", error.value); -} + + + + \ No newline at end of file diff --git a/services/frontend/pages/index.vue b/services/frontend/pages/index.vue index a1d2f62..fb00320 100644 --- a/services/frontend/pages/index.vue +++ b/services/frontend/pages/index.vue @@ -11,12 +11,12 @@ - - - - - - + + + + + + \ No newline at end of file + + + \ No newline at end of file diff --git a/services/frontend/public/image.jpg b/services/frontend/public/image.jpg new file mode 100644 index 0000000..1880493 Binary files /dev/null and b/services/frontend/public/image.jpg differ