5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-15 04:51:43 +00:00
panel/app/views/i18n/_text_field.haml

16 lines
569 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
- value = @site.data[@lang_to]
- [keys,key].flatten.each do |k|
- value = value[k]
= label_tag "i18n[#{@lang_to}]#{form_keys}", value
- if value.length > 140
= text_area "i18n[#{@lang_to}]#{form_keys}", key, value: value,
class: 'form-control'
- else
= text_field "i18n[#{@lang_to}]#{form_keys}", key, value: value,
class: 'form-control'
%small.text-muted.form-text= form_help