cortex-plugins-core 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE.md +201 -0
- data/README.md +24 -0
- data/Rakefile +37 -0
- data/app/assets/javascripts/cortex-field_types-core/application.js +1 -0
- data/app/cells/plugins/core/asset/input.haml +3 -0
- data/app/cells/plugins/core/asset_cell.rb +29 -0
- data/app/cells/plugins/core/boolean/checkbox.haml +6 -0
- data/app/cells/plugins/core/boolean/switch.haml +3 -0
- data/app/cells/plugins/core/boolean_cell.rb +39 -0
- data/app/cells/plugins/core/cell.rb +7 -0
- data/app/cells/plugins/core/checkbox/checkbox.haml +7 -0
- data/app/cells/plugins/core/checkbox_cell.rb +31 -0
- data/app/cells/plugins/core/date_time/datepicker.haml +4 -0
- data/app/cells/plugins/core/date_time_cell.rb +23 -0
- data/app/cells/plugins/core/tag/tag_picker.haml +5 -0
- data/app/cells/plugins/core/tag_cell.rb +19 -0
- data/app/cells/plugins/core/text/input.haml +4 -0
- data/app/cells/plugins/core/text/multiline_input.haml +3 -0
- data/app/cells/plugins/core/text/wysiwyg.haml +3 -0
- data/app/cells/plugins/core/text_cell.rb +53 -0
- data/app/cells/plugins/core/tree/checkboxes.haml +6 -0
- data/app/cells/plugins/core/tree/dropdown.haml +7 -0
- data/app/cells/plugins/core/tree_cell.rb +29 -0
- data/app/cells/plugins/core/user/dropdown.haml +4 -0
- data/app/cells/plugins/core/user_cell.rb +23 -0
- data/app/models/asset_field_type.rb +114 -0
- data/app/models/boolean_field_type.rb +36 -0
- data/app/models/date_time_field_type.rb +77 -0
- data/app/models/tag_field_type.rb +63 -0
- data/app/models/text_field_type.rb +86 -0
- data/app/models/tree_field_type.rb +111 -0
- data/app/models/user_field_type.rb +72 -0
- data/lib/cortex/plugins/core/engine.rb +10 -0
- data/lib/cortex/plugins/core/version.rb +7 -0
- data/lib/cortex/plugins/core.rb +8 -0
- data/lib/tasks/cortex/core/db.rake +30 -0
- data/lib/tasks/cortex/core/media.rake +165 -0
- metadata +165 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
Bundler.require(:default, Rails.env)
|
|
2
|
+
|
|
3
|
+
namespace :cortex do
|
|
4
|
+
namespace :core do
|
|
5
|
+
namespace :media do
|
|
6
|
+
desc 'Seed Cortex Media ContentType and Fields'
|
|
7
|
+
task seed: :environment do
|
|
8
|
+
puts "Creating Media ContentType..."
|
|
9
|
+
media = ContentType.new({
|
|
10
|
+
name: "Media",
|
|
11
|
+
description: "Media for Cortex",
|
|
12
|
+
icon: "collections",
|
|
13
|
+
creator_id: 1,
|
|
14
|
+
contract_id: 1
|
|
15
|
+
})
|
|
16
|
+
media.save
|
|
17
|
+
|
|
18
|
+
puts "Creating Fields..."
|
|
19
|
+
media.fields.new(name: 'Asset', field_type: 'asset_field_type', order_position: 1, validations: { presence: true })
|
|
20
|
+
media.fields.new(name: 'Title', field_type: 'text_field_type', order_position: 2, validations: { presence: true })
|
|
21
|
+
media.fields.new(name: 'Description', field_type: 'text_field_type', order_position: 3, validations: { presence: true })
|
|
22
|
+
media.fields.new(name: 'Tags', field_type: 'tag_field_type', order_position: 4, validations: {})
|
|
23
|
+
media.fields.new(name: 'Expiration Date', field_type: 'date_time_field_type', order_position: 5, validations: {})
|
|
24
|
+
media.fields.new(name: 'Alt Tag', field_type: 'text_field_type', order_position: 6, validations: {})
|
|
25
|
+
media.save
|
|
26
|
+
|
|
27
|
+
puts "Creating Wizard Decorators..."
|
|
28
|
+
wizard_hash = {
|
|
29
|
+
"steps": [
|
|
30
|
+
{
|
|
31
|
+
"name": "Upload",
|
|
32
|
+
"heading": "First thing's first..",
|
|
33
|
+
"description": "Add your media asset.",
|
|
34
|
+
"columns": [
|
|
35
|
+
{
|
|
36
|
+
"grid_width": 12,
|
|
37
|
+
"fields": [
|
|
38
|
+
{
|
|
39
|
+
"id": media.fields[0].id
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "Metadata",
|
|
47
|
+
"heading": "Let's talk about your asset..",
|
|
48
|
+
"description": "Provide details and metadata that will enhance search or inform end-users.",
|
|
49
|
+
"columns": [
|
|
50
|
+
{
|
|
51
|
+
"grid_width": 12,
|
|
52
|
+
"fields": [
|
|
53
|
+
{
|
|
54
|
+
"id": media.fields[1].id
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"id": media.fields[2].id
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"id": media.fields[3].id
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"id": media.fields[4].id
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"id": media.fields[5].id
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
media_wizard_decorator = Decorator.new(name: "Wizard", data: wizard_hash)
|
|
76
|
+
media_wizard_decorator.save
|
|
77
|
+
|
|
78
|
+
ContentableDecorator.create({
|
|
79
|
+
decorator_id: media_wizard_decorator.id,
|
|
80
|
+
contentable_id: media.id,
|
|
81
|
+
contentable_type: 'ContentType'
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
puts "Creating Index Decorators..."
|
|
85
|
+
index_hash = {
|
|
86
|
+
"columns":
|
|
87
|
+
[
|
|
88
|
+
{
|
|
89
|
+
"name": "Thumbnail",
|
|
90
|
+
"cells": [{
|
|
91
|
+
"field": {
|
|
92
|
+
"method": "author_image"
|
|
93
|
+
},
|
|
94
|
+
"display": {
|
|
95
|
+
"classes": [
|
|
96
|
+
"circular"
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
}]
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"name": "Creator",
|
|
103
|
+
"cells": [{
|
|
104
|
+
"field": {
|
|
105
|
+
"method": "author_image"
|
|
106
|
+
},
|
|
107
|
+
"display": {
|
|
108
|
+
"classes": [
|
|
109
|
+
"circular"
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
}]
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"name": "Details",
|
|
116
|
+
"cells": [
|
|
117
|
+
{
|
|
118
|
+
"field": {
|
|
119
|
+
"id": media.fields[0].id
|
|
120
|
+
},
|
|
121
|
+
"display": {
|
|
122
|
+
"classes": [
|
|
123
|
+
"bold",
|
|
124
|
+
"upcase"
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"field": {
|
|
130
|
+
"id": media.fields[1].id
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"name": "Tags",
|
|
137
|
+
"cells": [
|
|
138
|
+
{
|
|
139
|
+
"field": {
|
|
140
|
+
"id": media.fields[2].id
|
|
141
|
+
},
|
|
142
|
+
"display": {
|
|
143
|
+
"classes": [
|
|
144
|
+
"tag",
|
|
145
|
+
"rounded"
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
media_index_decorator = Decorator.new(name: "Index", data: index_hash)
|
|
155
|
+
media_index_decorator.save
|
|
156
|
+
|
|
157
|
+
ContentableDecorator.create({
|
|
158
|
+
decorator_id: media_index_decorator.id,
|
|
159
|
+
contentable_id: media.id,
|
|
160
|
+
contentable_type: 'ContentType'
|
|
161
|
+
})
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: cortex-plugins-core
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.3.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- CareerBuilder Employer Site & Content Products
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2016-10-18 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: rails
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '4'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ">="
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '4'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: cells
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '4.1'
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '4.1'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: cells-rails
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: 0.0.6
|
|
48
|
+
type: :runtime
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: 0.0.6
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: cells-haml
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - "~>"
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: 0.0.10
|
|
62
|
+
type: :runtime
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - "~>"
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: 0.0.10
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: ckeditor
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - "~>"
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: 4.2.0
|
|
76
|
+
type: :runtime
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - "~>"
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: 4.2.0
|
|
83
|
+
- !ruby/object:Gem::Dependency
|
|
84
|
+
name: sqlite3
|
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - ">="
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: '0'
|
|
90
|
+
type: :development
|
|
91
|
+
prerelease: false
|
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - ">="
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: '0'
|
|
97
|
+
description:
|
|
98
|
+
email:
|
|
99
|
+
- EmployerSiteContentProducts@cb.com
|
|
100
|
+
executables: []
|
|
101
|
+
extensions: []
|
|
102
|
+
extra_rdoc_files: []
|
|
103
|
+
files:
|
|
104
|
+
- LICENSE.md
|
|
105
|
+
- README.md
|
|
106
|
+
- Rakefile
|
|
107
|
+
- app/assets/javascripts/cortex-field_types-core/application.js
|
|
108
|
+
- app/cells/plugins/core/asset/input.haml
|
|
109
|
+
- app/cells/plugins/core/asset_cell.rb
|
|
110
|
+
- app/cells/plugins/core/boolean/checkbox.haml
|
|
111
|
+
- app/cells/plugins/core/boolean/switch.haml
|
|
112
|
+
- app/cells/plugins/core/boolean_cell.rb
|
|
113
|
+
- app/cells/plugins/core/cell.rb
|
|
114
|
+
- app/cells/plugins/core/checkbox/checkbox.haml
|
|
115
|
+
- app/cells/plugins/core/checkbox_cell.rb
|
|
116
|
+
- app/cells/plugins/core/date_time/datepicker.haml
|
|
117
|
+
- app/cells/plugins/core/date_time_cell.rb
|
|
118
|
+
- app/cells/plugins/core/tag/tag_picker.haml
|
|
119
|
+
- app/cells/plugins/core/tag_cell.rb
|
|
120
|
+
- app/cells/plugins/core/text/input.haml
|
|
121
|
+
- app/cells/plugins/core/text/multiline_input.haml
|
|
122
|
+
- app/cells/plugins/core/text/wysiwyg.haml
|
|
123
|
+
- app/cells/plugins/core/text_cell.rb
|
|
124
|
+
- app/cells/plugins/core/tree/checkboxes.haml
|
|
125
|
+
- app/cells/plugins/core/tree/dropdown.haml
|
|
126
|
+
- app/cells/plugins/core/tree_cell.rb
|
|
127
|
+
- app/cells/plugins/core/user/dropdown.haml
|
|
128
|
+
- app/cells/plugins/core/user_cell.rb
|
|
129
|
+
- app/models/asset_field_type.rb
|
|
130
|
+
- app/models/boolean_field_type.rb
|
|
131
|
+
- app/models/date_time_field_type.rb
|
|
132
|
+
- app/models/tag_field_type.rb
|
|
133
|
+
- app/models/text_field_type.rb
|
|
134
|
+
- app/models/tree_field_type.rb
|
|
135
|
+
- app/models/user_field_type.rb
|
|
136
|
+
- lib/cortex/plugins/core.rb
|
|
137
|
+
- lib/cortex/plugins/core/engine.rb
|
|
138
|
+
- lib/cortex/plugins/core/version.rb
|
|
139
|
+
- lib/tasks/cortex/core/db.rake
|
|
140
|
+
- lib/tasks/cortex/core/media.rake
|
|
141
|
+
homepage: https://github.com/cortex-cms/cortex-plugins-core
|
|
142
|
+
licenses:
|
|
143
|
+
- Apache-2.0
|
|
144
|
+
metadata: {}
|
|
145
|
+
post_install_message:
|
|
146
|
+
rdoc_options: []
|
|
147
|
+
require_paths:
|
|
148
|
+
- lib
|
|
149
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
150
|
+
requirements:
|
|
151
|
+
- - ">="
|
|
152
|
+
- !ruby/object:Gem::Version
|
|
153
|
+
version: '0'
|
|
154
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
|
+
requirements:
|
|
156
|
+
- - ">="
|
|
157
|
+
- !ruby/object:Gem::Version
|
|
158
|
+
version: '0'
|
|
159
|
+
requirements: []
|
|
160
|
+
rubyforge_project:
|
|
161
|
+
rubygems_version: 2.5.1
|
|
162
|
+
signing_key:
|
|
163
|
+
specification_version: 4
|
|
164
|
+
summary: The combined set of Core FieldTypes for the Cortex CMS platform
|
|
165
|
+
test_files: []
|