Thursday, July 6, 2006

Comatose v0.4

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

11 comments:

  1. Matt,
    This 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-

    ReplyDelete
  2. The migration upgrade worked great. Thanks.

    ReplyDelete
  3. slow down ... I keep having to install a new version of the plugin every day!

    ReplyDelete
  4. Ok...i fiannly got it working. It was my rails setup that was broken for some reason....
    A 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 ;-)

    ReplyDelete
  5. Dude. If you keep this up I'll have to discontinue the development of Radiant. :-)

    ReplyDelete
  6. the render partial problem occurs when using "normal" render, not inline...
    routes.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....

    ReplyDelete
  7. In addition to the ApplicationHelper, some of my helpers depend on methods of ApplicationController. Any suggestions on how to accomplish this?

    ReplyDelete
  8. Hi Matt,
    In 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

    ReplyDelete
  9. I've noticed that the html templates use UTF8, which is A Good Thing, but that the preview does not do so. Adding
    response.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?

    ReplyDelete
  10. 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. :-)

    ReplyDelete
  11. Works for me. Thanks in advance if you decide to incorporate it. I like the parameterized inline page rendering, too.
    Now, 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

    ReplyDelete