ds-kitsune 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (372) hide show
  1. data/.gitignore +4 -0
  2. data/.specification +447 -0
  3. data/README.textile +16 -0
  4. data/Rakefile +30 -0
  5. data/VERSION +1 -0
  6. data/app/controllers/admin/kitsune/application_controller.rb +3 -0
  7. data/app/controllers/admin/kitsune/kitsune_controller.rb +87 -0
  8. data/app/controllers/admin/kitsune/kitsune_users_controller.rb +20 -0
  9. data/app/controllers/admin/kitsune/media_controller.rb +27 -0
  10. data/app/controllers/admin/kitsune/models_controller.rb +10 -0
  11. data/app/controllers/admin/kitsune/pages_controller.rb +35 -0
  12. data/app/controllers/admin/kitsune/records_controller.rb +98 -0
  13. data/app/controllers/admin/kitsune/sessions_controller.rb +23 -0
  14. data/app/controllers/kitsune_controller.rb +8 -0
  15. data/app/helpers/admin/kitsune/records_helper.rb +39 -0
  16. data/app/views/admin/kitsune/kitsune_users/index.html.haml +19 -0
  17. data/app/views/admin/kitsune/kitsune_users/new.html.haml +19 -0
  18. data/app/views/admin/kitsune/media/new.html.erb +49 -0
  19. data/app/views/admin/kitsune/models/index.html.haml +1 -0
  20. data/app/views/admin/kitsune/pages/_form.html.erb +13 -0
  21. data/app/views/admin/kitsune/pages/edit.html.erb +7 -0
  22. data/app/views/admin/kitsune/pages/index.html.erb +5 -0
  23. data/app/views/admin/kitsune/pages/new.html.erb +7 -0
  24. data/app/views/admin/kitsune/records/_form.html.haml +27 -0
  25. data/app/views/admin/kitsune/records/_list.html.haml +26 -0
  26. data/app/views/admin/kitsune/records/edit.html.haml +6 -0
  27. data/app/views/admin/kitsune/records/index.html.haml +13 -0
  28. data/app/views/admin/kitsune/records/new.html.haml +6 -0
  29. data/app/views/admin/kitsune/records/show.html.haml +11 -0
  30. data/app/views/admin/kitsune/sessions/new.html.haml +12 -0
  31. data/app/views/admin/kitsune/shared/_flashes.html.haml +6 -0
  32. data/app/views/kitsune/show.html.erb +8 -0
  33. data/app/views/kitsune/show.html.haml +5 -0
  34. data/app/views/layouts/admin/kitsune.html.erb +66 -0
  35. data/config/kitsune_routes.rb +21 -0
  36. data/doc/developers.html +38 -0
  37. data/generators/kitsune/USAGE +1 -0
  38. data/generators/kitsune/kitsune_generator.rb +67 -0
  39. data/generators/kitsune/lib/insert_commands.rb +31 -0
  40. data/generators/kitsune/templates/README +18 -0
  41. data/generators/kitsune/templates/VERSIONED_README +19 -0
  42. data/generators/kitsune/templates/images/back-arrow.gif +0 -0
  43. data/generators/kitsune/templates/images/bg.jpg +0 -0
  44. data/generators/kitsune/templates/images/box-shadow.png +0 -0
  45. data/generators/kitsune/templates/images/content-bg.gif +0 -0
  46. data/generators/kitsune/templates/images/form-bg.gif +0 -0
  47. data/generators/kitsune/templates/images/grey-btn.png +0 -0
  48. data/generators/kitsune/templates/images/header-bg.gif +0 -0
  49. data/generators/kitsune/templates/images/header-link.png +0 -0
  50. data/generators/kitsune/templates/images/nicEditorIcons.gif +0 -0
  51. data/generators/kitsune/templates/javascripts/jquery.js +19 -0
  52. data/generators/kitsune/templates/javascripts/kitsune_jquery.js +10 -0
  53. data/generators/kitsune/templates/javascripts/tiny_mce/langs/en.js +154 -0
  54. data/generators/kitsune/templates/javascripts/tiny_mce/license.txt +504 -0
  55. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advhr/css/advhr.css +5 -0
  56. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advhr/editor_plugin.js +1 -0
  57. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advhr/editor_plugin_src.js +54 -0
  58. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advhr/js/rule.js +43 -0
  59. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advhr/langs/en_dlg.js +5 -0
  60. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advhr/rule.htm +62 -0
  61. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advimage/css/advimage.css +13 -0
  62. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advimage/editor_plugin.js +1 -0
  63. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advimage/editor_plugin_src.js +47 -0
  64. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advimage/image.htm +237 -0
  65. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advimage/img/sample.gif +0 -0
  66. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advimage/js/image.js +443 -0
  67. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advimage/langs/en_dlg.js +43 -0
  68. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advlink/css/advlink.css +8 -0
  69. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advlink/editor_plugin.js +1 -0
  70. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advlink/editor_plugin_src.js +58 -0
  71. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advlink/js/advlink.js +528 -0
  72. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advlink/langs/en_dlg.js +52 -0
  73. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advlink/link.htm +338 -0
  74. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/autoresize/editor_plugin.js +1 -0
  75. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/autoresize/editor_plugin_src.js +114 -0
  76. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/autosave/editor_plugin.js +1 -0
  77. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/autosave/editor_plugin_src.js +51 -0
  78. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/bbcode/editor_plugin.js +1 -0
  79. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/bbcode/editor_plugin_src.js +117 -0
  80. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/contextmenu/editor_plugin.js +1 -0
  81. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js +95 -0
  82. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/directionality/editor_plugin.js +1 -0
  83. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/directionality/editor_plugin_src.js +79 -0
  84. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/editor_plugin.js +1 -0
  85. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/editor_plugin_src.js +40 -0
  86. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/emotions.htm +40 -0
  87. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-cool.gif +0 -0
  88. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-cry.gif +0 -0
  89. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif +0 -0
  90. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif +0 -0
  91. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-frown.gif +0 -0
  92. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif +0 -0
  93. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif +0 -0
  94. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif +0 -0
  95. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif +0 -0
  96. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif +0 -0
  97. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-smile.gif +0 -0
  98. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif +0 -0
  99. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif +0 -0
  100. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif +0 -0
  101. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-wink.gif +0 -0
  102. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-yell.gif +0 -0
  103. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/js/emotions.js +22 -0
  104. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/langs/en_dlg.js +20 -0
  105. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/example/dialog.htm +27 -0
  106. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/example/editor_plugin.js +1 -0
  107. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/example/editor_plugin_src.js +81 -0
  108. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/example/img/example.gif +0 -0
  109. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/example/js/dialog.js +19 -0
  110. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/example/langs/en.js +3 -0
  111. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/example/langs/en_dlg.js +3 -0
  112. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/fullpage/css/fullpage.css +182 -0
  113. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/fullpage/editor_plugin.js +1 -0
  114. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/fullpage/editor_plugin_src.js +146 -0
  115. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/fullpage/fullpage.htm +576 -0
  116. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/fullpage/js/fullpage.js +461 -0
  117. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/fullpage/langs/en_dlg.js +85 -0
  118. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/fullscreen/editor_plugin.js +1 -0
  119. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js +145 -0
  120. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/fullscreen/fullscreen.htm +110 -0
  121. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/iespell/editor_plugin.js +1 -0
  122. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/iespell/editor_plugin_src.js +51 -0
  123. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin.js +1 -0
  124. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js +632 -0
  125. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif +0 -0
  126. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif +0 -0
  127. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif +0 -0
  128. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif +0 -0
  129. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif +0 -0
  130. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif +0 -0
  131. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif +0 -0
  132. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css +90 -0
  133. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/inlinepopups/template.htm +387 -0
  134. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin.js +1 -0
  135. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin_src.js +80 -0
  136. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/layer/editor_plugin.js +1 -0
  137. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/layer/editor_plugin_src.js +209 -0
  138. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/media/css/content.css +6 -0
  139. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/media/css/media.css +16 -0
  140. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/media/editor_plugin.js +1 -0
  141. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/media/editor_plugin_src.js +411 -0
  142. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/media/img/flash.gif +0 -0
  143. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/media/img/flv_player.swf +0 -0
  144. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/media/img/quicktime.gif +0 -0
  145. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/media/img/realmedia.gif +0 -0
  146. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/media/img/shockwave.gif +0 -0
  147. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/media/img/trans.gif +0 -0
  148. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/media/img/windowsmedia.gif +0 -0
  149. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/media/js/embed.js +73 -0
  150. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/media/js/media.js +630 -0
  151. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/media/langs/en_dlg.js +103 -0
  152. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/media/media.htm +822 -0
  153. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin.js +1 -0
  154. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js +50 -0
  155. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/noneditable/editor_plugin.js +1 -0
  156. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/noneditable/editor_plugin_src.js +87 -0
  157. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/pagebreak/css/content.css +1 -0
  158. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/pagebreak/editor_plugin.js +1 -0
  159. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js +74 -0
  160. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/pagebreak/img/pagebreak.gif +0 -0
  161. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/pagebreak/img/trans.gif +0 -0
  162. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/paste/editor_plugin.js +1 -0
  163. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/paste/editor_plugin_src.js +531 -0
  164. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/paste/js/pastetext.js +36 -0
  165. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/paste/js/pasteword.js +51 -0
  166. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/paste/langs/en_dlg.js +5 -0
  167. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/paste/pastetext.htm +33 -0
  168. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/paste/pasteword.htm +27 -0
  169. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/preview/editor_plugin.js +1 -0
  170. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/preview/editor_plugin_src.js +50 -0
  171. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/preview/example.html +28 -0
  172. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/preview/jscripts/embed.js +73 -0
  173. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/preview/preview.html +17 -0
  174. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/print/editor_plugin.js +1 -0
  175. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/print/editor_plugin_src.js +31 -0
  176. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/safari/blank.htm +1 -0
  177. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/safari/editor_plugin.js +1 -0
  178. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/safari/editor_plugin_src.js +438 -0
  179. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/save/editor_plugin.js +1 -0
  180. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/save/editor_plugin_src.js +98 -0
  181. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/searchreplace/css/searchreplace.css +6 -0
  182. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/searchreplace/editor_plugin.js +1 -0
  183. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js +54 -0
  184. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/searchreplace/js/searchreplace.js +126 -0
  185. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js +16 -0
  186. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/searchreplace/searchreplace.htm +104 -0
  187. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/spellchecker/css/content.css +1 -0
  188. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/spellchecker/editor_plugin.js +1 -0
  189. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js +338 -0
  190. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/spellchecker/img/wline.gif +0 -0
  191. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/style/css/props.css +13 -0
  192. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/style/editor_plugin.js +1 -0
  193. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/style/editor_plugin_src.js +52 -0
  194. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/style/js/props.js +641 -0
  195. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/style/langs/en_dlg.js +63 -0
  196. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/style/props.htm +730 -0
  197. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/tabfocus/editor_plugin.js +1 -0
  198. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js +109 -0
  199. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/table/cell.htm +183 -0
  200. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/table/css/cell.css +17 -0
  201. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/table/css/row.css +25 -0
  202. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/table/css/table.css +13 -0
  203. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/table/editor_plugin.js +1 -0
  204. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/table/editor_plugin_src.js +1202 -0
  205. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/table/js/cell.js +269 -0
  206. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/table/js/merge_cells.js +29 -0
  207. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/table/js/row.js +212 -0
  208. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/table/js/table.js +440 -0
  209. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/table/langs/en_dlg.js +74 -0
  210. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/table/merge_cells.htm +37 -0
  211. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/table/row.htm +160 -0
  212. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/table/table.htm +192 -0
  213. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/template/blank.htm +12 -0
  214. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/template/css/template.css +23 -0
  215. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/template/editor_plugin.js +1 -0
  216. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/template/editor_plugin_src.js +156 -0
  217. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/template/js/template.js +106 -0
  218. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/template/langs/en_dlg.js +15 -0
  219. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/template/template.htm +38 -0
  220. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/visualchars/editor_plugin.js +1 -0
  221. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/visualchars/editor_plugin_src.js +73 -0
  222. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/wordcount/editor_plugin.js +1 -0
  223. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/wordcount/editor_plugin_src.js +95 -0
  224. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/abbr.htm +148 -0
  225. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/acronym.htm +148 -0
  226. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/attributes.htm +153 -0
  227. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/cite.htm +148 -0
  228. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css +11 -0
  229. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/css/popup.css +9 -0
  230. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/del.htm +169 -0
  231. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js +1 -0
  232. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js +136 -0
  233. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/ins.htm +169 -0
  234. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js +25 -0
  235. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js +25 -0
  236. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js +123 -0
  237. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/js/cite.js +25 -0
  238. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/js/del.js +60 -0
  239. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/js/element_common.js +231 -0
  240. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/js/ins.js +59 -0
  241. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js +32 -0
  242. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/about.htm +56 -0
  243. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/anchor.htm +31 -0
  244. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/charmap.htm +53 -0
  245. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/color_picker.htm +75 -0
  246. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/editor_template.js +1 -0
  247. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/editor_template_src.js +1153 -0
  248. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/image.htm +85 -0
  249. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/img/colorpicker.jpg +0 -0
  250. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/img/icons.gif +0 -0
  251. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/js/about.js +72 -0
  252. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/js/anchor.js +37 -0
  253. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/js/charmap.js +325 -0
  254. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/js/color_picker.js +253 -0
  255. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/js/image.js +245 -0
  256. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/js/link.js +156 -0
  257. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/js/source_editor.js +62 -0
  258. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/langs/en.js +62 -0
  259. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/langs/en_dlg.js +51 -0
  260. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/link.htm +63 -0
  261. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/default/content.css +32 -0
  262. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/default/dialog.css +116 -0
  263. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/default/img/buttons.png +0 -0
  264. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/default/img/items.gif +0 -0
  265. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif +0 -0
  266. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif +0 -0
  267. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/default/img/progress.gif +0 -0
  268. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif +0 -0
  269. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/default/ui.css +214 -0
  270. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/o2k7/content.css +32 -0
  271. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css +115 -0
  272. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png +0 -0
  273. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png +0 -0
  274. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png +0 -0
  275. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui.css +215 -0
  276. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css +8 -0
  277. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +5 -0
  278. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/source_editor.htm +31 -0
  279. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/about.htm +56 -0
  280. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/anchor.htm +31 -0
  281. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/charmap.htm +53 -0
  282. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/color_picker.htm +75 -0
  283. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/editor_template.js +1153 -0
  284. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/editor_template_src.js +1153 -0
  285. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/image.htm +65 -0
  286. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/images.json +8 -0
  287. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/img/colorpicker.jpg +0 -0
  288. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/img/icons.gif +0 -0
  289. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/js/about.js +72 -0
  290. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/js/anchor.js +37 -0
  291. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/js/charmap.js +325 -0
  292. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/js/color_picker.js +253 -0
  293. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/js/image.js +260 -0
  294. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/js/link.js +156 -0
  295. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/js/source_editor.js +62 -0
  296. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/langs/en.js +62 -0
  297. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/langs/en_dlg.js +51 -0
  298. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/link.htm +63 -0
  299. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/default/content.css +32 -0
  300. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/default/dialog.css +184 -0
  301. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/default/img/buttons.png +0 -0
  302. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/default/img/items.gif +0 -0
  303. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/default/img/menu_arrow.gif +0 -0
  304. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/default/img/menu_check.gif +0 -0
  305. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/default/img/progress.gif +0 -0
  306. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/default/img/tabs.gif +0 -0
  307. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/default/ui.css +214 -0
  308. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/o2k7/content.css +32 -0
  309. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/o2k7/dialog.css +115 -0
  310. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/o2k7/img/button_bg.png +0 -0
  311. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/o2k7/img/button_bg_black.png +0 -0
  312. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/o2k7/img/button_bg_silver.png +0 -0
  313. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/o2k7/ui.css +215 -0
  314. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/o2k7/ui_black.css +8 -0
  315. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/o2k7/ui_silver.css +5 -0
  316. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/source_editor.htm +31 -0
  317. data/generators/kitsune/templates/javascripts/tiny_mce/themes/simple/editor_template.js +1 -0
  318. data/generators/kitsune/templates/javascripts/tiny_mce/themes/simple/editor_template_src.js +85 -0
  319. data/generators/kitsune/templates/javascripts/tiny_mce/themes/simple/img/icons.gif +0 -0
  320. data/generators/kitsune/templates/javascripts/tiny_mce/themes/simple/langs/en.js +11 -0
  321. data/generators/kitsune/templates/javascripts/tiny_mce/themes/simple/skins/default/content.css +25 -0
  322. data/generators/kitsune/templates/javascripts/tiny_mce/themes/simple/skins/default/ui.css +32 -0
  323. data/generators/kitsune/templates/javascripts/tiny_mce/themes/simple/skins/o2k7/content.css +17 -0
  324. data/generators/kitsune/templates/javascripts/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png +0 -0
  325. data/generators/kitsune/templates/javascripts/tiny_mce/themes/simple/skins/o2k7/ui.css +35 -0
  326. data/generators/kitsune/templates/javascripts/tiny_mce/tiny_mce.js +1 -0
  327. data/generators/kitsune/templates/javascripts/tiny_mce/tiny_mce_popup.js +5 -0
  328. data/generators/kitsune/templates/javascripts/tiny_mce/tiny_mce_src.js +13231 -0
  329. data/generators/kitsune/templates/javascripts/tiny_mce/utils/editable_selects.js +69 -0
  330. data/generators/kitsune/templates/javascripts/tiny_mce/utils/form_utils.js +199 -0
  331. data/generators/kitsune/templates/javascripts/tiny_mce/utils/mctabs.js +76 -0
  332. data/generators/kitsune/templates/javascripts/tiny_mce/utils/validate.js +219 -0
  333. data/generators/kitsune/templates/javascripts/upload_maker.js +19 -0
  334. data/generators/kitsune/templates/kitsune_user.rb +3 -0
  335. data/generators/kitsune/templates/migrations/create_kitsune_users.rb +15 -0
  336. data/generators/kitsune/templates/migrations/create_pages.rb +16 -0
  337. data/generators/kitsune/templates/page.rb +3 -0
  338. data/generators/kitsune/templates/stylesheets/global.css +445 -0
  339. data/generators/kitsune/templates/stylesheets/ie.css +3 -0
  340. data/generators/kitsune_flat_files/kitsune_flat_files_generator.rb +8 -0
  341. data/generators/kitsune_flat_files/templates/index.html.erb +35 -0
  342. data/generators/kitsune_flat_files/templates/views/erb/admin/kitsune/models/_form.html.erb +16 -0
  343. data/generators/kitsune_flat_files/templates/views/erb/admin/kitsune/models/index.html.erb +2 -0
  344. data/generators/kitsune_flat_files/templates/views/erb/admin/kitsune/pages/_form.html.erb +13 -0
  345. data/generators/kitsune_flat_files/templates/views/erb/admin/kitsune/pages/edit.html.erb +7 -0
  346. data/generators/kitsune_flat_files/templates/views/erb/admin/kitsune/pages/index.html.erb +5 -0
  347. data/generators/kitsune_flat_files/templates/views/erb/admin/kitsune/pages/new.html.erb +7 -0
  348. data/generators/kitsune_flat_files/templates/views/erb/admin/kitsune/records/_form.html.erb +21 -0
  349. data/generators/kitsune_flat_files/templates/views/erb/admin/kitsune/records/_list.html.erb +38 -0
  350. data/generators/kitsune_flat_files/templates/views/erb/admin/kitsune/records/edit.html.erb +15 -0
  351. data/generators/kitsune_flat_files/templates/views/erb/admin/kitsune/records/index.html.erb +13 -0
  352. data/generators/kitsune_flat_files/templates/views/erb/admin/kitsune/records/new.html.erb +8 -0
  353. data/generators/kitsune_flat_files/templates/views/erb/kitsune/show.html.erb +1 -0
  354. data/generators/kitsune_flat_files/templates/views/erb/layouts/admin/kitsune.html.erb +46 -0
  355. data/kitsune.gemspec +419 -0
  356. data/lib/kitsune/active_record.rb +36 -0
  357. data/lib/kitsune/builder.rb +236 -0
  358. data/lib/kitsune/extensions/routes.rb +15 -0
  359. data/lib/kitsune/faux_column.rb +8 -0
  360. data/lib/kitsune/form_helper_ext.rb +23 -0
  361. data/lib/kitsune/inspector.rb +268 -0
  362. data/lib/kitsune/layout.rb +15 -0
  363. data/lib/kitsune/mongo_mapper.rb +49 -0
  364. data/lib/kitsune/page.rb +70 -0
  365. data/lib/kitsune.rb +53 -0
  366. data/lib/kitsune_user.rb +49 -0
  367. data/rails/init.rb +7 -0
  368. data/test/builder_test.rb +9 -0
  369. data/test/inspector_test.rb +13 -0
  370. data/test/schema.rb +23 -0
  371. data/test/test_helper.rb +11 -0
  372. metadata +451 -0
@@ -0,0 +1,27 @@
1
+ class Admin::Kitsune::MediaController < Admin::Kitsune::KitsuneController
2
+ layout 'admin/kitsune'
3
+
4
+ helper 'admin/kitsune/records'
5
+
6
+ before_filter :load_model
7
+
8
+ def new
9
+ @parent_instance = @parent.new_record
10
+ @media = @model.new_record
11
+ render :layout => false
12
+ end
13
+
14
+ def create
15
+ @media = @model.new_record
16
+ @upload = @model.new_record
17
+ @parent_instance = @parent.new_record
18
+ @upload.update_attribute(@parent.kitsune_admin[:media].values.first, params['image'])
19
+ render 'new', :layout => false
20
+ end
21
+
22
+ private
23
+ def load_model
24
+ @parent = Kitsune::Inspector.new(params[:model_id].constantize) if params[:model_id]
25
+ @model = Kitsune::Inspector.new(params[:id].constantize) if params[:id]
26
+ end
27
+ end
@@ -0,0 +1,10 @@
1
+ class Admin::Kitsune::ModelsController < Admin::Kitsune::KitsuneController
2
+ layout 'admin/kitsune'
3
+
4
+ before_filter :load_model
5
+
6
+ private
7
+ def load_model
8
+ @model = Kitsune::Inspector.new(params[:id].constantize) if params[:id]
9
+ end
10
+ end
@@ -0,0 +1,35 @@
1
+ class Admin::Kitsune::PagesController < Admin::Kitsune::KitsuneController
2
+ layout 'admin/kitsune'
3
+
4
+ before_filter :load_page
5
+
6
+ def index
7
+ @pages = ::Page.all
8
+ end
9
+
10
+ def new
11
+ @page = ::Page.new
12
+ end
13
+
14
+ def create
15
+ @page = ::Page.new(params[:page])
16
+ if @page.save
17
+ redirect_to url_for(:controller => 'admin/kitsune/pages')
18
+ else
19
+ render 'new'
20
+ end
21
+ end
22
+
23
+ def update
24
+ if @page.update_attributes(params[:page])
25
+ redirect_to url_for(:controller => 'admin/kitsune/pages')
26
+ else
27
+ render 'edit'
28
+ end
29
+ end
30
+
31
+ private
32
+ def load_page
33
+ @page = Page.find_by_url(params[:id]) if params[:id]
34
+ end
35
+ end
@@ -0,0 +1,98 @@
1
+ class Admin::Kitsune::RecordsController < Admin::Kitsune::KitsuneController
2
+ layout 'admin/kitsune'
3
+
4
+ before_filter :load_model
5
+ before_filter :load_record
6
+
7
+ def index
8
+ order, @sort_param, @sort_dir = @model.order_by, nil, nil
9
+ if params[:sort]
10
+ @sort_param = params[:sort]
11
+ @sort_dir = params[:sort_dir]
12
+ order = "#{params[:sort]} #{params[:sort_dir]}"
13
+ end
14
+ @records = @model.paginate(:page => params[:page], :order => order)
15
+ end
16
+
17
+ def new
18
+ @record = @model.new_record
19
+ @model.run_hooks(:on_new, @record)
20
+ end
21
+
22
+ def create
23
+ if request.xhr?
24
+ render :text => "Foo"
25
+ else
26
+ if @model.is_sti? && params[params[:model_id].underscore][@model.sti_column].present?
27
+ sti_model = Kitsune::Inspector.new(params[params[:model_id].underscore].delete(@model.sti_column).constantize)
28
+ @record = sti_model.new_record(params[params[:model_id].underscore])
29
+ else
30
+ @record = @model.new_record(params[params[:model_id].underscore])
31
+ end
32
+ @model.run_hooks(:before_save, @record)
33
+ if @record.save
34
+ flash[:notice] = "Record Saved"
35
+ if params[:redirect]
36
+ klass = params[:redirect].gsub(/_id$/, '').classify.constantize
37
+ record = klass.find(params[:redirect_id])
38
+ redirect_to url_for(:controller => 'admin/kitsune/records', :model_id => klass.to_s, :id => params[:redirect_id], :action => :edit)
39
+ else
40
+ redirect_to url_for(:controller => 'admin/kitsune/records', :model_id => @model.class_name)
41
+ end
42
+ else
43
+ flash[:notice] = "Could not save record"
44
+ render 'new'
45
+ end
46
+ end
47
+ end
48
+
49
+ def edit
50
+ @model.run_hooks(:on_new, @record)
51
+ @model.run_hooks(:on_edit, @record)
52
+ end
53
+
54
+ def update
55
+
56
+ if @model.is_sti_child? && params[params[:model_id].underscore][:type]
57
+ if params[params[:model_id].underscore][:type].to_s != @record.type.to_s
58
+ @record.type = params[params[:model_id].underscore][:type]
59
+ @record.save
60
+ end
61
+ end
62
+ @model.run_hooks(:before_save, @record)
63
+ if @record.update_attributes(params[params[:model_id].underscore])
64
+ flash[:notice] = "Record Saved"
65
+ if params[:redirect]
66
+ klass = params[:redirect].gsub(/_id$/, '').classify.constantize
67
+ record = klass.find(params[:redirect_id])
68
+ redirect_to url_for(:controller => 'admin/kitsune/records', :model_id => klass.to_s, :id => params[:redirect_id], :action => :edit)
69
+ else
70
+ redirect_to url_for(:controller => 'admin/kitsune/records', :model_id => @model.class_name)
71
+ end
72
+ else
73
+ flash[:notice] = "Could not save record"
74
+ render 'edit'
75
+ end
76
+ end
77
+
78
+ def destroy
79
+ @record.destroy
80
+ flash[:notice] = "Record Deleted"
81
+ if params[:redirect]
82
+ klass = params[:redirect].gsub(/_id$/, '').classify.constantize
83
+ record = klass.find(params[:redirect_id])
84
+ redirect_to url_for(:controller => 'admin/kitsune/records', :model_id => klass.to_s, :id => params[:redirect_id], :action => :edit)
85
+ else
86
+ redirect_to url_for(:controller => 'admin/kitsune/records', :model_id => @model.class_name)
87
+ end
88
+ end
89
+
90
+ private
91
+ def load_model
92
+ @model = Kitsune::Inspector.new(params[:model_id].constantize) if params[:model_id]
93
+ end
94
+ def load_record
95
+ @record = @model.find(params[:id]) if params[:id]
96
+ @record.revert_to(params[:version].to_i) if params[:version]
97
+ end
98
+ end
@@ -0,0 +1,23 @@
1
+ class Admin::Kitsune::SessionsController < Admin::Kitsune::KitsuneController
2
+ skip_before_filter :authenticate, :load_models
3
+ layout 'admin/kitsune'
4
+ def new
5
+
6
+ end
7
+
8
+ def create
9
+ @user = KitsuneUser.authenticate(params[:session][:email], params[:session][:password])
10
+ if @user.nil?
11
+ flash[:notice] = "Could not log you in"
12
+ render 'new'
13
+ else
14
+ sign_in(@user)
15
+ redirect_back_or(url_for(:controller => 'admin/kitsune/models'))
16
+ end
17
+ end
18
+
19
+ def destroy
20
+ sign_out
21
+ redirect_to(url_for(:controller => 'admin/kitsune/models'))
22
+ end
23
+ end
@@ -0,0 +1,8 @@
1
+ class KitsuneController < ApplicationController
2
+ def show
3
+ @page = ::Page.find_by_url('/'+[params[:url]].flatten.join('/'))
4
+ raise ::ActionController::RoutingError, "No route matches #{request.path.inspect}" unless @page.present?
5
+ @title = @page.title
6
+ render :layout => @page.layout if @page.layout
7
+ end
8
+ end
@@ -0,0 +1,39 @@
1
+ module Admin::Kitsune::RecordsHelper
2
+ def url_for_record(record)
3
+ record.new_record? ? admin_kitsune_model_records_path(record.class.to_s) : admin_kitsune_model_record_path(record.class.to_s, record.id)
4
+ end
5
+
6
+ def sort_link_to(resource, column)
7
+ if resource.column_sortable(column)
8
+ ascending = false
9
+ unless params[:sort]
10
+ if resource.order_by_hash && resource.order_by_hash.keys.include?(column.name.to_sym)
11
+ params[:sort] = column.name
12
+ params[:sort_dir] = resource.order_by_hash[column.name.to_sym].to_s.upcase
13
+ end
14
+ end
15
+ ascending = params[:sort] == column.name && params[:sort_dir] == 'DESC'
16
+ options = {
17
+ :model => resource.object,
18
+ :sort => column.name,
19
+ :sort_dir => (ascending ? 'ASC' : 'DESC')
20
+ }
21
+ link_to column.name.to_s.titleize + (ascending ? ' &darr;' : (params[:sort] == column.name ? ' &uarr;' : ' &#8597;')), options
22
+ else
23
+ column.name.to_s.titleize
24
+ end
25
+ end
26
+
27
+ def additional_content_for(model, record, column)
28
+ if model.field_type(column.name) == :file_field && (file = record.send(column.name)).present?
29
+ "<p><strong>Current File</strong>: " + link_to(file.to_s, file.to_s) + "</p>"
30
+ elsif model.field_type(column.name) == :image_field && (file = record.send(column.name)).present?
31
+ "<p><strong>Current File</strong>: " + image_tag(file.to_s) + "</p>"
32
+ end
33
+ end
34
+
35
+ def kitsune_title
36
+ " - #{@model.admin_name}" + " : #{params[:action].titleize}"
37
+ end
38
+
39
+ end
@@ -0,0 +1,19 @@
1
+ #kitsune_record_header
2
+ %h2.legend Users
3
+ #menu= link_to "New user", :controller => 'admin/kitsune/kitsune_users', :action => :new
4
+
5
+ %table
6
+ %thead
7
+ %tr
8
+ %th Email
9
+ %th Actions
10
+ %tbody
11
+ - @users.each do |user|
12
+ %tr{:class=>cycle('odd', 'even')}
13
+ %td= user.email
14
+ %td
15
+ = link_to 'Edit', "#"
16
+ \-
17
+ = link_to 'Delete', '#'
18
+ - if defined? will_paginate
19
+ = will_paginate @users
@@ -0,0 +1,19 @@
1
+ #kitsune_record_header
2
+ %h2.legend New User
3
+ #menu.with_form
4
+ = link_to 'Back', :controller => 'admin/kitsune/kitsune_users'
5
+
6
+ - form_for([:admin, :kitsune, @user]) do |form|
7
+ %fieldset
8
+ = form.error_messages
9
+ .field
10
+ = form.label :email
11
+ = form.text_field :email
12
+ .field
13
+ = form.label :password
14
+ = form.password_field :password
15
+ .field
16
+ = form.label :password_confirmation
17
+ = form.password_field :password_confirmation
18
+ .submit_button
19
+ %button(value="Save" type='submit' class="submitBtn") <span>Save</span>
@@ -0,0 +1,49 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
6
+ <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
7
+ <%= javascript_include_tag 'kitsune/jquery.js', 'kitsune/kitsune_jquery.js', 'kitsune/upload_maker.js' %>
8
+ <script type="text/javascript">
9
+ $(document).ready(function() {
10
+ //Get the parent window
11
+ up = window.parent.document;
12
+ <% if @upload %>
13
+ var destination = '<%= params['destination'] %>'
14
+ //Update value
15
+ $('#' + destination, up).val('<%= @upload.send(@parent.kitsune_admin[:media].values.first).url %>');
16
+ //Trigger select
17
+ $('#' + destination, up).focus();
18
+ <% end %>
19
+ })
20
+ </script>
21
+ </head>
22
+ <body style="background-color:transparent; margin:0px; padding:0px; overflow:hidden;">
23
+ <% form_for(@parent_instance, :url => url_for_record(@parent_instance).gsub(/records/, 'media')+"?id=#{@media.class.to_s}", :html => {:multipart => true, :id => "upload_image_form"}) do |form| %>
24
+ <input type="hidden" name="destination" value="<%= params['destination'] %>">
25
+ <div id="controls">
26
+ <input type="hidden" name="domain" value="data"/>
27
+
28
+ <div style="font:normal 11px 'Lucida Grande',Verdana; color:#aaa;
29
+ text-decoration:none; cursor:pointer; position:absolute;
30
+ right:0px; top:0px; height:16px; line-height:16px;">+ Upload photo</div>
31
+ </div>
32
+
33
+ <div
34
+ style="position:absolute; right:0px; top:0px;
35
+ width:100px; height:24px;
36
+ filter:alpha(opacity=0); -moz-opacity:0; opacity:0; overflow:hidden;"><input
37
+ type="file" id="image" name="image"
38
+ style="cursor:pointer; height:24px; position:absolute;
39
+ right:0px; top:0px;"
40
+ onchange="document.getElementById('upload_image_form').submit();
41
+ document.getElementById('controls').style.display = 'none';
42
+ document.getElementById('loader').style.display = 'inline';"/></div>
43
+
44
+ <img src="http://assets.tumblr.com/images/bookmarklet_loader.gif" id="loader" style="display:none; width:16px;
45
+ height:16px; position:absolute; top:0px; right:0px;"/>
46
+ <% end %>
47
+ </body>
48
+
49
+ </html>
@@ -0,0 +1 @@
1
+ %p Use the left menu to manage your site.
@@ -0,0 +1,13 @@
1
+ <% form_for [:admin, :kitsune, @page] do |f| %>
2
+ <div class='field'>
3
+ <%= f.label :title %>
4
+ <%= f.text_field :title %>
5
+ </div>
6
+ <div class='field'>
7
+ <%= f.label :body %>
8
+ <%= f.wysiwyg :body %>
9
+ </div>
10
+ <div class='submit_button'>
11
+ <%= f.submit 'Save' %>
12
+ </div>
13
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <div id='menu' class='with_form'>
2
+ <%= link_to 'Back', :controller => 'admin/kitsune/pages' %>
3
+ </div>
4
+ <div id='body'>
5
+ <h2 class='legend'>Edit Page</h3>
6
+ <%= render 'form' %>
7
+ </div>
@@ -0,0 +1,5 @@
1
+ <% @pages.each do |page| %>
2
+ <%= page.title %>
3
+ <% end %>
4
+
5
+ <%= link_to 'New Page', :controller => 'admin/kitsune/pages', :action => :new %>
@@ -0,0 +1,7 @@
1
+ <div id='menu' class='with_form'>
2
+ <%= link_to 'Back', :controller => 'admin/kitsune/pages' %>
3
+ </div>
4
+ <div id='body'>
5
+ <h2 class='legend'>New Page</h3>
6
+ <%= render 'form' %>
7
+ </div>
@@ -0,0 +1,27 @@
1
+ - if params[:version]
2
+ .warning You are viewing a previous version. Click save if you wish to revert to this version.
3
+ - form_for(@record, {:url => url_for_record(@record)}.merge(@model.form_options_for(@record))) do |form|
4
+ %fieldset
5
+ = form.error_messages
6
+ - if @model.versioned? && !@record.new_record?
7
+ .record_details
8
+ Version: #{@record.version}<br />
9
+ Created At: #{@record.versions.find_by_number(@record.version).created_at}<br />
10
+ - if @record.version > 1
11
+ = link_to '&larr; Previous Version', :version => @record.version - 1
12
+ - unless @record.version + 1 >= @record.last_version
13
+ = link_to 'Next Version &rarr;', :version => @record.version + 1
14
+ - if params[:version]
15
+ = link_to 'Current Version &rarr;', :version => nil
16
+ - @model.columns(:edit).each do |column|
17
+ .field
18
+ - unless params[column.name] && !@model.always?(column)
19
+ = form.label column.name
20
+ = form.send(@model.form_type(column), column.name, *@model.options_for(column))
21
+ = additional_content_for(@model, @record, column)
22
+ - else
23
+ = form.hidden_field column.name, :value => params[column.name]
24
+ = hidden_field_tag :redirect, column.name
25
+ = hidden_field_tag :redirect_id, params[column.name]
26
+ .submit_button
27
+ %button(value="Save" type='submit' class="submitBtn") <span>Save</span>
@@ -0,0 +1,26 @@
1
+ %table
2
+ %thead
3
+ %tr
4
+ - model.columns(:display).each do |column|
5
+ %th= sort_link_to(model, column)
6
+ - unless model.disabled?(:edit) && model.disabled?(:delete)
7
+ %th Actions
8
+ %tbody
9
+ - records.each do |record|
10
+ %tr{:class=>cycle('odd', 'even')}
11
+ - model.columns(:display).each do |column|
12
+ %td= model.column_linked?(column) ? link_to(sanitize(model.display_for(record, column.name).to_s), url_for(:controller => 'admin/kitsune/records', :action => :show, :model_id => model.object_class, :id => record.id)): sanitize(model.display_for(record, column.name).to_s)
13
+ - unless model.disabled?(:edit) && model.disabled?(:delete)
14
+ %td
15
+ - unless model.disabled?(:edit)
16
+ - if parent
17
+ = link_to 'Edit', :controller => 'admin/kitsune/records', :action => :edit, :model_id => model.object_class, :id => record.id, (parent.class.to_s.underscore+'_id').to_sym => parent.id
18
+ - else
19
+ = link_to 'Edit', :controller => 'admin/kitsune/records', :action => :edit, :model_id => model.object_class, :id => record.id
20
+ - unless model.disabled?(:edit) || model.disabled?(:delete)
21
+ \-
22
+ - unless model.disabled?(:delete)
23
+ - if parent
24
+ = link_to('Delete', url_for(:controller => 'admin/kitsune/records', :model_id => model.object_class, :id => record.id, :action => :destroy, :redirect => (parent.class.to_s.underscore+'_id'), :redirect_id => parent.id), :method => :delete, :confirm => "Are you sure?")
25
+ - else
26
+ = link_to('Delete', url_for(:controller => 'admin/kitsune/records', :model_id => model.object_class, :id => record.id, :action => :destroy), :method => :delete, :confirm => "Are you sure?")
@@ -0,0 +1,6 @@
1
+ #kitsune_record_header
2
+ %h2.legend Edit #{params[:model_id]}
3
+ #menu.with_form
4
+ = link_to 'Back', :controller => 'admin/kitsune/records', :model_id => params[:model_id]
5
+
6
+ = render 'form'
@@ -0,0 +1,13 @@
1
+ - #@kitsune_title = @model.admin_name
2
+
3
+ #kitsune_record_header
4
+ %h2.legend= @model.admin_name
5
+ - unless @model.disabled?(:new)
6
+ #menu= link_to "New #{params[:id]}", :controller => 'admin/kitsune/records', :action => :new, :model_id => params[:model_id]
7
+
8
+ - @model.tabs.each do |key, value|
9
+ = link_to key, value
10
+
11
+ = render :partial => 'list', :locals => { :model => @model, :records => @records, :parent => nil }
12
+ - if defined? will_paginate
13
+ = will_paginate @records
@@ -0,0 +1,6 @@
1
+ #kitsune_record_header
2
+ %h2.legend New #{params[:model_id]}
3
+ #menu.with_form
4
+ = link_to 'Back', :controller => 'admin/kitsune/records', :model_id => params[:model_id]
5
+
6
+ = render 'form'
@@ -0,0 +1,11 @@
1
+ #kitsune_record_header
2
+ %h2.legend Show #{params[:model_id]}
3
+ %dl
4
+ - @model.columns(:show).each do |column|
5
+ %dt= column.name.capitalize
6
+ %dd= @record.send(column.name)
7
+ - @model.columns(:reflections).each do |column|
8
+ .reflection
9
+ %h3= column.name.to_s.titleize
10
+ = link_to 'New', :controller => 'admin/kitsune/records', :action => :new, :model_id => column.name.to_s.classify, (@record.class.to_s.underscore+'_id').to_sym => @record.id
11
+ = render :partial => 'list', :locals => { :model => Kitsune::Inspector.new(column.name.to_s.classify.constantize), :records => @record.send(column.name), :parent => @record }
@@ -0,0 +1,12 @@
1
+ #kitsune_record_header
2
+ %h2.legend Sign in
3
+ - form_for :session, :url => admin_kitsune_session_path do |form|
4
+ %fieldset
5
+ .field
6
+ = form.label :email
7
+ = form.text_field :email
8
+ .field
9
+ = form.label :password
10
+ = form.password_field :password
11
+ .submit_button
12
+ %input(value="Sign in" type='submit' class="submitBtn")
@@ -0,0 +1,6 @@
1
+ #flash_messages
2
+ - [:notice,:error].each do |flash_type|
3
+ - if flash[flash_type]
4
+ %div{ :class => "flash_#{flash_type}" }
5
+ - flash[flash_type].each do |n,msg|
6
+ = "#{n} #{msg}"
@@ -0,0 +1,8 @@
1
+ <% if @page.data[:content_for]%>
2
+ <% @page.data[:content_for].each do |key, value| %>
3
+ <% content_for(key) do %>
4
+ <%= value %>
5
+ <% end %>
6
+ <% end %>
7
+ <% end %>
8
+ <%= @page.body %>
@@ -0,0 +1,5 @@
1
+ - if @page.data[:content_for]
2
+ - @page.data[:content_for].each do |key, value|
3
+ - content_for(key) do
4
+ = value
5
+ = @page.body
@@ -0,0 +1,66 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
3
+ <head>
4
+ <title>Kitsune CMS <%= kitsune_title rescue "" %></title>
5
+ <%= javascript_include_tag 'kitsune/jquery.js', 'kitsune/kitsune_jquery.js', 'kitsune/upload_maker.js' %>
6
+ <%= stylesheet_link_tag 'kitsune/global.css' %>
7
+ <!--[if IE]>
8
+ <%= stylesheet_link_tag 'kitsune/ie.css' %>
9
+ <![endif]-->
10
+ <%= javascript_include_tag 'kitsune/tiny_mce/tiny_mce.js' %>
11
+ <script type='text/javascript'>
12
+ tinyMCE.init({
13
+ plugins: "iespell",
14
+ theme: "kitsune",
15
+ width: "650px",
16
+ height: "500px",
17
+ theme_kitsune_buttons1 : "bold,italic,strikethrough,|,bullist,numlist,|,outdent,indent,|,image,link,unlink,|,code",
18
+ theme_kitsune_buttons2 : "",
19
+ theme_kitsune_buttons3 : "",
20
+ theme_kitsune_toolbar_location : "top",
21
+ convert_urls : false
22
+ });
23
+ </script>
24
+ <%= yield :head %>
25
+ </head>
26
+ <body>
27
+ <div id='content'>
28
+ <div id='header'>
29
+ <h1><%= link_to 'Kitsune CMS', :controller => 'admin/kitsune/models' %></h1>
30
+ <% if Kitsune.authenticate && signed_in? %>
31
+ <%= link_to 'Sign out', url_for(:controller => 'admin/kitsune/sessions', :action => 'destroy'), :method => :delete, :class => 'sign_out' %>
32
+ <% end %>
33
+ <a href='/' class='view'>View Site</a>
34
+ </div>
35
+ <%= render "admin/kitsune/shared/flashes" %>
36
+ <div class='kitsune_container'>
37
+ <div class='kitsune_right_container'>
38
+ <div class='kitsune_right wrapper'>
39
+ <%= yield %>
40
+ </div>
41
+ </div>
42
+ <% if @models %>
43
+ <div class='kitsune_left'>
44
+ <div class='wrapper'>
45
+ <ul>
46
+ <% @models.each do |model| %>
47
+ <% if model.is_a? Hash %>
48
+ <% model.each do |key, value| %>
49
+ <li class='kitsune_category'><%= key %>
50
+ <% value.each do |inner_model| %>
51
+ <li class='kitsune_inner_model_link'><%= link_to inner_model.admin_name, :controller => 'admin/kitsune/records', :model_id => inner_model.object_class %></li>
52
+ <% end %>
53
+ </li>
54
+ <% end %>
55
+ <% else %>
56
+ <li class='kitsune_model_link'><%= link_to model.admin_name, :controller => 'admin/kitsune/records', :model_id => model.object_class %></li>
57
+ <% end %>
58
+ <% end %>
59
+ </ul>
60
+ </div>
61
+ </div>
62
+ <% end %>
63
+ </div>
64
+ </div>
65
+ </body>
66
+ </html>
@@ -0,0 +1,21 @@
1
+ ActionController::Routing::Routes.draw do |map|
2
+ map.connect '/admin/kitsune', :controller => 'admin/kitsune/models'
3
+ map.namespace :admin do |admin|
4
+ admin.namespace :kitsune do |kitsune|
5
+ kitsune.resource :session
6
+ kitsune.resources :kitsune_users, :as => :users
7
+ kitsune.resources :pages
8
+ kitsune.resources :models do |model|
9
+ model.resources :records
10
+ model.resources :media, :only => [:new, :create]
11
+ end
12
+ end
13
+ end
14
+
15
+ if defined?(Page)
16
+ Page.all.each do |page|
17
+ map.connect page.url, :controller => 'kitsune', :action => 'show', :url => page.url[1..-1].split('/')
18
+ end
19
+ end
20
+
21
+ end
@@ -0,0 +1,38 @@
1
+ Installation
2
+ config.gem 'kitsune'
3
+
4
+ script/generate kitsune
5
+ --without-page-model Exclude Page Model
6
+ --without-user-model Exclude User Model
7
+ --versioned Setup versioning for ActiveRecord, will need vestal_versions preinstalled
8
+
9
+ The admin panels will be available at /admin/kitsune
10
+
11
+ Admin Commands
12
+
13
+ display
14
+ edit
15
+ display_and_edit
16
+
17
+ no_menu
18
+
19
+ name
20
+ category
21
+
22
+ order_by
23
+
24
+ disable
25
+
26
+ sortable
27
+
28
+ file
29
+ image
30
+ multipart
31
+
32
+ select
33
+ string
34
+ text
35
+
36
+ sti
37
+
38
+ no_edit
@@ -0,0 +1 @@
1
+ script/generate kitsune