improved plugin nav capabilities

This commit is contained in:
vabene1111 2023-06-21 16:07:32 +02:00
parent fb52f34ef9
commit dd88641763
4 changed files with 32 additions and 0 deletions

View File

@ -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),
),
]

View File

@ -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

View File

@ -118,6 +118,10 @@
<a class="nav-link" href="{% url 'view_books' %}"><i
class="fas fa-fw fa-book-open"></i> {% trans 'Books' %}</a>
</li>
{% plugin_main_nav_templates as plugin_main_nav_templates %}
{% for pn in plugin_main_nav_templates %}
{% include pn %}
{% endfor %}
</ul>
<ul class="navbar-nav ml-auto">

View File

@ -140,6 +140,14 @@ def plugin_dropdown_nav_templates():
templates.append(p['nav_dropdown'])
return templates
@register.simple_tag
def plugin_main_nav_templates():
templates = []
for p in PLUGINS:
if p['nav_main']:
templates.append(p['nav_main'])
return templates
@register.simple_tag
def bookmarklet(request):