kopia lustrzana https://github.com/wagtail/wagtail
Add changelog/release notes for #1022
rodzic
096a24648d
commit
2895aac7f3
|
@ -28,8 +28,9 @@ Changelog
|
|||
* Bare text entered in rich text areas is now automatically wrapped in a paragraph element
|
||||
* Added pagination to the snippets listing and chooser (Martin Sanders)
|
||||
* Page / document / image / snippet choosers now include a link to edit the chosen item
|
||||
* Fix: The `document_served` signal now correctly passes the Document class as `sender` and the document as `instance`
|
||||
* Fix: Image edit page no longer throws OSError when the original image is missing
|
||||
* The `document_served` signal now correctly passes the Document class as `sender` and the document as `instance`
|
||||
* Image/Document edit page no longer throws OSError when the original image is missing
|
||||
* Page classes can specify an edit_handler property to override the default Content / Promote / Settings tabbed interface
|
||||
|
||||
0.8.5 (17.02.2015)
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
|
|
@ -49,6 +49,7 @@ Admin
|
|||
* ``FieldPanel`` now accepts an optional ``widget`` parameter to override the field's default form widget
|
||||
* Page model fields without a ``FieldPanel`` are no longer displayed in the form
|
||||
* No longer need to specify the base model on ``InlinePanel`` definitions
|
||||
* Page classes can specify an edit_handler property to override the default Content / Promote / Settings tabbed interface
|
||||
|
||||
|
||||
**Other admin changes**
|
||||
|
@ -157,3 +158,32 @@ Previously, the forms for creating and editing images followed Django's default
|
|||
has_legal_approval = models.BooleanField()
|
||||
|
||||
admin_form_fields = Image.admin_form_fields + ['photographer']
|
||||
|
||||
Customising the tabbed interface
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Wagtail organises panels into three tabs: 'Content', 'Promote' and 'Settings'. Depending on the requirements of your site, you may wish to customise this for specific page types - for example, adding an additional tab for sidebar content. This can be done by specifying an ``edit_handler`` property on the page model. For example:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from wagtail.wagtailadmin.edit_handlers import TabbedInterface, ObjectList
|
||||
|
||||
class BlogPage(Page):
|
||||
# field definitions omitted
|
||||
|
||||
BlogPage.content_panels = [
|
||||
FieldPanel('title', classname="full title"),
|
||||
FieldPanel('date'),
|
||||
FieldPanel('body', classname="full"),
|
||||
]
|
||||
BlogPage.sidebar_content_panels = [
|
||||
SnippetChooserPanel('advert', Advert),
|
||||
InlinePanel('related_links', label="Related links"),
|
||||
]
|
||||
|
||||
BlogPage.edit_handler = TabbedInterface([
|
||||
ObjectList(BlogPage.content_panels, heading='Content'),
|
||||
ObjectList(BlogPage.sidebar_content_panels, heading='Sidebar content'),
|
||||
ObjectList(BlogPage.promote_panels, heading='Promote'),
|
||||
ObjectList(BlogPage.settings_panels, heading='Settings', classname="settings"),
|
||||
])
|
||||
|
|
Ładowanie…
Reference in New Issue