From 3ea73be0836e2fc130111698495a4adef79e5246 Mon Sep 17 00:00:00 2001 From: Mark Hoekveen Date: Tue, 23 Jul 2024 13:29:36 +0200 Subject: [PATCH] background cover --- playlist/models/profile.py | 1 + playlist/templates/background.css | 3 +++ 2 files changed, 4 insertions(+) diff --git a/playlist/models/profile.py b/playlist/models/profile.py index ed9b765..f550bcb 100644 --- a/playlist/models/profile.py +++ b/playlist/models/profile.py @@ -20,6 +20,7 @@ class Background(models.Model): name = models.CharField(max_length=128) image = models.ImageField(upload_to="wallpapers/", null=True, blank=True) repeat = models.BooleanField(default=False) + cover = models.BooleanField(default=False) color = models.CharField(max_length=32, blank=True) class Profile(models.Model): diff --git a/playlist/templates/background.css b/playlist/templates/background.css index b74055d..59a2b53 100644 --- a/playlist/templates/background.css +++ b/playlist/templates/background.css @@ -7,6 +7,9 @@ body { {% if not background.repeat %} background-repeat: no-repeat; {% endif %} + {% if background.cover %} + background-size: cover; + {% endif %} {% if background.color %} background-color: {{background.color}} !important; {% endif %}