Remove unnecessary indentation from code examples

pull/7590/head
Matt Westcott 2021-10-13 18:13:47 +01:00 zatwierdzone przez Matt Westcott
rodzic 6012291707
commit 78389caa95
1 zmienionych plików z 36 dodań i 36 usunięć

Wyświetl plik

@ -23,11 +23,11 @@ Usage
`TypedTableBlock` can be imported from the module `wagtail.contrib.typed_table_block.blocks` and used within a StreamField definition. Just like `StructBlock` and `StreamBlock`, it accepts a list of `(name, block_type)` tuples to use as child blocks:
```python
from wagtail.contrib.typed_table_block.blocks import TypedTableBlock
from wagtail.core import blocks
from wagtail.images.blocks import ImageChooserBlock
from wagtail.contrib.typed_table_block.blocks import TypedTableBlock
from wagtail.core import blocks
from wagtail.images.blocks import ImageChooserBlock
class DemoStreamBlock(blocks.StreamBlock):
class DemoStreamBlock(blocks.StreamBlock):
title = blocks.CharBlock()
paragraph = blocks.RichTextBlock()
table = TableBlock([
@ -60,21 +60,21 @@ To keep the UI as simple as possible for authors, it's generally recommended to
On your page template, the `{% include_block %}` tag (called on either the individual block, or the StreamField value as a whole) will render any typed table blocks as an HTML `<table>` element.
```html+django
{% load wagtailcore_tags %}
{% load wagtailcore_tags %}
{% include_block page.body %}
{% include_block page.body %}
```
Or:
```html+django
{% load wagtailcore_tags %}
{% load wagtailcore_tags %}
{% for block in page.body %}
{% for block in page.body %}
{% if block.block_type == 'table' %}
{% include_block block %}
{% else %}
{# rendering for other block types #}
{% endif %}
{% endfor %}
{% endfor %}
```