From da29634e579d32c797adbe56398ddb5d7d1a1dee Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Sun, 15 Jun 2025 10:17:08 +0200 Subject: [PATCH 01/41] Update YouTube credentials handling to include channel title in home template --- game/templates/game/home.html | 2 ++ game/views.py | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/game/templates/game/home.html b/game/templates/game/home.html index fe97624..eb7e220 100644 --- a/game/templates/game/home.html +++ b/game/templates/game/home.html @@ -11,6 +11,8 @@

{% if not user.youtubecredentials.credentials %} Me connecter au compte Youtube + {% else %} + Connecté au compte Youtube {{ user.youtubecredentials.credentials.channel_title }}. {% endif %}

{% if user.owned_group_set.exists or user.group_set.exists %} diff --git a/game/views.py b/game/views.py index cec8875..cbcbdb8 100644 --- a/game/views.py +++ b/game/views.py @@ -1,6 +1,7 @@ import random import google_auth_oauthlib +import googleapiclient from django.conf import settings from django.contrib import messages from django.contrib.auth.mixins import LoginRequiredMixin @@ -363,6 +364,13 @@ class YoutubeCallbackView(LoginRequiredMixin, View): flow.fetch_token(code=request.GET.get("code")) credentials = flow.credentials + + yt_api = googleapiclient.discovery.build( + "youtube", "v3", credentials=credentials + ) + channel_request = yt_api.channels().list(part="snippet", mine=True) + res = channel_request.execute() + models.YoutubeCredentials.objects.update_or_create( user=request.user, defaults={ @@ -373,10 +381,10 @@ class YoutubeCallbackView(LoginRequiredMixin, View): "client_id": credentials.client_id, "client_secret": credentials.client_secret, "granted_scopes": credentials.granted_scopes, + "channel_title": res["items"][0]["snippet"]["title"], } }, ) - messages.add_message(request, messages.SUCCESS, "Connexion à Youtube réussie.") return redirect("/") From 28203bd630a2995ec1898a1a14ed15c65f582cb9 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Sun, 15 Jun 2025 10:19:46 +0200 Subject: [PATCH 02/41] Reorganize YouTube credentials display in home and form templates for consistency --- game/templates/game/home.html | 6 +++--- game/templates/game/musikgame_form.html | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/game/templates/game/home.html b/game/templates/game/home.html index eb7e220..27511b5 100644 --- a/game/templates/game/home.html +++ b/game/templates/game/home.html @@ -5,9 +5,6 @@ Musik

Bienvenue {{ user.username }} !

-

- Mes groupes -

{% if not user.youtubecredentials.credentials %} Me connecter au compte Youtube @@ -15,6 +12,9 @@ Connecté au compte Youtube {{ user.youtubecredentials.credentials.channel_title }}. {% endif %}

+

+ Mes groupes +

{% if user.owned_group_set.exists or user.group_set.exists %} {% for group in user.owned_group_set.all %} diff --git a/game/templates/game/musikgame_form.html b/game/templates/game/musikgame_form.html index 3e6d4ed..03820a3 100644 --- a/game/templates/game/musikgame_form.html +++ b/game/templates/game/musikgame_form.html @@ -4,5 +4,12 @@

{{ group.name }}

+

+ {% if not user.youtubecredentials.credentials %} + Me connecter au compte Youtube + {% else %} + Une playlist sera générée automatiquement sur le compte Youtube {{ user.youtubecredentials.credentials.channel_title }}. + {% endif %} +

{% form form %} {% endblock content %} From f36fe8ea84bf9facdc843edf67039bdc7ccfad90 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Sun, 15 Jun 2025 10:22:27 +0200 Subject: [PATCH 03/41] Remove channel title from credentials in playlist generation and deletion tasks --- game/tasks.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/game/tasks.py b/game/tasks.py index 22a7dc0..ceb5777 100644 --- a/game/tasks.py +++ b/game/tasks.py @@ -8,6 +8,7 @@ from . import models @shared_task def generate_playlist(creds, game_pk): game = models.MusikGame.objects.get(pk=game_pk) + creds.pop("channel_title") credentials = google.oauth2.credentials.Credentials(**creds) yt_api = googleapiclient.discovery.build("youtube", "v3", credentials=credentials) pl_request = yt_api.playlists().insert( @@ -47,6 +48,7 @@ def generate_playlist(creds, game_pk): @shared_task def delete_playlist(creds, playlist_id): + creds.pop("channel_title") credentials = google.oauth2.credentials.Credentials(**creds) yt_api = googleapiclient.discovery.build("youtube", "v3", credentials=credentials) From 83404e2ed5b969678c0cf7f0fd6a39fecd31eb7e Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Sun, 15 Jun 2025 10:25:40 +0200 Subject: [PATCH 04/41] Add title field to YoutubeCredentials model and update related templates and tasks --- .../migrations/0017_youtubecredentials_title.py | 17 +++++++++++++++++ game/models.py | 1 + game/tasks.py | 2 -- game/templates/game/home.html | 2 +- game/templates/game/musikgame_form.html | 2 +- game/views.py | 4 ++-- 6 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 game/migrations/0017_youtubecredentials_title.py diff --git a/game/migrations/0017_youtubecredentials_title.py b/game/migrations/0017_youtubecredentials_title.py new file mode 100644 index 0000000..89870e4 --- /dev/null +++ b/game/migrations/0017_youtubecredentials_title.py @@ -0,0 +1,17 @@ +# Generated by Django 5.2.3 on 2025-06-15 08:24 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("game", "0016_alter_groupleader_member"), + ] + + operations = [ + migrations.AddField( + model_name="youtubecredentials", + name="title", + field=models.CharField(blank=True), + ), + ] diff --git a/game/models.py b/game/models.py index a3f104d..1f8ce2f 100644 --- a/game/models.py +++ b/game/models.py @@ -11,6 +11,7 @@ from . import tasks class YoutubeCredentials(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) credentials = models.JSONField() + title = models.CharField(blank=True) class Group(models.Model): diff --git a/game/tasks.py b/game/tasks.py index ceb5777..22a7dc0 100644 --- a/game/tasks.py +++ b/game/tasks.py @@ -8,7 +8,6 @@ from . import models @shared_task def generate_playlist(creds, game_pk): game = models.MusikGame.objects.get(pk=game_pk) - creds.pop("channel_title") credentials = google.oauth2.credentials.Credentials(**creds) yt_api = googleapiclient.discovery.build("youtube", "v3", credentials=credentials) pl_request = yt_api.playlists().insert( @@ -48,7 +47,6 @@ def generate_playlist(creds, game_pk): @shared_task def delete_playlist(creds, playlist_id): - creds.pop("channel_title") credentials = google.oauth2.credentials.Credentials(**creds) yt_api = googleapiclient.discovery.build("youtube", "v3", credentials=credentials) diff --git a/game/templates/game/home.html b/game/templates/game/home.html index 27511b5..5a290a5 100644 --- a/game/templates/game/home.html +++ b/game/templates/game/home.html @@ -9,7 +9,7 @@ {% if not user.youtubecredentials.credentials %} Me connecter au compte Youtube {% else %} - Connecté au compte Youtube {{ user.youtubecredentials.credentials.channel_title }}. + Connecté au compte Youtube {{ user.youtubecredentials.title }}. {% endif %}

diff --git a/game/templates/game/musikgame_form.html b/game/templates/game/musikgame_form.html index 03820a3..38ed5b6 100644 --- a/game/templates/game/musikgame_form.html +++ b/game/templates/game/musikgame_form.html @@ -8,7 +8,7 @@ {% if not user.youtubecredentials.credentials %} Me connecter au compte Youtube {% else %} - Une playlist sera générée automatiquement sur le compte Youtube {{ user.youtubecredentials.credentials.channel_title }}. + Une playlist sera générée automatiquement sur le compte Youtube {{ user.youtubecredentials.title }}. {% endif %}

{% form form %} diff --git a/game/views.py b/game/views.py index cbcbdb8..096bc12 100644 --- a/game/views.py +++ b/game/views.py @@ -381,8 +381,8 @@ class YoutubeCallbackView(LoginRequiredMixin, View): "client_id": credentials.client_id, "client_secret": credentials.client_secret, "granted_scopes": credentials.granted_scopes, - "channel_title": res["items"][0]["snippet"]["title"], - } + }, + "title": res["items"][0]["snippet"]["title"], }, ) messages.add_message(request, messages.SUCCESS, "Connexion à Youtube réussie.") From 7259046916ced4d9d2188de3d2ed004729826347 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Sun, 15 Jun 2025 10:37:55 +0200 Subject: [PATCH 05/41] Add email configuration settings to Django settings --- musik/settings.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/musik/settings.py b/musik/settings.py index b12b987..aeb5f91 100644 --- a/musik/settings.py +++ b/musik/settings.py @@ -141,3 +141,12 @@ YOUTUBE_API_KEY = os.getenv("YOUTUBE_API_KEY", "") YOUTUBE_OAUTH_SECRETS = os.getenv("YOUTUBE_OAUTH_SECRETS", "") CELERY_BROKER_URL = os.getenv("CELERY_BROKER_URL", None) + +EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend" +EMAIL_HOST = os.getenv("EMAIL_HOST") +EMAIL_PORT = os.getenv("EMAIL_PORT", 587) +EMAIL_HOST_USER = os.getenv("EMAIL_HOST_USER") +EMAIL_HOST_PASSWORD = os.getenv("EMAIL_HOST_PASSWORD") +EMAIL_USE_SSL = os.getenv("EMAIL_USE_SSL", False) +EMAIL_USE_TLS = os.getenv("EMAIL_USE_TLS", not EMAIL_USE_SSL) +DEFAULT_FROM_EMAIL = os.getenv("DEFAULT_FROM_EMAIL", EMAIL_HOST_USER) From a24fb897a31c9a57e4a1fab585ef7fee4d1c97f0 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Sun, 15 Jun 2025 10:42:16 +0200 Subject: [PATCH 06/41] Refactor user registration and login forms for improved structure and error handling --- base/templates/auth/user_form.html | 2 +- base/templates/registration/login.html | 33 +++++++++++++++++++++----- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/base/templates/auth/user_form.html b/base/templates/auth/user_form.html index 257d1dc..20c40a8 100644 --- a/base/templates/auth/user_form.html +++ b/base/templates/auth/user_form.html @@ -2,5 +2,5 @@ {% load form %} {% block content %}

Créer un compte

- {% form form %} + {% form form submit="Créer mon compte" %} {% endblock content %} diff --git a/base/templates/registration/login.html b/base/templates/registration/login.html index 1a78811..8bbb8fd 100644 --- a/base/templates/registration/login.html +++ b/base/templates/registration/login.html @@ -1,9 +1,30 @@ {% extends "base.html" %} -{% load form %} {% block content %}

Connexion

-

- Créer un compte -

- {% form form submit="Se connecter" %} - {% endblock content %} + {% for error in form.non_field_errors %}
{{ error }}
{% endfor %} +
+ {% csrf_token %} + {% for field in form %} +
+ {% if field.id_for_label %} + + {% else %} + {{ field.label }} + {% endif %} + {{ field }} + {% if field.errors %} + {{ field.errors|join:", " }} + {% endif %} +
+ {% endfor %} + +

+ Créer mon compte +

+

+ J'ai oublié mon mot de passe +

+
+{% endblock content %} From da1c7507710cc77a60029ff101b40bcea4fb28e4 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Sun, 15 Jun 2025 11:02:35 +0200 Subject: [PATCH 07/41] Add password change and reset functionality with corresponding views and templates --- .../registration/password_change_form.html | 8 +++++++ .../registration/password_reset_confirm.html | 8 +++++++ .../registration/password_reset_form.html | 8 +++++++ base/urls.py | 21 +++++++++++++++++-- base/views.py | 18 ++++++++++++++++ 5 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 base/templates/registration/password_change_form.html create mode 100644 base/templates/registration/password_reset_confirm.html create mode 100644 base/templates/registration/password_reset_form.html diff --git a/base/templates/registration/password_change_form.html b/base/templates/registration/password_change_form.html new file mode 100644 index 0000000..25304fe --- /dev/null +++ b/base/templates/registration/password_change_form.html @@ -0,0 +1,8 @@ +{% extends "base.html" %} +{% load form %} +{% block content %} +

+ Changer mon mot de passe +

+ {% form form submit="Changer mon mot de passe" %} + {% endblock content %} diff --git a/base/templates/registration/password_reset_confirm.html b/base/templates/registration/password_reset_confirm.html new file mode 100644 index 0000000..2f7f317 --- /dev/null +++ b/base/templates/registration/password_reset_confirm.html @@ -0,0 +1,8 @@ +{% extends "base.html" %} +{% load form %} +{% block content %} +

+ Réinitialiser mon mot de passe +

+ {% form form submit="Réinitialiser mon mot de passe" %} + {% endblock content %} diff --git a/base/templates/registration/password_reset_form.html b/base/templates/registration/password_reset_form.html new file mode 100644 index 0000000..2f7f317 --- /dev/null +++ b/base/templates/registration/password_reset_form.html @@ -0,0 +1,8 @@ +{% extends "base.html" %} +{% load form %} +{% block content %} +

+ Réinitialiser mon mot de passe +

+ {% form form submit="Réinitialiser mon mot de passe" %} + {% endblock content %} diff --git a/base/urls.py b/base/urls.py index ea1f6ba..6723389 100644 --- a/base/urls.py +++ b/base/urls.py @@ -1,4 +1,5 @@ -from django.urls import include, path +from django.contrib.auth import views as auth_views +from django.urls import path from django.views.generic import TemplateView from . import views @@ -6,6 +7,22 @@ from . import views urlpatterns = [ path("", views.HomePageView.as_view(), name="index"), path("accounts/signup/", views.SignupView.as_view(), name="signup"), - path("accounts/", include("django.contrib.auth.urls")), + path("accounts/login/", auth_views.LoginView.as_view(), name="login"), + path("accounts/logout/", auth_views.LogoutView.as_view(), name="logout"), + path( + "accounts/password_change/", + views.PasswordChangeView.as_view(), + name="password_change", + ), + path( + "accounts/password_reset/", + views.PasswordResetView.as_view(), + name="password_reset", + ), + path( + "accounts/reset///", + views.PasswordResetConfirmView.as_view(), + name="password_reset_confirm", + ), path("legal/", TemplateView.as_view(template_name="privacy.html"), name="legal"), ] diff --git a/base/views.py b/base/views.py index 32dd5bb..26f9163 100644 --- a/base/views.py +++ b/base/views.py @@ -1,3 +1,4 @@ +from django.contrib.auth import views as auth_views from django.contrib.auth.models import User from django.contrib.messages.views import SuccessMessageMixin from django.shortcuts import redirect @@ -22,3 +23,20 @@ class SignupView(SuccessMessageMixin, CreateView): form_class = forms.UserSignupForm success_url = reverse_lazy("login") success_message = "Le compte %(username)s a été créé avec succès." + + +class PasswordChangeView(SuccessMessageMixin, auth_views.PasswordChangeView): + success_message = "Le mot de passe a été changé avec succès." + success_url = reverse_lazy("index") + + +class PasswordResetView(SuccessMessageMixin, auth_views.PasswordResetView): + success_message = "Un courriel a été envoyé avec les instructions pour réinitialiser votre mot de passe." + success_url = reverse_lazy("login") + + +class PasswordResetConfirmView( + SuccessMessageMixin, auth_views.PasswordResetConfirmView +): + success_message = "Le mot de passe a été réinitialisé avec succès." + success_url = reverse_lazy("login") From cd0ca2f5ea3e1834763261047f4908b7b451abf1 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Sun, 15 Jun 2025 11:19:12 +0200 Subject: [PATCH 08/41] Add account settings page with YouTube connection management and user update functionality --- base/templates/auth/user_settings.html | 37 ++++++++++++++++++++++++++ base/templates/base.html | 4 ++- base/urls.py | 1 + base/views.py | 14 +++++++++- game/templates/game/home.html | 7 +---- game/urls.py | 1 + game/views.py | 6 +++++ 7 files changed, 62 insertions(+), 8 deletions(-) create mode 100644 base/templates/auth/user_settings.html diff --git a/base/templates/auth/user_settings.html b/base/templates/auth/user_settings.html new file mode 100644 index 0000000..9fa4218 --- /dev/null +++ b/base/templates/auth/user_settings.html @@ -0,0 +1,37 @@ +{% extends "base.html" %} +{% load form %} +{% block content %} +

+ Mon compte +

+ {% for error in form.non_field_errors %}
{{ error }}
{% endfor %} +
+ {% csrf_token %} +
+ {% if not user.youtubecredentials.credentials %} + Me connecter au compte Youtube + {% else %} + + {% endif %} +
+
+ {% for field in form %} + + {% endfor %} + +
+
+ Changer mon mot de passe +
+
+{% endblock content %} diff --git a/base/templates/base.html b/base/templates/base.html index 8c84913..4622abb 100644 --- a/base/templates/base.html +++ b/base/templates/base.html @@ -47,7 +47,9 @@

- {% if musikgame.playlist or musikgame.playlist_loading %} -
- {% csrf_token %} -
+ + {% csrf_token %} +
+ {% if musikgame.playlist or musikgame.playlist_loading %} Playlist - {% if musikgame.over %} - Mes réponses - {% else %} - Répondre - {% endif %} -
- {% if is_leader and not musikgame.over %} -
- -
{% endif %} - - {% endif %} + {% if musikgame.over %} + Mes réponses + {% else %} + Répondre + {% endif %} +
+ {% if is_leader and not musikgame.over %} +
+ +
+ {% endif %} +

Joueurs

From 951128147cb561f223a5b20075a9ed32dd9dab11 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Mon, 16 Jun 2025 15:44:17 +0200 Subject: [PATCH 33/41] Fix playlist loading logic in MusikGame creation and update related template messages Fix #10 --- game/models.py | 3 +++ game/templates/game/musikgame_form.html | 8 +++++--- game/views.py | 5 ++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/game/models.py b/game/models.py index 18912a0..51eb410 100644 --- a/game/models.py +++ b/game/models.py @@ -99,6 +99,9 @@ def generateYoutubePlaylist(sender, instance, created, **kwargs): if creds := instance.group.owner.youtubecredentials: tasks.generate_playlist.delay_on_commit(creds.credentials, instance.pk) + else: + instance.playlist_loading = False + instance.save() @receiver(post_delete, sender=MusikGame) diff --git a/game/templates/game/musikgame_form.html b/game/templates/game/musikgame_form.html index 38ed5b6..655723a 100644 --- a/game/templates/game/musikgame_form.html +++ b/game/templates/game/musikgame_form.html @@ -5,10 +5,12 @@ {{ group.name }}

- {% if not user.youtubecredentials.credentials %} - Me connecter au compte Youtube + {% if group.owner.youtubecredentials.credentials %} + Une playlist sera générée automatiquement sur le compte Youtube de {{ group.owner }} ({{ group.owner.youtubecredentials.title }}). + {% elif user == group.owner %} + Connecter mon compte Youtube {% else %} - Une playlist sera générée automatiquement sur le compte Youtube {{ user.youtubecredentials.title }}. + Aucune playlist Youtube ne sera générée car {{ group.owner }} n'a pas lié son compte Youtube. {% endif %}

{% form form %} diff --git a/game/views.py b/game/views.py index 20fedff..45685aa 100644 --- a/game/views.py +++ b/game/views.py @@ -331,9 +331,8 @@ class GameCreateView(LoginRequiredMixin, CreateView): game=form.instance, player=player, music_video=music, order=order ) - if models.YoutubeCredentials.objects.filter(user=self.request.user).exists(): - form.instance.playlist_loading = True - form.instance.save() + form.instance.playlist_loading = True + form.instance.save() return res From c639307cfbe5ca0808ac85be8cbd8841a50a956c Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Mon, 16 Jun 2025 15:44:37 +0200 Subject: [PATCH 34/41] Add restart policy for RabbitMQ and Postgres services in Docker Compose Fix #11 --- compose.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compose.yaml b/compose.yaml index 04838ec..a6ee8b3 100644 --- a/compose.yaml +++ b/compose.yaml @@ -32,10 +32,12 @@ services: rabbitmq: image: rabbitmq container_name: musik_rabbitmq + restart: unless-stopped postgres: image: postgres:17 container_name: musik_postgres + restart: unless-stopped env_file: stack.env volumes: - /docker/musik/postgres:/var/lib/postgresql/data From 84c432c325bc48d02b8474d16241d01e88df66e9 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Mon, 16 Jun 2025 16:16:03 +0200 Subject: [PATCH 35/41] Refactor value calculation in MusicGameOrder to improve scoring logic Fix #13 Close #12 --- game/models.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/game/models.py b/game/models.py index 51eb410..153583f 100644 --- a/game/models.py +++ b/game/models.py @@ -121,13 +121,10 @@ class MusicGameOrder(models.Model): value = models.PositiveIntegerField(default=0) def update_value(self): - n_right = self.musicgameanswer_set.filter(game__player=F("answer")).count() - if n_right == 0: - self.value = 1000 - else: - self.value = 1000 / ( - 1 + ((n_right - 1) / (self.game.players.count() - 1)) ** 0.5 - ) + x = self.musicgameanswer_set.filter(game__player=F("answer")).count() + n = self.game.players.count() + n = max(3, n) + self.value = 1000 * 2 ** (-(x - 2) / (n - 2)) self.save() class Meta: From bd8529cd014f5cea9a3bb35683a273283b57fa91 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Mon, 16 Jun 2025 16:17:04 +0200 Subject: [PATCH 36/41] Bump version to 0.4.2 in settings and pyproject.toml --- musik/settings.py | 2 +- pyproject.toml | 2 +- uv.lock | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/musik/settings.py b/musik/settings.py index b69b0cb..a712445 100644 --- a/musik/settings.py +++ b/musik/settings.py @@ -13,7 +13,7 @@ https://docs.djangoproject.com/en/5.2/ref/settings/ import os from pathlib import Path -VERSION = "0.4.1" +VERSION = "0.4.2" # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent diff --git a/pyproject.toml b/pyproject.toml index 93cda42..17df9a9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "musik" -version = "0.4.1" +version = "0.4.2" description = "Le jeu de Musik." readme = "README.md" requires-python = ">=3.12" diff --git a/uv.lock b/uv.lock index 44c8b62..0e3ae81 100644 --- a/uv.lock +++ b/uv.lock @@ -423,7 +423,7 @@ wheels = [ [[package]] name = "musik" -version = "0.4.1" +version = "0.4.2" source = { virtual = "." } dependencies = [ { name = "celery" }, From b9711cbe9c75b122df5cdc6d11d3b6fcf32fccea Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Mon, 16 Jun 2025 22:04:18 +0200 Subject: [PATCH 37/41] Refactor hero section layout and update footer privacy notice for clarity --- base/static/css/main.css | 47 +++++++++++++++++++++++++++---------- base/templates/footer.html | 2 +- base/templates/hero.html | 24 +++++++++++++++---- base/templates/privacy.html | 3 ++- 4 files changed, 56 insertions(+), 20 deletions(-) diff --git a/base/static/css/main.css b/base/static/css/main.css index 8120679..74e4488 100644 --- a/base/static/css/main.css +++ b/base/static/css/main.css @@ -77,11 +77,6 @@ article.message { } #hero { - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; background: radial-gradient( circle 50vh at calc(100vw - 4rem) 50%, var(--pico-primary-background), @@ -90,19 +85,41 @@ article.message { color-mix(in hsl, var(--pico-primary-background) 30%, var(--pico-background-color)) 60%, color-mix(in hsl, var(--pico-primary-background) 10%, var(--pico-background-color)) 80%, var(--pico-background-color)); - display: grid; - grid-template-rows: 1fr min-content; - align-items: center; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + height: 100%; + overflow-y: auto; padding: 4rem; - .big-logo { - font-size: 8rem; + main { + display: contents; } - - h1 { - font-size: 4rem; + section { + max-width: 20rem; } } +.full-page { + height: 100%; + display: grid; + grid-template-rows: 1fr; + align-items: center; + margin-bottom: 4rem; + + &.r { + -ms-grid-column-align: end; + } + .big-logo { + font-size: 8rem; + } + + h1 { + font-size: 4rem; + } +} + h1, h2, @@ -201,3 +218,7 @@ table.results, table.musics { } } } + +.brand-name { + color: var(--pico-primary); +} diff --git a/base/templates/footer.html b/base/templates/footer.html index 52895f6..6c57641 100644 --- a/base/templates/footer.html +++ b/base/templates/footer.html @@ -1 +1 @@ -Musik {{ VERSION }} – © Edgar P. BurkhartMentions légales +Musik {{ VERSION }} – © Edgar P. BurkhartMentions légales et confidentialité diff --git a/base/templates/hero.html b/base/templates/hero.html index 04c2aee..813c011 100644 --- a/base/templates/hero.html +++ b/base/templates/hero.html @@ -1,11 +1,25 @@ {% load static %}
- -

Musik

-

- Jouer -

+
+
+ +

Musik

+

+ Jouer +

+
+
+
+
+

+ Musik Le jeu où ta playlist devient ton arme secrète ! +

+

+ Invite ta bande, ajoute tes sons fétiches, et c’est parti ! Une playlist Youtube apparaît, mélangeant les coups de cœur de tout le monde. Le jeu ? Écoute, devine qui a choisi quoi, et découvre les secrets musicaux de tes potes. Entre pièges, révélations et fous rires, Musik c’est le jeu parfait pour tester vos oreilles… et vos amitiés. Prêt à jouer le DJ incognito ? +

+
+