mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-09 16:04:45 +00:00
make comments about the purpose of 'sequence' more loud and obnoxious
This commit is contained in:
parent
1527a3a4a5
commit
5ca8f696a3
3 changed files with 36 additions and 2 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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 %}
|
||||
<div class="sequence">
|
||||
<input type="hidden" name="{{ prefix }}-count" id="{{ prefix }}-count" value="{{ list_members_html|length }}">
|
||||
|
||||
|
|
|
|||
|
|
@ -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 %}
|
||||
<li id="{{ prefix }}-container" class="sequence-member blockname-{{ block_type_name }}">
|
||||
<input type="hidden" id="{{ prefix }}-deleted" name="{{ prefix }}-deleted" value="">
|
||||
<input type="hidden" id="{{ prefix }}-order" name="{{ prefix }}-order" value="{{ index }}">
|
||||
|
|
|
|||
Loading…
Reference in a new issue