forked from unclecheese/silverstripe-bootstrap-forms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBootstrapCheckboxSetField.ss
executable file
·28 lines (28 loc) · 1.38 KB
/
BootstrapCheckboxSetField.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
<% if $Options.Count %>
<% if $HasColumns %>
<div class="row">
<div class="$ColumnClasses">
<% loop $Options %>
<div class="checkbox <% if $Up.Inline %>inline<% end_if %>">
<label>
<input id="$ID" class="checkbox" name="$Name" type="checkbox" value="$Value"<% if $isChecked %> checked="checked"<% end_if %><% if $isDisabled %> disabled="disabled"<% end_if %>>
$Title
</label>
</div>
<% if $Up.HasColumns && $MultipleOf($Up.PerColumn) %></div><div class="$Up.ColumnClasses"><% end_if %>
<% end_loop %>
</div>
</div>
<% else %>
<% loop $Options %>
<div class="checkbox <% if $Up.Inline %>inline<% end_if %>">
<label>
<input id="$ID" class="checkbox" name="$Name" type="checkbox" value="$Value"<% if $isChecked %> checked="checked"<% end_if %><% if $isDisabled %> disabled="disabled"<% end_if %>>
$Title
</label>
</div>
<% end_loop %>
<% end_if %>
<% else %>
<div>No options available</div>
<% end_if %>