135 |
} elsif ( $attr_type !~ m{^(Str|Int)$} ) { |
} elsif ( $attr_type !~ m{^(Str|Int)$} ) { |
136 |
$value_html = qq|<textarea name="$name" title="$attr_type">$value</textarea>|; |
$value_html = qq|<textarea name="$name" title="$attr_type">$value</textarea>|; |
137 |
} |
} |
138 |
|
|
139 |
$value = $attr->default( $name ) if ! $value && $attr->has_default; |
$value = $attr->default( $name ) if ! $value && $attr->has_default; |
140 |
$label_title = qq| title="| . $attr->documentation . qq|"| if $attr->has_documentation; |
$label_title = qq| title="| . $attr->documentation . qq|"| if $attr->has_documentation; |
141 |
|
|
142 |
$default->{$name} = $value unless defined $default->{$name}; |
$default->{$name} = $value unless defined $default->{$name}; |
143 |
|
|
144 |
$value_html = qq|<input type="$type" name="$name" title="$attr_type" value="$value">| unless $value_html; |
if ( ! $value_html ) { |
145 |
|
my $suffix = ''; |
146 |
|
if ( $attr_type =~ m{^Bool$} ) { |
147 |
|
$type = 'checkbox'; |
148 |
|
$suffix = ' checked' if $value; |
149 |
|
} |
150 |
|
$value_html = qq|<input type="$type" name="$name" title="$attr_type" value="$value"$suffix>|; |
151 |
|
} |
152 |
|
|
153 |
# warn "# required $name ", $class->meta->get_attribute( $name )->dump( 2 ); |
# warn "# required $name ", $class->meta->get_attribute( $name )->dump( 2 ); |
154 |
$form .= qq|<label for="$name"$label_title>$label</label>| . $value_html; |
$form .= qq|<label for="$name"$label_title>$label</label>| . $value_html; |