From 820164afb0bcad756f42bc569be9535664146a19 Mon Sep 17 00:00:00 2001 From: James Murty Date: Wed, 22 Feb 2017 12:19:02 +1100 Subject: [PATCH] Add configurable "no items" message for events content listing plugin --- ...ventcontentlistingitem_no_items_message.py | 19 +++++++++++++++++++ .../event_content_listing/default.html | 3 +-- 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 icekit_events/plugins/event_content_listing/migrations/0003_eventcontentlistingitem_no_items_message.py diff --git a/icekit_events/plugins/event_content_listing/migrations/0003_eventcontentlistingitem_no_items_message.py b/icekit_events/plugins/event_content_listing/migrations/0003_eventcontentlistingitem_no_items_message.py new file mode 100644 index 0000000..0e38ddd --- /dev/null +++ b/icekit_events/plugins/event_content_listing/migrations/0003_eventcontentlistingitem_no_items_message.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('ik_event_listing', '0002_auto_20170222_1136'), + ] + + operations = [ + migrations.AddField( + model_name='eventcontentlistingitem', + name='no_items_message', + field=models.CharField(blank=True, help_text=b'Message to show if there are not items in listing.', null=True, max_length=255), + ), + ] diff --git a/icekit_events/plugins/event_content_listing/templates/icekit_events/plugins/event_content_listing/default.html b/icekit_events/plugins/event_content_listing/templates/icekit_events/plugins/event_content_listing/default.html index 055e5cb..533ae30 100644 --- a/icekit_events/plugins/event_content_listing/templates/icekit_events/plugins/event_content_listing/default.html +++ b/icekit_events/plugins/event_content_listing/templates/icekit_events/plugins/event_content_listing/default.html @@ -2,8 +2,7 @@ {% for event in instance.get_items %} {% include "icekit_events/plugins/event_content_listing/_event.html" %} {% empty %} -
  • There are no items to show on this page
  • - {{ instance.get_default_embed }} +
  • {{ instance.no_items_message|default:"There are no items to show" }}
  • {% endfor %}