diff --git a/htmleditor/admin.py b/htmleditor/admin.py index 874ea00da229fd0fa89243c72d61c139cc252ade..7d160484f48c0efa1f794e82cdc05c85236adf70 100644 --- a/htmleditor/admin.py +++ b/htmleditor/admin.py @@ -110,7 +110,8 @@ class NavigationNodeAdmin(SortableAdmin): list_display = ['name', 'get_path', 'document', 'view'] fieldsets = ( (None, { - 'fields': ('name', 'parent', 'document', 'view', 'icon') + 'fields': ( + 'name', 'parent', 'document', 'show_title', 'view', 'icon') }), ('Advanced', { 'classes': ('collapse',), diff --git a/htmleditor/migrations/0027_navigationnode_show_title.py b/htmleditor/migrations/0027_navigationnode_show_title.py new file mode 100644 index 0000000000000000000000000000000000000000..c5446defb761b304c5d9dabac73e2513841bbc05 --- /dev/null +++ b/htmleditor/migrations/0027_navigationnode_show_title.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.1 on 2016-07-01 14:47 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('htmleditor', '0026_tabdocument_sorting'), + ] + + operations = [ + migrations.AddField( + model_name='navigationnode', + name='show_title', + field=models.BooleanField(default=True, help_text='Show the document title at the top of the page.'), + ), + ] diff --git a/htmleditor/models.py b/htmleditor/models.py index d2dd842e75ecffc7a2dbdbb9b178ab88fe3c06dc..0c894e30cb33c2847a97674db48d6023f2c4c91f 100644 --- a/htmleditor/models.py +++ b/htmleditor/models.py @@ -240,6 +240,9 @@ class NavigationNode(SortableMixin): limit_choices_to={'parent': None}) document = models.ForeignKey('Document', models.SET_NULL, blank=True, null=True) + show_title = models.BooleanField( + blank=True, default=True, + help_text="Show the document title at the top of the page."); view = models.CharField( max_length=MAX_LENGTH, choices=VIEW_CHOICES, blank=True, default="", help_text="This overrides document and any tab documents if set.") diff --git a/htmleditor/templates/htmleditor/view.html b/htmleditor/templates/htmleditor/view.html index 8c8c5c2918b35c98153150249c2ab047c27bf634..ed1d88a9e5e03496a4ea9a92ab45c6b7edf3d834 100644 --- a/htmleditor/templates/htmleditor/view.html +++ b/htmleditor/templates/htmleditor/view.html @@ -5,7 +5,11 @@ {% block main %} {% if document %} - <h1>{{ document.name }} {% if perms.htmleditor.change_document %}<a href="{% url 'admin:htmleditor_document_change' document.pk %}?next={{ request.get_full_path|urlencode }}"><img alt="Pencil" title="Edit" src="{% static 'usta/edit.png' %}"></a>{% endif %}</h1> + {% if node.show_title %} + <h1>{{ document.name }} {% if perms.htmleditor.change_document %}<a href="{% url 'admin:htmleditor_document_change' document.pk %}?next={{ request.get_full_path|urlencode }}"><img alt="Pencil" title="Edit" src="{% static 'usta/edit.png' %}"></a>{% endif %}</h1> + {% else %} + {% if perms.htmleditor.change_document %}<h1><a href="{% url 'admin:htmleditor_document_change' document.pk %}?next={{ request.get_full_path|urlencode }}"><img alt="Pencil" title="Edit" src="{% static 'usta/edit.png' %}"></a></h1>{% endif %} + {% endif %} {% docreplace document.content %} {% else %} <h1>{{ node.name }}</h1>