Skip to content

Commit

Permalink
- Radio buttons in a radio button choice widget are now spaced closer
Browse files Browse the repository at this point in the history
  together and the button is on the left hand side.

- The ``closebutton_url`` argument to the SequenceWidget no longer
  does anything.  Style the widget template via CSS to add an image.

- The sequence remove button is no longer an image.
  • Loading branch information
mcdonc committed Sep 4, 2010
1 parent 32fcb5b commit 479a636
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 22 deletions.
9 changes: 7 additions & 2 deletions CHANGES.txt
Expand Up @@ -10,8 +10,10 @@ Features
- Sequence widgets are no longer ``structural`` by default; they now
print the label of the sequence above the sequence adder.

- The sequence widget now scrolls a newly added sequence item into
view when it is added.
- Radio buttons in a radio button choice widget are now spaced closer
together and the button is on the left hand side.

- The sequence remove button is no longer an image.

- The sequence widget now puts the sequence adding link *after* any
existing items in the sequence (previously the link was always
Expand Down Expand Up @@ -110,6 +112,9 @@ Backwards Incompatibilities
- The JavaScript function ``deformFocusFirstInput`` was removed. This
is now implied by ``deform.load()``.

- The ``closebutton_url`` argument to the SequenceWidget no longer
does anything. Style the widget template via CSS to add an image.

Internal
~~~~~~~~

Expand Down
29 changes: 19 additions & 10 deletions deform/static/css/form.css
Expand Up @@ -915,13 +915,19 @@ form li.paging-context{

/* deform additions*/

img.deformClosebutton {
.deformClosebutton {
border: 0;
cursor: pointer;
width: 1em;
height: 1em;
float: left;
margin: .5em;
/* width: 1em; */
/* height: 1em; */
/* margin: .5em; */
}

.deformClosebutton:before {
content:"✖";
color:red;
margin-right: 2px;
}

a.deformSeqAdd:visited {
Expand All @@ -934,11 +940,14 @@ div.deformReplaces {

/* css_class test */
form .deformWidgetWithStyle{
width:100px;
margin:0;
padding: 10px;
border: 2px solid #71a23c;
background-color: #fff7c0;
font-weight: bold;
width:100px;
margin:0;
padding: 10px;
border: 2px solid #71a23c;
background-color: #fff7c0;
font-weight: bold;
}

.deformSet-item {
padding: 1px;
}
12 changes: 6 additions & 6 deletions deform/templates/sequence_item.pt
Expand Up @@ -3,19 +3,19 @@
title="${field.description}">
<!-- sequence_item -->

<img class="deformClosebutton"
id="${field.oid}-close"
tal:condition="not field.widget.hidden"
src="${parent.widget.closebutton_url}"
alt="Remove" onclick="javascript:$(this).parent().remove();"/>
<span class="deformClosebutton"
id="${field.oid}-close"
tal:condition="not field.widget.hidden"
title="Remove"
onclick="javascript:$(this).parent().remove();"></span>

<span tal:replace="structure field.serialize(cstruct)"/>

<p tal:condition="field.error and not field.widget.hidden"
tal:define="errstr 'error-%s' % field.oid"
tal:repeat="msg field.error.messages()"
tal:attributes="id repeat.msg.index==0 and errstr or
('%s-%s' % (errstr, repeat.msg.index))"
('%s-%s' % (errstr, repeat.msg.index))"
class="${field.widget.error_class}">${msg}</p>

<!-- /sequence_item -->
Expand Down
5 changes: 1 addition & 4 deletions deform/widget.py
Expand Up @@ -881,9 +881,6 @@ class SequenceWidget(Widget):
of a form including a sequence widget, a child widget
rendering should be performed. Default: ``False``.
closebutton_url
The URL to the image representing the sequence item close
button. Default: ``/static/images/close.png``
"""
template = 'sequence'
readonly_template = 'readonly/sequence'
Expand All @@ -892,7 +889,6 @@ class SequenceWidget(Widget):
error_class = None
add_subitem_text_template = _('Add ${subitem_title}')
render_initial_item = False
closebutton_url = '/static/images/close.png'
requirements = ( ('deform', None), )

def prototype(self, field):
Expand Down Expand Up @@ -1367,6 +1363,7 @@ def __call__(self, requirements):
'scripts/deform.js'),
'css':('css/form.css',
'css/theme.css'),

},
},
'tinymce': {
Expand Down

0 comments on commit 479a636

Please sign in to comment.