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/static/favicon/apple-touch-icon.png b/base/static/favicon/apple-touch-icon.png
new file mode 100644
index 0000000..abb8a48
Binary files /dev/null and b/base/static/favicon/apple-touch-icon.png differ
diff --git a/base/static/favicon/favicon-96x96.png b/base/static/favicon/favicon-96x96.png
new file mode 100644
index 0000000..beab288
Binary files /dev/null and b/base/static/favicon/favicon-96x96.png differ
diff --git a/base/static/favicon/favicon.ico b/base/static/favicon/favicon.ico
new file mode 100644
index 0000000..178d60c
Binary files /dev/null and b/base/static/favicon/favicon.ico differ
diff --git a/base/static/favicon/favicon.svg b/base/static/favicon/favicon.svg
new file mode 100644
index 0000000..63c10e0
--- /dev/null
+++ b/base/static/favicon/favicon.svg
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/base/static/favicon/site.webmanifest b/base/static/favicon/site.webmanifest
new file mode 100644
index 0000000..af6d059
--- /dev/null
+++ b/base/static/favicon/site.webmanifest
@@ -0,0 +1,21 @@
+{
+ "name": "MyWebSite",
+ "short_name": "MySite",
+ "icons": [
+ {
+ "src": "/web-app-manifest-192x192.png",
+ "sizes": "192x192",
+ "type": "image/png",
+ "purpose": "maskable"
+ },
+ {
+ "src": "/web-app-manifest-512x512.png",
+ "sizes": "512x512",
+ "type": "image/png",
+ "purpose": "maskable"
+ }
+ ],
+ "theme_color": "#aa40bf",
+ "background_color": "#ffffff",
+ "display": "standalone"
+}
diff --git a/base/static/favicon/web-app-manifest-192x192.png b/base/static/favicon/web-app-manifest-192x192.png
new file mode 100644
index 0000000..f7f97da
Binary files /dev/null and b/base/static/favicon/web-app-manifest-192x192.png differ
diff --git a/base/static/favicon/web-app-manifest-512x512.png b/base/static/favicon/web-app-manifest-512x512.png
new file mode 100644
index 0000000..9e4e381
Binary files /dev/null and b/base/static/favicon/web-app-manifest-512x512.png differ
diff --git a/base/templates/base.html b/base/templates/base.html
index 16be674..504228f 100644
--- a/base/templates/base.html
+++ b/base/templates/base.html
@@ -11,7 +11,7 @@
Musik
{% endblock title %}
-
+ {% include "favicon.html" %}
+
+
+
+
+
+
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. Burkhart – Mentions légales
+Musik {{ VERSION }} – © Edgar P. Burkhart – Mentions 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 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 ?
+
+
+
{% include "footer.html" %}
diff --git a/base/templates/privacy.html b/base/templates/privacy.html
index 8e78465..1549403 100644
--- a/base/templates/privacy.html
+++ b/base/templates/privacy.html
@@ -16,6 +16,7 @@
Youtube est une marque de Google LLC.
- La suppression des données stockée par le service Musik pour son utilisation peut être demandée par email à Edgar P. Burkhart .
+ Les données saisies dans Musik (groupes créés, listes de musiques) sont conservées jusqu'à demande de suppression. La suppression du compte entraîne la suppression de l'ensemble des données qui y sont liées.
+ La suppression du compte peut être demandée dans les paramètres du compte. La suppression des données est immédiate et définitive.
{% endblock content %}
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
diff --git a/game/models.py b/game/models.py
index 18912a0..153583f 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)
@@ -118,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:
diff --git a/game/tasks.py b/game/tasks.py
index 22a7dc0..61937d0 100644
--- a/game/tasks.py
+++ b/game/tasks.py
@@ -18,7 +18,7 @@ def generate_playlist(creds, game_pk):
"description": "Playlist générée par Musik",
},
"status": {
- "privacyStatus": "private",
+ "privacyStatus": "unlisted",
},
},
)
diff --git a/game/templates/game/musikgame_answer.html b/game/templates/game/musikgame_answer.html
index 84e055d..f947802 100644
--- a/game/templates/game/musikgame_answer.html
+++ b/game/templates/game/musikgame_answer.html
@@ -21,6 +21,6 @@
{% endfor %}
- {% if not musikgame.over %}Valider mes réponses {% endif %}
+ {% if not musikgame.over %}Sauvegarder mes réponses {% endif %}
{% endblock content %}
diff --git a/game/templates/game/musikgame_detail.html b/game/templates/game/musikgame_detail.html
index 67b9921..66708c0 100644
--- a/game/templates/game/musikgame_detail.html
+++ b/game/templates/game/musikgame_detail.html
@@ -9,31 +9,31 @@
{% endif %}
{{ musikgame.date }}
- {% if musikgame.playlist or musikgame.playlist_loading %}
-
Joueurs
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 d5f3b7d..45685aa 100644
--- a/game/views.py
+++ b/game/views.py
@@ -327,15 +327,12 @@ class GameCreateView(LoginRequiredMixin, CreateView):
pm_list = list(zip(players, musics))
random.shuffle(pm_list)
for (player, music), order in zip(pm_list, range(1, len(pm_list) + 1)):
- music.blacklisted = True
- music.save()
models.MusicGameOrder.objects.create(
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
@@ -481,6 +478,9 @@ class GameEndView(LoginRequiredMixin, SingleObjectMixin, View):
if not game.group.is_leader(request.user):
raise PermissionDenied()
game.over = True
+ models.MusicVideo.objects.filter(musicgameorder__game=game).update(
+ blacklisted=True
+ )
for go in game.musicgameorder_set.all():
go.update_value()
diff --git a/musik/settings.py b/musik/settings.py
index b69b0cb..0f097d7 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.4"
# 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..0be7cd8 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "musik"
-version = "0.4.1"
+version = "0.4.4"
description = "Le jeu de Musik."
readme = "README.md"
requires-python = ">=3.12"
diff --git a/uv.lock b/uv.lock
index 44c8b62..21e0387 100644
--- a/uv.lock
+++ b/uv.lock
@@ -423,7 +423,7 @@ wheels = [
[[package]]
name = "musik"
-version = "0.4.1"
+version = "0.4.4"
source = { virtual = "." }
dependencies = [
{ name = "celery" },