-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduces inputWrapperClass, an element which wraps input fields,
errors and help texts. This is needed for columns in bootstrap horizontal from. Example usage: ``` // routes/application.js import Ember from 'ember'; export default Ember.Route.extend({ beforeModel() { this.set('inputWrapperClass', 'col-sm-10'); this.set('labelClass', 'col-sm-2'); this.set('formClass', 'form-horizontal'); }, fmConfig: Ember.inject.service('fm-config') }); ``` You will have a bootstrap horizontal form. Column offset are not handeled automatically for fields without a label (fm-checkbox, fm-submit) or if label property is empty. As this seems to be to much bootstrap specific for this general form-builder libary. Together with #36 we could make a nice horizontal bootstrap form like this one: http://getbootstrap.com/css/#forms-horizontal ``` {{#fm-form}} {{fm-field label='Email'}} {{fm-field label='Password'}} {{fm-checkbox label='Remember me' inputWrapperClass='col-sm-10 col-sm-offset-2'}} {{#fm-submit inputWrapperClass='col-sm-10 col-sm-offset-2'}} Sign in {{/fm-submit}} {{/fm-form}} ``` Of course you should have service configuration set like above.
- Loading branch information
Showing
10 changed files
with
78 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 14 additions & 12 deletions
26
addon/templates/components/ember-form-master-2000/fm-checkbox.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
<div class='checkbox'> | ||
<div class={{inputWrapperClass}}> | ||
<div class='checkbox'> | ||
|
||
<label> | ||
{{input | ||
type='checkbox' | ||
checked=checked | ||
disabled=disabled | ||
name=name | ||
tabindex=tabindex}} | ||
{{label}} | ||
</label> | ||
<label> | ||
{{input | ||
type='checkbox' | ||
checked=checked | ||
disabled=disabled | ||
name=name | ||
tabindex=tabindex}} | ||
{{label}} | ||
</label> | ||
|
||
{{fm-errortext errors=errors}} | ||
{{fm-errortext errors=errors}} | ||
|
||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 12 additions & 10 deletions
22
addon/templates/components/ember-form-master-2000/fm-submit.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
<button | ||
value={{value}} | ||
disabled={{disabled}} | ||
class='{{submitButtonClass}}' | ||
type="submit"> | ||
{{#if value}} | ||
{{value}} | ||
{{/if}} | ||
{{yield}} | ||
</button> | ||
<div class={{inputWrapperClass}}> | ||
<button | ||
value={{value}} | ||
disabled={{disabled}} | ||
class='{{submitButtonClass}}' | ||
type="submit"> | ||
{{#if value}} | ||
{{value}} | ||
{{/if}} | ||
{{yield}} | ||
</button> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters