Class: Alchemy::Ingredients::FileEditor
- Inherits:
-
BaseEditor
- Object
- ViewComponent::Base
- BaseEditor
- Alchemy::Ingredients::FileEditor
- Defined in:
- app/components/alchemy/ingredients/file_editor.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from BaseEditor
Instance Method Summary collapse
Methods inherited from BaseEditor
#call, #form_field_id, #form_field_name, #initialize
Constructor Details
This class inherits a constructor from Alchemy::Ingredients::BaseEditor
Instance Method Details
#input_field ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'app/components/alchemy/ingredients/file_editor.rb', line 9 def input_field content_tag("alchemy-file-editor", class: "file") do concat tag.div( render_icon(&.icon_css_class), class: "file_icon" ) concat tag.div(&.name, class: "file_name") if editable? concat link_to( render_icon(:times), "#", class: [ "remove_file_link", ? nil : "hidden" ], data: { form_field_id: form_field_id(:attachment_id) } ) end concat( tag.div(class: "file_tools") do concat dialog_link concat link_to_dialog( render_icon(:edit), editable? ? alchemy.edit_admin_ingredient_path(ingredient) : nil, { title: Alchemy.t(:edit_file_properties), size: "400x215" }, title: editable? ? Alchemy.t(:edit_file_properties) : nil ) end ) concat hidden_field_tag(form_field_name(:attachment_id), &.id, id: form_field_id(:attachment_id)) end end |