feat: pagination for videos and icon separating

This commit is contained in:
mohamad
2026-08-01 17:45:55 +03:30
parent 7cddc03a57
commit 04b6e9049e
15 changed files with 508 additions and 25 deletions
+36 -5
View File
@@ -1,3 +1,4 @@
from django.core.validators import FileExtensionValidator
from django.db import models
@@ -13,20 +14,50 @@ class SiteBranding(models.Model):
upload_to="branding/",
blank=True,
null=True,
help_text="Logo shown in the site header and footer. Leave empty to use the default static icon.",
verbose_name="Header and footer logo",
help_text="Brand logo shown in the site navigation and footer. Leave empty to use the default logo.",
)
icon_alt = models.CharField(
max_length=200,
blank=True,
help_text="Alt text for the brand icon (decorative icons can stay empty).",
)
website_icon = models.FileField(
upload_to="branding/icons/",
blank=True,
null=True,
validators=[
FileExtensionValidator(
allowed_extensions=("ico", "png", "svg", "jpg", "jpeg", "webp")
)
],
help_text=(
"Icon shown in browser tabs and bookmarks. Use a square ICO, PNG, SVG, "
"JPG, or WebP file. Leave empty to use the default Radiuma icons."
),
)
hero_logo = models.ImageField(
upload_to="branding/hero/",
blank=True,
null=True,
help_text=(
"Large brand artwork shown in the homepage hero. Leave empty to use "
"the existing hero image."
),
)
hero_logo_alt = models.CharField(
max_length=200,
blank=True,
default="Radiuma",
help_text="Accessible description for the homepage hero logo.",
)
navbar_icon_size = models.PositiveSmallIntegerField(
default=26,
help_text="Width and height in pixels for the header icon.",
help_text="Maximum height in pixels for the header logo. Width scales automatically.",
)
footer_icon_size = models.PositiveSmallIntegerField(
default=34,
help_text="Width and height in pixels for the footer icon.",
help_text="Maximum height in pixels for the footer logo. Width scales automatically.",
)
show_border = models.BooleanField(
default=False,
@@ -61,9 +92,9 @@ class SiteBranding(models.Model):
def icon_style(self, size_px):
parts = [
f"width:{size_px}px",
"width:auto",
f"height:{size_px}px",
f"object-fit:{self.object_fit}",
"object-fit:contain",
]
if self.show_border:
parts.append(f"border:{self.border_width}px solid {self.border_color}")