mirror of
https://github.com/Superredstone/patrickcanal.it.git
synced 2026-10-01 22:38:52 +02:00
feat(portfolio): add dark_text field to project tags
This commit is contained in:
@@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 6.1.1 on 2026-10-01 19:38
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('portfolio', '0006_alter_project_short_description'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='projecttag',
|
||||||
|
name='dark_text',
|
||||||
|
field=models.BooleanField(default=False, verbose_name='Dark text'),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -68,6 +68,7 @@ class ProjectTag(models.Model):
|
|||||||
blank=False,
|
blank=False,
|
||||||
default="000000",
|
default="000000",
|
||||||
)
|
)
|
||||||
|
dark_text = models.BooleanField(verbose_name=_("Dark text"), default=False)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<p>{{ project.short_description }}</p>
|
<p>{{ project.short_description }}</p>
|
||||||
<div>
|
<div>
|
||||||
{% for t in project.tags.all %}
|
{% for t in project.tags.all %}
|
||||||
<div class="badge text-white fs-5"
|
<div class="badge {% if t.dark_text %}text-black{% else %}text-white{% endif %} fs-5"
|
||||||
style="background-color: #{{ t.color }}">{{ t }}</div>
|
style="background-color: #{{ t.color }}">{{ t }}</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user