Skip to content

template cleaning #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 15, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/bootstrap-datepicker.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/bootstrap-decorator.min.js

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Documentation
1. [Basic Usage](#basic-usage)
1. [Handling Submit](#handling-submit)
1. [Global Options](#global-options)
1. [Form types](#form-types)
1. [Form types](#form-types)
1. [Default form types](#default-form-types)
1. [Form definitions](#form-definitions)
1. [Overriding field types and order](#overriding-field-types-and-order)
Expand Down Expand Up @@ -190,6 +190,7 @@ Schema Form currently supports the following form field types out of the box:
| submit | a submit button |
| button | a button |
| radios | radio buttons |
| radios-inline | radio buttons in one line |
| radiobuttons | radio buttons with bootstrap buttons |
| help | insert arbitrary html |
| tab | tabs with content |
Expand Down Expand Up @@ -312,7 +313,7 @@ General options most field types can handle:

### onChange
The ```onChange``` option can be used with most fields and its value should be
either an angular expression, as a string, or a function. If its an expression
either an angular expression, as a string, or a function. If its an expression
it will be evaluated in the parent scope of the ```sf-schema``` directive with
the special locals ```modelValue``` and ```form```. If its a function that will
be called with ```modelValue``` and ```form``` as first and second arguments.
Expand Down Expand Up @@ -876,7 +877,7 @@ It is not needed for tabs on top.
The `title` option is a bit special in `tabarray`, it defines the title
of the tab and is considered a angular expression. The expression is evaluated
with two extra variables in context: **value** and **$index**, where **value**
is the value in the array (i.e. that tab) and **$index** the index.
is the value in the array (i.e. that tab) and **$index** the index.

Example with tabs on the top:

Expand Down
2 changes: 2 additions & 0 deletions src/directives/decorators/bootstrap/bootstrap-decorator.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ angular.module('schemaForm').config(['schemaFormDecoratorsProvider',function(dec
submit: base+'submit.html',
button: base+'submit.html',
radios: base+'radios.html',
'radios-inline': base+'radios-inline.html',
radiobuttons: base+'radio-buttons.html',
help: base+'help.html',
'default': base+'default.html'
Expand All @@ -44,6 +45,7 @@ angular.module('schemaForm').config(['schemaFormDecoratorsProvider',function(dec
datepicker: base+'datepicker.html',
input: base+'default.html',
radios: base+'radios.html',
'radios-inline': base+'radios-inline.html',
radiobuttons: base+'radio-buttons.html',
});

Expand Down
8 changes: 5 additions & 3 deletions src/directives/decorators/bootstrap/checkboxes.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div sf-array="form" class="form-group" ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
<label ng-show="showTitle()">{{form.title}}</label>
<div sf-array="form" ng-model="$$value$$" class="form-group" ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
<label class="control-label" ng-show="showTitle()">{{form.title}}</label>
<div class="checkbox" ng-repeat="val in titleMapValues track by $index" >
<label>
<input type="checkbox"
Expand All @@ -9,5 +9,7 @@
</label>

</div>
<div class="help-block" ng-show="form.description" ng-bind-html="form.description"></div>
<div class="help-block"
ng-show="(hasError() && errorMessage(schemaError())) || form.description"
ng-bind-html="(hasError() && errorMessage(schemaError())) || form.description"></div>
</div>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="form-group" ng-class="{'has-error': hasError()}">
<label ng-show="showTitle()">{{form.title}}</label>
<label class="control-label" ng-show="showTitle()">{{form.title}}</label>

<input ng-show="form.key"
style="background-color: white"
Expand Down
2 changes: 1 addition & 1 deletion src/directives/decorators/bootstrap/radio-buttons.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="form-group" ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
<div>
<label ng-show="showTitle()">{{form.title}}</label>
<label class="control-label" ng-show="showTitle()">{{form.title}}</label>
</div>
<div class="btn-group">
<label class="btn {{ (item.value === $$value$$) ? form.style.selected || 'btn-primary' : form.style.unselected || 'btn-primary'; }}"
Expand Down
13 changes: 13 additions & 0 deletions src/directives/decorators/bootstrap/radios-inline.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<div class="form-group" ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
<label class="control-label" ng-show="showTitle()">{{form.title}}</label>
<div>
<label class="radio-inline" ng-repeat="item in form.titleMap" >
<input type="radio"
sf-changed="form"
ng-model="$$value$$"
ng-value="item.value">
<span ng-bind-html="item.name"></span>
</label>
</div>
<div class="help-block" ng-show="(hasError() && errorMessage(schemaError())) || form.description" ng-bind-html="(hasError() && errorMessage(schemaError())) || form.description"></div>
</div>
4 changes: 2 additions & 2 deletions src/directives/decorators/bootstrap/radios.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="form-group" ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
<label ng-show="showTitle()">{{form.title}}</label>
<label class="control-label" ng-show="showTitle()">{{form.title}}</label>
<div class="radio" ng-repeat="item in form.titleMap" >
<label>
<input type="radio"
Expand All @@ -10,5 +10,5 @@
<span ng-bind-html="item.name"></span>
</label>
</div>
<div class="help-block" ng-show="form.description" ng-bind-html="form.description"></div>
<div class="help-block" ng-show="(hasError() && errorMessage(schemaError())) || form.description" ng-bind-html="(hasError() && errorMessage(schemaError())) || form.description"></div>
</div>
2 changes: 1 addition & 1 deletion src/directives/decorators/bootstrap/select.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="form-group" ng-class="{'has-error': hasError(), 'has-success': hasSuccess(), 'has-feedback': form.feedback !== false}">
<label ng-show="showTitle()">
<label class="control-label" ng-show="showTitle()">
{{form.title}}
</label>
<select ng-model="$$value$$"
Expand Down