jemcode / administrate-field-ckeditor

A plugin for adding CKEditor support to Administrate
https://rubygems.org/gems/administrate-field-ckeditor
MIT License
20 stars 25 forks source link

Add some additional features to administrate-field-ckeditor #1

Closed pedantic-git closed 7 years ago

pedantic-git commented 8 years ago

Greetings from one UK-based consultancy to another! Thanks for putting together this gem.

I've made a handful of changes that hopefully you'll like:

  1. On 'show' pages, the HTML of CkEditor elements is actually rendered as HTML, rather than the tags being visible.
  2. On 'index' pages, the tags are stripped before the content is truncated.
  3. You can pass a :ckeditor option to the field to apply any of CkEditor's options to the field (e.g. disabling some of the more annoying plugins, like filebrowser).

Let me know if you want any changes making!

rikkipitt commented 8 years ago

Hey @pedantic-git, thanks for taking the time to help improve this addon. I'll take a look ASAP and get it merged when I can!

Rikki

pedantic-git commented 8 years ago

Awesome - thanks!

I've made one more change which you may have a better solution for:

When the gem is loaded by a path: or github: line in Gemfile, it currently fails, because bundler tries to read the gemspec file before all the other gems are installed, and the file containing the VERSION depends on the Administrate gem being installed.

I've moved the VERSION into the gemspec file itself and removed that require line, which fixes my issue, but I appreciate you may have a better solution.

pedantic-git commented 7 years ago

Hey @rikkipitt - just checking in about this PR to find out if you got a chance to take a look at it?

adrianvalenz commented 7 years ago

I was hoping this would merge soon, been waiting months, finally I added the changes to a fork I did and I'm stumped, can't get it to display the editor on an Edit page in Administrate.

pedantic-git commented 7 years ago

@adrianvalenz What line do you have in the dashboard's ATTRIBUTE_TYPES for that field?

rikkipitt commented 7 years ago

Hey folks, sorry for the delay! It's merged in. Thank you @pedantic-git for this pull request and for helping out @adrianvalenz.

rikkipitt commented 7 years ago

Updated the published gem to v0.0.3. I'll test with the latest version of Administrate and push a new version for that too soon.

Hope this helps!

adrianvalenz commented 7 years ago

@pedantic-git In my dashboards for my post.rb model I have:

content: Field::Ckeditor,

just like the docs said. Is that what you mean?

adrianvalenz commented 7 years ago

The dependencies are also out of date

rikkipitt commented 7 years ago

This was working on v0.2.1 of Administrate. I'll need to test with the latest 0.3.0 version soon and make sure it all works as intended.

adrianvalenz commented 7 years ago

@rikkipitt Ah I see. I don't think v0.2.1 of Administrate works with Rails 5... :(

pedantic-git commented 7 years ago

@adrianvalenz I'm using this line in my Gemfile which has been working up till now:

gem 'administrate', '~> 0.2.2', github: 'thoughtbot/administrate' # until it supports rails5

I would test administrate 0.3 but I have other dependency issues so probably won't get to it this week.

You might need to add a :ref parameter too and pick a revision from before the version number changed to 0.3. The one I have in my world is 73d4d55.

adrianvalenz commented 7 years ago

@pedantic-git It didn't work for me... :(

adrianvalenz commented 7 years ago

@pedantic-git that ref number goes into what, the "administrate" gem or "ckeditor" or "administrate-field-ckeditor"?

pedantic-git commented 7 years ago

@adrianvalenz The administrate gem - you want the latest version of administrate-ckeditor:

gem 'administrate', '~> 0.2.2', github: 'thoughtbot/administrate', ref: '73d4d55'