feat: changes for citation ad dynamic

This commit is contained in:
mohamad
2026-05-17 18:51:26 +03:30
parent f0a9d5832b
commit b8ab67049f
22 changed files with 1170 additions and 287 deletions
@@ -0,0 +1,22 @@
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("products", "0004_distribution_and_versions"),
]
operations = [
migrations.AddField(
model_name="article",
name="badge",
field=models.CharField(
blank=True,
default="",
help_text="Optional label shown above the article title (e.g. 'Overview', 'Note').",
max_length=100,
),
preserve_default=False,
),
]
@@ -0,0 +1,49 @@
# Generated by Django 5.0.2 on 2026-05-17 14:59
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('products', '0005_article_badge'),
]
operations = [
migrations.AddField(
model_name='subproduct',
name='homepage_order',
field=models.PositiveIntegerField(default=0, help_text='Order within the homepage Products section.'),
),
migrations.AddField(
model_name='subproduct',
name='logo',
field=models.ImageField(blank=True, help_text='Small logo shown as a corner badge on homepage product cards.', null=True, upload_to='products/sub_logos/'),
),
migrations.AddField(
model_name='subproduct',
name='show_on_homepage',
field=models.BooleanField(default=False, help_text='Display this sub-product in the homepage Products section.'),
),
migrations.AlterField(
model_name='subproductversion',
name='package_resource_url',
field=models.URLField(blank=True, help_text='Shown on the site when set. For Resources it is the main Open link; for Installable it appears under the platform grid.'),
),
migrations.CreateModel(
name='ArticleCitation',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('text', models.TextField(help_text='Full citation text.')),
('url', models.URLField(blank=True, help_text='Optional link to the cited source.')),
('order', models.PositiveIntegerField(default=0)),
('article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='citations', to='products.article')),
],
options={
'verbose_name': 'Article Citation',
'verbose_name_plural': 'Article Citations',
'ordering': ['order', 'pk'],
},
),
]
@@ -0,0 +1,18 @@
# Generated by Django 5.0.2 on 2026-05-17 15:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('products', '0006_subproduct_logo_homepage_citations'),
]
operations = [
migrations.AddField(
model_name='article',
name='citation_count_display',
field=models.PositiveSmallIntegerField(blank=True, help_text='Optional number shown in the dashed citation circle badge at the bottom of the article card. Leave blank to hide the badge.', null=True),
),
]