Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
add validation and require support to templates
Browse files Browse the repository at this point in the history
  • Loading branch information
swilliamset committed Apr 19, 2017
1 parent 55a700e commit b35c948
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 27 deletions.
4 changes: 2 additions & 2 deletions templates/handlebars/bootstrap/input.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="form-group{{#if horizontal}}{{#if inputsize}} form-group-{{inputsize}}{{/if}}{{/if}}{{#if validation}} has-{{validation}}{{#if feedback}} has-feedback{{/if}}{{/if}}">
<div class="form-group{{#if horizontal}}{{#if inputsize}} form-group-{{inputsize}}{{/if}}{{/if}}{{#if validation}} has-{{validation}}{{#if feedback}} has-feedback{{/if}}{{/if}}{{#if required}} required{{/if}}">
{{#if label}}<label for="{{#if id}}{{id}}{{else}}myInput{{/if}}" class="control-label{{#if horizontal}} col-sm-2{{/if}}">{{label}}</label>{{/if}}
{{#if horizontal}}<div class="col-sm-10">{{/if}}
{{#if hasAside}}<div class="input-group">{{/if}}
Expand Down Expand Up @@ -29,4 +29,4 @@
{{#if feedback}}<span class="glyphicon glyphicon-{{feedback}} form-control-feedback" aria-hidden="true"></span><span id="{{#if id}}{{id}}{{else}}myInput{{/if}}Status" class="sr-only">({{#if validation}}{{validation}}{{/if}})</span>{{/if}}
{{#if helptext}}<p class="help-block">{{helptext}}</p>{{/if}}
{{#if horizontal}}</div>{{/if}}
</div>
</div>
4 changes: 2 additions & 2 deletions templates/handlebars/bootstrap/textarea.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="form-group{{#if validation}} has-{{validation}}{{/if}}">
<div class="form-group{{#if validation}} has-{{validation}}{{/if}}{{#if required}} required{{/if}}">
<label class="control-label{{#if horizontal}} col-sm-2{{/if}}" for="{{#if id}}{{id}}{{else}}myTextarea{{/if}}">{{#if label}}{{label}}{{/if}}</label>
{{#if horizontal}}<div class="col-sm-10">{{/if}}
<textarea class="form-control" id="{{#if id}}{{id}}{{else}}myTextarea{{/if}}" name="{{#if name}}{{name}}{{else}}{{#if id}}{{id}}{{else}}myTextarea{{/if}}{{/if}}" rows="{{#if rows}}{{rows}}{{/if}}"{{#if required}} required{{/if}}{{#if readonly}} readonly{{/if}}{{#if disabled}} disabled{{/if}}>{{#if text}}{{text}}{{/if}}</textarea>
{{#if helptext}}<p class="help-block">{{helptext}}</p>{{/if}}
{{#if horizontal}}</div>{{/if}}
</div>
</div>
4 changes: 2 additions & 2 deletions templates/handlebars/fuelux/checkbox.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="form-group{{#if validation}} has-{{validation}}{{/if}}">
<div class="form-group{{#if validation}} has-{{validation}}{{/if}}{{#if required}} required{{/if}}">
<label for="{{#if id}}{{id}}{{else}}myCustomCheckboxWrapper{{/if}}" class="control-label{{#if horizontal}} col-sm-2{{/if}}">{{#if label}}{{label}}{{/if}}</label>

<div class="{{#if inline}}checkbox{{/if}}{{#if horizontal}} col-sm-10{{/if}}"{{#if required}} required{{/if}}>
Expand All @@ -12,4 +12,4 @@
{{/each}}
{{#if helptext}}<p class="help-block">{{helptext}}</p>{{/if}}
</div>
</div>
</div>
4 changes: 2 additions & 2 deletions templates/handlebars/fuelux/combobox.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="form-group{{#if horizontal}}{{#if inputsize}} form-group-{{inputsize}}{{/if}}{{/if}}{{#if validation}} has-{{validation}}{{#if feedback}} has-feedback{{/if}}{{/if}}">
<div class="form-group{{#if horizontal}}{{#if inputsize}} form-group-{{inputsize}}{{/if}}{{/if}}{{#if validation}} has-{{validation}}{{#if feedback}} has-feedback{{/if}}{{/if}}{{#if required}} required{{/if}}">
<label for="{{#if id}}{{id}}{{else}}myCombobox{{/if}}Input" class="control-label{{#if horizontal}} col-sm-2{{/if}}">{{#if label}}{{label}}{{/if}}</label>

{{#if horizontal}}<div class="col-sm-10">{{/if}}
Expand All @@ -17,4 +17,4 @@
{{#if feedback}}<span class="glyphicon glyphicon-{{feedback}} form-control-feedback" aria-hidden="true"></span><span id="{{#if id}}{{id}}{{else}}myCombobox{{/if}}Status" class="sr-only">({{#if validation}}{{validation}}{{/if}})</span>{{/if}}
{{#if helptext}}<p class="help-block">{{helptext}}</p>{{/if}}
{{#if horizontal}}</div>{{/if}}
</div>
</div>
4 changes: 2 additions & 2 deletions templates/handlebars/fuelux/radio.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="form-group{{#if validation}} has-{{validation}}{{/if}}">
<div class="form-group{{#if validation}} has-{{validation}}{{/if}}{{#if required}} required{{/if}}">
<label for="{{#if id}}{{id}}{{else}}myCustomRadioWrapper{{/if}}" class="control-label{{#if horizontal}} col-sm-2{{/if}}">{{#if label}}{{label}}{{/if}}</label>

<div class="{{#if inline}}radio{{/if}}{{#if horizontal}} col-sm-10{{/if}}"{{#if required}} required{{/if}}>
Expand All @@ -12,4 +12,4 @@
{{/each}}
{{#if helptext}}<p class="help-block">{{helptext}}</p>{{/if}}
</div>
</div>
</div>
4 changes: 2 additions & 2 deletions templates/handlebars/fuelux/selectlist.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="form-group{{#if validation}} has-{{validation}}{{/if}}">
<div class="form-group{{#if validation}} has-{{validation}}{{/if}}{{#if required}} required{{/if}}">
<label class="control-label{{#if horizontal}} col-sm-2{{/if}}" for="{{#if id}}{{id}}{{else}}mySelectlist{{/if}}">{{#if label}}{{label}}{{/if}}</label>
<div class="controls text-{{#if buttonalign}}{{buttonalign}}{{else}}left{{/if}}{{#if horizontal}} col-sm-10{{/if}}">
<div class="btn-group selectlist"{{#unless doNotInit}} data-initialize="selectlist"{{/unless}} data-resize="auto" id="{{#if id}}{{id}}{{else}}mySelectlist{{/if}}">
Expand All @@ -16,4 +16,4 @@
</div>
{{#if helptext}}<p class="help-block">{{helptext}}</p>{{/if}}
</div>
</div>
</div>
4 changes: 2 additions & 2 deletions templates/handlebars/fuelux/spinbox.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="form-group{{#if validation}} has-{{validation}}{{#if feedback}} has-feedback{{/if}}{{/if}}">
<div class="form-group{{#if validation}} has-{{validation}}{{#if feedback}} has-feedback{{/if}}{{/if}}{{#if required}} required{{/if}}">
<label class="control-label{{#if horizontal}} col-sm-2{{/if}}" for="{{#if id}}{{id}}{{else}}mySpinbox{{/if}}Input">{{#if label}}{{label}}{{/if}}</label>
<div{{#if horizontal}} class="col-sm-10"{{/if}}>
<div class="spinbox" {{#unless doNotInit}}data-initialize="spinbox"{{/unless}} id="{{#if id}}{{id}}{{else}}mySpinbox{{/if}}">
Expand All @@ -15,4 +15,4 @@
</div>
{{#if helptext}}<p class="help-block">{{helptext}}</p>{{/if}}
</div>
</div>
</div>
4 changes: 2 additions & 2 deletions templates/underscore/bootstrap/input.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- Text input http://getbootstrap.com/css/#forms -->
<div class="form-group<% if(horizontal && inputsize.length > 0) {%> form-group-<%= inputsize %><% } %>">
<div class="form-group<% if(horizontal && inputsize.length > 0) {%> form-group-<%= inputsize %><% } %><% if(validation) {%> has-<%= validation %><% } %><% if(required) {%> required<% } %>">
<label for="<%= id %>" class="control-label<% if(horizontal) { %> col-sm-2<% } %>"><%= label %></label>
<% if(horizontal) {%><div class="col-sm-10"><% } %>
<input type="<%= inputtype %>" class="<% if(!horizontal && inputsize.length > 0) {%>input-<%= inputsize %> <% } %>form-control" id="<%= id %>" placeholder="<%= placeholder %>"<% if(required) {%> required <% } %><% if(readonly) {%> readonly <% } %><% if(isDisabled) {%> disabled <% } %>>
<% if (helptext.length > 0) { %><p class="help-block"><%= helptext %></p><% } %>
<% if(horizontal) {%></div><% } %>
</div>
</div>
2 changes: 1 addition & 1 deletion templates/underscore/bootstrap/textarea.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- Textarea http://getbootstrap.com/css/#textarea -->
<div class="form-group">
<div class="form-group<% if(validation) {%> has-<%= validation %><% } %><% if(required) {%> required<% } %>">
<label class="control-label<% if(horizontal) { %> col-sm-2<% } %>" for="<%= id %>"><%= label %></label>
<% if(horizontal) {%><div class="col-sm-10"><% } %>
<textarea class="form-control" id="<%= id %>" name="<%= id %>" rows="<%= rows %>"<% if(required) {%> required <% } %><% if(readonly) {%> readonly <% } %><% if(isDisabled) {%> disabled <% } %>><%= textarea %></textarea>
Expand Down
4 changes: 2 additions & 2 deletions templates/underscore/fuelux/checkboxes.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- Fuel UX Checkboxes http://getfuelux.com/javascript.html#checkbox -->
<div class="form-group">
<div class="form-group<% if(validation) {%> has-<%= validation %><% } %><% if(required) {%> required<% } %>">
<label for="<%= name %>" class="control-label<% if(horizontal) { %> col-sm-2<% } %>"><%= label %></label>
<div class="<% if(horizontal) {%> col-sm-10<% } %><% if(required) {%> required<% } %>">
<% _.each(checkboxes, function(checkbox, i){ %><div class="checkbox">
Expand All @@ -10,4 +10,4 @@
</div><% }); %>
<% if (helptext.length > 0) { %><p class="help-block"><%= helptext %></p><% } %>
</div>
</div>
</div>
4 changes: 2 additions & 2 deletions templates/underscore/fuelux/input-with-combobox.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- Input With Combobox http://getfuelux.com/javascript.html#combobox -->
<div class="form-group<% if(horizontal && inputsize.length > 0) {%> form-group-<%= inputsize %><% } %>">
<div class="form-group<% if(horizontal && inputsize.length > 0) {%> form-group-<%= inputsize %><% } %><% if(validation) {%> has-<%= validation %><% } %><% if(required) {%> required<% } %>">
<label class="control-label<% if(horizontal) { %> col-sm-2<% } %>" for="<%= id %>Input"><%= label %></label>
<% if(horizontal) {%><div class="col-sm-10"><% } %>
<div class="input-group <% if(placement=="appended") { %>input-append<% } else { %>input-prepend<% } %> dropdown combobox<% if(inputsize.length > 0) {%> input-group-<%= inputsize %><% } %>" data-initialize="combobox" id="<%= id %>">
Expand All @@ -14,4 +14,4 @@
</div>
<% if (helptext.length > 0) { %><p class="help-block"><%= helptext %></p><% } %>
<% if(horizontal) {%></div><% } %>
</div>
</div>
4 changes: 2 additions & 2 deletions templates/underscore/fuelux/radios.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- Fuel UX Radios http://getfuelux.com/javascript.html#radio -->
<div class="form-group">
<div class="form-group<% if(validation) {%> has-<%= validation %><% } %><% if(required) {%> required<% } %>">
<label for="<%= name %>" class="control-label<% if(horizontal) { %> col-sm-2<% } %>"><%= label %></label>
<div class="<% if(horizontal) {%> col-sm-10<% } %><% if(required) {%> required<% } %>">
<% _.each(radios, function(radio, i){ %><div class="radio">
Expand All @@ -10,4 +10,4 @@
</div><% }); %>
<% if (helptext.length > 0) { %><p class="help-block"><%= helptext %></p><% } %>
</div>
</div>
</div>
4 changes: 2 additions & 2 deletions templates/underscore/fuelux/selectlist.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- Fuel UX Select http://getfuelux.com/javascript.html#selectlist -->
<div class="form-group">
<div class="form-group<% if(validation) {%> has-<%= validation %><% } %><% if(required) {%> required<% } %>">
<label class="control-label<% if(horizontal) { %> col-sm-2<% } %>" for="<%= id %>"><%= label %></label>
<div class="controls <%= buttonalign %><% if(horizontal) {%> col-sm-10<% } %>">
<div class="btn-group selectlist" data-initialize="selectlist" data-resize="auto" id="<%= id %>">
Expand All @@ -15,4 +15,4 @@
</div>
<% if (helptext.length > 0) { %><p class="help-block"><%= helptext %></p><% } %>
</div>
</div>
</div>
4 changes: 2 additions & 2 deletions templates/underscore/fuelux/spinbox.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- Spinbox http://getfuelux.com/javascript.html#spinbox -->
<div class="form-group">
<div class="form-group<% if(validation) {%> has-<%= validation %><% } %><% if(required) {%> required<% } %>">
<label for="<%= id %>" class="control-label<% if(horizontal) { %> col-sm-2<% } %>"><%= label %></label>
<div<% if(horizontal) {%> class="col-sm-10"<% } %>>
<div class="spinbox" data-initialize="spinbox" id="<%= id %>">
Expand All @@ -15,4 +15,4 @@
</div>
<% if (helptext.length > 0) { %><p class="help-block"><%= helptext %></p><% } %>
</div>
</div>
</div>

0 comments on commit b35c948

Please sign in to comment.