Skip to content

Commit

Permalink
Remove content_type template filter from the project template - fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
gasman committed Sep 15, 2014
1 parent 27a3fd5 commit 9f8a5f2
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
~~~~~~~~~~~~~~~~
Expand Down
2 changes: 2 additions & 0 deletions docs/releases/0.7.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
~~~~~~~~~
Expand Down
1 change: 1 addition & 0 deletions docs/releases/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Release notes
:maxdepth: 1

roadmap
0.7
0.6
0.5
0.4.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
9 changes: 0 additions & 9 deletions wagtail/project_template/core/templatetags/core_tags.py
Original file line number Diff line number Diff line change
@@ -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__

0 comments on commit 9f8a5f2

Please sign in to comment.