style multiple entry form more nicely

also show label correctly
agranig/1_0_subfix
Gerhard Jungwirth 13 years ago
parent 58c45bb632
commit c3caf6442e

@ -63,9 +63,12 @@ sub field_list {
$field = { $field = {
name => $meta->attribute, name => $meta->attribute,
type => 'Text', type => 'Text',
do_label => 0,
do_wrapper => 0,
}; };
} }
} }
$field->{label} = $meta->attribute;
push @field_list, $field; push @field_list, $field;
} }
@ -81,6 +84,14 @@ has_field 'save' => (
label => '', label => '',
); );
has_field 'add' => (
type => 'Submit',
value => 'Add',
element_class => [qw/btn btn-primary/],
do_label => 0,
do_wrapper => 0,
);
has_block 'actions' => ( has_block 'actions' => (
tag => 'div', tag => 'div',
class => [qw/modal-footer/], class => [qw/modal-footer/],

@ -82,6 +82,7 @@
<h3>Edit Preference [% helper.preference_meta.attribute %]</h3> <h3>Edit Preference [% helper.preference_meta.attribute %]</h3>
</div> </div>
[% IF helper.preference_meta.max_occur != 1 %] [% IF helper.preference_meta.max_occur != 1 %]
<div class="modal-body">
[% FOREACH v IN helper.preference.all %] [% FOREACH v IN helper.preference.all %]
[% IF v.value.substr(0,1) == '#' %] [% IF v.value.substr(0,1) == '#' %]
<input type="text" value="[% v.value.substr(1) %]" disabled="disabled" class="entry-disabled"></input> <input type="text" value="[% v.value.substr(1) %]" disabled="disabled" class="entry-disabled"></input>
@ -96,8 +97,14 @@
[% END %] [% END %]
<br /> <br />
[% END %] [% END %]
<form action="[% helper.form.action %]" method="post">
[% helper.form.fields.2.render %]
<span class="">[% helper.form.field("add").render %]</span>
</form>
</div>
[% ELSE %]
[% helper.form.render -%]
[% END %] [% END %]
[% helper.form.render -%]
</div> </div>
<script> <script>
$(function () { $(function () {

Loading…
Cancel
Save