administrate-field-ckeditor 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +43 -0
- data/administrate-field-ckeditor.gemspec +22 -0
- data/app/assets/javascripts/administrate-field-ckeditor/application.js +1 -0
- data/app/views/fields/ckeditor/_form.html.erb +6 -0
- data/app/views/fields/ckeditor/_index.html.erb +1 -0
- data/app/views/fields/ckeditor/_show.html.erb +1 -0
- data/lib/administrate/field/ckeditor.rb +14 -0
- data/spec/lib/administrate/field/ckeditor_spec.rb +14 -0
- metadata +95 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 436d72ed7307f3165abc6c6ca0534a8ebf3919e0
|
4
|
+
data.tar.gz: 468b493062674693e1d285fcf8560314ea8dcc4d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: cad908656b322f1f9cef18cf0085f2140bb3c45ef70d38551d1a955e33bebae623ab365c75132fab43469a6073860160c32544eaa502445d94146e0996749aee
|
7
|
+
data.tar.gz: 577f58cb1e079d2bc59c159d1bc532d12d1eac93ca0b28d507e72acb6cfda8e29860b5ceedfbf874da57df866184b590df3e0ea7af9ebac79d5b445f83e32d67
|
data/README.md
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# Administrate::Field::Ckeditor
|
2
|
+
|
3
|
+
A plugin for adding [Ckeditor] support in [Administrate].
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
Add to your `Gemfile`:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem "administrate-field-ckeditor", "~> 0.0.1"
|
11
|
+
```
|
12
|
+
|
13
|
+
Run:
|
14
|
+
|
15
|
+
```bash
|
16
|
+
$ bundle install
|
17
|
+
```
|
18
|
+
|
19
|
+
Add to your `FooDashboard`:
|
20
|
+
```ruby
|
21
|
+
ATTRIBUTE_TYPES = [
|
22
|
+
bars: Field::Ckeditor,
|
23
|
+
]
|
24
|
+
```
|
25
|
+
|
26
|
+
## Stopgap fix for javascript
|
27
|
+
|
28
|
+
At the moment, Administrate doesn't automatically load javascripts from plugins.
|
29
|
+
To fix this, you need to generate the Administrate javascript file:
|
30
|
+
|
31
|
+
```bash
|
32
|
+
$ rails g administrate:views:layout
|
33
|
+
```
|
34
|
+
|
35
|
+
And then add a line to `app/views/admin/application/_javascript.html.erb`
|
36
|
+
to input the javascript for this gem:
|
37
|
+
|
38
|
+
```
|
39
|
+
<%= javascript_include_tag "administrate-field-ckeditor/application" %>
|
40
|
+
```
|
41
|
+
|
42
|
+
[Ckeditor]: https://github.com/galetahub/ckeditor
|
43
|
+
[Administrate]: https://github.com/thoughtbot/administrate
|
@@ -0,0 +1,22 @@
|
|
1
|
+
$:.push File.expand_path("../lib", __FILE__)
|
2
|
+
|
3
|
+
require "administrate/field/ckeditor"
|
4
|
+
|
5
|
+
Gem::Specification.new do |gem|
|
6
|
+
gem.name = "administrate-field-ckeditor"
|
7
|
+
gem.version = Administrate::Field::Ckeditor::VERSION
|
8
|
+
gem.authors = ["Rikki Pitt"]
|
9
|
+
gem.email = ["rikkipitt@gmail.com"]
|
10
|
+
gem.homepage = "https://github.com/jemcode/administrate-field-ckeditor"
|
11
|
+
gem.summary = "Plugin for adding ckeditor support in Administrate"
|
12
|
+
gem.description = gem.summary
|
13
|
+
gem.license = "MIT"
|
14
|
+
|
15
|
+
gem.require_paths = ["lib"]
|
16
|
+
gem.files = `git ls-files`.split("\n")
|
17
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
|
19
|
+
gem.add_dependency "administrate", "~> 0.2.0"
|
20
|
+
gem.add_dependency "ckeditor", "~> 4.1"
|
21
|
+
gem.add_dependency "rails", "~> 4.2"
|
22
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
//= require ckeditor/init
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= field.truncate %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<span class="preserve-whitespace"><%= field.data %></span>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require "administrate/field/ckeditor"
|
2
|
+
|
3
|
+
describe Administrate::Field::Ckeditor do
|
4
|
+
describe "#to_partial_path" do
|
5
|
+
it "returns a partial based on the page being rendered" do
|
6
|
+
page = :show
|
7
|
+
field = Administrate::Field::Ckeditor.new(:relation, "/a.jpg", page)
|
8
|
+
|
9
|
+
path = field.to_partial_path
|
10
|
+
|
11
|
+
expect(path).to eq("/fields/ckeditor/#{page}")
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
metadata
ADDED
@@ -0,0 +1,95 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: administrate-field-ckeditor
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Rikki Pitt
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-05-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: administrate
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.2.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.2.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: ckeditor
|
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: rails
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '4.2'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '4.2'
|
55
|
+
description: Plugin for adding ckeditor support in Administrate
|
56
|
+
email:
|
57
|
+
- rikkipitt@gmail.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- README.md
|
63
|
+
- administrate-field-ckeditor.gemspec
|
64
|
+
- app/assets/javascripts/administrate-field-ckeditor/application.js
|
65
|
+
- app/views/fields/ckeditor/_form.html.erb
|
66
|
+
- app/views/fields/ckeditor/_index.html.erb
|
67
|
+
- app/views/fields/ckeditor/_show.html.erb
|
68
|
+
- lib/administrate/field/ckeditor.rb
|
69
|
+
- spec/lib/administrate/field/ckeditor_spec.rb
|
70
|
+
homepage: https://github.com/jemcode/administrate-field-ckeditor
|
71
|
+
licenses:
|
72
|
+
- MIT
|
73
|
+
metadata: {}
|
74
|
+
post_install_message:
|
75
|
+
rdoc_options: []
|
76
|
+
require_paths:
|
77
|
+
- lib
|
78
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
requirements: []
|
89
|
+
rubyforge_project:
|
90
|
+
rubygems_version: 2.5.1
|
91
|
+
signing_key:
|
92
|
+
specification_version: 4
|
93
|
+
summary: Plugin for adding ckeditor support in Administrate
|
94
|
+
test_files:
|
95
|
+
- spec/lib/administrate/field/ckeditor_spec.rb
|