Navigation Menu

Skip to content

Commit

Permalink
Add text and number settings type
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximeSangoi committed Jan 16, 2015
1 parent a221b17 commit b433b38
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
4 changes: 4 additions & 0 deletions www/base/src/app/builders/builders.route.coffee
Expand Up @@ -26,6 +26,10 @@ class State extends Config
{ name: 'radio1' }
{ name: 'radio2' }
]
,
type:'integer'
name: 'Number of builders displayed'
default_value: 10
]

# Configuration
Expand Down
4 changes: 4 additions & 0 deletions www/base/src/app/home/home.route.coffee
Expand Up @@ -26,6 +26,10 @@ class State extends Config
{ name: 'radio1' }
{ name: 'radio2' }
]
,
type:'text'
name:'Default welcome message'
default_value: 'Hello!'
]

cfg =
Expand Down
13 changes: 10 additions & 3 deletions www/base/src/app/settings/settings.tpl.jade
Expand Up @@ -6,13 +6,20 @@
h3 {{group.caption}}
form(name="{{ group.name }}")
div(ng-repeat="item in group.items")
div(ng-switch="", on="item.type")
div(ng-switch-when="bool")
div(ng-switch="", on="item.type" class="col-md-12")
div(ng-switch-when="bool" class="form-group")
label(class="checkbox-inline")
input(type="checkbox" name="{{item.name}}" ng-model="item.value" ng-value="item.value")
| {{ item.name }}
div(ng-switch-when="choices")
div(ng-switch-when="choices" class="form-group")
div(ng-repeat="answer in item.answers")
label(class="radio-inline")
input(type="radio" name="{{group.name + '_' + answer.name}}" ng-model="item.value" ng-value="answer.name")
| {{ answer.name }}
div(ng-switch-when="integer", class="form-group")
label(class="control-label") {{ item.name }}
input(type="number" class="form-control" ng-model="item.value")
div(ng-switch-when="text", class="form-group")
label(class="control-label") {{ item.name }}
input(type="text" class="form-control" ng-model="item.value")

0 comments on commit b433b38

Please sign in to comment.