add service tagline

This commit is contained in:
Tobias Brunner 2025-03-03 17:54:47 +01:00
parent 5157d7c781
commit 928bd0818e
No known key found for this signature in database
4 changed files with 31 additions and 0 deletions

View file

@ -0,0 +1,18 @@
# Generated by Django 5.1.5 on 2025-03-03 16:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("services", "0016_cloudprovider_disable_listing_and_more"),
]
operations = [
migrations.AddField(
model_name="service",
name="tagline",
field=models.TextField(blank=True, max_length=500, null=True),
),
]

View file

@ -116,6 +116,7 @@ class Service(models.Model):
name = models.CharField(max_length=200) name = models.CharField(max_length=200)
slug = models.SlugField(max_length=250, unique=True) slug = models.SlugField(max_length=250, unique=True)
description = ProseEditorField() description = ProseEditorField()
tagline = models.TextField(max_length=500, blank=True, null=True)
logo = models.ImageField( logo = models.ImageField(
upload_to="service_logos/", upload_to="service_logos/",
validators=[validate_image_size], validators=[validate_image_size],

View file

@ -106,6 +106,13 @@
<button class="btn btn-tertiary btn-sm mr-12">{{ category.full_path }}</button> <button class="btn btn-tertiary btn-sm mr-12">{{ category.full_path }}</button>
{% endfor %} {% endfor %}
</div> </div>
{% if service.tagline %}
<div class="mt-3">
<p class="fst-italic text-muted fs-19">
"{{ service.tagline }}"
</p>
</div>
{% endif %}
</div> </div>
<!-- Description --> <!-- Description -->

View file

@ -179,6 +179,11 @@
<span>{{ category.full_path }}</span> <span>{{ category.full_path }}</span>
{% endfor %} {% endfor %}
</p> </p>
{% if service.tagline %}
<p class="card__tagline fst-italic text-muted">
<small>"{{ service.tagline }}"</small>
</p>
{% endif %}
</div> </div>
<div class="card__desc flex-grow-1"> <div class="card__desc flex-grow-1">
<p class="mb-0">{{ service.description|safe|truncatewords:30 }}</p> <p class="mb-0">{{ service.description|safe|truncatewords:30 }}</p>