diff --git a/htmleditor/migrations/0028_tabdocument_show_title.py b/htmleditor/migrations/0028_tabdocument_show_title.py new file mode 100644 index 0000000000000000000000000000000000000000..954858406633bfe92d8732576561fdee98b09e42 --- /dev/null +++ b/htmleditor/migrations/0028_tabdocument_show_title.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.1 on 2016-07-02 22:08 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('htmleditor', '0027_navigationnode_show_title'), + ] + + operations = [ + migrations.AddField( + model_name='tabdocument', + 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 0c894e30cb33c2847a97674db48d6023f2c4c91f..e066ba6401298c901895f82b89c64499f8204891 100644 --- a/htmleditor/models.py +++ b/htmleditor/models.py @@ -317,6 +317,9 @@ class TabDocument(SortableMixin): title = models.CharField(max_length=MAX_LENGTH, help_text="This is the tab text") document = models.ForeignKey('Document', models.CASCADE) + show_title = models.BooleanField( + blank=True, default=True, + help_text="Show the document title at the top of the page."); navigation_node = models.ForeignKey('NavigationNode', models.CASCADE, related_name='tabs') diff --git a/htmleditor/templates/htmleditor/view.html b/htmleditor/templates/htmleditor/view.html index ed1d88a9e5e03496a4ea9a92ab45c6b7edf3d834..aa8cfa9c5787c65b7f1bc21f0a6fe137234ad6f8 100644 --- a/htmleditor/templates/htmleditor/view.html +++ b/htmleditor/templates/htmleditor/view.html @@ -25,8 +25,11 @@ </ul> {% for tab in node.tabs.all %} <div id="tab-{{ tab.pk }}" class="content"> - <h1>{{ tab.document.name }} {% if perms.htmleditor.change_document %}<a href="{% url 'admin:htmleditor_document_change' tab.document.pk %}?next={{ request.get_full_path|urlencode }}"><img alt="Pencil" title="Edit" src="{% static 'usta/edit.png' %}"></a>{% endif %}</h1> - <br> + {% if tab.show_title %} + <h1>{{ tab.document.name }} {% if perms.htmleditor.change_document %}<a href="{% url 'admin:htmleditor_document_change' tab.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' tab.document.pk %}?next={{ request.get_full_path|urlencode }}"><img alt="Pencil" title="Edit" src="{% static 'usta/edit.png' %}"></a></h1>{% endif %} + {% endif %} {% docreplace tab.document.content %} </div> {% endfor %}