diff --git a/concordia/migrations/0089_campaign_image_alt_text.py b/concordia/migrations/0089_campaign_image_alt_text.py new file mode 100644 index 000000000..ac5082579 --- /dev/null +++ b/concordia/migrations/0089_campaign_image_alt_text.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.24 on 2024-02-26 14:13 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("concordia", "0088_alter_simplepage_body"), + ] + + operations = [ + migrations.AddField( + model_name="campaign", + name="image_alt_text", + field=models.TextField(blank=True, null=True), + ), + ] diff --git a/concordia/models.py b/concordia/models.py index 12b3a63e3..38de68f6f 100644 --- a/concordia/models.py +++ b/concordia/models.py @@ -258,6 +258,7 @@ class Status(models.IntegerChoices): card_family = models.ForeignKey( CardFamily, on_delete=models.CASCADE, blank=True, null=True ) + image_alt_text = models.TextField(blank=True, null=True) thumbnail_image = models.ImageField( upload_to="campaign-thumbnails", blank=True, null=True ) diff --git a/concordia/templates/home.html b/concordia/templates/home.html index 075696181..274d414c9 100644 --- a/concordia/templates/home.html +++ b/concordia/templates/home.html @@ -188,7 +188,7 @@

Campaigns: Choose which collectio
- + {{ campaign.image_alt_text }}
{{ campaign.title }} diff --git a/concordia/templates/transcriptions/campaign_small_block.html b/concordia/templates/transcriptions/campaign_small_block.html index 4da7da397..c742b5c8d 100644 --- a/concordia/templates/transcriptions/campaign_small_block.html +++ b/concordia/templates/transcriptions/campaign_small_block.html @@ -4,7 +4,7 @@
- + {{ campaign.alt_image_text}}
{{ campaign.title }} diff --git a/concordia/templates/transcriptions/campaign_topic_list.html b/concordia/templates/transcriptions/campaign_topic_list.html index 35966331b..f798b2d97 100644 --- a/concordia/templates/transcriptions/campaign_topic_list.html +++ b/concordia/templates/transcriptions/campaign_topic_list.html @@ -36,7 +36,7 @@

Active Campaigns

{{ campaign.title }}

-

{{ campaign.title }} image

+

{% if campaign.image_alt_text %}{{ campaign.image_alt_text }}{% else %}{{ campaign.title }} image{% endif %}

{{ campaign.short_description|safe }}