background cover

This commit is contained in:
2024-07-23 13:29:36 +02:00
parent 1bacafd8b2
commit 3ea73be083
2 changed files with 4 additions and 0 deletions
+1
View File
@@ -20,6 +20,7 @@ class Background(models.Model):
name = models.CharField(max_length=128) name = models.CharField(max_length=128)
image = models.ImageField(upload_to="wallpapers/", null=True, blank=True) image = models.ImageField(upload_to="wallpapers/", null=True, blank=True)
repeat = models.BooleanField(default=False) repeat = models.BooleanField(default=False)
cover = models.BooleanField(default=False)
color = models.CharField(max_length=32, blank=True) color = models.CharField(max_length=32, blank=True)
class Profile(models.Model): class Profile(models.Model):
+3
View File
@@ -7,6 +7,9 @@ body {
{% if not background.repeat %} {% if not background.repeat %}
background-repeat: no-repeat; background-repeat: no-repeat;
{% endif %} {% endif %}
{% if background.cover %}
background-size: cover;
{% endif %}
{% if background.color %} {% if background.color %}
background-color: {{background.color}} !important; background-color: {{background.color}} !important;
{% endif %} {% endif %}