Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions app/cells/plugins/core/content_item/popup.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
= render_label
%br
%button.content_item_button.text-center.popup--open
.button_content
%i{ class: "material-icons icon" }
cloud_upload
%br
%span.content_item_button-text
Click to add a
= field.name
from the media library
%small
Recommended size: 1452px x 530px with a live area of 930px x 530px
15 changes: 15 additions & 0 deletions app/cells/plugins/core/content_item_cell.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module Plugins
module Core
class ContentItemCell < Plugins::Core::Cell
def popup
render
end

private

def render_label
"Add #{field.name}"
end
end
end
end
11 changes: 11 additions & 0 deletions app/models/content_item_field_type.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class ContentItemFieldType < FieldType
def mapping
{ name: mapping_field_name, type: :string, analyzer: :snowball }
end

private

def mapping_field_name
"#{field_name.parameterize('_')}_content_item"
end
end