Remove content_type template filter from the project template - fixes #626

pull/568/head
Matt Westcott 2014-09-15 19:36:07 +01:00
rodzic 27a3fd50d5
commit 9f8a5f2379
5 zmienionych plików z 5 dodań i 10 usunięć

Wyświetl plik

@ -4,6 +4,7 @@ Changelog
0.7 (xx.xx.2014)
~~~~~~~~~~~~~~~~
* Added interface for choosing focal point on images
* Removed 'content_type' template filter from the project template, as the same thing can be accomplished with self.get_verbose_name|slugify
0.6 (11.09.2014)
~~~~~~~~~~~~~~~~

Wyświetl plik

@ -17,6 +17,8 @@ New interface for choosing images focal point
Minor features
~~~~~~~~~~~~~~
* The ``content_type`` template filter has been removed from the project template, as the same thing can be accomplished with ``self.get_verbose_name|slugify``.
Bug fixes
~~~~~~~~~

Wyświetl plik

@ -5,6 +5,7 @@ Release notes
:maxdepth: 1
roadmap
0.7
0.6
0.5
0.4.1

Wyświetl plik

@ -2,7 +2,7 @@
{% templatetag openblock %} load static core_tags {% templatetag closeblock %}
{% templatetag openblock %} block body_class {% templatetag closeblock %}template-{% templatetag openvariable %} self|content_type|slugify {% templatetag closevariable %}{% templatetag openblock %} endblock {% templatetag closeblock %}
{% templatetag openblock %} block body_class {% templatetag closeblock %}template-{% templatetag openvariable %} self.get_verbose_name|slugify {% templatetag closevariable %}{% templatetag openblock %} endblock {% templatetag closeblock %}
{% templatetag openblock %} block content {% templatetag closeblock %}
<h1>Welcome to your new Wagtail site!</h1>

Wyświetl plik

@ -1,12 +1,3 @@
from django import template
from django.conf import settings
register = template.Library()
# Return the model name/"content type" as a string e.g BlogPage, NewsListingPage.
# Can be used with "slugify" to create CSS-friendly classnames
# Usage: {% verbatim %}{{ self|content_type|slugify }}{% endverbatim %}
@register.filter
def content_type(model):
return model.__class__.__name__