From dd886417635ac5ae5c58a645d13e5afecc831700 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Wed, 21 Jun 2023 16:07:32 +0200 Subject: [PATCH] improved plugin nav capabilities --- .../migrations/0193_space_internal_note.py | 18 ++++++++++++++++++ cookbook/models.py | 2 ++ cookbook/templates/base.html | 4 ++++ cookbook/templatetags/custom_tags.py | 8 ++++++++ 4 files changed, 32 insertions(+) create mode 100644 cookbook/migrations/0193_space_internal_note.py diff --git a/cookbook/migrations/0193_space_internal_note.py b/cookbook/migrations/0193_space_internal_note.py new file mode 100644 index 000000000..d29d4f75d --- /dev/null +++ b/cookbook/migrations/0193_space_internal_note.py @@ -0,0 +1,18 @@ +# Generated by Django 4.1.9 on 2023-06-21 13:19 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('cookbook', '0192_food_food_unique_open_data_slug_per_space_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='space', + name='internal_note', + field=models.TextField(blank=True, null=True), + ), + ] diff --git a/cookbook/models.py b/cookbook/models.py index 70b505b0d..46af7e786 100644 --- a/cookbook/models.py +++ b/cookbook/models.py @@ -270,6 +270,8 @@ class Space(ExportModelOperationsMixin('space'), models.Model): food_inherit = models.ManyToManyField(FoodInheritField, blank=True) show_facet_count = models.BooleanField(default=False) + internal_note = models.TextField(blank=True, null=True) + def safe_delete(self): """ Safely deletes a space by deleting all objects belonging to the space first and then deleting the space itself diff --git a/cookbook/templates/base.html b/cookbook/templates/base.html index e775bee09..0b0d12b24 100644 --- a/cookbook/templates/base.html +++ b/cookbook/templates/base.html @@ -118,6 +118,10 @@ {% trans 'Books' %} + {% plugin_main_nav_templates as plugin_main_nav_templates %} + {% for pn in plugin_main_nav_templates %} + {% include pn %} + {% endfor %}