Output human-readable label in the header of a streamfield child block

pull/1413/head
Matt Westcott 2015-06-05 22:59:36 +01:00
rodzic 4e64a5f3b9
commit 6226a2bacd
2 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

@ -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>

Wyświetl plik

@ -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):
""" """