line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Yancy::Plugin::Form::Bootstrap4; |
2
|
|
|
|
|
|
|
our $VERSION = '1.088'; |
3
|
|
|
|
|
|
|
# ABSTRACT: Generate forms using Bootstrap 4 |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
#pod =head1 SYNOPSIS |
6
|
|
|
|
|
|
|
#pod |
7
|
|
|
|
|
|
|
#pod use Mojolicious::Lite; |
8
|
|
|
|
|
|
|
#pod plugin Yancy => { |
9
|
|
|
|
|
|
|
#pod backend => 'pg://localhost/mysite', |
10
|
|
|
|
|
|
|
#pod read_schema => 1, |
11
|
|
|
|
|
|
|
#pod }; |
12
|
|
|
|
|
|
|
#pod app->yancy->plugin( 'Form::Bootstrap4' ); |
13
|
|
|
|
|
|
|
#pod # See Yancy::Controller::Yancy for routing |
14
|
|
|
|
|
|
|
#pod app->routes->get( '/people/:id/edit' )->to( |
15
|
|
|
|
|
|
|
#pod 'yancy#set', |
16
|
|
|
|
|
|
|
#pod schema => 'people', |
17
|
|
|
|
|
|
|
#pod template => 'edit_people', |
18
|
|
|
|
|
|
|
#pod ); |
19
|
|
|
|
|
|
|
#pod app->start; |
20
|
|
|
|
|
|
|
#pod __DATA__ |
21
|
|
|
|
|
|
|
#pod @@ edit_people.html.ep |
22
|
|
|
|
|
|
|
#pod %= $c->yancy->form->form_for( 'people' ); |
23
|
|
|
|
|
|
|
#pod |
24
|
|
|
|
|
|
|
#pod =head1 DESCRIPTION |
25
|
|
|
|
|
|
|
#pod |
26
|
|
|
|
|
|
|
#pod This plugin generates forms using the L
|
27
|
|
|
|
|
|
|
#pod 4.0|https://getbootstrap.com/docs/4.0/>. |
28
|
|
|
|
|
|
|
#pod |
29
|
|
|
|
|
|
|
#pod For details on the helpers added by this plugin, see |
30
|
|
|
|
|
|
|
#pod L. |
31
|
|
|
|
|
|
|
#pod |
32
|
|
|
|
|
|
|
#pod =head1 TEMPLATES |
33
|
|
|
|
|
|
|
#pod |
34
|
|
|
|
|
|
|
#pod To override these templates, add your own at the designated path inside |
35
|
|
|
|
|
|
|
#pod your app's C directory. |
36
|
|
|
|
|
|
|
#pod |
37
|
|
|
|
|
|
|
#pod =head2 yancy/form/bootstrap4/form.html.ep |
38
|
|
|
|
|
|
|
#pod |
39
|
|
|
|
|
|
|
#pod This template surrounds the form to create the C<< |
40
|
|
|
|
|
|
|
#pod list all the fields, and add a submit button. Also includes a CSRF token. |
41
|
|
|
|
|
|
|
#pod |
42
|
|
|
|
|
|
|
#pod =head2 yancy/form/bootstrap4/field.html.ep |
43
|
|
|
|
|
|
|
#pod |
44
|
|
|
|
|
|
|
#pod This template surrounds a single form field to add a C<< |
45
|
|
|
|
|
|
|
#pod element, the appropriate input element(s), and the optional description. |
46
|
|
|
|
|
|
|
#pod |
47
|
|
|
|
|
|
|
#pod =head2 yancy/form/bootstrap4/input.html.ep |
48
|
|
|
|
|
|
|
#pod |
49
|
|
|
|
|
|
|
#pod This template is for single C<< >> elements and the attributes |
50
|
|
|
|
|
|
|
#pod they need. This is used by field types C, C, C, |
51
|
|
|
|
|
|
|
#pod and string fields with formats C and C. |
52
|
|
|
|
|
|
|
#pod |
53
|
|
|
|
|
|
|
#pod =head2 yancy/form/bootstrap4/textarea.html.ep |
54
|
|
|
|
|
|
|
#pod |
55
|
|
|
|
|
|
|
#pod This template is for single C<< |
56
|
|
|
|
|
|
|
#pod attributes they need. This is used by fields with type C and |
57
|
|
|
|
|
|
|
#pod format C |
58
|
|
|
|
|
|
|
#pod |
59
|
|
|
|
|
|
|
#pod =head2 yancy/form/bootstrap4/select.html.ep |
60
|
|
|
|
|
|
|
#pod |
61
|
|
|
|
|
|
|
#pod This template is for single C<< |
62
|
|
|
|
|
|
|
#pod they need. This is used by fields with an C property. |
63
|
|
|
|
|
|
|
#pod |
64
|
|
|
|
|
|
|
#pod =head2 yancy/form/bootstrap4/yesno.html.ep |
65
|
|
|
|
|
|
|
#pod |
66
|
|
|
|
|
|
|
#pod This template displays a yes/no toggle used for fields of type |
67
|
|
|
|
|
|
|
#pod C. |
68
|
|
|
|
|
|
|
#pod |
69
|
|
|
|
|
|
|
#pod =head2 yancy/form/bootstrap4/readonly.html.ep |
70
|
|
|
|
|
|
|
#pod |
71
|
|
|
|
|
|
|
#pod This template displays all read-only fields. This template must not include |
72
|
|
|
|
|
|
|
#pod any kind of C<< >>, C<< |
73
|
|
|
|
|
|
|
#pod |
74
|
|
|
|
|
|
|
#pod =head1 SEE ALSO |
75
|
|
|
|
|
|
|
#pod |
76
|
|
|
|
|
|
|
#pod L, L |
77
|
|
|
|
|
|
|
#pod |
78
|
|
|
|
|
|
|
#pod =cut |
79
|
|
|
|
|
|
|
|
80
|
19
|
|
|
19
|
|
15397
|
use Mojo::Base 'Yancy::Plugin::Form'; |
|
19
|
|
|
|
|
54
|
|
|
19
|
|
|
|
|
142
|
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
sub register { |
83
|
53
|
|
|
53
|
1
|
530
|
my ( $self, $app, $conf ) = @_; |
84
|
53
|
|
|
|
|
466
|
$self->SUPER::register( $app, $conf ); |
85
|
53
|
|
|
|
|
63741
|
push @{$app->renderer->classes}, __PACKAGE__; |
|
53
|
|
|
|
|
246
|
|
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub input { |
89
|
90
|
|
|
90
|
0
|
500
|
my ( $self, $c, %opt ) = @_; |
90
|
|
|
|
|
|
|
|
91
|
90
|
100
|
|
|
|
257
|
die "input name is required" unless $opt{name}; |
92
|
89
|
|
66
|
|
|
473
|
$opt{value} //= $c->req->param( $opt{name} ); |
93
|
|
|
|
|
|
|
|
94
|
89
|
|
|
|
|
4747
|
my %attr; |
95
|
89
|
|
|
|
|
155
|
my $template = 'input'; |
96
|
|
|
|
|
|
|
my $type = !$opt{type} ? 'string' |
97
|
|
|
|
|
|
|
: ref $opt{type} eq 'ARRAY' ? $opt{type}[0] |
98
|
89
|
100
|
|
|
|
381
|
: $opt{type}; |
|
|
100
|
|
|
|
|
|
99
|
89
|
|
100
|
|
|
363
|
my $format = delete $opt{format} // ''; |
100
|
|
|
|
|
|
|
|
101
|
89
|
100
|
100
|
|
|
522
|
if ( $opt{ enum } ) { |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
102
|
8
|
|
|
|
|
29
|
$template = 'select'; |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
elsif ( $type eq 'boolean' ) { |
105
|
2
|
|
|
|
|
8
|
$template = 'yesno'; |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
elsif ( $type eq 'integer' || $type eq 'number' ) { |
108
|
12
|
|
|
|
|
30
|
$attr{ type } = 'number'; |
109
|
12
|
|
|
|
|
48
|
$attr{ inputmode } = 'decimal'; |
110
|
12
|
100
|
|
|
|
31
|
if ( $type eq 'integer' ) { |
111
|
|
|
|
|
|
|
# Enable numeric input mode on iOS with pattern attribute |
112
|
|
|
|
|
|
|
# https://css-tricks.com/finger-friendly-numerical-inputs-with-inputmode/ |
113
|
11
|
|
50
|
|
|
51
|
$opt{ pattern } ||= '[0-9]*'; |
114
|
11
|
|
|
|
|
21
|
$attr{ inputmode } = 'numeric'; |
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
elsif ( $type eq 'string' ) { |
118
|
67
|
|
100
|
|
|
229
|
$attr{ type } = $format || 'text'; |
119
|
67
|
100
|
|
|
|
317
|
if ( $format eq 'textarea' ) { |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
120
|
4
|
|
|
|
|
8
|
$template = 'textarea'; |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
elsif ( $format eq 'email' ) { |
123
|
14
|
|
100
|
|
|
70
|
$opt{ pattern } ||= '[^@]+@[^@]+'; |
124
|
14
|
|
|
|
|
46
|
$attr{ inputmode } = 'email'; |
125
|
|
|
|
|
|
|
} |
126
|
|
|
|
|
|
|
elsif ( $format eq 'date-time' ) { |
127
|
7
|
|
|
|
|
21
|
$attr{ type } = 'datetime-local'; |
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
elsif ( $format eq 'markdown' ) { |
130
|
1
|
|
|
|
|
4
|
$template = 'markdown'; |
131
|
|
|
|
|
|
|
} |
132
|
|
|
|
|
|
|
elsif ( $format eq 'password' ) { |
133
|
9
|
|
|
|
|
27
|
delete $opt{ value }; |
134
|
|
|
|
|
|
|
} |
135
|
|
|
|
|
|
|
} |
136
|
|
|
|
|
|
|
|
137
|
89
|
100
|
100
|
|
|
399
|
if ( my $readonly = ( delete $opt{ readOnly } or delete $opt{ readonly } ) ) { |
138
|
5
|
|
|
|
|
27
|
$template = 'readonly'; |
139
|
|
|
|
|
|
|
} |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
# ; use Data::Dumper; |
142
|
|
|
|
|
|
|
# ; say Dumper \%opt; |
143
|
|
|
|
|
|
|
# ; say Dumper \%attr; |
144
|
|
|
|
|
|
|
|
145
|
89
|
|
|
|
|
251
|
my $path = join '/', qw( yancy form bootstrap4 ), $template; |
146
|
89
|
|
|
|
|
649
|
my $html = $c->render_to_string( |
147
|
|
|
|
|
|
|
template => $path, |
148
|
|
|
|
|
|
|
input => { %opt, %attr }, |
149
|
|
|
|
|
|
|
); |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
# ; say $html; |
152
|
|
|
|
|
|
|
|
153
|
89
|
|
|
|
|
91324
|
return $html; |
154
|
|
|
|
|
|
|
} |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
sub input_for { |
157
|
4
|
|
|
4
|
0
|
17
|
my ( $self, $c, $coll, $prop, %opt ) = @_; |
158
|
4
|
|
|
|
|
13
|
my $schema = $c->yancy->schema( $coll ); |
159
|
4
|
50
|
0
|
|
|
19
|
my $required = exists $opt{required} ? $opt{required} : !!grep { $_ eq $prop } @{ $schema->{required} // [] }; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
160
|
|
|
|
|
|
|
|
161
|
4
|
|
|
|
|
12
|
my $field = $schema->{properties}{ $prop }; |
162
|
|
|
|
|
|
|
my $input = $self->input( $c, |
163
|
|
|
|
|
|
|
%$field, |
164
|
|
|
|
|
|
|
( type => $opt{type} )x!!exists $opt{type}, |
165
|
|
|
|
|
|
|
( enum => $opt{enum} )x!!exists $opt{enum}, |
166
|
|
|
|
|
|
|
( format => $opt{format} )x!!exists $opt{format}, |
167
|
|
|
|
|
|
|
( enum_labels => $opt{ enum_labels } )x!!exists $opt{enum_labels}, |
168
|
|
|
|
|
|
|
name => $prop, |
169
|
|
|
|
|
|
|
value => $opt{value}, |
170
|
|
|
|
|
|
|
( $required ? ( required => $required ) : () ), |
171
|
4
|
50
|
|
|
|
57
|
( $opt{class} ? ( class => $opt{class} ) : () ), |
|
|
50
|
|
|
|
|
|
172
|
|
|
|
|
|
|
); |
173
|
|
|
|
|
|
|
} |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
sub filter_for { |
176
|
4
|
|
|
4
|
0
|
15
|
my ( $self, $c, $coll, $prop, %opt ) = @_; |
177
|
4
|
|
|
|
|
10
|
my $schema = $c->yancy->schema( $coll ); |
178
|
4
|
|
|
|
|
15
|
my $field = $schema->{properties}{ $prop }; |
179
|
4
|
50
|
|
|
|
15
|
if ( $field->{type} eq 'boolean' ) { |
180
|
0
|
|
|
|
|
0
|
$opt{ type } = 'string'; |
181
|
0
|
|
|
|
|
0
|
$opt{ enum } = [ undef, 1, 0 ]; |
182
|
0
|
|
|
|
|
0
|
$opt{ enum_labels } = [ undef, 'Yes', 'No' ]; |
183
|
|
|
|
|
|
|
} |
184
|
4
|
|
|
|
|
10
|
$opt{format} = undef; |
185
|
4
|
|
66
|
|
|
30
|
$opt{ value } //= $c->req->param( $prop ); |
186
|
4
|
|
|
|
|
376
|
$opt{required} = 0; |
187
|
4
|
|
|
|
|
28
|
return $self->input_for( $c, $coll, $prop, %opt ); |
188
|
|
|
|
|
|
|
} |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
sub field_for { |
191
|
68
|
|
|
68
|
0
|
213
|
my ( $self, $c, $coll, $prop, %opt ) = @_; |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
# ; use Data::Dumper; |
194
|
|
|
|
|
|
|
# ; say Dumper \%opt; |
195
|
68
|
|
|
|
|
373
|
my $schema = $c->yancy->schema( $coll ); |
196
|
68
|
|
50
|
|
|
143
|
my $required = !!grep { $_ eq $prop } @{ $schema->{required} // [] }; |
|
204
|
|
|
|
|
434
|
|
|
68
|
|
|
|
|
209
|
|
197
|
|
|
|
|
|
|
|
198
|
68
|
|
|
|
|
142
|
my $field = $schema->{properties}{ $prop }; |
199
|
|
|
|
|
|
|
my $input = $self->input( $c, |
200
|
|
|
|
|
|
|
%$field, |
201
|
|
|
|
|
|
|
name => $prop, |
202
|
|
|
|
|
|
|
value => $opt{value}, |
203
|
|
|
|
|
|
|
id => "field-$coll-$prop", |
204
|
|
|
|
|
|
|
( $required ? ( required => $required ) : () ), |
205
|
68
|
100
|
|
|
|
511
|
( $opt{class} ? ( class => $opt{class} ) : () ), |
|
|
100
|
|
|
|
|
|
206
|
|
|
|
|
|
|
); |
207
|
|
|
|
|
|
|
|
208
|
68
|
|
|
|
|
173
|
my $path = join '/', qw( yancy form bootstrap4 field ); |
209
|
68
|
|
|
|
|
672
|
my $html = $c->render_to_string( |
210
|
|
|
|
|
|
|
template => $path, |
211
|
|
|
|
|
|
|
field => { |
212
|
|
|
|
|
|
|
%$field, |
213
|
|
|
|
|
|
|
%opt, |
214
|
|
|
|
|
|
|
id => "field-$coll-$prop", |
215
|
|
|
|
|
|
|
name => $prop, |
216
|
|
|
|
|
|
|
required => $required, |
217
|
|
|
|
|
|
|
content => $input, |
218
|
|
|
|
|
|
|
}, |
219
|
|
|
|
|
|
|
); |
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
# ; say $html; |
222
|
|
|
|
|
|
|
|
223
|
68
|
|
|
|
|
38348
|
return $html; |
224
|
|
|
|
|
|
|
} |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
sub form_for { |
227
|
8
|
|
|
8
|
0
|
42
|
my ( $self, $c, $coll, %opt ) = @_; |
228
|
|
|
|
|
|
|
|
229
|
8
|
|
100
|
|
|
50
|
my $item = $opt{ item } || $c->stash( 'item' ) || {}; |
230
|
8
|
|
|
|
|
111
|
my $props = $c->yancy->schema( $coll )->{properties}; |
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
my $prop_names = $opt{properties} // $c->stash( 'properties' ) |
233
|
|
|
|
|
|
|
# By default, do not show read-only fields |
234
|
8
|
|
100
|
|
|
70
|
// [ grep !$props->{$_}{readOnly}, keys %$props ]; |
|
|
|
100
|
|
|
|
|
235
|
|
|
|
|
|
|
$props = { |
236
|
8
|
|
|
|
|
232
|
map { $_ => $props->{ $_ } } |
|
56
|
|
|
|
|
130
|
|
237
|
|
|
|
|
|
|
@$prop_names |
238
|
|
|
|
|
|
|
}; |
239
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
my @sorted_props |
241
|
|
|
|
|
|
|
= sort { |
242
|
8
|
|
50
|
|
|
68
|
( $props->{$a}{'x-order'}//2**31 ) <=> ( $props->{$b}{'x-order'}//2**31 ) |
|
98
|
|
50
|
|
|
300
|
|
243
|
|
|
|
|
|
|
} |
244
|
|
|
|
|
|
|
keys %$props; |
245
|
8
|
|
|
|
|
18
|
my @fields; |
246
|
8
|
|
|
|
|
22
|
for my $field ( @sorted_props ) { |
247
|
|
|
|
|
|
|
my %field_opt = ( |
248
|
56
|
|
100
|
|
|
190
|
value => $c->req->param( $field ) // $item->{ $field }, |
249
|
|
|
|
|
|
|
); |
250
|
56
|
|
|
|
|
3128
|
push @fields, $self->field_for( $c, $coll, $field, %field_opt ); |
251
|
|
|
|
|
|
|
} |
252
|
|
|
|
|
|
|
|
253
|
8
|
100
|
66
|
|
|
57
|
if ( !exists $opt{csrf} || $opt{csrf} ) { |
254
|
|
|
|
|
|
|
# Verify that this form is being built with a real request |
255
|
|
|
|
|
|
|
# so the CSRF field can work correctly |
256
|
7
|
100
|
|
|
|
38
|
if ( !$c->tx->remote_address ) { |
257
|
1
|
|
|
|
|
36
|
$c->log->warn( 'form_for() called with incomplete request. CSRF token may not validate!'); |
258
|
|
|
|
|
|
|
} |
259
|
|
|
|
|
|
|
} |
260
|
|
|
|
|
|
|
|
261
|
8
|
|
|
|
|
543
|
my $path = join '/', qw( yancy form bootstrap4 form); |
262
|
8
|
|
|
|
|
57
|
my $html = $c->render_to_string( |
263
|
|
|
|
|
|
|
template => $path, |
264
|
|
|
|
|
|
|
form => { |
265
|
|
|
|
|
|
|
method => 'POST', |
266
|
|
|
|
|
|
|
csrf => 1, |
267
|
|
|
|
|
|
|
%opt, |
268
|
|
|
|
|
|
|
fields => \@fields, |
269
|
|
|
|
|
|
|
}, |
270
|
|
|
|
|
|
|
); |
271
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
# ; say $html; |
273
|
|
|
|
|
|
|
|
274
|
8
|
|
|
|
|
9753
|
return $html; |
275
|
|
|
|
|
|
|
} |
276
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
=pod |
278
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
=head1 NAME |
280
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
Yancy::Plugin::Form::Bootstrap4 - Generate forms using Bootstrap 4 |
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
=head1 VERSION |
284
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
version 1.088 |
286
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
=head1 SYNOPSIS |
288
|
|
|
|
|
|
|
|
289
|
|
|
|
|
|
|
use Mojolicious::Lite; |
290
|
|
|
|
|
|
|
plugin Yancy => { |
291
|
|
|
|
|
|
|
backend => 'pg://localhost/mysite', |
292
|
|
|
|
|
|
|
read_schema => 1, |
293
|
|
|
|
|
|
|
}; |
294
|
|
|
|
|
|
|
app->yancy->plugin( 'Form::Bootstrap4' ); |
295
|
|
|
|
|
|
|
# See Yancy::Controller::Yancy for routing |
296
|
|
|
|
|
|
|
app->routes->get( '/people/:id/edit' )->to( |
297
|
|
|
|
|
|
|
'yancy#set', |
298
|
|
|
|
|
|
|
schema => 'people', |
299
|
|
|
|
|
|
|
template => 'edit_people', |
300
|
|
|
|
|
|
|
); |
301
|
|
|
|
|
|
|
app->start; |
302
|
|
|
|
|
|
|
__DATA__ |
303
|
|
|
|
|
|
|
@@ edit_people.html.ep |
304
|
|
|
|
|
|
|
%= $c->yancy->form->form_for( 'people' ); |
305
|
|
|
|
|
|
|
|
306
|
|
|
|
|
|
|
=head1 DESCRIPTION |
307
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
This plugin generates forms using the L
|
309
|
|
|
|
|
|
|
4.0|https://getbootstrap.com/docs/4.0/>. |
310
|
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
For details on the helpers added by this plugin, see |
312
|
|
|
|
|
|
|
L. |
313
|
|
|
|
|
|
|
|
314
|
|
|
|
|
|
|
=head1 TEMPLATES |
315
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
To override these templates, add your own at the designated path inside |
317
|
|
|
|
|
|
|
your app's C directory. |
318
|
|
|
|
|
|
|
|
319
|
|
|
|
|
|
|
=head2 yancy/form/bootstrap4/form.html.ep |
320
|
|
|
|
|
|
|
|
321
|
|
|
|
|
|
|
This template surrounds the form to create the C<< |
322
|
|
|
|
|
|
|
list all the fields, and add a submit button. Also includes a CSRF token. |
323
|
|
|
|
|
|
|
|
324
|
|
|
|
|
|
|
=head2 yancy/form/bootstrap4/field.html.ep |
325
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
This template surrounds a single form field to add a C<< |
327
|
|
|
|
|
|
|
element, the appropriate input element(s), and the optional description. |
328
|
|
|
|
|
|
|
|
329
|
|
|
|
|
|
|
=head2 yancy/form/bootstrap4/input.html.ep |
330
|
|
|
|
|
|
|
|
331
|
|
|
|
|
|
|
This template is for single C<< >> elements and the attributes |
332
|
|
|
|
|
|
|
they need. This is used by field types C, C, C, |
333
|
|
|
|
|
|
|
and string fields with formats C and C. |
334
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
=head2 yancy/form/bootstrap4/textarea.html.ep |
336
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
This template is for single C<< |
338
|
|
|
|
|
|
|
attributes they need. This is used by fields with type C and |
339
|
|
|
|
|
|
|
format C |
340
|
|
|
|
|
|
|
|
341
|
|
|
|
|
|
|
=head2 yancy/form/bootstrap4/select.html.ep |
342
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
This template is for single C<< |
344
|
|
|
|
|
|
|
they need. This is used by fields with an C property. |
345
|
|
|
|
|
|
|
|
346
|
|
|
|
|
|
|
=head2 yancy/form/bootstrap4/yesno.html.ep |
347
|
|
|
|
|
|
|
|
348
|
|
|
|
|
|
|
This template displays a yes/no toggle used for fields of type |
349
|
|
|
|
|
|
|
C. |
350
|
|
|
|
|
|
|
|
351
|
|
|
|
|
|
|
=head2 yancy/form/bootstrap4/readonly.html.ep |
352
|
|
|
|
|
|
|
|
353
|
|
|
|
|
|
|
This template displays all read-only fields. This template must not include |
354
|
|
|
|
|
|
|
any kind of C<< >>, C<< |
355
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
=head1 SEE ALSO |
357
|
|
|
|
|
|
|
|
358
|
|
|
|
|
|
|
L, L |
359
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
=head1 AUTHOR |
361
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
Doug Bell |
363
|
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
365
|
|
|
|
|
|
|
|
366
|
|
|
|
|
|
|
This software is copyright (c) 2021 by Doug Bell. |
367
|
|
|
|
|
|
|
|
368
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
369
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
370
|
|
|
|
|
|
|
|
371
|
|
|
|
|
|
|
=cut |
372
|
|
|
|
|
|
|
|
373
|
|
|
|
|
|
|
__DATA__ |