mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
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.
16 lines
589 B
Plaintext
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
|