sutty/app/views/i18n/_text_field.haml

16 lines
584 B
Text
Raw Normal View History

2018-02-09 21:28:27 +00:00
.form-group
- key = keys.pop
- form_keys = keys.map { |k| "[#{k.to_s}]" }.join('')
- form_help = (keys.size > 0) ? [keys,key].flatten.join('.') : key
2018-02-09 21:30:47 +00:00
- value_to = @site.data[@lang_to]
2018-02-09 21:28:27 +00:00
- [keys,key].flatten.each do |k|
2018-02-09 21:30:47 +00:00
- value_to = value_to[k]
2018-02-09 21:28:27 +00:00
= label_tag "i18n[#{@lang_to}]#{form_keys}", value
- if value.length > 140
2018-02-09 21:30:47 +00:00
= text_area "i18n[#{@lang_to}]#{form_keys}", key, value: value_to,
2018-02-09 21:28:27 +00:00
class: 'form-control'
- else
2018-02-09 21:30:47 +00:00
= text_field "i18n[#{@lang_to}]#{form_keys}", key, value: value_to,
2018-02-09 21:28:27 +00:00
class: 'form-control'
%small.text-muted.form-text= form_help