class BannerAdmin(TranslationAdmin):
- list_display = ['place', 'text', 'priority', 'since', 'until', 'show_members', 'staff_preview']
+ list_display = [
+ 'place', 'text',
+ 'text_color', 'background_color',
+ 'priority', 'since', 'until',
+ 'show_members', 'staff_preview']
admin.site.register(models.Banner, BannerAdmin)
--- /dev/null
+# Generated by Django 2.2.19 on 2021-06-10 12:37
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('annoy', '0010_auto_20210430_1331'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='banner',
+ name='background_color',
+ field=models.CharField(blank=True, max_length=10),
+ ),
+ migrations.AddField(
+ model_name='banner',
+ name='text_color',
+ field=models.CharField(blank=True, max_length=10),
+ ),
+ ]
help_text=_('Affects blackout.')
)
smallfont = models.BooleanField(_('small font'), default=False)
+ text_color = models.CharField(max_length=10, blank=True)
+ background_color = models.CharField(max_length=10, blank=True)
action_label = models.CharField(
_('action label'),
max_length=255, blank=True,
annoy-banner-style_{{ banner.style }}
{% if banner.image %}with-image{% endif %}
{% if banner.smallfont %}banner-smallfont{% endif %}
- " id="annoy-banner-{{ banner.id }}">
+ "
+ id="annoy-banner-{{ banner.id }}"
+ style="
+ {% if banner.text_color %}color: {{ banner.text_color }};{% endif %}
+ {% if banner.background_color %}background-color: {{ banner.background_color }};{% endif %}
+ ">
{% if not banner.action_label %}
<a href="{{ banner.url }}">
{% endif %}