2020-01-28 21:05:59 +00:00
|
|
|
.form-group
|
|
|
|
= label_tag "post_#{attribute}", post_label_t(attribute, post: post)
|
|
|
|
|
2020-05-23 19:34:45 +00:00
|
|
|
.mapable{ dir: dir, lang: locale,
|
|
|
|
data: { values: metadata.value.to_json,
|
2020-01-28 21:05:59 +00:00
|
|
|
'default-values': metadata.values.to_json,
|
|
|
|
name: "post[#{attribute}][]", list: id_for_datalist(attribute),
|
|
|
|
remove: 'false', legend: post_label_t(attribute, post: post),
|
2020-05-23 16:52:58 +00:00
|
|
|
button: t('posts.attributes.add'),
|
2020-01-28 21:05:59 +00:00
|
|
|
described: id_for_help(attribute) } }
|
|
|
|
|
|
|
|
= text_field(*field_name_for('post', attribute, '[]'),
|
|
|
|
value: metadata.value.join(', '),
|
2020-05-23 19:34:45 +00:00
|
|
|
dir: dir, lang: locale,
|
2020-01-28 21:05:59 +00:00
|
|
|
**field_options(attribute, metadata))
|
|
|
|
|
|
|
|
= render 'posts/attribute_feedback',
|
|
|
|
post: post, attribute: attribute, metadata: metadata
|
|
|
|
|
|
|
|
%datalist{ id: id_for_datalist(attribute) }
|
|
|
|
- metadata.values.keys.each do |value|
|
|
|
|
%option{ value: value }
|