5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-23 01:46:21 +00:00
panel/app/views/posts/attributes/_array.haml
2021-02-11 12:13:18 -03:00

20 lines
787 B
Text

.form-group
= label_tag "#{base}_#{attribute}", post_label_t(attribute, post: post)
= hidden_field_tag "#{base}[#{attribute}][]", ''
.taggable{ dir: dir, lang: locale, data: { values: metadata.value.to_json,
name: "#{base}[#{attribute}][]", list: id_for_datalist(attribute),
remove: 'false', legend: post_label_t(attribute, post: post),
button: t('posts.attributes.add'),
described: id_for_help(attribute) } }
= text_field(*field_name_for(base, attribute, '[]'),
value: metadata.value.join(', '),
**field_options(attribute, metadata))
= render 'posts/attribute_feedback',
post: post, attribute: attribute, metadata: metadata
%datalist{ id: id_for_datalist(attribute) }
- metadata.values.each do |value|
%option{ value: value }