diff --git a/CHANGELOG.txt b/CHANGELOG.txt index f8378da49..d0ca8a047 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -9,12 +9,14 @@ Changelog * Added thousands separator for counters on dashboard * Added contextual links to admin notification messages * When copying pages, it is now possible to specify a place to copy to (Timo Rieber) + * FieldPanel now accepts an optional 'widget' parameter to override the field's default form widget (Alejandro Giacometti) 0.8.5 (xx.xx.20xx) ~~~~~~~~~~~~~~~~~~ * Fix: On adding a new page, the available page types are ordered by the displayed verbose name * Fix: Active admin submenus were not properly closed when activating another +* Fix: get_sitemap_urls is now called on the specific page class so it can now be overridden (Jerel Unruh) 0.8.4 (04.12.2014) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 85654264d..dae2fd56e 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -38,6 +38,7 @@ Contributors * Robert Rollins * linibou * Timo Rieber +* Jerel Unruh Translators =========== diff --git a/docs/core_components/pages/editing_api.rst b/docs/core_components/pages/editing_api.rst index 94bbb8e88..2087f8c87 100644 --- a/docs/core_components/pages/editing_api.rst +++ b/docs/core_components/pages/editing_api.rst @@ -23,8 +23,10 @@ A "panel" is the basic editing block in Wagtail. Wagtail will automatically pick There are four basic types of panels: - ``FieldPanel( field_name, classname=None )`` - This is the panel used for basic Django field types. ``field_name`` is the name of the class property used in your model definition. ``classname`` is a string of optional CSS classes given to the panel which are used in formatting and scripted interactivity. By default, panels are formatted as inset fields. The CSS class ``full`` can be used to format the panel so it covers the full width of the Wagtail page editor. The CSS class ``title`` can be used to mark a field as the source for auto-generated slug strings. + ``FieldPanel( field_name, classname=None, widget=None )`` + This is the panel used for basic Django field types. ``field_name`` is the name of the class property used in your model definition. ``classname`` is a string of optional CSS classes given to the panel which are used in formatting and scripted interactivity. By default, panels are formatted as inset fields. The CSS class ``full`` can be used to format the panel so it covers the full width of the Wagtail page editor. The CSS class ``title`` can be used to mark a field as the source for auto-generated slug strings. The optional ``widget`` parameter allows you to specify a `django form widget`_ to use instead of the default widget for this field type. + +.. _django form widget: https://docs.djangoproject.com/en/dev/ref/forms/widgets/ ``MultiFieldPanel( children, heading="", classname=None )`` This panel condenses several ``FieldPanel`` s or choosers, from a list or tuple, under a single ``heading`` string. diff --git a/docs/releases/0.8.5.rst b/docs/releases/0.8.5.rst index 447a68d33..9cb718254 100644 --- a/docs/releases/0.8.5.rst +++ b/docs/releases/0.8.5.rst @@ -15,3 +15,4 @@ Bug fixes * On adding a new page, the available page types are ordered by the displayed verbose name * Active admin submenus were not properly closed when activating another +* ``get_sitemap_urls`` is now called on the specific page class so it can now be overridden diff --git a/docs/releases/0.9.rst b/docs/releases/0.9.rst index f70778bd3..c3b0f5c1d 100644 --- a/docs/releases/0.9.rst +++ b/docs/releases/0.9.rst @@ -18,6 +18,7 @@ Minor features * Added thousands separator for counters on dashboard * Added contextual links to admin notification messages * When copying pages, it is now possible to specify a place to copy to + * ``FieldPanel`` now accepts an optional ``widget`` parameter to override the field's default form widget Bug fixes diff --git a/setup.py b/setup.py index b5654c7cc..bd0f4de7f 100644 --- a/setup.py +++ b/setup.py @@ -40,6 +40,7 @@ install_requires = [ "Unidecode>=0.04.14", "six>=1.7.0", 'requests>=2.0.0', + "Willow==0.1", ] diff --git a/tox.ini b/tox.ini index a01c890fe..df523d812 100644 --- a/tox.ini +++ b/tox.ini @@ -17,6 +17,7 @@ base = python-dateutil==2.2 pytz==2014.7 Embedly + Willow==0.1 coverage dj17 = diff --git a/wagtail/contrib/wagtailsitemaps/sitemap_generator.py b/wagtail/contrib/wagtailsitemaps/sitemap_generator.py index d22f88112..e5e43b03e 100644 --- a/wagtail/contrib/wagtailsitemaps/sitemap_generator.py +++ b/wagtail/contrib/wagtailsitemaps/sitemap_generator.py @@ -12,7 +12,7 @@ class Sitemap(object): def get_urls(self): for page in self.get_pages(): - for url in page.get_sitemap_urls(): + for url in page.specific.get_sitemap_urls(): yield url def render(self): diff --git a/wagtail/contrib/wagtailsitemaps/tests.py b/wagtail/contrib/wagtailsitemaps/tests.py index a556ce156..a2d0498d7 100644 --- a/wagtail/contrib/wagtailsitemaps/tests.py +++ b/wagtail/contrib/wagtailsitemaps/tests.py @@ -2,7 +2,7 @@ from django.test import TestCase from django.core.cache import cache from wagtail.wagtailcore.models import Page, PageViewRestriction, Site -from wagtail.tests.models import SimplePage +from wagtail.tests.models import SimplePage, EventIndex from .sitemap_generator import Sitemap @@ -47,6 +47,20 @@ class TestSitemapGenerator(TestCase): self.assertIn('http://localhost/', urls) # Homepage self.assertIn('http://localhost/hello-world/', urls) # Child page + def test_get_urls_uses_specific(self): + # Add an event page which has an extra url in the sitemap + events_page = self.home_page.add_child(instance=EventIndex( + title="Events", + slug='events', + live=True, + )) + + sitemap = Sitemap(self.site) + urls = [url['location'] for url in sitemap.get_urls()] + + self.assertIn('http://localhost/events/', urls) # Main view + self.assertIn('http://localhost/events/past/', urls) # Sub view + def test_render(self): sitemap = Sitemap(self.site) xml = sitemap.render() diff --git a/wagtail/contrib/wagtailstyleguide/templates/wagtailstyleguide/base.html b/wagtail/contrib/wagtailstyleguide/templates/wagtailstyleguide/base.html index 53697e82d..358bc71bd 100644 --- a/wagtail/contrib/wagtailstyleguide/templates/wagtailstyleguide/base.html +++ b/wagtail/contrib/wagtailstyleguide/templates/wagtailstyleguide/base.html @@ -230,6 +230,8 @@

Buttons

+

Buttons must have interaction possible (i.e be an input or button element) to get a suitable hover cursor

+ button button-secondary @@ -250,8 +252,6 @@
button on a div
-

Buttons must have interaction possible (i.e be an input or button element) to get a suitable hover cursor

- @@ -261,6 +261,14 @@ + + + A link button + A non-link button + + + A link button + A non-link button