forked from unclecheese/silverstripe-bootstrap-forms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBootstrapForm.ss
executable file
·42 lines (37 loc) · 1.13 KB
/
BootstrapForm.ss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<% if $IncludeFormTag %>
<form $AttributesHTML role="form">
<% end_if %>
<% if $Message %>
<% if $MessageType == "good" %>
<div id="{$FormName}_error" class="alert alert-success" role="alert">$Message</div>
<% else_if $MessageType == "info" %>
<div id="{$FormName}_error" class="alert alert-info" role="alert">$Message</div>
<% else_if $MessageType == "bad" %>
<div id="{$FormName}_error" class="alert alert-danger" role="alert">$Message</div>
<% end_if %>
<% end_if %>
<fieldset>
<% if $Legend %><legend>$Legend</legend><% end_if %>
<% loop $Fields %>
$FieldHolder
<% end_loop %>
<div class="clear"><!-- --></div>
</fieldset>
<% if $Actions %>
<% if $formLayout=='horizontal' %>
<div class="form-group">
<div class="$gridActionClass">
<% else %>
<div class="form-actions">
<% end_if %>
<% loop $Actions %>
$Field
<% end_loop %>
<% if $formLayout=='horizontal' %>
</div>
<% end_if %>
</div>
<% end_if %>
<% if $IncludeFormTag %>
</form>
<% end_if %>