view release on metacpan or search on metacpan
lib/Gantry/Control/C/Groups.pm view on Meta::CPAN
228229230231232233234235236237238239240241242243244245246247248
label
=>
$name
,
type
=>
'checkbox'
,
default_value
=> 1,
checked
=>
$groups
{
$user_id
},
callback
=>
$callback
,
});
}
my
$form
= {
ajax_java_script
=>
$ajax
->define_javascript_functions,
legend
=>
"Add/Remove Members"
,
back
=>
$$self
{location},
fields
=> \
@fields
};
# stash form
$self
->stash->view->form(
$form
);
}
# end do_members
#-------------------------------------------------
lib/Gantry/Control/C/Groups.pm view on Meta::CPAN
310311312313314315316317318319320321322323324325326327328329330#-------------------------------------------------
# _form( $row ? )
#-------------------------------------------------
sub
_form {
my
(
$self
,
$data
) =
@_
;
my
$row
=
$data
->{row};
my
$form
= {
legend
=>
$self
->path_info =~ /edit/i ?
'Edit'
:
'Add'
,
row
=>
$row
,
fields
=> [
{
name
=>
'name'
,
label
=>
'Group Name'
,
type
=>
'text'
,
is
=>
'varchar'
,
},
{
name
=>
'ident'
,
label
=>
'Ident'
,
type
=>
'text'
,
lib/Gantry/Control/C/Pages.pm view on Meta::CPAN
313314315316317318319320321322323324325326327328329330331332333foreach
(
$AUTH_USERS
->retrieve_all(
{
order_by
=>
'last_name, first_name'
} ) ) {
push
(
@owner_options
, {
label
=> (
$_
->last_name .
", "
.
$_
->first_name ),
value
=>
$_
->id,
});
}
my
$form
= {
legend
=>
$self
->path_info =~ /edit/i ?
'Edit'
:
'Add'
,
width
=>
"400"
,
label_width
=>
'40px'
,
row
=>
$row
,
fields
=> [
{
name
=>
'uri'
,
label
=>
'URI'
,
type
=>
'text'
,
is
=>
'varchar'
},
{
name
=>
'title'
,
lib/Gantry/Control/C/Users.pm view on Meta::CPAN
253254255256257258259260261262263264265266267268269270271272273
},
{
optional
=> 1,
name
=>
'email'
,
is
=>
'varchar'
,
label
=>
'E-mail'
,
type
=>
'text'
,
}
);
my
$form
= {
legend
=>
$self
->path_info =~ /edit/i ?
'Edit'
:
'Add'
,
width
=> 400,
row
=>
$row
,
fields
=> \
@fields
};
return
(
$form
);
}
# end _form
sub
site_links {
lib/Gantry/Docs/Cookbook.pod view on Meta::CPAN
477478479480481482483484485486487488489490491492493494495496497#-----------------------------------------------------------------
sub
do_groups {
my
(
$self
,
$user_id
) =
@_
;
my
$threeway
= Gantry::Utils::Threeway->new( {
self
=>
$self
,
primary_id
=>
$user_id
,
primary_table
=>
'user'
,
join_table
=>
'user_user_group'
,
secondary_table
=>
'user_group'
,
legend
=>
'Assign Groups to User'
} );
$threeway
->process();
}
# END do_groups
All you have to
do
is construct the three way object and call process
on it. This displays a form
with
a check box
for
each
group. The current
memberships are already checked. Clicking in the boxes and submitting
the form updates them.
lib/Gantry/Docs/Cookbook.pod view on Meta::CPAN
514515516517518519520521522523524525526527528529530531532533534535536The name of the controller's table.
=item join_table
The name of the joining table.
=item secondary_table
The name of the table on the other end of the many-to-many.
=item legend
HTML fieldset legend around the form where new joining table rows
are created from check box values.
=back
=head3 Using the three way manually
If you want to access rows from the table on the other end of the
many-to-many relationship, use the C<many_to_many> relationship in the model:
my @groups = $user->user_groups();
lib/Gantry/Docs/Tutorial.pod view on Meta::CPAN
415416417418419420421422423424425426427428429430431432433434435436437438439440441442443=for html <img src='http://www.usegantry.org/images/form.png' alt='Form Screen Shot' />
#-----------------------------------------------------------------
# $self->form( $row )
#-----------------------------------------------------------------
sub form {
return {
row => $row,
legend => $self->path_info =~ /edit/i ? 'Edit' : 'Add',
fields => [
The default template is called C<form.tt>. Among other things, it expects
the return value hash to contain C<row> (if editing), C<legend> (legend
of form's fieldset), and C<fields> (what the user will see and enter or edit).
If the C<row> is supplied, its values are used for initial form population.
The C<legend> is set based on the C<path_info> which contains part of the
URL. If that URL fragment includes 'edit,' the legend is 'Edit.' Otherwise,
it is 'Add.'
The C<fields> are an array of the entry elements the user will see. The
order of the array controls the on screen order. Each field is a little
hash. While there are other keys, the four most common are used over and
over, not just in this example.
{
name => 'name',
optional => 0,
lib/Gantry/Docs/Tutorial.pod view on Meta::CPAN
757758759760761762763764765766767768769770771772773774775776777}
# END do_main
#-----------------------------------------------------------------
# $self->form( $row )
#-----------------------------------------------------------------
sub
form {
my
(
$self
,
$row
) =
@_
;
return
{
row
=>
$row
,
legend
=>
$self
->path_info =~ /edit/i ?
'Edit'
:
'Add'
,
fields
=> [
{
name
=>
'name'
,
optional
=> 0,
label
=>
'Name'
,
type
=>
'text'
,
},
{
name
=>
'street'
,
optional
=> 1,
lib/Gantry/Docs/Tutorial.pod view on Meta::CPAN
12871288128912901291129212931294129512961297129812991300130113021303130413051306
row_options Edit, Delete;
}
The main listing is just like the one
for
the address table, except
for
the names of the displayed fields.
method form is AutoCRUD_form {
form_name birthday_form;
all_fields_but id;
extra_keys
legend
=> `
$self
->path_info =~ /edit/i ?
'Edit'
:
'Add'
`,
javascript
=> `
$self
->calendar_month_js(
'birthday_form'
)`;
}
}
Now the name of the form becomes important. The calendar_month_js
method (mixed in by Gantry::Plugins::Calendar) generates the javascript
for
the popup and its callback, which populates the date fields.
Note that we don't
tell
it which fields to handle. It will work on
all fields that have date_select_text statements.
lib/Gantry/Docs/Tutorial.pod view on Meta::CPAN
141314141415141614171418141914201421142214231424142514261427142814291430143114321433
page_link_label Address;
method do_main is main_listing {
cols name, street;
header_options Add;
row_options Edit, Delete;
title Address;
}
method form is AutoCRUD_form {
all_fields_but id, created, modified;
extra_keys
legend
=> `
$self
->path_info =~ /edit/i ?
'Edit'
:
'Add'
`;
}
}
table birth {
field id {
is int4, primary_key, auto;
}
field name {
is varchar;
label Name;
html_form_type text;
lib/Gantry/Docs/Tutorial.pod view on Meta::CPAN
145514561457145814591460146114621463146414651466146714681469147014711472147314741475
method do_main is main_listing {
title `Birth Day`;
cols name, family, birthday;
header_options Add;
row_options Edit, Delete;
}
method form is AutoCRUD_form {
form_name birthday_form;
all_fields_but id;
extra_keys
legend
=> `
$self
->path_info =~ /edit/i ?
'Edit'
:
'Add'
`,
javascript
=> `
$self
->calendar_month_js(
'birthday_form'
)`;
}
}
}
=head1 Summary
In this document we have seen how a simple Gantry app can be written
and deployed. While building a simple app with bigtop can take just
a few minutes, interesting parts can be fleshed out as needed. Our
lib/Gantry/Utils/Threeway.pm view on Meta::CPAN
333435363738394041424344454647484950515253my
$gself
=
$self
->{options}{self};
my
$template
=
$self
->{options}{template} ||
'threeway.tt'
;
my
$join_table
=
$self
->{options}{join_table};
my
$form_action
=
$self
->{options}{action} ||
$gself
->uri;
my
$type
=
$self
->{options}{type} ||
'checkbox'
;
my
$primary_table
=
$self
->{options}{primary_table};
my
$secondary_table
=
$self
->{options}{secondary_table};
my
$redirect_loc
=
$self
->{options}{redirect_loc} ||
$gself
->location;
my
$order_by
=
$self
->{options}{order_by} ||
'id'
;
my
$legend
=
$self
->{options}{legend} ||
"Add ${secondary_table}s"
;
my
$sch
=
$gself
->get_schema();
my
%param
=
$gself
->get_param_hash;
# pull from the member table
my
$selected
=
$sch
->resultset(
$join_table
)->search(
{
$primary_table
=>
$self
->{options}{primary_id} }, { }
);
my
%selected
;
lib/Gantry/Utils/Threeway.pm view on Meta::CPAN
125126127128129130131132133134135136137138139140141142143144
return
;
}
my
$available
=
$sch
->resultset(
$secondary_table
)->search( {}, {
order_by
=>
$order_by
,
} );
$gself
->stash->view->template(
$template
);
$gself
->stash->view->form( {
legend
=>
$legend
,
action
=>
$form_action
} );
$gself
->stash->view->data( {
type
=>
$type
,
available
=>
$available
,
selected
=> \
%selected
} );
}
# END process
lib/Gantry/Utils/Threeway.pm view on Meta::CPAN
156157158159160161162163164165166167168169170171172173174175
sub
do_something {
my
(
$self
,
$blog_id
) =
@_
;
my
$threeway
= Gantry::Utils::Threeway->new( {
self
=>
$self
,
primary_id
=>
$blog_id
,
primary_table
=>
'blog'
,
join_table
=>
'blog_tag'
,
legend
=>
'Add Tags'
,
orderby
=>
'id'
,
secondary_table
=>
'tag'
} );
$threeway
->process();
}
=head1 DESCRIPTION
lib/Gantry/Utils/Threeway.pm view on Meta::CPAN
187188189190191192193194195196197198199200201202203204205206207Requires the following parameters
self
# gantry site object
primary_id
# the row id for which your adding the relationships to
primary_table
# the primary table
join_table
# the join table is where the relationship rows are stored
secondary_table
# table in which your're relating to
Optional parameters
legend
# form legend
order_by
# sort list by this field
redirect_loc
# redirect location for on submit or cancel
=item process()
preforms the CRUD like procedures for maintaining the three-way relationships.
=back
=head1 SEE ALSO
root/css/default.css view on Meta::CPAN
902903904905906907908909910911912913914915916917918919920921922923924.block-rounded-genres h2 .trc { display: block; background: url(/images/trc-gray-block.gif)
no
-repeat 100% 0%; position: relative; padding: 3px 5px 2px 5px; margin-right: -1px; }
.block-rounded-genres .brc { background: url(/images/brc-gray-block.gif)
no
-repeat 100% 100%; position: relative; top: 2px; left: 1px; }
.block-rounded-genres .blc { background: url(/images/blc-gray-block.gif)
no
-repeat 0% 100%; position: relative; padding: 5px 5px 5px 10px; left: -2px; top: 0px; }
.block-rounded-genres .box_title h2 { line-height: 22px; background-color:
#ddd; background-color: #afafaf; margin: 0px; color: #fff; text-align: center; }
#docs ul { list-style: none; padding: 0; margin: 0 }
#docs ul li { color: #333; }
#docs fieldset { background: #fff; padding: 0; margin: 0; border: none; }
#docs fieldset legend { display: none; border: none; font-size: 13pt; }
#download ul { list-style: none; padding: 0; margin: 0 }
#download ul li { float: left; width: 320px; height: 120px; text-align: center; vertical-align: bottom; }
#download fieldset { background: #fff; padding: 0; margin: 0; border: none; }
#download fieldset legend { display: none; border: none; font-size: 13pt; }
#features ul { list-style: none; padding: 0; margin-left: -8px; margin-right: -6px; }
#features ul li { font-size: 11pt; border-bottom: 1px dotted #666; padding: 5px; margin: 0; }
#dfeatures ul li { float: left; width: 320px; height: 20px; text-align: center; vertical-align: bottom; }
#features fieldset { background: #fff; padding: 0; margin: 0; border: none; }
#features fieldset legend { display: none; border: none; font-size: 13pt; }
root/css/gantry_forms.css view on Meta::CPAN
12345678910111213#comments li { }
#comment-form fieldset { background: transparent; border: none; }
#comment-form fieldset legend { display: none; }
#comment-form td { text-align: left; }
#comment-form td.rshd { text-align: right; }
dl.classlist { text-align: left; }
#body .classlist dl { text-align: left; }
#preview_button { position: relative; top: -60px; left: 130px; }
/* FORMS */
div.form-box { background:
#FFF; padding: 0 2px 0 2px; width: 100%; }
div.form-box h5.heading { width: 100%; margin: 0 -2px 2px -2px; background:
#AFAFAF; font-size: 1.3em; padding: 0 0 0 2px; }
root/css/gantry_forms.css view on Meta::CPAN
2223242526272829303132333435363738394041fieldset.missing { border: 1px dotted red; margin: -2px 0 0 0; }
ul.site-
link
-list { padding: 10px 0 0 10px; font-size: 11px; }
.actions { text-align: right; background:
#AFAFAF; margin: 0 0px 0px 0px; font-size: 1.3em; padding: 0 0 0 2px; }
input { font-size: 10px; border: 1px solid
#777; background: #dce2da; }
select
{ font-size: 10px; border: 1px solid
#777; background: #dce2da; }
textarea { border: 1px solid
#777; background: #dce2da; font-family: 'Lucida Grande', helvetica, arial, sans-serif; font-size: 1.0em; }
fieldset { background:
#fff; border: 1px solid #c7c7c7; padding: 10px; }
legend { padding: 0 10px 0 10px; border: 1px solid
#c7c7c7; background: #fff; }
.results-box { clear: both; border: 1px solid
#777; font-size: 10px; }
.results-box table { padding: 0; margin: 0; background:
#eee; width: 100%; }
.results-box table td { padding: 0 4px 0 4px; margin: 0; border: 0; }
.results-box table
tr
.heading { background:
#afafaf; }
.results-box table
tr
{ background:
#fff; }
.results-box table
tr
.rhdr { text-align: right; }
.results-box table
tr
.rdta { text-align: right; font-size: 10px; }
.results-box table
tr
.alt td { background:
#ecf6fc; }
root/css/gantry_site.css view on Meta::CPAN
272829303132333435363738394041424344454647h1 { font-size: 2.4em;}
h2 { font-size: 2.2em;}
h3 { font-size: 2.0em;}
h4 { font-size: 1.8em;}
h5 { font-size: 1.6em;}
h6 { font-size: 1.4em;}
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { color:
#3A566B; text-decoration: none;}
p { margin: .3em 0 1em 0; font-family:
'Lucida Grande'
, helvetica, arial, sans-serif; font-size: 1.0em; line-height: 1.5em; color:
#333;}
ul { margin: 1em 0;}
legend, li, dt, dd, th, td { font-family:
'Lucida Grande'
, helvetica, arial, sans-serif; font-size: 1.0em; line-height: 1.5em; color:
#333;}
dd { font-size: 1em;}
a { color:
#3A566B; text-decoration: none;}
a:hover { text-decoration: underline;}
em { color:
#3A566B;}
.currency { text-align: right; }
/* Logo-------------------------------------------------------------------------------- */
#header h1 { position: absolute; margin: 0; top: 69px; left: 0; width: 17em; height: 7.2em; overflow: hidden; clip: rect(0 17em 7.2em 0);}
#header h1 a { display: block; padding-top: 17em; /* background: transparent url(../images/merchspot.gif) top left no-repeat; */ }
root/form.tt view on Meta::CPAN
1011121314151617181920212223242526272829view.form - a hash
with
these
keys
:
method - POST or GET (defaults to POST)
action - url of page to process form (defaults to self.uri)
name - the name of the form (useful
for
javascript references)
row - the current row object from the table (
if
available)
javascript - javascript code the form needs (like
for
date popups.
Consider using Gantry::Plugins::Calendar and calling
its calendar_month_js.
(This could actually be anything, it just gets copied to
the output immediately
after
the form opening tag)
legend - The title
for
the legend box wrapping the form.
change_log - An array of change_log entries (optional). Each entry
is a hash
with
these
keys
:
date - the date the change happened
by - the name of the person making the change
message - what happened
results - the
return
value from Data::FormValidator->check
cellspacing - becomes the cellspacing parameter of the form's table
(defaults to 0)
width - becomes the width parameter of the form's table
root/form.tt view on Meta::CPAN
117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146<form
method=
"[% view.form.method || 'post' %]"
action=
"[% view.form.action || self.uri %]"
name=
"[% view.form.name %]"
[% IF view.form.enctype !=
''
;
"enctype='$view.form.enctype'"
; END; %]
>
[% view.form.javascript %]
<fieldset>
<legend>
[% view.form.legend %]
</legend>
[%- IF view.form.change_log %]
<div style=
"float: right; width: 240px"
>
<fieldset>
<legend><a href=
'[% view.form.change_log_url %]'
>Change Log</a>
</legend>
<div id=
"change_log"
>
[% FOREACH entry IN view.form.change_log %]
<b>[% entry.date %]</b> By [% entry.by %]<br />
·
; [% entry.message %]<br />
[% END %]
</div>
</fieldset>
</div>
[%- END %]
root/form_ajax.tt view on Meta::CPAN
1234567891011121314151617[% title = view.title %]
[% view.form.ajax_java_script %]
<fieldset>
<legend>
[% view.form.legend %]
</legend>
<div id=
"float_left"
>
<table class=
"results"
cellspacing=
"[% view.form.cellspacing || 0 %]"
border=0 width=
"[% view.form.width %]"
>
[% FOREACH field IN view.form.fields %]
<
tr
class=
"[% 'selected' IF field.checked %]"
>
<td class=
"shd"
style=
"width: [% field.label_width || '20%' %]"
>
[% field.label %]
</td>
<td class=
"dta"
style=
"width: [% field.width || '80%' %]"
valign=
"top"
>
root/login.tt view on Meta::CPAN
12345678910111213141516171819202122232425[% title = view.title %]
<style type=
"text/css"
>
#login_page { width: 600px; }
#login { float: left;}
#login ul { list-style: none }
#login input { border: 1px solid #c7c7c7; }
#login fieldset legend { padding: 3px }
#login fieldset { width: 150px; border: 1px solid #c7c7c7; padding: 10px 0px 15px 15px;}
#login_page #login_text { float: left; width: 300px; }
</style>
<div id=
"login_page"
>
<div id=
"login"
>
<fieldset>
<legend>Login</legend>
[% IF site.stash.controller.data.errors > 0 %]
<div id=
"login_errors"
>
<ul>
[% FOREACH err IN site.stash.controller.data.errors %]
<li>[% err %]</li>
[% END %]
</ul>
root/moxie/delete.tt view on Meta::CPAN
12345678910111213[% title = view.title %]
<form method=
'post'
action=
'[% site.uri %]/yes'
class=
'form-box'
>
<div class=
"form-box"
>
<h5 class=
"heading"
>[% view.form.legend ||
'Delete'
%]</h5>
<dl><dd>[% view.form.message %]</dd></dl>
</div>
<div class=
"form-box actions"
>
<input type=
"submit"
name=
"submit"
value=
"Continue with Delete"
/>
<input type=
"submit"
name=
"cancel"
value=
"Cancel"
/>
</div>
</form>
root/moxie/form.tt view on Meta::CPAN
89101112131415161718192021222324252627282930313233343536373839404142434445) %]
[%- IF view.form.show_error_summary %]
[% PROCESS error_summary %]
[%- END %]
[%
# check for older style crud form %]
[%- IF view.form.fields %]
<div class=
"form-box"
>
<h5 class=
"heading"
>[% view.form.legend %]</h5>
<p class=
"form-description"
>
[% view.title %]
</p>
[%- FOREACH field_data IN view.form.fields %]
[%- PROCESS field
dta = field_data
row = view.form.row
layout =
'default'
%]
[%- END %]
</div>
[%- ELSE %]
[%- WHILE ( row = view.form.row.
next
) %]
<div class=
"form-box"
>
<h5 class=
"heading"
>[% view.form.legend %]</h5>
[%- FOREACH field_data IN view.form.fields %]
[%- PROCESS field
dta = field_data
row = row
layout =
'default'
%]
[%- END %]
</div>
[%- END %]
root/moxie/form_onetomany.tt view on Meta::CPAN
12345678910111213141516[%- USE form = HTML.SuperForm( self.params ) %]
<div class=
"results-box"
>
<table class=
"results"
id=
"results"
>
<
tr
class=
"heading"
>
<td colspan=
"2"
class=
"hdr"
>
[% view.form.legend %]
</td>
</
tr
>
[% FOREACH field IN view.form.fields %]
[% onclick_text = BLOCK -%]
javascript: ajax_action(
'[% field.cb_action %]'
, this.checked,
'view_[% field.name %]'
);
[%- END %]
<
tr
class=
"[% 'selected' IF field.checked %]"
>
<td class=
"form_selector"
>
root/moxie/threeway.tt view on Meta::CPAN
161718192021222324252627282930313233343536
field[i].checked = false ;
}
}
// End -->
</script>
<form method=
"post"
action=
"[% view.form.action || self.uri %]"
id=
"[% view.form.name || 'myform' %]"
>
<div class=
"form-box"
>
<h5 class=
"heading"
>[% view.form.legend ||
'Make Selection'
%]</h5>
<dl class=
"checklist"
>
[% IF view.data.type ==
'checkbox'
%]
[%- WHILE ( available = view.data.available.
next
) %]
[%- id = available.id %]
<dd>
<input type=
"checkbox"
value=
"1"
name=
"subscribe:[% id %]"
[%- IF view.data.selected.
$id
%]
checked=
"checked"
[%- END %] />
root/sample_wrapper.tt view on Meta::CPAN
262728293031323334353637383940414243444546#users { width: 150px; margin: 0 0 10px 0;}
#user_content ul { list-style: none; margin: 0; padding: 0;}
#products ul { list-style: none; margin: 0; padding: 0;}
#product_attribs ul { list-style: none; margin: 0; padding: 0;}
#login_errors ul { padding: 0 0 0 0; }
#login_errors { white-space: nowrap; }
#users ul { list-style: none; margin: 0; padding: 0;}
#site_links { visibility: hidden;}
#footer #site_links { visibility: visible;}
fieldset { background:
#e9e9e9; border: 1px solid #c7c7c7;}
legend { padding: 0 10px 0 10px; border: 1px solid
#c7c7c7; background: #fff;}
#content .box table { padding: 0; margin: 0; background: #eee; width: 100%;}
#content .box table td { padding: 0 4px 0 4px; margin: 0; border: 0;}
#content .box table tr { background: #b9c5b4;}
#content .box table tr + tr { background: #fff;}
#content table .rhdr { text-align: right }
#content table .rdta { text-align: right }
#content table .rshd { text-align: right }
#footer { font: normal 12px/20px sans-serif; text-align: center; padding: 10px; margin: 0px auto ; width: 740px;}
#float_right { float: right;}
#float_left { float: left;}
root/search.tt view on Meta::CPAN
1617181920212223242526272829303132333435363738<form
method=
"[% view.form.method || 'post' %]"
action=
"[% view.form.action || self.uri %]"
name=
"[% view.form.name %]"
>
[% view.form.javascript %]
<fieldset>
<legend>
[% view.form.legend %]
</legend>
<div style=
"float: left"
>
<table class=
"results"
cellspacing=
"[% view.form.cellspacing || 0 %]"
border=
"0"
width=
"[% view.form.width %]"
>
[% FOREACH field IN view.form.fields %]
root/sfbb/form.tt view on Meta::CPAN
2324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384[%- END %]
[%
# check for older style crud form %]
[%- IF view.form.fields %]
<div class=
"form-box [% view.form.class %]"
>
[% UNLESS view.form.nohead %]<h4 class=
"heading"
>[% view.title %]</h4>[% END %]
[%-
fieldsets = [];
cfsgroup.legend =
'gantry-default'
;
cfsgroup.fields = [];
FOREACH field_data IN view.form.fields;
IF field_data.fieldset && ! field_data.fieldset.match(cfsgroup.legend);
IF cfsgroup.fields.size;
fieldsets.
push
(cfsgroup);
cfsgroup = {};
cfsgroup.fields = [];
ELSE;
cfsgroup = {};
cfsgroup.fields = [];
END;
cfsgroup.legend = field_data.fieldset;
cfsgroup.fields.
push
(field_data);
ELSE;
cfsgroup.fields.
push
(field_data);
END;
END;
fieldsets.
push
(cfsgroup);
-%]
[%- FOREACH fieldset IN fieldsets %]
<fieldset class=
"[% fieldset.legend | replace('\s+', '-') | replace("
'", '
') | lower %]">
[% UNLESS fieldset.legend.match(
'gantry-default'
) %]
<legend>[% fieldset.legend %]</legend>
[% END %]
[% FOREACH field_data IN fieldset.fields; %]
[%- PROCESS field
dta = field_data
row = view.form.row
layout =
'default'
%]
<br id=
"[% field_data.name _ '_br' %]"
style=
"clear: both"
/>
[% END %]
</fieldset>
[%- END %]
</div>
[%- ELSE %]
[%- WHILE ( row = view.form.row.
next
) %]
<div class=
"form-box [% view.form.class %]"
>
<h5 class=
"heading"
>[% view.form.legend %]</h5>
[%- FOREACH field_data IN view.form.fields %]
[%- PROCESS field
dta = field_data
row = row
layout =
'default'
%]
[%- END %]
</div>
[%- END %]
root/threeway.tt view on Meta::CPAN
1617181920212223242526272829303132333435363738
field[i].checked = false ;
}
}
// End -->
</script>
<form method=
"post"
action=
"[% view.form.action || self.uri %]"
id=
"[% view.form.name || 'myform' %]"
>
<fieldset>
<legend>
[% view.form.legend %]
</legend>
<dl class=
"checklist"
>
[% IF view.data.type ==
'checkbox'
%]
[%- WHILE ( available = view.data.available.
next
) %]
[%- id = available.id %]
<dd>
<input type=
"checkbox"
value=
"1"
name=
"subscribe:[% id %]"
[%- IF view.data.selected.
$id
%]
checked=
"checked"
[%- END %] />