I’ve just checked in a big update for Comatose.
Here’s a list of the major changes from the CHANGELOG:
[version 0.4] * Added keywords field * Abstracted text filters into a micro plugin structure, default support for - Textile - Markdown - RDoc * It will only show the filters as a choice in the admin if you have the necessary libraries for the filters to function. * Added ComatoseController.hidden_meta_info = [] as a way of showing/hiding the meta fields * The comatose_migration generator now accepts an --upgrade flag which will create a micro migration that only has the new fields in it * get_root_page will now support returning an array of root pages to show in the admin page list * Created some initial tests... (Can you tell I'm not a test _first_ guy?) * Inline rendering now handles :silent flag -- it will just return and empty string if :silent=>true * Modified all the internal references to ComatoseController to self.class. The views reference controller.class. Redirects redirect to :controller=> self.controller_name or controller.controller_name (action and view respectively). This show allow you to sub-class the ComatoseController.
As always, I’ve tried to keep the README up to date with the changes.
Upgrading from the previous version...
I’ve added a couple of fields to the comatose page model… If you have already installed the comatose plugin, and have the add_comatose_support
migration applied, you can get a migration of just the new fields by running:
$ ./script/generate comatose_migration --upgrade
There’s only one other feature that I know I’m going to add in the near future—The ability to re-order the pages. It won’t be a big deal when I release that one though, I already have the field I need in there.
Feedback
As always, check it out, kick the tires, etc. Let me know if you have any issues/questions/suggestions…. darthapo at gmail dot com
Matt,
ReplyDeleteThis is a great idea and script/plugin. I really liked the first version and this version is even better. Thanks for the new filters.
One suggestion is to add a TinyMCE filter. I think this would make it a great plugin option for most.
Chris-
The migration upgrade worked great. Thanks.
ReplyDeleteslow down ... I keep having to install a new version of the plugin every day!
ReplyDeleteOk...i fiannly got it working. It was my rails setup that was broken for some reason....
ReplyDeleteA few notes:
When choosing at custom layout comatose is unable to locate templates called with render :partial
comatose doesnt have access to ApplicationHelper methods...
Solving these two issues would be really kewl...
Ill try to look into it, but dont count on me solving anything ;-)
Dude. If you keep this up I'll have to discontinue the development of Radiant. :-)
ReplyDeletethe render partial problem occurs when using "normal" render, not inline...
ReplyDeleteroutes.rb
comatose_root "",:layout=>"application"
in application.rhtml
"shared/navigation"%>
unable to locate shared/_navigation!!!
Would be nice with a fix for this...
I try to look into it....
In addition to the ApplicationHelper, some of my helpers depend on methods of ApplicationController. Any suggestions on how to accomplish this?
ReplyDeleteHi Matt,
ReplyDeleteIn ComatoseController#show, you store the page title and keywords as session values. The best I can tell, they're only accessed from comatose_content.html. When I comment out the session assignments and replace the references to the session hash in comatose_content.html with attribute lookups on @page (@page.title and @page.keywords), everything seems to work fine.
Is it safe to remove those session assignments so that Comatose isn't storing per-user session values?
Thanks, Scott
I've noticed that the html templates use UTF8, which is A Good Thing, but that the preview does not do so. Adding
ReplyDeleteresponse.headers["Content-Type"] = "text/html; charset=utf-8"
before the +render+ call in +preview+ solves the problem for me. I don't know if it should be there by default, but I know that character encoding is a can of worms, and my fix could break someone else's working setup (and mine too, in another project). Any thoughts?
A request(ion): How do you feel about adding a page cache hook in the cache_cms_page method so the app can make more fine-grained page caching decisions (in part to support finer-grained page-oriented authorization)? Obviously this can also be done via routes in many cases, so it is a "nice to have," but it is definitely nice to have. :-)
ReplyDeleteWorks for me. Thanks in advance if you decide to incorporate it. I like the parameterized inline page rendering, too.
ReplyDeleteNow, if you just mokney-patch Rails to optionally render a Comatose page that matches the controller/action name after executing an action instead of rendering a filesystem-based erb view after actions as Rails does now, then the assimilation will be complete! :-)
- Scott