[Jifty-commit] r1154 - in jifty/trunk: . lib/Jifty/Web/Form
lib/Jifty/Web/Form/Field
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Sun Jun 4 12:21:03 EDT 2006
Author: seanmil
Date: Sun Jun 4 12:20:57 2006
New Revision: 1154
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Web/Form/Field.pm
jifty/trunk/lib/Jifty/Web/Form/Field/Radio.pm
jifty/trunk/share/web/static/css/forms.css
Log:
r349 at pc102: sean | 2006-06-04 12:20:48 -0400
* Fix use of label to refer to the form element id, not name
* Add labels to radio button text
Modified: jifty/trunk/lib/Jifty/Web/Form/Field.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web/Form/Field.pm (original)
+++ jifty/trunk/lib/Jifty/Web/Form/Field.pm Sun Jun 4 12:20:57 2006
@@ -379,7 +379,7 @@
sub render_label {
my $self = shift;
Jifty->web->out(
-qq!<label class="label @{[$self->classes]}" for="@{[$self->input_name ]}">@{[_($self->label) ]}</label>\n!
+qq!<label class="label @{[$self->classes]}" for="@{[$self->element_id ]}">@{[_($self->label) ]}</label>\n!
);
return '';
Modified: jifty/trunk/lib/Jifty/Web/Form/Field/Radio.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web/Form/Field/Radio.pm (original)
+++ jifty/trunk/lib/Jifty/Web/Form/Field/Radio.pm Sun Jun 4 12:20:57 2006
@@ -41,7 +41,9 @@
$field .= qq! checked="1" !
if defined $self->current_value and $self->current_value eq $value;
- $field .= qq!>$display\n!;
+ $field .= qq!><label for="@{[ $id ]}"!;
+ $field .= $self->_widget_class;
+ $field .= qq!>$display</label>\n!;
Jifty->web->out($field);
'';
}
Modified: jifty/trunk/share/web/static/css/forms.css
==============================================================================
--- jifty/trunk/share/web/static/css/forms.css (original)
+++ jifty/trunk/share/web/static/css/forms.css Sun Jun 4 12:20:57 2006
@@ -14,7 +14,7 @@
float: left;
}
-div.form_field label {
+div.form_field label.label {
float: left;
width: 15%;
text-align: right;
@@ -95,7 +95,7 @@
margin-right: 0.5em;
}
-div.inline div.form_field label,
+div.inline div.form_field label.label,
div.inline .hints,
div.inline .error
{
@@ -113,7 +113,7 @@
}
-div.inline div.form_field label {
+div.inline div.form_field label.label {
/* aesthetic */
padding-bottom: 0.1em;
}
More information about the Jifty-commit
mailing list