kopia lustrzana https://github.com/wagtail/wagtail
Exclude the error messages from the count of inline panel elements (#4957)
Ref #4304 ; explicitly identify and count inline-panel-child elements as per https://github.com/wagtail/wagtail/pull/4304#discussion_r169149310pull/4963/head
rodzic
5f7b7230a2
commit
a11f7ee015
|
@ -4,7 +4,8 @@ Changelog
|
|||
2.5 (xx.xx.xxxx) - IN DEVELOPMENT
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
* Fix: Set `SERVER_PORT` to 443 in `Page.dummy_request()` for HTTPS sites (Sergey Fedoseev)
|
||||
* Fix: Set `SERVER_PORT` to 443 in `Page.dummy_request()` for HTTPS sites (Sergey Fedoseev)
|
||||
* Fix: Validation error messages in `InlinePanel` no longer count towards `max_num` when disabling the 'add' button (Todd Dembrey, Thibaud Colas)
|
||||
|
||||
|
||||
2.4 (xx.xx.xxxx) - IN DEVELOPMENT
|
||||
|
|
|
@ -19,6 +19,7 @@ Bug fixes
|
|||
~~~~~~~~~
|
||||
|
||||
* Set ``SERVER_PORT`` to 443 in ``Page.dummy_request()`` for HTTPS sites (Sergey Fedoseev)
|
||||
* Validation error messages in ``InlinePanel`` no longer count towards ``max_num`` when disabling the 'add' button (Todd Dembrey, Thibaud Colas)
|
||||
|
||||
|
||||
Upgrade considerations
|
||||
|
|
|
@ -176,7 +176,7 @@ function InlinePanel(opts) {
|
|||
|
||||
self.updateAddButtonState = function() {
|
||||
if (opts.maxForms) {
|
||||
var forms = $('> li', self.formsUl).not('.deleted');
|
||||
var forms = $('> [data-inline-panel-child]', self.formsUl).not('.deleted');
|
||||
var addButton = $('#' + opts.formsetPrefix + '-ADD');
|
||||
|
||||
if (forms.length >= opts.maxForms) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{% load i18n %}
|
||||
<li id="inline_child_{{ child.form.prefix }}">
|
||||
<li data-inline-panel-child id="inline_child_{{ child.form.prefix }}">
|
||||
<ul class="controls">
|
||||
{% if can_order %}
|
||||
<li><button type="button" class="button icon text-replace white icon-order-up inline-child-move-up" id="{{ child.form.prefix }}-move-up" title="{% trans 'Move up' %}">{% trans "Move up" %}</button></li>
|
||||
|
|
Ładowanie…
Reference in New Issue