[Jifty-commit] r1350 - in jifty/trunk: . lib/Jifty lib/Jifty/Web lib/Jifty/Web/Form/Field share/web/static/css share/web/templates/_elements

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Thu Jun 22 15:10:22 EDT 2006


Author: seanmil
Date: Thu Jun 22 15:10:15 2006
New Revision: 1350

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Action.pm
   jifty/trunk/lib/Jifty/Web/Form.pm
   jifty/trunk/lib/Jifty/Web/Form/Field.pm
   jifty/trunk/lib/Jifty/Web/Form/Field/Checkbox.pm
   jifty/trunk/lib/Jifty/Web/Form/Field/Radio.pm
   jifty/trunk/share/web/static/css/forms.css
   jifty/trunk/share/web/templates/_elements/menu

Log:
 r567 at pc102:  sean | 2006-06-22 15:08:47 -0400
 * Numerous minor tag/rendering cleanup towards XHTML 1.0 Strict


Modified: jifty/trunk/lib/Jifty/Action.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Action.pm	(original)
+++ jifty/trunk/lib/Jifty/Action.pm	Thu Jun 22 15:10:15 2006
@@ -406,11 +406,11 @@
 
 sub register {
     my $self = shift;
-    Jifty->web->out( qq!<input type="hidden"! .
+    Jifty->web->out( qq!<div><input type="hidden"! .
                        qq! name="@{[$self->register_name]}"! .
                        qq! id="@{[$self->register_name]}"! .
                        qq! value="@{[ref($self)]}"! .
-                       qq! />\n! );
+                       qq! /></div>\n! );
 
 
 
@@ -418,6 +418,7 @@
 
     while ( my ( $name, $info ) = each %args ) {
         next unless $info->{'constructor'};
+        Jifty->web->out( qq!<div>! );
         Jifty::Web::Form::Field->new(
             %$info,
             action        => $self,
@@ -426,6 +427,7 @@
             default_value => ($self->argument_value($name) || $info->{'default_value'}),
             render_as     => 'Hidden'
         )->render();
+        Jifty->web->out( qq!</div>! );
     }
     return '';
 }

Modified: jifty/trunk/lib/Jifty/Web/Form.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web/Form.pm	(original)
+++ jifty/trunk/lib/Jifty/Web/Form.pm	Thu Jun 22 15:10:15 2006
@@ -197,9 +197,9 @@
     my $self = shift;
 
     my $button = Jifty::Web::Form::Clickable->new(submit => undef, @_)->generate;
-    Jifty->web->out(qq{<span class="submit_button">});
+    Jifty->web->out(qq{<div class="submit_button">});
     $button->render_widget;
-    Jifty->web->out(qq{</span>});
+    Jifty->web->out(qq{</div>});
 
     return '';
 }

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	Thu Jun 22 15:10:15 2006
@@ -375,9 +375,15 @@
 
 sub render_label {
     my $self = shift;
-    Jifty->web->out(
+    if ( $self->render_mode eq 'update' ) {
+        Jifty->web->out(
 qq!<label class="label @{[$self->classes]}" for="@{[$self->element_id ]}">@{[_($self->label) ]}</label>\n!
-    );
+        );
+    } else {
+        Jifty->web->out(
+            qq!<span class="label @{[$self->classes]}">@{[_($self->label) ]}</span>\n!
+        );
+    }
 
     return '';
 }

Modified: jifty/trunk/lib/Jifty/Web/Form/Field/Checkbox.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web/Form/Field/Checkbox.pm	(original)
+++ jifty/trunk/lib/Jifty/Web/Form/Field/Checkbox.pm	Thu Jun 22 15:10:15 2006
@@ -55,7 +55,7 @@
     $field .= qq! value="@{[$self->value ||1]}"!;
     $field .= $self->_widget_class;
     $field .= qq! checked="checked"! if ($self->checked or $self->current_value);
-    $field .= qq! disabled readonly!;
+    $field .= qq! disabled="disabled" readonly="readonly"!;
     $field .= qq! />\n!;
 
     Jifty->web->out($field);

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	Thu Jun 22 15:10:15 2006
@@ -19,6 +19,22 @@
     }
 }
 
+=head2 render_label
+
+We need to output the label as a span instead since the labels are associated 
+with the individual options.
+
+=cut
+
+sub render_label {
+    my $self = shift;
+    Jifty->web->out(
+        qq!<span class="label @{[$self->classes]}">@{[_($self->label) ]}</span>\n!
+    );
+
+    return '';
+}
+
 =head2 render_option option
 
 Renders a radio widget
@@ -39,9 +55,9 @@
     $field .= qq! value="@{[ $value ]}"!;
     $field .= $self->_widget_class;
 
-    $field .= qq! checked="1" !
+    $field .= qq! checked="checked" !
       if defined $self->current_value and $self->current_value eq $value;
-    $field .= qq!><label for="@{[ $id ]}"!;
+    $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	Thu Jun 22 15:10:15 2006
@@ -14,7 +14,7 @@
     float: left;
 }
 
-div.form_field label.label {
+div.form_field label.label, div.form_field span.label {
     float: left;
     width: 15%;
     text-align: right;

Modified: jifty/trunk/share/web/templates/_elements/menu
==============================================================================
--- jifty/trunk/share/web/templates/_elements/menu	(original)
+++ jifty/trunk/share/web/templates/_elements/menu	Thu Jun 22 15:10:15 2006
@@ -5,13 +5,16 @@
 # Default to the app menu
 $menu = Jifty->web->navigation if not defined $menu;
 </%init>
+% my @children = $menu->children;
+% if ( @children ) {
 <ul class="menu">
 <%perl>
 $m->comp( ".menu", item => $_ )
     for sort { $a->sort_order <=> $b->sort_order }
-             $menu->children;
+             @children;
 </%perl>
 </ul>
+% }
 
 <%def .menu>
   <%args>


More information about the Jifty-commit mailing list