Skip to content

Commit

Permalink
FEATURE: remove (most) custom templates, use onBeforeRender, clean up JS
Browse files Browse the repository at this point in the history
  • Loading branch information
Uncle Cheese committed Dec 22, 2014
2 parents 2871854 + df95d85 commit 0077b97
Show file tree
Hide file tree
Showing 7 changed files with 127 additions and 0 deletions.
19 changes: 19 additions & 0 deletions templates/BootstrapCheckboxField_holder.ss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<div id="$Name" class="field $extraClass $HolderClasses" $HolderAttributes <% if DisplayLogic %>data-display-logic-masters="$DisplayLogicMasters"<% end_if %>>
<div class="controls">
<label class="checkbox" for="$ID">
<input $AttributesHTML>
$Title
</label>

<% if HelpText %>
<p class="help-block">$HelpText</p>
<% end_if %>
<% if InlineHelpText %>
<span class="help-inline">$InlineHelpText</span>
<% end_if %>
</div>
<% if DisplayLogic %>
<div class="display-logic-eval">$DisplayLogic</div>
<% end_if %>
</div>

17 changes: 17 additions & 0 deletions templates/BootstrapFieldHolder.ss
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<div id="$Name" class="field $extraClass $HolderClasses" $HolderAttributes <% if DisplayLogic %>data-display-logic-masters="$DisplayLogicMasters"<% end_if %>>
<label class="control-label $labelClasses" for="$ID">$Title</label>
<div class="controls $inputClasses">
$Field

<% if HelpText %>
<p class="help-block">$HelpText</p>
<% end_if %>
<% if InlineHelpText %>
<span class="help-inline">$InlineHelpText</span>
<% end_if %>
</div>
<% if DisplayLogic %>
<div class="display-logic-eval">$DisplayLogic</div>
<% end_if %>
</div>

23 changes: 23 additions & 0 deletions templates/BootstrapTextField_holder.ss
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<div id="$Name" class="field $extraClass $HolderClasses" $HolderAttributes <% if DisplayLogic %>data-display-logic-masters="$DisplayLogicMasters"<% end_if %>>
<label class="control-label $labelClasses" for="$ID">$Title</label>
<div class="controls $inputClasses">
<% if AppendedText || PrependedText %>
<div class="<% if AppendedText %>$input-append<% end_if %><% if PrependedText %> input-prepend<% end_if %>">
<% if PrependedText %><span class="add-on">$PrependedText</span><% end_if %>$Field<% if AppendedText %><span class="add-on">$AppendedText</span><% end_if %>
</div>
<% else %>
$Field
<% end_if %>

<% if HelpText %>
<p class="help-block">$HelpText</p>
<% end_if %>
<% if InlineHelpText %>
<span class="help-inline">$InlineHelpText</span>
<% end_if %>

</div>
<% if DisplayLogic %>
<div class="display-logic-eval">$DisplayLogic</div>
<% end_if %>
</div>
11 changes: 11 additions & 0 deletions templates/Includes/CheckboxField_holder.ss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<div id="$Name" class="field<% if extraClass %> $extraClass<% end_if %>" <% if DisplayLogic %>data-display-logic-masters="$DisplayLogicMasters"<% end_if %>>
$Field
<label class="right" for="$ID">$Title</label>
<% if Message %><span class="message $MessageType">$Message</span><% end_if %>
<% if Description %><span class="description">$Description</span><% end_if %>

<% if DisplayLogic %>
<div class="display-logic-eval">$DisplayLogic</div>
<% end_if %>

</div>
21 changes: 21 additions & 0 deletions templates/Includes/CompositeField_holder.ss
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<$Tag class="CompositeField $extraClass <% if ColumnCount %>multicolumn<% end_if %>" <% if DisplayLogic %>data-display-logic-masters="$DisplayLogicMasters"<% end_if %>>
<% if $Tag == 'fieldset' && $Legend %>
<legend>$Legend</legend>
<% end_if %>

<% loop FieldList %>
<% if ColumnCount %>
<div class="column-{$ColumnCount} $FirstLast">
$FieldHolder
</div>
<% else %>
$FieldHolder
<% end_if %>
<% end_loop %>

<% if Description %><span class="description">$Description</span><% end_if %>

<% if DisplayLogic %>
<div class="display-logic-eval">$DisplayLogic</div>
<% end_if %>
</$Tag>
23 changes: 23 additions & 0 deletions templates/Includes/DisplayLogicWrapper_holder.ss
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<$Tag class="field WrapperField $extraClass <% if ColumnCount %>multicolumn<% end_if %>" <% if DisplayLogic %>data-display-logic-masters="$DisplayLogicMasters"<% end_if %>>

<% if $Tag == 'fieldset' && $Legend %>
<legend>$Legend</legend>
<% end_if %>

<% loop FieldList %>
<% if ColumnCount %>
<div class="column-{$ColumnCount} $FirstLast">
$FieldHolder
</div>
<% else %>
$FieldHolder
<% end_if %>
<% end_loop %>

<% if Description %><span class="description">$Description</span><% end_if %>

<% if DisplayLogic %>
<div class="display-logic-eval">$DisplayLogic</div>
<% end_if %>

</$Tag>
13 changes: 13 additions & 0 deletions templates/Includes/FormField_holder.ss
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<div id="$Name" class="field<% if extraClass %> $extraClass<% end_if %>" <% if DisplayLogic %>data-display-logic-masters="$DisplayLogicMasters"<% end_if %>>
<% if Title %><label class="left" for="$ID">$Title</label><% end_if %>
<div class="middleColumn">
$Field
</div>
<% if RightTitle %><label class="right" for="$ID">$RightTitle</label><% end_if %>
<% if Message %><span class="message $MessageType">$Message</span><% end_if %>
<% if $Description %><span class="description">$Description</span><% end_if %>

<% if DisplayLogic %>
<div class="display-logic-eval">$DisplayLogic</div>
<% end_if %>
</div>

0 comments on commit 0077b97

Please sign in to comment.