Add textarea option to settings

pull/425/head
Rodrigo Nascimento 11 years ago
parent ce15d63709
commit 44da11752d
  1. 8
      client/views/settings/settings.coffee
  2. 6
      client/views/settings/settings.html

@ -23,16 +23,16 @@ Template.settings.helpers
Template.settings.events
"click .submit": ->
"click .submit": (e, t) ->
group = FlowRouter.getParam('group')
settings = Settings.find({ group: group }).fetch()
updateSettings = []
for setting in settings
value = null
if setting.type is 'string'
value = _.trim($("input[name=#{setting._id}]").val())
else if setting.type is 'boolean' and $("input[name=#{setting._id}]:checked").length
value = if $("input[name=#{setting._id}]:checked").val() is "1" then true else false
value = _.trim(t.$("[name=#{setting._id}]").val())
else if setting.type is 'boolean' and t.$("[name=#{setting._id}]:checked").length
value = if t.$("[name=#{setting._id}]:checked").val() is "1" then true else false
if value?
updateSettings.push { _id: setting._id, value: value }

@ -23,7 +23,11 @@
<div class="input-line double-col">
<label>{{label}}</label>
<div>
<input type="text" name="{{_id}}" value="{{value}}" />
{{#if multiline}}
<textarea name="{{_id}}" rows="4" style="height: auto">{{value}}</textarea>
{{else}}
<input type="text" name="{{_id}}" value="{{value}}" />
{{/if}}
</div>
</div>
{{/if}}

Loading…
Cancel
Save