Skip to content

Commit 75cbd79

Browse files
committed
Changed so that some types can have HTML in title. All can have it in description. Updated tests for this. Updated bootstrap examples.
1 parent b1fb67d commit 75cbd79

File tree

11 files changed

+76
-17
lines changed

11 files changed

+76
-17
lines changed

dist/bootstrap-decorator.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/bootstrap-example.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ <h3>Schema</h3>
118118
},
119119
"soul": {
120120
"title": "Terms Of Service",
121-
"description": "I agree to sell my undying soul",
121+
"description": "I agree to sell my undying <a href='https://www.youtube.com/watch?v=dQw4w9WgXcQ'>soul</a>",
122122
"type": "boolean",
123123
"default": true,
124124
},
@@ -192,7 +192,13 @@ <h3>Schema</h3>
192192
]
193193
},
194194
{ key: "date", minDate: "2014-06-20" },
195-
{ key: "radio", type: "radios" },
195+
{ key: "radio",
196+
type: "radios",
197+
titleMap: {
198+
"Transistor": "Transistor <br> Not the tube kind.",
199+
"Tube": "Tube <br> The tube kind."
200+
}
201+
},
196202
{ key: "radiobuttons", type: "radiobuttons" },
197203
{
198204
type: 'actions',

src/directives/decorators/bootstrap/checkbox.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
ng-model="$$value$$"
66
schema-validate="form.schema"
77
ng-required="form.required">
8-
{{form.title}}
8+
<div ng-bind-html="form.title"></div>
99
</label>
1010

11-
<span class="help-block" ng-show="form.description">{{form.description}}</span>
11+
<span class="help-block" ng-show="form.description" ng-bind-html="form.description"></span>
1212
</div>

src/directives/decorators/bootstrap/checkboxes.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
sf-changed="form"
77
ng-model="checkboxValues[value]"
88
ng-change="$$value$$ = checkboxValuesToList(checkboxValues)" >
9-
{{name}}
9+
<div ng-bind-html="form.name"></div>
1010
</label>
1111

1212
</div>
13-
<span class="help-block" ng-show="form.description">{{form.description}}</span>
13+
<span class="help-block" ng-show="form.description" ng-bind-html="form.description"></span>
1414
</div>

src/directives/decorators/bootstrap/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
<span ng-if="form.feedback !== false"
1313
class="form-control-feedback"
1414
ng-class="evalInScope(form.feedback) || {'glyphicon': true, 'glyphicon-ok': hasSuccess(), 'glyphicon-remove': hasError() }"></span>
15-
<span class="help-block">{{ (hasError() && errorMessage(schemaError())) || form.description}}</span>
15+
<span class="help-block" ng-show="form.description" ng-bind-html="(hasError() && errorMessage(schemaError())) || form.description"></span>
1616
</div>

src/directives/decorators/bootstrap/radio-buttons.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
style="display: none;"
1010
ng-model="$$value$$"
1111
ng-value="value">
12-
{{name}}
12+
<div ng-bind-html="name"></div>
1313
</label>
1414
</div>
15-
<span class="help-block" ng-show="form.description">{{form.description}}</span>
15+
<span class="help-block" ng-show="form.description" ng-bind-html="form.description"></span>
1616
</div>

src/directives/decorators/bootstrap/radios.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
sf-changed="form"
77
ng-model="$$value$$"
88
ng-value="value">
9-
{{name}}
9+
<div ng-bind-html="name"></div>
1010
</label>
1111
</div>
12-
<span class="help-block" ng-show="form.description">{{form.description}}</span>
12+
<span class="help-block" ng-show="form.description" ng-bind-html="form.description"></span>
1313
</div>

src/directives/decorators/bootstrap/readonly.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
<label ng-show="showTitle()">{{form.title}}</label>
33
<input ng-if="form.type !== 'textarea'" type="text" disabled class="form-control" value="{{$$value$$}}">
44
<textarea ng-if="form.type === 'textarea'" disabled class="form-control">{{$$value$$}}</textarea>
5-
<span class="help-block" ng-show="form.description">{{form.description}} </span>
6-
</div>
5+
<span class="help-block" ng-show="form.description" ng-bind-html="form.description"></span>
6+
</div>

src/directives/decorators/bootstrap/select.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
ng-required="form.required"
1010
ng-options="val as name for (val,name) in form.titleMap">
1111
</select>
12-
<span class="help-block">{{ (hasError() && errorMessage(schemaError())) || form.description}} </span>
12+
<span class="help-block" ng-show="form.description" ng-bind-html="(hasError() && errorMessage(schemaError())) || form.description"></span>
1313
</div>

src/directives/decorators/bootstrap/textarea.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
<span ng-if="form.feedback !== false"
99
class="form-control-feedback"
1010
ng-class="evalInScope(form.feedback) || { 'glyphicon': true, 'glyphicon-ok': hasSuccess(), 'glyphicon-remove': hasError() }"></span>
11-
<span class="help-block">{{ (hasError() && errorMessage(schemaError())) || form.description}} </span>
11+
<span class="help-block" ng-show="form.description" ng-bind-html="(hasError() && errorMessage(schemaError())) || form.description"></span>
1212
</div>

0 commit comments

Comments
 (0)