darthapo-comatose 2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +171 -0
- data/INSTALL +19 -0
- data/LICENSE +20 -0
- data/MANIFEST +91 -0
- data/README.rdoc +148 -0
- data/Rakefile +122 -0
- data/SPECS +61 -0
- data/about.yml +7 -0
- data/bin/comatose +20 -0
- data/generators/comatose_migration/USAGE +15 -0
- data/generators/comatose_migration/comatose_migration_generator.rb +59 -0
- data/generators/comatose_migration/templates/migration.rb +35 -0
- data/generators/comatose_migration/templates/v4_upgrade.rb +15 -0
- data/generators/comatose_migration/templates/v6_upgrade.rb +23 -0
- data/generators/comatose_migration/templates/v7_upgrade.rb +22 -0
- data/init.rb +10 -0
- data/install.rb +16 -0
- data/lib/acts_as_versioned.rb +543 -0
- data/lib/comatose.rb +23 -0
- data/lib/comatose/comatose_drop.rb +79 -0
- data/lib/comatose/configuration.rb +68 -0
- data/lib/comatose/page_wrapper.rb +119 -0
- data/lib/comatose/processing_context.rb +69 -0
- data/lib/comatose/tasks/admin.rb +60 -0
- data/lib/comatose/tasks/data.rb +82 -0
- data/lib/comatose/tasks/setup.rb +52 -0
- data/lib/comatose/version.rb +4 -0
- data/lib/comatose_admin_controller.rb +348 -0
- data/lib/comatose_admin_helper.rb +37 -0
- data/lib/comatose_controller.rb +141 -0
- data/lib/comatose_helper.rb +3 -0
- data/lib/comatose_page.rb +141 -0
- data/lib/liquid.rb +52 -0
- data/lib/liquid/block.rb +96 -0
- data/lib/liquid/context.rb +190 -0
- data/lib/liquid/document.rb +17 -0
- data/lib/liquid/drop.rb +48 -0
- data/lib/liquid/errors.rb +7 -0
- data/lib/liquid/extensions.rb +53 -0
- data/lib/liquid/file_system.rb +62 -0
- data/lib/liquid/htmltags.rb +64 -0
- data/lib/liquid/standardfilters.rb +111 -0
- data/lib/liquid/standardtags.rb +399 -0
- data/lib/liquid/strainer.rb +42 -0
- data/lib/liquid/tag.rb +25 -0
- data/lib/liquid/template.rb +88 -0
- data/lib/liquid/variable.rb +39 -0
- data/lib/redcloth.rb +1129 -0
- data/lib/support/class_options.rb +36 -0
- data/lib/support/inline_rendering.rb +48 -0
- data/lib/support/route_mapper.rb +50 -0
- data/lib/text_filters.rb +138 -0
- data/lib/text_filters/markdown.rb +14 -0
- data/lib/text_filters/markdown_smartypants.rb +15 -0
- data/lib/text_filters/none.rb +8 -0
- data/lib/text_filters/rdoc.rb +13 -0
- data/lib/text_filters/simple.rb +8 -0
- data/lib/text_filters/textile.rb +15 -0
- data/rails/init.rb +12 -0
- data/resources/layouts/comatose_admin_template.html.erb +28 -0
- data/resources/public/images/collapsed.gif +0 -0
- data/resources/public/images/expanded.gif +0 -0
- data/resources/public/images/no-children.gif +0 -0
- data/resources/public/images/page.gif +0 -0
- data/resources/public/images/spinner.gif +0 -0
- data/resources/public/images/title-hover-bg.gif +0 -0
- data/resources/public/javascripts/comatose_admin.js +401 -0
- data/resources/public/stylesheets/comatose_admin.css +381 -0
- data/tasks/comatose.rake +9 -0
- data/test/behaviors.rb +106 -0
- data/test/fixtures/comatose_pages.yml +96 -0
- data/test/functional/comatose_admin_controller_test.rb +112 -0
- data/test/functional/comatose_controller_test.rb +44 -0
- data/test/javascripts/test.html +26 -0
- data/test/javascripts/test_runner.js +307 -0
- data/test/test_helper.rb +43 -0
- data/test/unit/class_options_test.rb +52 -0
- data/test/unit/comatose_page_test.rb +128 -0
- data/test/unit/processing_context_test.rb +108 -0
- data/test/unit/text_filters_test.rb +52 -0
- data/views/comatose_admin/_form.html.erb +96 -0
- data/views/comatose_admin/_page_list_item.html.erb +60 -0
- data/views/comatose_admin/delete.html.erb +18 -0
- data/views/comatose_admin/edit.html.erb +5 -0
- data/views/comatose_admin/index.html.erb +18 -0
- data/views/comatose_admin/new.html.erb +5 -0
- data/views/comatose_admin/reorder.html.erb +30 -0
- data/views/comatose_admin/versions.html.erb +40 -0
- data/views/layouts/comatose_admin.html.erb +814 -0
- data/views/layouts/comatose_admin_customize.html.erb +28 -0
- data/views/layouts/comatose_content.html.erb +17 -0
- metadata +157 -0
data/CHANGELOG
ADDED
@@ -0,0 +1,171 @@
|
|
1
|
+
- version: 2.0 (uber alpha)
|
2
|
+
- Removed controllers, models, and helpers from Comatose module. It was causing odd issues
|
3
|
+
- Initial support for Rails 2.1(ish)
|
4
|
+
- Fixed up slug generation to remove leading and trailing whitespace
|
5
|
+
- Moved to github
|
6
|
+
- Changed all the .rhtml files to .html.erb
|
7
|
+
- Adding support for use as a gem plugin
|
8
|
+
|
9
|
+
- version: 0.8.1
|
10
|
+
changes:
|
11
|
+
- All includes and helpers are loaded at the end of the ComatoseController and ComatoseAdminController classes
|
12
|
+
- Fixed the ComatoseController#show action to correctly send an HTTP status of 404 even if it finds, and renders, a page at '/404'
|
13
|
+
- Fixed the migration to default a page's full_path to '' instead of null
|
14
|
+
- Formalized ComatoseDrops. Use Comatose.define_drop "drop_name", do ... end. Every method within that block should return a value for use with a Liquid and/or ERB template. Usage in a comatose page: {{ drop_name.def_name }}
|
15
|
+
- Added support for a config.after_setup block that gets called after Comatose is setup (in the Dispatcher#to_prepare event)
|
16
|
+
- Added HTML comment output for calls that result in a method_missing on the ProcessingContext
|
17
|
+
- Updated page tree to remember collapsed/expanded nodes between page visits
|
18
|
+
- Fixed some errors that were caused by null revisions (usually happened after initial installation)
|
19
|
+
- Added my javascript test_runner lib for testing slugs generated by JavaScript. More JS tests to come.
|
20
|
+
- Bugfix #8640 (rubyforge bug)
|
21
|
+
|
22
|
+
- version: 0.8
|
23
|
+
changes:
|
24
|
+
- Now ONLY supports Rails 1.2 (not even tested in Rails 1.1)
|
25
|
+
- New configuration system
|
26
|
+
- DEFER_COMATOSE_LOAD is gone -- Using Dispatcher.to_prepare replaces it
|
27
|
+
- You no longer extend the base classes to add functionality. You configure Comatose to include modules and send it symbols for providing said functionality. e.g. Comatose.config.includes << :authentiation_system; Comatose.config.authorization = :require_login
|
28
|
+
- The automatic loading of RAILS_ROOT/lib/comatose/*.rb files is NO longer supported.
|
29
|
+
- In addition to mapping comatose_root in your routes.rb, you'll want to map.comatose_admin as well
|
30
|
+
|
31
|
+
- version: 0.7.1
|
32
|
+
changes:
|
33
|
+
- A new DEFER_COMATOSE_LOAD flag is defined in the init.rb -- if you manually set it to `true`, you'll need to call Comatose.load in your environment.rb, but this should combat a lot of the plugin incompatiblities Coamtose has been suffering from
|
34
|
+
- The revisions link on the edit page is now only shown if you have revisions
|
35
|
+
|
36
|
+
- version: 0.7
|
37
|
+
changes:
|
38
|
+
- Finally, page versioning via Rick Olsen's excellent acts_as_versioned! (included)
|
39
|
+
- Tries to load any text filters, tags/drops, or extensions under RAILS_ROOT/lib/comatose/ (actually it just `require`'s every .rb file in that folder) so you no longer need to muck around with adding stuff in your environment.rb file
|
40
|
+
- Previewing a page no longer updates it
|
41
|
+
|
42
|
+
- version: 0.6.9
|
43
|
+
changes:
|
44
|
+
- The page context now supports page.next, page.last, page.first_child, page.last_child
|
45
|
+
|
46
|
+
- version: 0.6.8
|
47
|
+
changes:
|
48
|
+
- Bugfix ComatoseController now references plugin_layout_path correctly from the class method
|
49
|
+
- Some HTML/CSS/JS cleanup on the administration view -- should degrade to straight HTML pretty well now
|
50
|
+
|
51
|
+
- version: 0.6.7
|
52
|
+
changes:
|
53
|
+
- Removed Comatose::Page.record_timestamps = false -- it was breaking the magic. Override the record_timestamp methds instead
|
54
|
+
- AdminController was still referencing, in a few places, ComatoseController for page cache expiration
|
55
|
+
|
56
|
+
- version: 0.6.6
|
57
|
+
changes:
|
58
|
+
- The cache expiration code is now on the ComatoseAdminController, as it should have been in the first place
|
59
|
+
- Changed internal references from root_paths or cms_root to mount_point, since that's what I've started calling them... And it seems to make the most sense
|
60
|
+
- Cleaned up the class_options code
|
61
|
+
- Added initial support for pre-caching pages (generating static HTML), there's not a UI element for it yet, however
|
62
|
+
- Changes to content-type handling:
|
63
|
+
- Removed Comatose::Options.force_utf8
|
64
|
+
- Added Support for Comatose::Options.content_type = "utf-8" This will affect the HTTP headers, as well as the META tag in the admin views
|
65
|
+
- Changed this log file to yaml format. And yes, there's a method to my madness... Wait for it.
|
66
|
+
|
67
|
+
- version: 0.6.5
|
68
|
+
changes:
|
69
|
+
- Fixed a bug in comatose_admin.js -- if you hid any of the meta_fields it would barf
|
70
|
+
|
71
|
+
- version: 0.6.4
|
72
|
+
changes:
|
73
|
+
- Fixed a typo in comatose_admin_customize.rhtml
|
74
|
+
- Controller now keeps all information about mount points not just the :root (uri) and :index (page tree)
|
75
|
+
|
76
|
+
- version: 0.6.3
|
77
|
+
changes:
|
78
|
+
- Fixed the customization tasks
|
79
|
+
- Added support for the new Routes system in Edge Rails
|
80
|
+
- Removed the getting started guide -- it's now available at: http://comatose.rubyforge.org/getting-started-guide
|
81
|
+
|
82
|
+
- version: 0.6.2
|
83
|
+
changes:
|
84
|
+
- Fixed an issue with named_routes
|
85
|
+
|
86
|
+
- version: 0.6.1
|
87
|
+
changes:
|
88
|
+
- Fixed a migration issue
|
89
|
+
|
90
|
+
- version: 0.6
|
91
|
+
changes:
|
92
|
+
- Split out the admin from the ComatoseController into a new ComatoseAdminController class.
|
93
|
+
- Moved controllers/model into Comatose module, now ComatoseController extends Comatose::Controller, and ComatoseAdminController extends Comatose::AdminController. And they extend your ApplicationController ComatoseController
|
94
|
+
- Created a Comatose::Options class for configuration.
|
95
|
+
- Add Liquid support to Text Processing -- made it the default processor.
|
96
|
+
- Added support for adding 'tags' to processing context. They are Liquid Drops when using Liquid for processing, use like objects/methods when in ERB
|
97
|
+
- Changed comatose.css, comatose.js, and app/views/comatose to comatose_admin.css, comatose_admin.js, and app/views/comatose_admin
|
98
|
+
- Changed the names of some of the internals... ComatoseBinding is now Comatose::ProcessingContext, ComatosePageWrapper is Comatose::PageWrapper
|
99
|
+
- Bugfix: PostgreSQL need the scope to be a symbol instead of a string, eh? Fine -- it is so. (Thanks to Lyle for the fix)
|
100
|
+
- Added support for named routes... Anytime you use map.comatose_*, if * isn't 'root', it will use it as a named route
|
101
|
+
|
102
|
+
- version: 0.5
|
103
|
+
changes:
|
104
|
+
- Added support for parameterized inline rendering of comatose pages. Uselike a partial: render :comatose=>'path', :locals=>{:username=>'stuff'} the locals hash will be sent to the ERB context for use when rendering the page.
|
105
|
+
- Support for a Hash ERB context exists all the way down to the TextFilters.
|
106
|
+
- Initial support for fragment caching for inline rendering. It's turned off by default. Send :use_cache=>true in the render :comatose=>'' tag to use it. Caching will also not be used if you are sending the page parameters via the :locals hash. Oh, and don't forget to set your ActionController::Base.fragment_cache_store
|
107
|
+
- Return reloadable? false for the ComatoseController by default... This should prevent the development mode hassles people have been having.
|
108
|
+
- Updated data migration tasks to better support nested pages.
|
109
|
+
- comatose:data:export FROM=page_path TO_FILE=file_path
|
110
|
+
- comatose:data:import TO=page_path FROM_FILE=file_path
|
111
|
+
- FROM_FILE and TO_FILE default to 'db/comatose-pages.yml'
|
112
|
+
- FROM and TO default to '', the page tree root
|
113
|
+
- Fixed 'Clear Page Cache' bug -- it didn't handle the page root being an array like it should have.
|
114
|
+
- Removed :page_title and :page_keywords from session
|
115
|
+
- Updated the rails_version in the about.yml to 1.1+ -- just because I haven't tested it on anything less than that. If you have, and it works, let me know!
|
116
|
+
- Adds the utf8 header to all output (text/html; charset=utf-8). Use ComatoseController.force_utf8 = false to disable.
|
117
|
+
- Initial support for page reordering (via AJAX)
|
118
|
+
- Updated the administration look-n-feel.
|
119
|
+
|
120
|
+
- version: 0.4
|
121
|
+
changes:
|
122
|
+
- Added keywords field
|
123
|
+
- Abstracted text filters into a micro plugin structure, default support for Textile, Markdown, and RDoc
|
124
|
+
- It will only show the filters as a choice in the admin if you have the necessary libraries for the filters to function.
|
125
|
+
- Added ComatoseController.hidden_meta_fields = [] as a way of showing/hiding the meta fields
|
126
|
+
- The comatose_migration generator now accepts an --upgrade flag which will create a micro migration that only has the new fields in it
|
127
|
+
- get_root_page will now support returning an array of root pages to show in the admin page list
|
128
|
+
- Created some initial tests... (Can you tell I'm not a test _first_ guy?)
|
129
|
+
- Inline rendering now handles :silent flag -- it will just return and empty string if :silent=>true
|
130
|
+
- 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.
|
131
|
+
|
132
|
+
- version: 0.3.1
|
133
|
+
changes:
|
134
|
+
- Abstracted retrieval of root comatose page to allow multi-user/limited view support
|
135
|
+
- Added redcloth so there are now no external dependencies... Other than Rails, of course ;-)
|
136
|
+
- DRYed up the folder structure a bit
|
137
|
+
- Added a Rakefile
|
138
|
+
- Made this ChangeLog more human-readable
|
139
|
+
|
140
|
+
- version: 0.3
|
141
|
+
changes:
|
142
|
+
- Added support for running entirely from the plugin
|
143
|
+
- Added support for hierarchal pages
|
144
|
+
- Pages are pre-filtered by ERB, therefor ERB can generate Textile
|
145
|
+
- Comatose binding object
|
146
|
+
- Used with ERB context to protect AR model
|
147
|
+
- Has a few helper methods too: link, include
|
148
|
+
- Migration updated
|
149
|
+
- rendered_body removed, not much sense with ERB pre-processing and page-caching
|
150
|
+
- full_path added for easy access to child pages
|
151
|
+
- position, and author fields for future use
|
152
|
+
- Administration Updates
|
153
|
+
- Page listing is now a collapsible tree view
|
154
|
+
- Page edit supports previewing the content
|
155
|
+
- Preview textile only for new pages, full ERB previews for existing pages
|
156
|
+
- ERB errors show up as AR errors
|
157
|
+
- Shows Title and Body fields by default, clicking 'more...' makes Slug and Parent visible
|
158
|
+
- CSS updates to lighten it up a bit
|
159
|
+
|
160
|
+
- version: 0.2
|
161
|
+
changes:
|
162
|
+
- Added support for rendering pages inline
|
163
|
+
- Added support for expiring entire page cache
|
164
|
+
- Added support for properly expiring pages when they are modified or deleted
|
165
|
+
- Update stylesheets, generally made it usable
|
166
|
+
- Fixed #new action
|
167
|
+
- Minor tweaks
|
168
|
+
|
169
|
+
- version: 0.1
|
170
|
+
changes:
|
171
|
+
- First mostly-working version
|
data/INSTALL
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
|
2
|
+
======================
|
3
|
+
Welcome to Comatose!
|
4
|
+
======================
|
5
|
+
|
6
|
+
From here you'll want to run:
|
7
|
+
|
8
|
+
$ ./script/generate comatose_migration
|
9
|
+
|
10
|
+
When that's finished, run:
|
11
|
+
|
12
|
+
$ rake db:migrate
|
13
|
+
|
14
|
+
That's it for the Comatose setup! Now just add the following line to the bottom of your config/routes.rb file:
|
15
|
+
|
16
|
+
map.comatose_admin
|
17
|
+
map.comatose_root ''
|
18
|
+
|
19
|
+
Be sure to read the README file, and the 'Getting Started' guide. They are located at vendor/plugins/comatose/README and http://comatose.rubyforge.org/getting-started-guide respectively.
|
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2006 Matthew McCray [ http://www.mattmccray.com ]
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sub-license, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/MANIFEST
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
about.yml
|
2
|
+
bin/comatose
|
3
|
+
CHANGELOG
|
4
|
+
generators/comatose_migration/comatose_migration_generator.rb
|
5
|
+
generators/comatose_migration/templates/migration.rb
|
6
|
+
generators/comatose_migration/templates/v4_upgrade.rb
|
7
|
+
generators/comatose_migration/templates/v6_upgrade.rb
|
8
|
+
generators/comatose_migration/templates/v7_upgrade.rb
|
9
|
+
generators/comatose_migration/USAGE
|
10
|
+
init.rb
|
11
|
+
INSTALL
|
12
|
+
install.rb
|
13
|
+
lib/acts_as_versioned.rb
|
14
|
+
lib/comatose/comatose_drop.rb
|
15
|
+
lib/comatose/configuration.rb
|
16
|
+
lib/comatose/page_wrapper.rb
|
17
|
+
lib/comatose/processing_context.rb
|
18
|
+
lib/comatose/tasks/admin.rb
|
19
|
+
lib/comatose/tasks/data.rb
|
20
|
+
lib/comatose/tasks/setup.rb
|
21
|
+
lib/comatose/version.rb
|
22
|
+
lib/comatose.rb
|
23
|
+
lib/comatose_admin_controller.rb
|
24
|
+
lib/comatose_admin_helper.rb
|
25
|
+
lib/comatose_controller.rb
|
26
|
+
lib/comatose_helper.rb
|
27
|
+
lib/comatose_page.rb
|
28
|
+
lib/liquid/block.rb
|
29
|
+
lib/liquid/context.rb
|
30
|
+
lib/liquid/document.rb
|
31
|
+
lib/liquid/drop.rb
|
32
|
+
lib/liquid/errors.rb
|
33
|
+
lib/liquid/extensions.rb
|
34
|
+
lib/liquid/file_system.rb
|
35
|
+
lib/liquid/htmltags.rb
|
36
|
+
lib/liquid/standardfilters.rb
|
37
|
+
lib/liquid/standardtags.rb
|
38
|
+
lib/liquid/strainer.rb
|
39
|
+
lib/liquid/tag.rb
|
40
|
+
lib/liquid/template.rb
|
41
|
+
lib/liquid/variable.rb
|
42
|
+
lib/liquid.rb
|
43
|
+
lib/redcloth.rb
|
44
|
+
lib/support/class_options.rb
|
45
|
+
lib/support/inline_rendering.rb
|
46
|
+
lib/support/route_mapper.rb
|
47
|
+
lib/text_filters/markdown.rb
|
48
|
+
lib/text_filters/markdown_smartypants.rb
|
49
|
+
lib/text_filters/none.rb
|
50
|
+
lib/text_filters/rdoc.rb
|
51
|
+
lib/text_filters/simple.rb
|
52
|
+
lib/text_filters/textile.rb
|
53
|
+
lib/text_filters.rb
|
54
|
+
LICENSE
|
55
|
+
MANIFEST
|
56
|
+
rails/init.rb
|
57
|
+
Rakefile
|
58
|
+
README.rdoc
|
59
|
+
resources/layouts/comatose_admin_template.html.erb
|
60
|
+
resources/public/images/collapsed.gif
|
61
|
+
resources/public/images/expanded.gif
|
62
|
+
resources/public/images/no-children.gif
|
63
|
+
resources/public/images/page.gif
|
64
|
+
resources/public/images/spinner.gif
|
65
|
+
resources/public/images/title-hover-bg.gif
|
66
|
+
resources/public/javascripts/comatose_admin.js
|
67
|
+
resources/public/stylesheets/comatose_admin.css
|
68
|
+
SPECS
|
69
|
+
tasks/comatose.rake
|
70
|
+
test/behaviors.rb
|
71
|
+
test/fixtures/comatose_pages.yml
|
72
|
+
test/functional/comatose_admin_controller_test.rb
|
73
|
+
test/functional/comatose_controller_test.rb
|
74
|
+
test/javascripts/test.html
|
75
|
+
test/javascripts/test_runner.js
|
76
|
+
test/test_helper.rb
|
77
|
+
test/unit/class_options_test.rb
|
78
|
+
test/unit/comatose_page_test.rb
|
79
|
+
test/unit/processing_context_test.rb
|
80
|
+
test/unit/text_filters_test.rb
|
81
|
+
views/comatose_admin/_form.html.erb
|
82
|
+
views/comatose_admin/_page_list_item.html.erb
|
83
|
+
views/comatose_admin/delete.html.erb
|
84
|
+
views/comatose_admin/edit.html.erb
|
85
|
+
views/comatose_admin/index.html.erb
|
86
|
+
views/comatose_admin/new.html.erb
|
87
|
+
views/comatose_admin/reorder.html.erb
|
88
|
+
views/comatose_admin/versions.html.erb
|
89
|
+
views/layouts/comatose_admin.html.erb
|
90
|
+
views/layouts/comatose_admin_customize.html.erb
|
91
|
+
views/layouts/comatose_content.html.erb
|
data/README.rdoc
ADDED
@@ -0,0 +1,148 @@
|
|
1
|
+
= Comatose
|
2
|
+
|
3
|
+
Version:: 2.0 (uber-alpha)
|
4
|
+
Author:: M@ McCray
|
5
|
+
Website:: comatose.rubyforge.org
|
6
|
+
Email:: matt at elucidata dot net
|
7
|
+
|
8
|
+
|
9
|
+
*Comatose* is a micro CMS designed for being embedded into existing Rails
|
10
|
+
applications.
|
11
|
+
|
12
|
+
It's intended for simple CMS support. Comatose supports
|
13
|
+
|
14
|
+
* Nested pages
|
15
|
+
* Versioning
|
16
|
+
* Page markup in Textile, Markdown, RDoc, or easily add your own
|
17
|
+
* Page processing through Liquid or ERb
|
18
|
+
* Generators for easy installation/migration
|
19
|
+
* Completely self-contained within plugin folder
|
20
|
+
|
21
|
+
It's meant to be lean, mean, easily embedded, and easy to re-skin for
|
22
|
+
existing applications. If you need something more, I would recommend
|
23
|
+
looking into Radiant.
|
24
|
+
|
25
|
+
For more information, see the 'Getting Started' guide: http://comatose.rubyforge.org
|
26
|
+
|
27
|
+
=== Requirements
|
28
|
+
|
29
|
+
* Rails 2+ (2.1)
|
30
|
+
* <tt>acts_as_list</tt> and <tt>acts_as_tree</tt> plugins are required
|
31
|
+
|
32
|
+
|
33
|
+
=== Development Notes
|
34
|
+
|
35
|
+
*NOTE*: This is an active branch of Comatose that is built specifically for Rails 2.1.
|
36
|
+
I will *probably* remove any legacy support.
|
37
|
+
|
38
|
+
* Make comatose fully self-contained, which means removing acts_as_(tree|list)
|
39
|
+
* Move to gem plugin
|
40
|
+
* Comatose.configure needs to be an initializer (update docs)
|
41
|
+
* Go through bugs on 1x branch from google code and ensure they are fixed
|
42
|
+
* Give access to all the default rails helpers to Comatose Pages by default?
|
43
|
+
|
44
|
+
|
45
|
+
== Installation
|
46
|
+
|
47
|
+
*Note*: See the 'Upgrading' section if you already have an older version of
|
48
|
+
the comatose plugin installed.
|
49
|
+
|
50
|
+
$ ./script/plugin source http://mattmccray.com/svn/rails/plugins
|
51
|
+
$ ./script/plugin install comatose
|
52
|
+
$ ./script/generate comatose_migration
|
53
|
+
$ rake migrate
|
54
|
+
|
55
|
+
Open your <tt>routes.rb</tt> and add the comatose root route at the
|
56
|
+
bottom:
|
57
|
+
|
58
|
+
map.comatose_admin
|
59
|
+
map.comatose_root ''
|
60
|
+
|
61
|
+
That's it, you're ready to go! You should be able to browse to
|
62
|
+
http://127.0.0.1:3000/comatose_admin and start adding pages to your CMS.
|
63
|
+
Browsing to http://127.0.0.1:3000/ will render your comatose pages if
|
64
|
+
routing doesn't match any of your controllers.
|
65
|
+
|
66
|
+
|
67
|
+
== Upgrading
|
68
|
+
|
69
|
+
*NOTE*: This is an experimental 2.0 branch, so upgrading is possible at
|
70
|
+
the moment, but these instructions may not work for much longer.
|
71
|
+
|
72
|
+
If you are upgrading from an older version of Comatose (version 0.3,
|
73
|
+
0.4, 0.5, or 0.6), then you will need to re-install the comatose
|
74
|
+
plugin and run:
|
75
|
+
|
76
|
+
$ ./script/plugin remove comatose
|
77
|
+
$ ./script/plugin install comatose
|
78
|
+
$ ./script/generate comatose_migration --upgrade --from=VERSION
|
79
|
+
$ rake migrate
|
80
|
+
|
81
|
+
*Note*: Be sure to set the <tt>--from</tt> parameter to the version of
|
82
|
+
Comatose you last had installed. Also, you only need to first two digits,
|
83
|
+
including the dot, of the version you are upgrading from. For example, if
|
84
|
+
you're upgrading from version 0.6.9 you can use:
|
85
|
+
|
86
|
+
$ ./script/generate comatose_migration --upgrade --from=0.6
|
87
|
+
|
88
|
+
This will create the upgrade migration(s) for you. It just adds the new
|
89
|
+
fields, so you can keep the original migration comatose created.
|
90
|
+
|
91
|
+
|
92
|
+
== Configuration
|
93
|
+
|
94
|
+
You configure Comatose in your `config/environment.rb` file. Here is an example
|
95
|
+
configuration block:
|
96
|
+
|
97
|
+
Comatose.configure do |config|
|
98
|
+
# Sets the text in the Admin UI's title area
|
99
|
+
config.admin_title = "Site Content"
|
100
|
+
config.admin_sub_title = "Content for the rest of us..."
|
101
|
+
end
|
102
|
+
|
103
|
+
Here's an example that uses the AuthentiationSystem as generated by the
|
104
|
+
restful_authentication plugin:
|
105
|
+
|
106
|
+
Comatose.configure do |config|
|
107
|
+
# Includes AuthenticationSystem in the ComatoseController
|
108
|
+
config.includes << :authenticated_system
|
109
|
+
|
110
|
+
# admin
|
111
|
+
config.admin_title = "Comatose - TESTING"
|
112
|
+
config.admin_sub_title = "Content for the rest of us..."
|
113
|
+
|
114
|
+
# Includes AuthenticationSystem in the ComatoseAdminController
|
115
|
+
config.admin_includes << :authenticated_system
|
116
|
+
|
117
|
+
# Calls :login_required as a before_filter
|
118
|
+
config.admin_authorization = :login_required
|
119
|
+
# Returns the author name (login, in this case) for the current user
|
120
|
+
config.admin_get_author do
|
121
|
+
current_user.login
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
|
126
|
+
== Extra Credit
|
127
|
+
|
128
|
+
This plugin includes the work of many wonderful contributors to the Railsphere.
|
129
|
+
Following are the specific libraries that are distributed with Comatose. If I've
|
130
|
+
missed someone/something please let me know.
|
131
|
+
|
132
|
+
* Liquid (http://home.leetsoft.com/liquid) by Tobias Luetke (http://blog.leetsoft.com)
|
133
|
+
* RedCloth (http://whytheluckystiff.net/ruby/redcloth) by why the lucky stiff (http://whytheluckystiff.net)
|
134
|
+
* Acts as Versioned (http://ar-versioned.rubyforge.org) by Rick Olsen (http://weblog.techno-weenie.net)
|
135
|
+
* Behaviors (http://behaviors.rubyforge.org) by Atomic Object LLC -- very nice BDD-like testing library
|
136
|
+
|
137
|
+
== Feedback
|
138
|
+
|
139
|
+
I’ve released Comatose under the MIT license. Which basically means you
|
140
|
+
can use it however you want.
|
141
|
+
|
142
|
+
Don't forget to read the 'Getting Started' guide located on the RubyForge
|
143
|
+
project site: http://comatose.rubyforge.org/getting-started-guide
|
144
|
+
|
145
|
+
If you like it, hate it, or have some ideas for new features, let me know!
|
146
|
+
|
147
|
+
darthapo at gmail dot com
|
148
|
+
|