from django.db import models

class BrandingSetting(models.Model):
    app_name = models.CharField(max_length=200, default="Veranstaltungsschichtplaner")
    logo_url = models.CharField(max_length=500, blank=True, default="")
    primary_color = models.CharField(max_length=50, default="#E05A47")
    secondary_color = models.CharField(max_length=50, default="#4f46e5")
    custom_banner_text = models.TextField(blank=True, default="")

    # Home Page Community Info Box
    show_community_info_box = models.BooleanField(default=True)
    community_info_title = models.CharField(max_length=200, default="📌 Verein & Infos")
    community_info_text = models.TextField(default="Initiative e.V. Hausverein\nOffene Angebote, DIY-Kultur & engagierte Schichten.")

    # Home Page Support Box
    show_support_box = models.BooleanField(default=True)
    support_box_title = models.CharField(max_length=200, default="❤️ Unterstützen")
    support_box_text = models.TextField(default="Hilf mit als Helfer*in an der Bar, beim Essen kochen oder beim Auf- & Abbau.")

    @classmethod
    def get_solo(cls):
        obj, _ = cls.objects.get_or_create(pk=1)
        return obj

    def __str__(self):
        return f"Branding: {self.app_name}"
