Files
openfoodnetwork/app/views/admin/contents/_fieldset.html.haml
Maikel Linke 727eef3c4f Replace Paperclippable ContentConfig
The old Paperclip configuration was very clever and easy to use but it
was also a complicated implementation building on the complicated Spree
preference system.

I simplified this with Active Storage, storing simple references to blob
ids and default URLs as backup.
2022-06-01 17:16:54 +10:00

16 lines
589 B
Plaintext

%fieldset.no-border-bottom
%legend{align: "center"}= name
- preferences.each do |key|
- type = ContentConfig.preference_type(key)
- if name == t('admin.contents.edit.main_links') && type == :boolean
- text = t("#{key}_title") + " - " + t("#{key}_url")
- else
- text = t(key)
.field
= label_tag(key, text + ': ') + tag(:br) if type != :boolean
- if type == :file
= file_field_tag(key, type: type)
- else
= preference_field_tag(key, ContentConfig[key], type: type)
= label_tag(key, text) + tag(:br) if type == :boolean