From c3caf6442edb1a23d7d072ef7d4359cd847b982b Mon Sep 17 00:00:00 2001 From: Gerhard Jungwirth Date: Fri, 12 Apr 2013 15:25:51 +0200 Subject: [PATCH] style multiple entry form more nicely also show label correctly --- lib/NGCP/Panel/Form/Preferences.pm | 11 +++++++++++ share/templates/helpers/pref_table.tt | 9 ++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lib/NGCP/Panel/Form/Preferences.pm b/lib/NGCP/Panel/Form/Preferences.pm index 501e72f352..67e071239a 100644 --- a/lib/NGCP/Panel/Form/Preferences.pm +++ b/lib/NGCP/Panel/Form/Preferences.pm @@ -63,9 +63,12 @@ sub field_list { $field = { name => $meta->attribute, type => 'Text', + do_label => 0, + do_wrapper => 0, }; } } + $field->{label} = $meta->attribute; push @field_list, $field; } @@ -81,6 +84,14 @@ has_field 'save' => ( label => '', ); +has_field 'add' => ( + type => 'Submit', + value => 'Add', + element_class => [qw/btn btn-primary/], + do_label => 0, + do_wrapper => 0, +); + has_block 'actions' => ( tag => 'div', class => [qw/modal-footer/], diff --git a/share/templates/helpers/pref_table.tt b/share/templates/helpers/pref_table.tt index 55d5374dfd..dcff2e1eb3 100644 --- a/share/templates/helpers/pref_table.tt +++ b/share/templates/helpers/pref_table.tt @@ -82,6 +82,7 @@

Edit Preference [% helper.preference_meta.attribute %]

[% IF helper.preference_meta.max_occur != 1 %] + + [% ELSE %] + [% helper.form.render -%] [% END %] - [% helper.form.render -%]