Skip to content

Commit bfe8d8e

Browse files
committed
Add Popup Cell to new, faked ContentItemFiledType
1 parent 133247c commit bfe8d8e

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
%button{ class: "popup--open mdl-button mdl-js-button mdl-button--raised mdl-button--success mdl-js-ripple-effect" }
2+
= render_button_name
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_field_name
11+
"Insert #{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)