qwerty 0.0.1.pre → 0.0.3.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +20 -6
- data/app/controllers/documents_controller.rb +20 -1
- data/app/controllers/qwerty_admin/base_controller.rb +5 -4
- data/app/controllers/qwerty_base_controller.rb +6 -3
- data/app/helpers/documents_helper.rb +1 -1
- data/app/models/document.rb +8 -3
- data/app/views/cms/show.html.erb +4 -0
- data/app/views/kaminari/twitter/_first_page.html.erb +13 -0
- data/app/views/kaminari/twitter/_gap.html.erb +11 -0
- data/app/views/kaminari/twitter/_last_page.html.erb +3 -0
- data/app/views/kaminari/twitter/_next_page.html.erb +3 -0
- data/app/views/kaminari/twitter/_page.html.erb +5 -0
- data/app/views/kaminari/twitter/_paginator.html.erb +17 -0
- data/app/views/kaminari/twitter/_prev_page.html.erb +12 -0
- data/app/views/layouts/qwerty_admin.html.erb +0 -1
- data/app/views/qwerty_admin/documents/_document.html.erb +4 -2
- data/app/views/qwerty_admin/documents/_form.html.erb +1 -1
- data/app/views/qwerty_admin/documents/index.html.erb +3 -3
- data/app/views/qwerty_admin/documents/show.html.erb +6 -2
- data/app/views/qwerty_admin/nodes/_node.html.erb +2 -2
- data/config/routes.rb +2 -2
- data/db/migrate/20110909144300_create_documents.rb +1 -1
- data/lib/generators/qwerty/copy_views/copy_views_generator.rb +10 -0
- data/lib/generators/qwerty/create_document_views/create_document_views_generator.rb +18 -0
- data/lib/generators/qwerty/create_document_views/templates/show.html.erb +22 -0
- data/lib/generators/qwerty/install/install_generator.rb +24 -0
- data/lib/generators/qwerty/install/templates/README +30 -0
- data/lib/generators/qwerty/install/templates/qwerty.rb +34 -0
- data/lib/generators/qwerty/install/templates/sitemap.rb +39 -0
- data/lib/qwerty/engine.rb +0 -1
- data/lib/qwerty/version.rb +1 -1
- data/lib/qwerty.rb +40 -3
- data/lib/tasks/qwerty_tasks.rake +9 -2
- data/test/dummy/app/views/cms/blog.html.erb +10 -0
- data/test/dummy/config/sitemap.rb +4 -4
- data/test/dummy/db/schema.rb +1 -15
- data/test/dummy/log/development.log +31645 -0
- data/test/dummy/tmp/dragonfly/cache/meta/08/583d3580bdba862155e60de9a00668e59daf9a +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/09/828a2e2227c8ee400355ae1a23ad2bd790141d +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/0d/3d65cfd83d3144d664a407c58772a9af580f2c +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/1f/f07ad344a1cb0b8ec31186f4dc9db0839ad627 +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/31/2c7a5054f251c184a219299e46d5dd6f0730cd +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/33/fd8b6a50207f556064a867cd45a5a913fc39e6 +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/36/a1e2bafc0b1be17cdfbcc85af2c1ddbdc97274 +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/51/d20274bbbbb01e6fa7dcdd39776bfb0a001dda +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/5b/4beef5209ea5ca056828b4b61d413f586dc689 +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/5e/f7d5756119e2b71e82ea878824891efc8d4e98 +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/64/41ffd938beeeae87f4cb84ed8cc2dc89d7ebc0 +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/66/4c2f6718656261fba53eae83feecda49a4fe27 +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/66/f44aba1428593600ff0e47ea6aa54362e39a59 +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/6c/e61baa71dc8133c47f88feebb2dc25158461f0 +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/6d/d387d4d65cd8d6d331d45659f28626df019f06 +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/75/868cd14b8d420dcd4ef44afcd20722ad7a1c3f +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/77/08cd91d09e6cc0e0393e02a0fb2e0205cf34af +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/77/89d929429830411758a64c37875ee16224640d +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/7c/14b32e4e029b0200d54b210b4148be0349e72c +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/7f/0b8b6f8f34b458916f99a528f4cab40107490d +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/80/5841ac20acdd8dd41460c8346294abc5c4dd8f +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/81/5c4edaf06b6f561037f8424878bc479644cfe2 +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/87/6f1ac29d9a3be64d8ec07d988ee2f7e9210a8c +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/9b/1e5d2a62e4e1c014350ded8b89e08731e51e12 +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/a0/ca7d61a5e5763e257e13dcbc2b0f11abfd607c +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/a6/415b21bb312e94f5386bebaf0b9dd96f102a4c +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/ae/67c778b4cac5a750af11726e141b1c44969772 +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/bc/3d6a023e30186fa647759d74acd8538ec159d9 +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/c2/630081ff80175138d240306b29a05a5557fe32 +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/df/91db539ca547413619d0dadb1e773568d66321 +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/e7/6a8134e4f01b53cb7ab6551c68f0c44faac748 +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/ee/fe74949a8c2a0bbc077385a12944d9f98a12e0 +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/ef/f08311365a487d92cc4a5a33a327b00fa4a576 +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/f9/67ac04386c59253bd80f4034d18af166cc5691 +0 -0
- data/test/dummy/tmp/dragonfly/cache/meta/ff/d5f8f0d3f33df0282fc5c47f8761d3f328806c +0 -0
- metadata +67 -324
- data/app/assets/javascripts/ckeditor/CHANGES.html +0 -1433
- data/app/assets/javascripts/ckeditor/INSTALL.html +0 -92
- data/app/assets/javascripts/ckeditor/LICENSE.html +0 -1327
- data/app/assets/javascripts/ckeditor/adapters/jquery.js +0 -6
- data/app/assets/javascripts/ckeditor/ckeditor.js +0 -149
- data/app/assets/javascripts/ckeditor/ckeditor.pack +0 -211
- data/app/assets/javascripts/ckeditor/ckeditor_basic.js +0 -8
- data/app/assets/javascripts/ckeditor/ckeditor_basic_source.js +0 -20
- data/app/assets/javascripts/ckeditor/ckeditor_source.js +0 -35
- data/app/assets/javascripts/ckeditor/config.js +0 -78
- data/app/assets/javascripts/ckeditor/contents.css +0 -25
- data/app/assets/javascripts/ckeditor/filebrowser/images/gal_add.jpg +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/gal_add.png +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/gal_del.png +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/gal_more.gif +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/preloader.gif +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/ckfnothumb.gif +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/mp3.gif +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/pdf.gif +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/rar.gif +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/swf.gif +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/xls.gif +0 -0
- data/app/assets/javascripts/ckeditor/filebrowser/javascripts/application.js +0 -222
- data/app/assets/javascripts/ckeditor/filebrowser/javascripts/fileuploader.js +0 -1301
- data/app/assets/javascripts/ckeditor/filebrowser/javascripts/jquery.js +0 -18
- data/app/assets/javascripts/ckeditor/filebrowser/javascripts/jquery.tmpl.js +0 -10
- data/app/assets/javascripts/ckeditor/filebrowser/javascripts/rails.js +0 -363
- data/app/assets/javascripts/ckeditor/filebrowser/stylesheets/uploader.css +0 -117
- data/app/assets/javascripts/ckeditor/images/spacer.gif +0 -0
- data/app/assets/javascripts/ckeditor/lang/_languages.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/_translationstatus.txt +0 -61
- data/app/assets/javascripts/ckeditor/lang/af.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/ar.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/bg.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/bn.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/bs.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/ca.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/cs.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/cy.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/da.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/de.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/el.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/en-au.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/en-ca.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/en-gb.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/en.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/eo.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/es.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/et.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/eu.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/fa.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/fi.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/fo.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/fr-ca.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/fr.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/gl.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/gu.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/he.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/hi.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/hr.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/hu.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/is.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/it.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/ja.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/ka.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/km.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/ko.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/lt.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/lv.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/mn.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/ms.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/nb.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/nl.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/no.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/pl.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/pt-br.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/pt.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/ro.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/ru.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/sk.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/sl.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/sr-latn.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/sr.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/sv.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/th.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/tr.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/uk.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/vi.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/zh-cn.js +0 -6
- data/app/assets/javascripts/ckeditor/lang/zh.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +0 -7
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/lang/en.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/a11yhelp/lang/he.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/about/dialogs/about.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/about/dialogs/logo_ckeditor.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/adobeair/plugin.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/ajax/plugin.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/attachment/dialogs/attachment.js +0 -1
- data/app/assets/javascripts/ckeditor/plugins/attachment/images/attachment.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/attachment/lang/en.js +0 -10
- data/app/assets/javascripts/ckeditor/plugins/attachment/lang/ru.js +0 -10
- data/app/assets/javascripts/ckeditor/plugins/attachment/lang/uk.js +0 -10
- data/app/assets/javascripts/ckeditor/plugins/attachment/plugin.js +0 -1
- data/app/assets/javascripts/ckeditor/plugins/autogrow/plugin.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/bbcode/plugin.js +0 -9
- data/app/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +0 -7
- data/app/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.js +0 -7
- data/app/assets/javascripts/ckeditor/plugins/devtools/lang/en.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/devtools/plugin.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js +0 -4
- data/app/assets/javascripts/ckeditor/plugins/div/dialogs/div.js +0 -8
- data/app/assets/javascripts/ckeditor/plugins/docprops/dialogs/docprops.js +0 -10
- data/app/assets/javascripts/ckeditor/plugins/docprops/plugin.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/embed/dialogs/embed.js +0 -1
- data/app/assets/javascripts/ckeditor/plugins/embed/images/embed.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/embed/lang/en.js +0 -9
- data/app/assets/javascripts/ckeditor/plugins/embed/lang/ru.js +0 -9
- data/app/assets/javascripts/ckeditor/plugins/embed/lang/uk.js +0 -9
- data/app/assets/javascripts/ckeditor/plugins/embed/plugin.js +0 -1
- data/app/assets/javascripts/ckeditor/plugins/find/dialogs/find.js +0 -10
- data/app/assets/javascripts/ckeditor/plugins/flash/dialogs/flash.js +0 -9
- data/app/assets/javascripts/ckeditor/plugins/flash/images/placeholder.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/forms/dialogs/button.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/forms/dialogs/checkbox.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/forms/dialogs/form.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/forms/dialogs/hiddenfield.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/forms/dialogs/radio.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/forms/dialogs/select.js +0 -9
- data/app/assets/javascripts/ckeditor/plugins/forms/dialogs/textarea.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/forms/dialogs/textfield.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/forms/images/hiddenfield.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/iframe/dialogs/iframe.js +0 -7
- data/app/assets/javascripts/ckeditor/plugins/iframe/images/placeholder.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/iframedialog/plugin.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +0 -13
- data/app/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +0 -12
- data/app/assets/javascripts/ckeditor/plugins/link/images/anchor.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/liststyle/dialogs/liststyle.js +0 -7
- data/app/assets/javascripts/ckeditor/plugins/pagebreak/images/pagebreak.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +0 -11
- data/app/assets/javascripts/ckeditor/plugins/pastetext/dialogs/pastetext.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/placeholder/dialogs/placeholder.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/en.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/he.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/placeholder/placeholder.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/placeholder/plugin.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +0 -8
- data/app/assets/javascripts/ckeditor/plugins/scayt/dialogs/toolbar.css +0 -6
- data/app/assets/javascripts/ckeditor/plugins/showblocks/images/block_address.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/showblocks/images/block_blockquote.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/showblocks/images/block_div.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/showblocks/images/block_h1.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/showblocks/images/block_h2.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/showblocks/images/block_h3.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/showblocks/images/block_h4.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/showblocks/images/block_h5.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/showblocks/images/block_h6.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/showblocks/images/block_p.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/showblocks/images/block_pre.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/dialogs/smiley.js +0 -7
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/angel_smile.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/angry_smile.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/broken_heart.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/confused_smile.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/cry_smile.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/devil_smile.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/embaressed_smile.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/envelope.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/heart.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/kiss.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/lightbulb.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/omg_smile.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/regular_smile.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/sad_smile.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/shades_smile.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/teeth_smile.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_down.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_up.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/tounge_smile.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/smiley/images/wink_smile.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/specialchar/dialogs/specialchar.js +0 -7
- data/app/assets/javascripts/ckeditor/plugins/specialchar/lang/en.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/styles/styles/default.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/stylesheetparser/plugin.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +0 -9
- data/app/assets/javascripts/ckeditor/plugins/tableresize/plugin.js +0 -7
- data/app/assets/javascripts/ckeditor/plugins/tabletools/dialogs/tableCell.js +0 -8
- data/app/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.js +0 -7
- data/app/assets/javascripts/ckeditor/plugins/templates/templates/default.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/templates/templates/images/template1.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/templates/templates/images/template2.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/templates/templates/images/template3.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/uicolor/dialogs/uicolor.js +0 -7
- data/app/assets/javascripts/ckeditor/plugins/uicolor/lang/en.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/uicolor/lang/he.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/uicolor/plugin.js +0 -6
- data/app/assets/javascripts/ckeditor/plugins/uicolor/uicolor.gif +0 -0
- data/app/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/hue_bg.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/hue_thumb.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/picker_mask.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/picker_thumb.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/yui.css +0 -6
- data/app/assets/javascripts/ckeditor/plugins/uicolor/yui/yui.js +0 -76
- data/app/assets/javascripts/ckeditor/plugins/wsc/dialogs/ciframe.html +0 -49
- data/app/assets/javascripts/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +0 -52
- data/app/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.css +0 -6
- data/app/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +0 -7
- data/app/assets/javascripts/ckeditor/plugins/xml/plugin.js +0 -6
- data/app/assets/javascripts/ckeditor/skins/kama/dialog.css +0 -10
- data/app/assets/javascripts/ckeditor/skins/kama/editor.css +0 -13
- data/app/assets/javascripts/ckeditor/skins/kama/icons.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/kama/icons_rtl.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/kama/images/dialog_sides.gif +0 -0
- data/app/assets/javascripts/ckeditor/skins/kama/images/dialog_sides.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/kama/images/dialog_sides_rtl.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/kama/images/mini.gif +0 -0
- data/app/assets/javascripts/ckeditor/skins/kama/images/noimage.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/kama/images/sprites.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/kama/images/sprites_ie6.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/kama/images/toolbar_start.gif +0 -0
- data/app/assets/javascripts/ckeditor/skins/kama/skin.js +0 -7
- data/app/assets/javascripts/ckeditor/skins/kama/templates.css +0 -6
- data/app/assets/javascripts/ckeditor/skins/office2003/dialog.css +0 -9
- data/app/assets/javascripts/ckeditor/skins/office2003/editor.css +0 -14
- data/app/assets/javascripts/ckeditor/skins/office2003/icons.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/office2003/icons_rtl.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/office2003/images/dialog_sides.gif +0 -0
- data/app/assets/javascripts/ckeditor/skins/office2003/images/dialog_sides.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/office2003/images/dialog_sides_rtl.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/office2003/images/mini.gif +0 -0
- data/app/assets/javascripts/ckeditor/skins/office2003/images/noimage.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/office2003/images/sprites.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/office2003/images/sprites_ie6.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/office2003/skin.js +0 -6
- data/app/assets/javascripts/ckeditor/skins/office2003/templates.css +0 -6
- data/app/assets/javascripts/ckeditor/skins/v2/dialog.css +0 -9
- data/app/assets/javascripts/ckeditor/skins/v2/editor.css +0 -13
- data/app/assets/javascripts/ckeditor/skins/v2/icons.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/v2/icons_rtl.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/v2/images/dialog_sides.gif +0 -0
- data/app/assets/javascripts/ckeditor/skins/v2/images/dialog_sides.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/v2/images/dialog_sides_rtl.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/v2/images/mini.gif +0 -0
- data/app/assets/javascripts/ckeditor/skins/v2/images/noimage.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/v2/images/sprites.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/v2/images/sprites_ie6.png +0 -0
- data/app/assets/javascripts/ckeditor/skins/v2/images/toolbar_start.gif +0 -0
- data/app/assets/javascripts/ckeditor/skins/v2/skin.js +0 -6
- data/app/assets/javascripts/ckeditor/skins/v2/templates.css +0 -6
- data/app/assets/javascripts/ckeditor/themes/default/theme.js +0 -8
- data/app/models/ckeditor/asset.rb +0 -4
- data/app/models/ckeditor/attachment_file.rb +0 -15
- data/app/models/ckeditor/picture.rb +0 -13
- data/config/initializers/ckeditor.rb +0 -18
- data/db/migrate/20110919190859_create_ckeditor_assets.rb +0 -26
- data/test/dummy/public/ckeditor_assets/attachments/2/p1010062.jpg +0 -0
- data/test/dummy/public/ckeditor_assets/pictures/1/content_member_9440972.jpeg +0 -0
- data/test/dummy/public/ckeditor_assets/pictures/1/original_member_9440972.jpeg +0 -0
- data/test/dummy/public/ckeditor_assets/pictures/1/thumb_member_9440972.jpeg +0 -0
- data/test/dummy/public/ckeditor_assets/pictures/3/content_p1010062.jpg +0 -0
- data/test/dummy/public/ckeditor_assets/pictures/3/original_p1010062.jpg +0 -0
- data/test/dummy/public/ckeditor_assets/pictures/3/thumb_p1010062.jpg +0 -0
- data/test/dummy/tmp/pids/server.pid +0 -1
data/README.rdoc
CHANGED
|
@@ -1,16 +1,30 @@
|
|
|
1
1
|
= Qwerty
|
|
2
2
|
|
|
3
|
+
== Install
|
|
4
|
+
|
|
3
5
|
gem 'qwerty'
|
|
4
|
-
rake qwerty_engine:install:migrations
|
|
5
|
-
rails generate ckeditor:install
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
For now we also need to add an additional dependancy to your Gemfile, since Gem's can not depend on git repositories only released versions
|
|
8
|
+
|
|
9
|
+
gem 'simple_form', :git => 'git://github.com/plataformatec/simple_form.git'
|
|
10
|
+
gem 'kaminari', :git => 'git://github.com/ivanyv/kaminari.git'
|
|
11
|
+
|
|
12
|
+
rake qwerty_engine:install:migrations
|
|
13
|
+
rake db:migrate
|
|
14
|
+
rails g qwerty:install
|
|
11
15
|
|
|
12
16
|
Developer Notes
|
|
13
17
|
|
|
14
18
|
Vim users: To allow rails.vim to detect this is as a Rails project "touch config/environment.rb", which has already been added to .gitignore.
|
|
15
19
|
|
|
20
|
+
Release Policy
|
|
21
|
+
|
|
22
|
+
Create release branch from next
|
|
23
|
+
Bump version in Qwerty module: http://semver.org/
|
|
24
|
+
Document release as required
|
|
25
|
+
Merge release branch in to master and next
|
|
26
|
+
Tag master using with 'v' prefix e.g v0.0.1
|
|
27
|
+
Build and push gem to Rubyforge: http://yehudakatz.com/2010/04/02/using-gemspecs-as-intended/
|
|
28
|
+
|
|
29
|
+
|
|
16
30
|
This project rocks and uses MIT-LICENSE.
|
|
@@ -9,15 +9,34 @@ class DocumentsController < QwertyBaseController
|
|
|
9
9
|
def show
|
|
10
10
|
path = request.path == '/' ? '/home' : request.path
|
|
11
11
|
@document = Document.public.find_by_permalink!(path)
|
|
12
|
+
prepare_view_environment
|
|
12
13
|
render locate_template(@document)
|
|
13
14
|
end
|
|
14
15
|
|
|
15
16
|
private
|
|
17
|
+
|
|
18
|
+
def prepare_view_environment
|
|
19
|
+
# e.g @blog
|
|
20
|
+
instance_variable_set("@#{@document.node_name}", @document)
|
|
21
|
+
# e.g @posts
|
|
22
|
+
if @document.can_have_children?
|
|
23
|
+
@document.node.children.each do | node |
|
|
24
|
+
logger.warn("[Qwerty] Both parent and child have the same node name, so @#{@document.node_name} is overwriting @#{node.name.pluralize}, use @document instead to access the parent document") if node.name.pluralize == @document.node_name
|
|
25
|
+
instance_variable_set("@#{node.name.pluralize}", node.documents.public.order(node.get(:sort) || 'published_at desc').page(page_param(@document)).per(node.get(:per_page) || 10))
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def page_param(document)
|
|
31
|
+
params[document.node_name + '_page']
|
|
32
|
+
end
|
|
16
33
|
|
|
17
34
|
# TODO: move this in a class in lib, path_prefix should be setable in
|
|
18
35
|
# Qwerty.options
|
|
19
36
|
# Use Pathname class:
|
|
20
37
|
# http://ruby-doc.org/stdlib/libdoc/pathname/rdoc/index.html
|
|
38
|
+
# Or ViewResolver
|
|
39
|
+
# http://jkfill.com/2011/03/11/implementing-a-rails-3-view-resolver/
|
|
21
40
|
|
|
22
41
|
def locate_template(document)
|
|
23
42
|
view_prefix = 'cms'
|
|
@@ -35,7 +54,7 @@ class DocumentsController < QwertyBaseController
|
|
|
35
54
|
paths.uniq.each do | path |
|
|
36
55
|
view_paths.each do | view_path |
|
|
37
56
|
rel_path = File.join(view_prefix, path) + '.html.erb'
|
|
38
|
-
full_path = File.join(view_path, rel_path)
|
|
57
|
+
full_path = File.join(view_path.to_s, rel_path)
|
|
39
58
|
if File.exists? full_path
|
|
40
59
|
logger.debug "Found: #{full_path}"
|
|
41
60
|
return rel_path
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
class QwertyAdmin::BaseController < InheritedResources::Base
|
|
2
|
-
# Module which has a method called 'autherize', this is called from a before_filter below
|
|
3
|
-
include Qwerty.options[:admin_autherization]
|
|
4
2
|
|
|
5
|
-
|
|
3
|
+
unless Qwerty.options[:admin_autherization].nil?
|
|
4
|
+
include Qwerty.options[:admin_autherization]
|
|
5
|
+
before_filter :autherize
|
|
6
|
+
end
|
|
6
7
|
|
|
7
|
-
layout
|
|
8
|
+
layout Qwerty.options[:admin_layout] unless Qwerty.options[:admin_layout].nil?
|
|
8
9
|
end
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
class QwertyBaseController < ApplicationController
|
|
2
|
-
# Module which has a method called 'autherize', this is called from a before_filter below
|
|
3
|
-
include Qwerty.options[:autherization]
|
|
4
2
|
|
|
5
|
-
|
|
3
|
+
unless Qwerty.options[:autherization].nil?
|
|
4
|
+
include Qwerty.options[:autherization]
|
|
5
|
+
before_filter :autherize
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
layout Qwerty.options[:layout] unless Qwerty.options[:layout].nil?
|
|
6
9
|
end
|
data/app/models/document.rb
CHANGED
|
@@ -11,15 +11,16 @@ class Document < ActiveRecord::Base
|
|
|
11
11
|
|
|
12
12
|
image_accessor :image
|
|
13
13
|
|
|
14
|
-
default_scope :order => 'position ASC'
|
|
14
|
+
# default_scope :order => 'position ASC'
|
|
15
15
|
|
|
16
16
|
scope :by_node, lambda { |node| where(:node_id => node.id) }
|
|
17
17
|
scope :public, where(:published => true)
|
|
18
18
|
|
|
19
19
|
before_save :set_summary, :set_meta_fields
|
|
20
|
-
before_validation :set_published_at
|
|
20
|
+
before_validation :set_published_at
|
|
21
|
+
before_validation :set_permalink, :on => :create
|
|
21
22
|
|
|
22
|
-
delegate :get, :to => :node
|
|
23
|
+
delegate :get, :set, :to => :node
|
|
23
24
|
|
|
24
25
|
def node_name
|
|
25
26
|
node.name
|
|
@@ -29,6 +30,10 @@ class Document < ActiveRecord::Base
|
|
|
29
30
|
!image.nil?
|
|
30
31
|
end
|
|
31
32
|
|
|
33
|
+
def can_have_children?
|
|
34
|
+
!node.children.empty?
|
|
35
|
+
end
|
|
36
|
+
|
|
32
37
|
private
|
|
33
38
|
|
|
34
39
|
def set_summary
|
data/app/views/cms/show.html.erb
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<div style="padding:8px; background-color:#E9EDF2; margin: 10px;">
|
|
2
|
+
<strong>Warning</strong>: This is the default document template, to generate sample templates run: <code>rails g qwerty:create_document_views</code>
|
|
3
|
+
</div>
|
|
4
|
+
|
|
1
5
|
<h2><%= @document.title %></h2>
|
|
2
6
|
|
|
3
7
|
<% if @document.image? %>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<%#
|
|
2
|
+
-# Link to the "First" page
|
|
3
|
+
-# available local variables
|
|
4
|
+
-# url: url to the first page
|
|
5
|
+
-# current_page: a page object for the currently displayed page
|
|
6
|
+
-# num_pages: total number of pages
|
|
7
|
+
-# per_page: number of items to fetch per page
|
|
8
|
+
-# remote: data-remote
|
|
9
|
+
%>
|
|
10
|
+
<li class='prev <%= 'disabled' if current_page.first? %>'>
|
|
11
|
+
<%= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote %>
|
|
12
|
+
</li>
|
|
13
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<%#
|
|
2
|
+
-# Non-link tag that stands for skipped pages...
|
|
3
|
+
-# available local variables
|
|
4
|
+
-# current_page: a page object for the currently displayed page
|
|
5
|
+
-# num_pages: total number of pages
|
|
6
|
+
-# per_page: number of items to fetch per page
|
|
7
|
+
-# remote: data-remote
|
|
8
|
+
%>
|
|
9
|
+
<li class='disabled'>
|
|
10
|
+
<%= link_to(raw(t 'views.pagination.truncate'), "#") %>
|
|
11
|
+
</li>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<%= paginator.render do %>
|
|
2
|
+
<div class='pagination'>
|
|
3
|
+
<ul>
|
|
4
|
+
<%= first_page_tag unless current_page.first? %>
|
|
5
|
+
<%= prev_page_tag unless current_page.first? %>
|
|
6
|
+
<% each_page do |page| %>
|
|
7
|
+
<% if page.left_outer? || page.right_outer? || page.inside_window? %>
|
|
8
|
+
<%= page_tag page %>
|
|
9
|
+
<% elsif !page.was_truncated? %>
|
|
10
|
+
<%= gap_tag %>
|
|
11
|
+
<% end %>
|
|
12
|
+
<% end %>
|
|
13
|
+
<%= next_page_tag unless current_page.last? %>
|
|
14
|
+
<%= last_page_tag unless current_page.last? %>
|
|
15
|
+
</ul>
|
|
16
|
+
</div>
|
|
17
|
+
<% end %>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<%#
|
|
2
|
+
-# Link to the "Previous" page
|
|
3
|
+
-# available local variables
|
|
4
|
+
-# url: url to the previous page
|
|
5
|
+
-# current_page: a page object for the currently displayed page
|
|
6
|
+
-# num_pages: total number of pages
|
|
7
|
+
-# per_page: number of items to fetch per page
|
|
8
|
+
-# remote: data-remote
|
|
9
|
+
%>
|
|
10
|
+
<li class='prev <%= 'disabled' if current_page.first? %>'>
|
|
11
|
+
<%= link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote %>
|
|
12
|
+
</li>
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.3.0/bootstrap.min.css">
|
|
7
7
|
<%= javascript_include_tag "application" %>
|
|
8
8
|
<%= javascript_include_tag 'http://twitter.github.com/bootstrap/1.3.0/bootstrap-alerts.js' %>
|
|
9
|
-
<%= javascript_include_tag "ckeditor/ckeditor.js" %>
|
|
10
9
|
<%= csrf_meta_tags %>
|
|
11
10
|
<style type="text/css">
|
|
12
11
|
body {
|
|
@@ -16,8 +16,10 @@
|
|
|
16
16
|
</div>
|
|
17
17
|
|
|
18
18
|
<div class="span4 offset2">
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
<% if document.get(:sort).try('include?', 'position') %>
|
|
20
|
+
<%= link_to image_tag('qwerty/admin/icons/up.png'), up_qwerty_admin_document_path(document), :class => "btn small#{' disabled' if document.first?}" %>
|
|
21
|
+
<%= link_to image_tag('qwerty/admin/icons/down.png'), down_qwerty_admin_document_path(document), :class => "btn small#{' disabled' if document.last?}" %>
|
|
22
|
+
<% end %>
|
|
21
23
|
<%= link_to 'Edit', edit_qwerty_admin_document_path(document), :class => 'btn small' %>
|
|
22
24
|
<%= link_to 'Live', document_path(document), :target => '_blank', :class => 'btn small' %>
|
|
23
25
|
</div>
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<div class='inputs'>
|
|
7
7
|
<fieldset>
|
|
8
8
|
<%= form.input :title if fields.include?('title') %>
|
|
9
|
-
<%= form.input :body, :
|
|
9
|
+
<%= form.input :body, :hint => 'HTML allowed', :input_html => { :rows => 9, :class => 'span14' } if fields.include?('body')%>
|
|
10
10
|
<%= form.input :summary, :hint => 'Plain text only, automatically set if left blank', :input_html => { :rows => 5, :class => 'span14'} if fields.include?('summary') %>
|
|
11
11
|
<%= form.input :url, :as => :url if fields.include?('url') %>
|
|
12
12
|
<%= form.input :published if fields.include?('published') %>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<h2>Sitemap</h2>
|
|
2
2
|
|
|
3
|
+
|
|
3
4
|
<div id="documents">
|
|
4
5
|
<% @documents.each do | document | %>
|
|
5
6
|
|
|
@@ -16,14 +17,13 @@
|
|
|
16
17
|
</div>
|
|
17
18
|
|
|
18
19
|
<div class="span4 offset2">
|
|
19
|
-
<%= link_to image_tag('qwerty/admin/icons/up.png'), up_qwerty_admin_document_path(document), :class => 'btn small' unless document.
|
|
20
|
-
<%= link_to image_tag('qwerty/admin/icons/down.png'), down_qwerty_admin_document_path(document), :class => 'btn small' unless document.
|
|
20
|
+
<%= link_to image_tag('qwerty/admin/icons/up.png'), up_qwerty_admin_document_path(document), :class => 'btn small' unless document.first? %>
|
|
21
|
+
<%= link_to image_tag('qwerty/admin/icons/down.png'), down_qwerty_admin_document_path(document), :class => 'btn small' unless document.last? %>
|
|
21
22
|
<%= link_to 'Edit', edit_qwerty_admin_document_path(document), :class => 'btn small' %>
|
|
22
23
|
<%= link_to 'Live', document_path(document), :target => '_blank', :class => 'btn small' %>
|
|
23
24
|
</div>
|
|
24
25
|
</div>
|
|
25
26
|
|
|
26
|
-
|
|
27
27
|
<p>
|
|
28
28
|
<% document.node.children.each do | node | %>
|
|
29
29
|
<%= link_to "Add #{node.name.capitalize}", new_qwerty_admin_document_path(:parent_id => document.id, :node_id => node.id), :class => 'btn primary' %>
|
|
@@ -20,13 +20,17 @@
|
|
|
20
20
|
<div class='node'>
|
|
21
21
|
<h3><%= node.name.pluralize.capitalize %></h3>
|
|
22
22
|
|
|
23
|
-
<% unless
|
|
23
|
+
<% unless node.documents.empty? %>
|
|
24
24
|
<div class="documents">
|
|
25
|
-
|
|
25
|
+
<% documents = node.documents.order(node.get(:sort) || 'published_at desc').page(params["#{node.name}_page".to_sym]).per(10 / @document.node.children.size) %>
|
|
26
|
+
<%= render :partial => documents %>
|
|
26
27
|
</div>
|
|
27
28
|
<% else %>
|
|
28
29
|
<p>No <%= node.name.capitalize.pluralize %> have been added yet.</p>
|
|
29
30
|
<% end %>
|
|
31
|
+
|
|
32
|
+
<%= paginate documents, :route => :qwerty_admin_document_path, :param_name => "#{node.name}_page", :theme => :twitter %>
|
|
33
|
+
|
|
30
34
|
<p>
|
|
31
35
|
<%= link_to "Add #{node.name.capitalize}", new_qwerty_admin_document_path(:parent_id => @document.id, :node_id => node.id), :class => 'btn primary' %>
|
|
32
36
|
</p>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<li class='node'><%= (node.leaf? ? node.name.pluralize : node.name).capitalize %>
|
|
2
2
|
<span>
|
|
3
3
|
<%= link_to 'Add', new_qwerty_admin_node_path(:parent_id => node.id) %>
|
|
4
|
-
<%= link_to 'Up', up_qwerty_admin_node_path(node) %>
|
|
5
|
-
<%= link_to 'Down', down_qwerty_admin_node_path(node) %>
|
|
4
|
+
<%= link_to 'Up', up_qwerty_admin_node_path(node) unless node.last? %>
|
|
5
|
+
<%= link_to 'Down', down_qwerty_admin_node_path(node) unless node.first? %>
|
|
6
6
|
<%= link_to 'Edit', edit_qwerty_admin_node_path(node) %>
|
|
7
7
|
<%= link_to 'Delete', qwerty_admin_node_path(node), :method => :delete, :confirm => 'Are you sure?' %>
|
|
8
8
|
<%= node.position %>
|
data/config/routes.rb
CHANGED
|
@@ -3,7 +3,7 @@ Rails.application.routes.draw do
|
|
|
3
3
|
|
|
4
4
|
root :to => 'documents#show'
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
scope Qwerty.options[:admin_route_namespace], :module => :qwerty_admin, :as => :qwerty_admin do
|
|
7
7
|
root :to => 'documents#index'
|
|
8
8
|
|
|
9
9
|
resources :nodes do
|
|
@@ -22,5 +22,5 @@ Rails.application.routes.draw do
|
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
match '*permalink' => 'documents#show'
|
|
25
|
+
match '*permalink' => 'documents#show', :as => :document
|
|
26
26
|
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
class Qwerty::CreateDocumentViewsGenerator < Rails::Generators::Base
|
|
2
|
+
source_root File.expand_path('../templates', __FILE__)
|
|
3
|
+
desc 'Create a example views for a documents'
|
|
4
|
+
|
|
5
|
+
def generate_views(node = Sitemap.root)
|
|
6
|
+
node.children.each do | node |
|
|
7
|
+
generate_view(node)
|
|
8
|
+
generate_views(node) unless node.leaf?
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
private
|
|
13
|
+
|
|
14
|
+
def generate_view(node)
|
|
15
|
+
destination_root = Rails.root
|
|
16
|
+
template 'show.html.erb', "app/views/cms/#{node.ancestry.gsub('/root/', '').gsub('/', '.')}.html.erb", :node => node
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<% node = config[:node]
|
|
2
|
+
parent_var = '@' + (node.children.any? { |n| n.name.pluralize == node.name } ? 'document' : node.name)
|
|
3
|
+
-%>
|
|
4
|
+
<h2><%%= <%= parent_var %>.title %></h2>
|
|
5
|
+
|
|
6
|
+
<div class='body'><%%= <%= parent_var %>.body.html_safe %></div>
|
|
7
|
+
|
|
8
|
+
<% node.children.each do | node | %>
|
|
9
|
+
|
|
10
|
+
<div id="<%= node.name.pluralize %>">
|
|
11
|
+
<%% @<%= node.name.pluralize %>.each do | <%= node.name %> | %>
|
|
12
|
+
<div class='<%= node.name %>'>
|
|
13
|
+
<h3><%%= link_to <%= node.name %>.title, document_path(<%= node.name %>) %></h3>
|
|
14
|
+
|
|
15
|
+
<div><%%= <%= node.name %>.summary %></div>
|
|
16
|
+
<div><%%= <%= node.name %>.published_at %></div>
|
|
17
|
+
</div>
|
|
18
|
+
<%% end %>
|
|
19
|
+
|
|
20
|
+
<%%= paginate @<%= node.name.pluralize %>, :route => :document_path, :param_name => "#{@<%= node.name %>}_page", :theme => :twitter %>
|
|
21
|
+
</div>
|
|
22
|
+
<% end %>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
module Qwerty
|
|
2
|
+
class InstallGenerator < Rails::Generators::Base
|
|
3
|
+
source_root File.expand_path('../templates', __FILE__)
|
|
4
|
+
desc 'Install Qwerty in to your Rails application'
|
|
5
|
+
|
|
6
|
+
invoke 'qwerty:copy_views'
|
|
7
|
+
|
|
8
|
+
def copy_sitemap_config
|
|
9
|
+
template 'sitemap.rb', 'config/sitemap.rb'
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def copy_initializers
|
|
13
|
+
template 'qwerty.rb', 'config/initializers/qwerty.rb'
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def remove_index_html
|
|
17
|
+
remove_file 'public/index.html'
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def show_readme
|
|
21
|
+
readme 'README'
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
===============================================================================
|
|
2
|
+
_
|
|
3
|
+
| |
|
|
4
|
+
__ ___ _____ _ __| |_ _ _
|
|
5
|
+
/ _` \ \ /\ / / _ \ '__| __| | | |
|
|
6
|
+
| (_| |\ V V / __/ | | |_| |_| |
|
|
7
|
+
\__, | \_/\_/ \___|_| \__|\__, |
|
|
8
|
+
| | __/ |
|
|
9
|
+
|_| |___/
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
1. Construct your sitemap
|
|
13
|
+
|
|
14
|
+
config/sitemap.rb
|
|
15
|
+
|
|
16
|
+
2. Load your sitemap and some Lipsum content
|
|
17
|
+
|
|
18
|
+
rake bootstrap
|
|
19
|
+
|
|
20
|
+
3. Start the server
|
|
21
|
+
|
|
22
|
+
rails s
|
|
23
|
+
|
|
24
|
+
4. Open your browser
|
|
25
|
+
|
|
26
|
+
visit localhost:3000
|
|
27
|
+
|
|
28
|
+
5. Enjoy !
|
|
29
|
+
|
|
30
|
+
===============================================================================
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
Qwerty.configure do | config |
|
|
2
|
+
# config.options[:admin_title] = 'Qwerty'
|
|
3
|
+
|
|
4
|
+
# Qwerty does not include autherisation/authentication, it hooks in to your
|
|
5
|
+
# applications own choices. This way you can use authlogic, devise, cancan or
|
|
6
|
+
# any other system.
|
|
7
|
+
#
|
|
8
|
+
# Create a module with a autherize method, the autherize method is called from
|
|
9
|
+
# a before_filter in every one of Qwerty's admin controllers.
|
|
10
|
+
#
|
|
11
|
+
# Example:
|
|
12
|
+
# module Qwerty
|
|
13
|
+
# module DeviseAuth
|
|
14
|
+
# def autherize
|
|
15
|
+
# # Delegate to Devise
|
|
16
|
+
# authenticate_user!
|
|
17
|
+
# raise 'You must be an admin' unless current_user.admin?
|
|
18
|
+
# end
|
|
19
|
+
# end
|
|
20
|
+
# end
|
|
21
|
+
#
|
|
22
|
+
# config.options[:admin_autherization] = Qwerty::DeviseAuth
|
|
23
|
+
#
|
|
24
|
+
# Qwerty comes bundled with two Auth stratagies AllowAuth and DenyAuth.
|
|
25
|
+
# As the names suggest AllowAuth allows everything and DenyAuth allows
|
|
26
|
+
# nothing.
|
|
27
|
+
#
|
|
28
|
+
# You can also autherize a user for regular CMS pages, for example if some
|
|
29
|
+
# pages need to be private. By default anyone is allowed to view all
|
|
30
|
+
# non-admin pages.
|
|
31
|
+
#
|
|
32
|
+
# config.options[:autherization] = Qwerty::AllowAuth
|
|
33
|
+
end
|
|
34
|
+
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
Sitemap.build do | root |
|
|
2
|
+
root.undeleteable!
|
|
3
|
+
|
|
4
|
+
root.add(:home) do | home |
|
|
5
|
+
home.undeleteable!
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
root.add(:project) do | project |
|
|
9
|
+
project.undeleteable!
|
|
10
|
+
|
|
11
|
+
project.add(:page) do | page |
|
|
12
|
+
page.set(:per_page => 10)
|
|
13
|
+
page.set(:sort => 'updated_at desc')
|
|
14
|
+
|
|
15
|
+
page.add(:image) do | image |
|
|
16
|
+
image.set(:per_page => 10)
|
|
17
|
+
image.set(:sort => 'position asc')
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
root.add(:about) do | about |
|
|
23
|
+
about.undeleteable!
|
|
24
|
+
|
|
25
|
+
about.add(:page) do | page |
|
|
26
|
+
page.set(:per_page => 10)
|
|
27
|
+
page.set(:sort => 'title asc')
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
root.add(:blog) do | blog |
|
|
32
|
+
blog.undeleteable!
|
|
33
|
+
|
|
34
|
+
blog.add(:post) do | post |
|
|
35
|
+
post.set(:per_page => 10)
|
|
36
|
+
post.set(:sort => 'published_at asc')
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
data/lib/qwerty/engine.rb
CHANGED
data/lib/qwerty/version.rb
CHANGED
data/lib/qwerty.rb
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
require 'nested_set'
|
|
3
|
+
require 'acts_as_list'
|
|
4
|
+
require "inherited_resources"
|
|
5
|
+
require "simple_form"
|
|
6
|
+
require "jquery-rails"
|
|
7
|
+
require "sanitize"
|
|
8
|
+
require "dragonfly"
|
|
9
|
+
require "faker"
|
|
10
|
+
|
|
11
|
+
# Qwerty
|
|
1
12
|
require "qwerty/engine"
|
|
2
13
|
require "qwerty/allow_auth"
|
|
3
14
|
require "qwerty/deny_auth"
|
|
@@ -7,13 +18,39 @@ module Qwerty
|
|
|
7
18
|
class << self
|
|
8
19
|
|
|
9
20
|
# Provides configurability to Qwerty
|
|
21
|
+
#
|
|
10
22
|
# * admin_title: The title shown in the admin UI
|
|
11
|
-
#
|
|
23
|
+
#
|
|
24
|
+
# * admin_autherization: Module which is mixed in to Qwerty admin
|
|
25
|
+
# controllers, it must have a method called 'autherize', which is called
|
|
26
|
+
# from a before_filter. Set to nil to turn autherization off.
|
|
27
|
+
#
|
|
28
|
+
# * autherization: Module which is mixed in to public facing Qwerty, works
|
|
29
|
+
# in the same way as admin_authentication. Usually this will be left as nil
|
|
30
|
+
# to allow anybody access to CMS pages.
|
|
31
|
+
#
|
|
32
|
+
# Note: All Qwerty controllers inherit from ApplicationController, so your
|
|
33
|
+
# autherize method will have access to its private methods e.g current_user.
|
|
34
|
+
#
|
|
35
|
+
# * admin_layout: The layout to use for all Qwerty's admin controllers,
|
|
36
|
+
# set o nil to use Rails default layout
|
|
37
|
+
#
|
|
38
|
+
# * layout: The layout to use for Qwerty's public facing controllers, set
|
|
39
|
+
# to nil to use the Rails default layout
|
|
40
|
+
#
|
|
41
|
+
# * admin_route_namespace: The namespace for the admin controllers, you may
|
|
42
|
+
# wish to change this to '/admin' if you have other controllers in this
|
|
43
|
+
# namespace and you want consistant URL's. Note: if you change this your
|
|
44
|
+
# views will still reside in 'views/qwerty_admin'.
|
|
45
|
+
|
|
12
46
|
def options
|
|
13
47
|
@options ||= {
|
|
14
48
|
:admin_title => 'Qwerty CMS',
|
|
15
|
-
:autherization =>
|
|
16
|
-
:admin_autherization =>
|
|
49
|
+
:autherization => nil,
|
|
50
|
+
:admin_autherization => nil,
|
|
51
|
+
:admin_layout => 'qwerty_admin',
|
|
52
|
+
:layout => nil,
|
|
53
|
+
:admin_route_namespace => '/qwerty_admin'
|
|
17
54
|
}
|
|
18
55
|
end
|
|
19
56
|
|
data/lib/tasks/qwerty_tasks.rake
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
desc "
|
|
2
|
-
task :bootstrap => [:
|
|
1
|
+
desc "Destructively rebuild the site"
|
|
2
|
+
task :bootstrap => [:load_sitemap, :load_lipsum]
|
|
3
|
+
|
|
4
|
+
desc 'Load sitemap from config/sitemap.rb'
|
|
5
|
+
task :load_sitemap => [:environment] do
|
|
3
6
|
Sitemap.load_from_disk!
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
desc 'Load some Lispsum content for all nodes in Sitemap'
|
|
10
|
+
task :load_lipsum => [:environment] do
|
|
4
11
|
Qwerty::Lipsum.new.run!
|
|
5
12
|
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<h2><%= @blog.title %></h2>
|
|
2
|
+
|
|
3
|
+
<% @posts.each do | post | %>
|
|
4
|
+
<h3><%= link_to post.title, document_path(post) %></h3>
|
|
5
|
+
|
|
6
|
+
<div><%= post.summary %></div>
|
|
7
|
+
<div><%= post.published_at %></div>
|
|
8
|
+
<% end %>
|
|
9
|
+
|
|
10
|
+
<%= paginate @posts, :route => :document_path, :param_name => "#{@blog.node_name}_page", :theme => :twitter %>
|