kopia lustrzana https://github.com/wagtail/wagtail
Put add comment button on single_field_panel.html
rodzic
b2562e612c
commit
7cf38f8750
|
@ -474,6 +474,7 @@ class FieldPanel(EditHandler):
|
|||
'self': self,
|
||||
self.TEMPLATE_VAR: self,
|
||||
'field': self.bound_field,
|
||||
'show_add_comment_button': self.comments_enabled and getattr(self.bound_field.field.widget, 'show_add_comment_button', True),
|
||||
}))
|
||||
|
||||
field_template = "wagtailadmin/edit_handlers/field_panel_field.html"
|
||||
|
|
|
@ -1,8 +1,18 @@
|
|||
{% load i18n %}
|
||||
|
||||
<fieldset>
|
||||
<legend>{{ self.heading }}</legend>
|
||||
<ul class="fields">
|
||||
<li>
|
||||
{% include "wagtailadmin/shared/field.html" with show_label=False show_help_text=False %}
|
||||
{% include "wagtailadmin/shared/field.html" with show_label=False show_help_text=False show_add_comment_button=False %}
|
||||
</li>
|
||||
</ul>
|
||||
</fieldset>
|
||||
|
||||
{% if show_add_comment_button %}
|
||||
<div class="field-comment-control" data-contentpath="{{ self.field_name }}">
|
||||
<button type="button" data-component="add-comment-button" class="button button-secondary button-small u-hidden" aria-label="{% trans 'Add comment' %}">
|
||||
<svg class="icon icon-comment-add initial" aria-hidden="true" focusable="false"><use href="#icon-comment-add"></use></svg>
|
||||
</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
|
@ -21,9 +21,13 @@
|
|||
{% endfor %}
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
{% if show_add_comment_button %}
|
||||
<button type="button" data-component="add-comment-button" class="button button-secondary button-small u-hidden" aria-label="{% trans 'Add comment' %}"><svg class="icon icon-comment initial" aria-hidden="true" focusable="false"><use href="#icon-comment"></use></svg></button>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if show_add_comment_button %}
|
||||
<div class="field-comment-control">
|
||||
<button type="button" data-component="add-comment-button" class="button button-secondary button-small u-hidden" aria-label="{% trans 'Add comment' %}">
|
||||
<svg class="icon icon-comment-add initial" aria-hidden="true" focusable="false"><use href="#icon-comment-add"></use></svg>
|
||||
</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
|
Ładowanie…
Reference in New Issue