fix: video pagination
This commit is contained in:
+36
-5
@@ -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 Tecvico icon."
|
||||
),
|
||||
)
|
||||
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 default hero artwork."
|
||||
),
|
||||
)
|
||||
hero_logo_alt = models.CharField(
|
||||
max_length=200,
|
||||
blank=True,
|
||||
default="Tecvico showcase",
|
||||
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}")
|
||||
|
||||
Reference in New Issue
Block a user