Skip to content

Commit 9012236

Browse files
Merge pull request #22 from cortex-cms/topic/COR-526-Popup-Button
COR-526: Popup Button
2 parents 133247c + dfeb1f6 commit 9012236

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
= render_label
2+
%br
3+
%button.content_item_button.text-center.popup--open
4+
.button_content
5+
%i{ class: "material-icons icon" }
6+
cloud_upload
7+
%br
8+
%span.content_item_button-text
9+
Click to add a
10+
= field.name
11+
from the media library
12+
%small
13+
Recommended size: 1452px x 530px with a live area of 930px x 530px
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module Plugins
2+
module Core
3+
class ContentItemCell < Plugins::Core::Cell
4+
def popup
5+
render
6+
end
7+
8+
private
9+
10+
def render_label
11+
"Add #{field.name}"
12+
end
13+
end
14+
end
15+
end

app/models/content_item_field_type.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class ContentItemFieldType < FieldType
2+
def mapping
3+
{ name: mapping_field_name, type: :string, analyzer: :snowball }
4+
end
5+
6+
private
7+
8+
def mapping_field_name
9+
"#{field_name.parameterize('_')}_content_item"
10+
end
11+
end

0 commit comments

Comments
 (0)