kopia lustrzana https://github.com/wagtail/wagtail
Remove content_type template filter from the project template - fixes #626
rodzic
27a3fd50d5
commit
9f8a5f2379
|
@ -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)
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
|
|
@ -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
|
||||
~~~~~~~~~
|
||||
|
|
|
@ -5,6 +5,7 @@ Release notes
|
|||
:maxdepth: 1
|
||||
|
||||
roadmap
|
||||
0.7
|
||||
0.6
|
||||
0.5
|
||||
0.4.1
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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__
|
||||
|
|
Ładowanie…
Reference in New Issue