diff --git a/wagtail/wagtailadmin/static/wagtailadmin/js/blocks/sequence.js b/wagtail/wagtailadmin/static/wagtailadmin/js/blocks/sequence.js index ff6f2641e..a7c671b25 100644 --- a/wagtail/wagtailadmin/static/wagtailadmin/js/blocks/sequence.js +++ b/wagtail/wagtailadmin/static/wagtailadmin/js/blocks/sequence.js @@ -1,9 +1,16 @@ -/* Operations on a sequence of items, common to both ListBlock and StreamBlock. +/* + +Operations on a sequence of items, common to both ListBlock and StreamBlock. + These assume the presence of a container element named "{prefix}-container" for each list item, and certain hidden fields such as "{prefix}-deleted" as defined in sequence_member.html, but make no assumptions about layout or visible controls within the block. + For example, they don't assume the presence of a 'delete' button - it's up to the specific subclass (list.js / stream.js) to attach this to the SequenceMember.delete method. + +CODE FOR SETTING UP SPECIFIC UI WIDGETS, SUCH AS DELETE BUTTONS OR MENUS, DOES NOT BELONG HERE. + */ (function($) { window.SequenceMember = function(sequence, prefix) { diff --git a/wagtail/wagtailadmin/templates/wagtailadmin/block_forms/sequence.html b/wagtail/wagtailadmin/templates/wagtailadmin/block_forms/sequence.html index 06ed9738b..1e6e0bb98 100644 --- a/wagtail/wagtailadmin/templates/wagtailadmin/block_forms/sequence.html +++ b/wagtail/wagtailadmin/templates/wagtailadmin/block_forms/sequence.html @@ -1,4 +1,17 @@ -{# Common HTML structure shared by list and stream blocks #} +{% comment %} + A 'sequence' is a generalised structure that implements a collection of blocks that can be + ordered, added and deleted. + + It provides the overall HTML structure, and the logic for updating hidden fields to reflect + changes to the sequence, but NOT the UI controls for performing those changes: that is the + responsibility of specific subtypes of 'sequence', such as list and stream. + + + DO NOT PUT UI CONTROLS HERE, OR ANYTHING ELSE THAT ASSUMES A SPECIFIC VISUAL RENDERING OF THE LIST. + (That belongs in templates that extend this one, such as list.html and stream.html.) + + +{% endcomment %}
diff --git a/wagtail/wagtailadmin/templates/wagtailadmin/block_forms/sequence_member.html b/wagtail/wagtailadmin/templates/wagtailadmin/block_forms/sequence_member.html index 6fa8944ac..1d9a44566 100644 --- a/wagtail/wagtailadmin/templates/wagtailadmin/block_forms/sequence_member.html +++ b/wagtail/wagtailadmin/templates/wagtailadmin/block_forms/sequence_member.html @@ -1,3 +1,17 @@ +{% comment %} + A 'sequence' is a generalised structure that implements a collection of blocks that can be + ordered, added and deleted. + + It provides the overall HTML structure, and the logic for updating hidden fields to reflect + changes to the sequence, but NOT the UI controls for performing those changes: that is the + responsibility of specific subtypes of 'sequence', such as list and stream. + + + DO NOT PUT UI CONTROLS HERE, OR ANYTHING ELSE THAT ASSUMES A SPECIFIC VISUAL RENDERING OF THE LIST. + (That belongs in templates that extend this one, such as list_member.html and stream_member.html.) + + +{% endcomment %}