kopia lustrzana https://github.com/wagtail/wagtail
Output human-readable label in the header of a streamfield child block
rodzic
4e64a5f3b9
commit
6226a2bacd
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
{% block header_controls %}
|
{% block header_controls %}
|
||||||
<div class="stream-controls">
|
<div class="stream-controls">
|
||||||
<h3>{{ block_type_name }}</h3>{# TODO: this should be the label, not the name, the latter being a machine-name #}
|
<h3><label{% if child.id_for_label %} for="{{ child.id_for_label }}"{% endif %}>{{ child.block.label }}</label></h3>
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<button type="button" id="{{ prefix }}-moveup" title="{% trans 'Move up' %}" class="icon button-nobg button-neutral text-replace icon-order-up">{% trans 'Move up' %}</button>
|
<button type="button" id="{{ prefix }}-moveup" title="{% trans 'Move up' %}" class="icon button-nobg button-neutral text-replace icon-order-up">{% trans 'Move up' %}</button>
|
||||||
<button type="button" id="{{ prefix }}-movedown" title="{% trans 'Move down' %}" class="icon button-nobg button-neutral text-replace icon-order-down">{% trans 'Move down' %}</button>
|
<button type="button" id="{{ prefix }}-movedown" title="{% trans 'Move down' %}" class="icon button-nobg button-neutral text-replace icon-order-down">{% trans 'Move down' %}</button>
|
||||||
|
|
|
@ -379,6 +379,9 @@ class BoundBlock(object):
|
||||||
def render(self):
|
def render(self):
|
||||||
return self.block.render(self.value)
|
return self.block.render(self.value)
|
||||||
|
|
||||||
|
def id_for_label(self):
|
||||||
|
return self.block.id_for_label(self.prefix)
|
||||||
|
|
||||||
|
|
||||||
class DeclarativeSubBlocksMetaclass(BaseBlock):
|
class DeclarativeSubBlocksMetaclass(BaseBlock):
|
||||||
"""
|
"""
|
||||||
|
|
Ładowanie…
Reference in New Issue