feat: dynamic citation text and logo

This commit is contained in:
mohamad
2026-05-20 16:02:16 +03:30
parent 2341b32d4c
commit 24dd24e1c9
11 changed files with 181 additions and 29 deletions
+32 -1
View File
@@ -1,7 +1,7 @@
from django.core.management.base import BaseCommand
from django.db import transaction
from apps.pages.models import DownloadItem, FAQEntry, HomepageSection, HomepageSectionItem
from apps.pages.models import DownloadItem, FAQEntry, HeroSection, HomepageSection, HomepageSectionItem
from apps.products.models import Article, ArticleSection, MainProduct, SubProduct
MAIN_PRODUCTS = [
@@ -395,11 +395,13 @@ class Command(BaseCommand):
DownloadItem.objects.all().delete()
HomepageSectionItem.objects.all().delete()
HomepageSection.objects.all().delete()
HeroSection.objects.all().delete()
self._seed_products()
self._seed_faq()
self._seed_downloads()
self._seed_homepage_sections()
self._seed_hero()
self.stdout.write(self.style.SUCCESS("Content seeded successfully."))
@@ -509,3 +511,32 @@ class Command(BaseCommand):
action = "Created" if created else "Updated"
self.stdout.write(f" {action} download: {item}")
def _seed_hero(self):
data = {
"badge": "Developing since 2021",
"title": "Radiuma,",
"title_highlight": "A Powerful Workflow Generator",
"subtitle": "for Standardized Radiomics Analysis and Medical Image Visualization",
"description": (
"Radiuma is a free, open-source software specialized for visualization, processing, "
"segmentation, registration, fusion and analysis of medical and biomedical images, "
"including radiomics and machine learning analysis."
),
"primary_cta_text": "Get Radiuma",
"primary_cta_url": "/products/",
"secondary_cta_text": "About Radiuma",
"secondary_cta_url": "/about/",
"image_alt": "Radiuma application — main workflow view",
}
hero = HeroSection.objects.first()
if hero is None:
HeroSection.objects.create(**data)
self.stdout.write(" Created hero section")
else:
for field, value in data.items():
if field == "image":
continue
setattr(hero, field, value)
hero.save()
self.stdout.write(" Updated hero section")