zen 0.2.7 → 0.2.8

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.
Files changed (303) hide show
  1. data/.gitignore +15 -0
  2. data/.mailmap +2 -0
  3. data/.rvmrc +2 -0
  4. data/.travis.yml +8 -3
  5. data/AUTHORS +1 -2
  6. data/CHANGELOG.md +48 -17
  7. data/README.md +44 -39
  8. data/Rakefile +4 -0
  9. data/bin/zen +5 -30
  10. data/lib/zen.rb +13 -19
  11. data/lib/zen/asset.rb +99 -64
  12. data/lib/zen/bin/create.rb +94 -0
  13. data/lib/zen/bin/runner.rb +118 -0
  14. data/lib/zen/controller/admin_controller.rb +52 -36
  15. data/lib/zen/controller/base_controller.rb +5 -5
  16. data/lib/zen/controller/frontend_controller.rb +7 -7
  17. data/lib/zen/controller/main_controller.rb +12 -10
  18. data/lib/zen/controller/preview.rb +15 -11
  19. data/lib/zen/helper/acl.rb +73 -53
  20. data/lib/zen/helper/blue_form_vendor.rb +689 -0
  21. data/lib/zen/helper/breadcrumb.rb +23 -19
  22. data/lib/zen/helper/message.rb +3 -3
  23. data/lib/zen/helper/theme.rb +18 -13
  24. data/lib/zen/language.rb +62 -58
  25. data/lib/zen/language/en/zen_general.yml +2 -4
  26. data/lib/zen/language/nl/zen_general.yml +2 -4
  27. data/lib/zen/layout/admin.xhtml +3 -12
  28. data/lib/zen/layout/login.xhtml +1 -6
  29. data/lib/zen/model/methods.rb +6 -6
  30. data/lib/zen/model/settings.rb +5 -4
  31. data/lib/zen/package.rb +47 -38
  32. data/lib/zen/package/all.rb +3 -5
  33. data/lib/zen/package/base.rb +7 -7
  34. data/lib/zen/package/categories/lib/categories.rb +8 -3
  35. data/lib/zen/package/categories/lib/categories/controller/categories.rb +81 -55
  36. data/lib/zen/package/categories/lib/categories/controller/category_groups.rb +45 -44
  37. data/lib/zen/package/categories/lib/categories/helper/category.rb +88 -0
  38. data/lib/zen/package/categories/lib/categories/language/en/categories.yml +5 -4
  39. data/lib/zen/package/categories/lib/categories/language/en/category_groups.yml +5 -4
  40. data/lib/zen/package/categories/lib/categories/language/nl/categories.yml +5 -4
  41. data/lib/zen/package/categories/lib/categories/language/nl/category_groups.yml +5 -4
  42. data/lib/zen/package/categories/lib/categories/model/category.rb +15 -13
  43. data/lib/zen/package/categories/lib/categories/model/category_group.rb +3 -3
  44. data/lib/zen/package/categories/lib/categories/plugin/categories.rb +36 -25
  45. data/lib/zen/package/categories/lib/categories/view/admin/categories/form.xhtml +49 -56
  46. data/lib/zen/package/categories/lib/categories/view/admin/categories/index.xhtml +48 -35
  47. data/lib/zen/package/categories/lib/categories/view/admin/category-groups/form.xhtml +36 -29
  48. data/lib/zen/package/categories/lib/categories/view/admin/category-groups/index.xhtml +42 -37
  49. data/lib/zen/package/comments/lib/comments.rb +4 -1
  50. data/lib/zen/package/comments/lib/comments/controller/comments.rb +39 -32
  51. data/lib/zen/package/comments/lib/comments/controller/comments_form.rb +45 -26
  52. data/lib/zen/package/comments/lib/comments/helper/comment.rb +35 -0
  53. data/lib/zen/package/comments/lib/comments/language/en/comments.yml +9 -7
  54. data/lib/zen/package/comments/lib/comments/language/nl/comments.yml +10 -8
  55. data/lib/zen/package/comments/lib/comments/model/comment.rb +31 -17
  56. data/lib/zen/package/comments/lib/comments/model/comment_status.rb +15 -0
  57. data/lib/zen/package/comments/lib/comments/plugin/anti_spam.rb +27 -18
  58. data/lib/zen/package/comments/lib/comments/plugin/comments.rb +25 -20
  59. data/lib/zen/package/comments/lib/comments/view/admin/comments/form.xhtml +61 -54
  60. data/lib/zen/package/comments/lib/comments/view/admin/comments/index.xhtml +38 -23
  61. data/lib/zen/package/comments/migrations/1308774099_comment_status.rb +60 -0
  62. data/lib/zen/package/custom_fields/lib/custom_fields.rb +33 -7
  63. data/lib/zen/package/custom_fields/lib/custom_fields/blue_form_parameters.rb +209 -0
  64. data/lib/zen/package/custom_fields/lib/custom_fields/controller/custom_field_groups.rb +50 -47
  65. data/lib/zen/package/custom_fields/lib/custom_fields/controller/custom_field_types.rb +215 -0
  66. data/lib/zen/package/custom_fields/lib/custom_fields/controller/custom_fields.rb +111 -73
  67. data/lib/zen/package/custom_fields/lib/custom_fields/helper/custom_field.rb +79 -0
  68. data/lib/zen/package/custom_fields/lib/custom_fields/language/en/custom_field_groups.yml +20 -19
  69. data/lib/zen/package/custom_fields/lib/custom_fields/language/en/custom_field_types.yml +40 -0
  70. data/lib/zen/package/custom_fields/lib/custom_fields/language/en/custom_fields.yml +34 -32
  71. data/lib/zen/package/custom_fields/lib/custom_fields/language/nl/custom_field_groups.yml +5 -4
  72. data/lib/zen/package/custom_fields/lib/custom_fields/language/nl/custom_field_types.yml +40 -0
  73. data/lib/zen/package/custom_fields/lib/custom_fields/language/nl/custom_fields.yml +18 -16
  74. data/lib/zen/package/custom_fields/lib/custom_fields/model/custom_field.rb +31 -11
  75. data/lib/zen/package/custom_fields/lib/custom_fields/model/custom_field_method.rb +15 -0
  76. data/lib/zen/package/custom_fields/lib/custom_fields/model/custom_field_type.rb +50 -0
  77. data/lib/zen/package/custom_fields/lib/custom_fields/model/custom_field_value.rb +28 -7
  78. data/lib/zen/package/custom_fields/lib/custom_fields/view/admin/custom-field-groups/form.xhtml +33 -28
  79. data/lib/zen/package/custom_fields/lib/custom_fields/view/admin/custom-field-groups/index.xhtml +48 -46
  80. data/lib/zen/package/custom_fields/lib/custom_fields/view/admin/custom-field-types/form.xhtml +61 -0
  81. data/lib/zen/package/custom_fields/lib/custom_fields/view/admin/custom-field-types/index.xhtml +93 -0
  82. data/lib/zen/package/custom_fields/lib/custom_fields/view/admin/custom-fields/form.xhtml +105 -99
  83. data/lib/zen/package/custom_fields/lib/custom_fields/view/admin/custom-fields/index.xhtml +43 -39
  84. data/lib/zen/package/custom_fields/migrations/1295255665_create_schema.rb +47 -16
  85. data/lib/zen/package/custom_fields/migrations/1310659580_custom_field_types.rb +148 -0
  86. data/lib/zen/package/custom_fields/migrations/1311694920_rename_css_class.rb +11 -0
  87. data/lib/zen/package/menus/lib/menus/controller/menu_items.rb +40 -35
  88. data/lib/zen/package/menus/lib/menus/controller/menus.rb +47 -43
  89. data/lib/zen/package/menus/lib/menus/helper/{menu_item.rb → menu.rb} +42 -15
  90. data/lib/zen/package/menus/lib/menus/language/en/menu_items.yml +5 -5
  91. data/lib/zen/package/menus/lib/menus/language/en/menus.yml +9 -8
  92. data/lib/zen/package/menus/lib/menus/language/nl/menu_items.yml +8 -8
  93. data/lib/zen/package/menus/lib/menus/language/nl/menus.yml +11 -10
  94. data/lib/zen/package/menus/lib/menus/model/menu.rb +5 -5
  95. data/lib/zen/package/menus/lib/menus/model/menu_item.rb +6 -5
  96. data/lib/zen/package/menus/lib/menus/plugin/menus.rb +41 -43
  97. data/lib/zen/package/menus/lib/menus/view/admin/menu-items/form.xhtml +59 -63
  98. data/lib/zen/package/menus/lib/menus/view/admin/menu-items/index.xhtml +35 -30
  99. data/lib/zen/package/menus/lib/menus/view/admin/menus/form.xhtml +46 -37
  100. data/lib/zen/package/menus/lib/menus/view/admin/menus/index.xhtml +37 -37
  101. data/lib/zen/package/menus/migrations/1297184342_create_schema.rb +5 -5
  102. data/lib/zen/package/menus/migrations/1308671733_rename_order_column.rb +11 -0
  103. data/lib/zen/package/menus/migrations/1311695030_rename_css_class.rb +17 -0
  104. data/lib/zen/package/sections/lib/sections.rb +18 -11
  105. data/lib/zen/package/sections/lib/sections/controller/section_entries.rb +115 -109
  106. data/lib/zen/package/sections/lib/sections/controller/sections.rb +72 -50
  107. data/lib/zen/package/sections/lib/sections/helper/section.rb +53 -0
  108. data/lib/zen/package/sections/lib/sections/language/en/section_entries.yml +5 -4
  109. data/lib/zen/package/sections/lib/sections/language/en/sections.yml +5 -4
  110. data/lib/zen/package/sections/lib/sections/language/nl/section_entries.yml +5 -4
  111. data/lib/zen/package/sections/lib/sections/language/nl/sections.yml +5 -4
  112. data/lib/zen/package/sections/lib/sections/model/section.rb +17 -9
  113. data/lib/zen/package/sections/lib/sections/model/section_entry.rb +192 -13
  114. data/lib/zen/package/sections/lib/sections/model/section_entry_status.rb +13 -0
  115. data/lib/zen/package/sections/lib/sections/plugin/section_entries.rb +60 -39
  116. data/lib/zen/package/sections/lib/sections/plugin/sections.rb +14 -11
  117. data/lib/zen/package/sections/lib/sections/view/admin/form.xhtml +100 -97
  118. data/lib/zen/package/sections/lib/sections/view/admin/index.xhtml +41 -39
  119. data/lib/zen/package/sections/lib/sections/view/admin/section-entries/form.xhtml +95 -215
  120. data/lib/zen/package/sections/lib/sections/view/admin/section-entries/index.xhtml +48 -40
  121. data/lib/zen/package/sections/migrations/1308672298_use_id_for_default_section.rb +40 -0
  122. data/lib/zen/package/sections/migrations/1308813320_section_entry_statuses.rb +58 -0
  123. data/lib/zen/package/settings/lib/settings/controller/settings.rb +5 -8
  124. data/lib/zen/package/settings/lib/settings/model/setting.rb +2 -37
  125. data/lib/zen/package/settings/lib/settings/plugin/setting_base.rb +18 -1
  126. data/lib/zen/package/settings/lib/settings/plugin/settings.rb +13 -7
  127. data/lib/zen/package/settings/lib/settings/view/admin/settings/index.xhtml +2 -1
  128. data/lib/zen/package/users/lib/users.rb +3 -1
  129. data/lib/zen/package/users/lib/users/controller/access_rules.rb +77 -60
  130. data/lib/zen/package/users/lib/users/controller/user_groups.rb +41 -36
  131. data/lib/zen/package/users/lib/users/controller/users.rb +48 -42
  132. data/lib/zen/package/users/lib/users/helper/users.rb +72 -0
  133. data/lib/zen/package/users/lib/users/language/en/access_rules.yml +6 -5
  134. data/lib/zen/package/users/lib/users/language/en/user_groups.yml +5 -4
  135. data/lib/zen/package/users/lib/users/language/en/users.yml +1 -0
  136. data/lib/zen/package/users/lib/users/language/nl/access_rules.yml +5 -4
  137. data/lib/zen/package/users/lib/users/language/nl/user_groups.yml +5 -4
  138. data/lib/zen/package/users/lib/users/language/nl/users.yml +1 -0
  139. data/lib/zen/package/users/lib/users/model/access_rule.rb +5 -1
  140. data/lib/zen/package/users/lib/users/model/user.rb +17 -10
  141. data/lib/zen/package/users/lib/users/public/admin/js/users/access_rules.js +10 -37
  142. data/lib/zen/package/users/lib/users/public/admin/js/users/lib/access_rules.js +49 -0
  143. data/lib/zen/package/users/lib/users/view/admin/access-rules/form.xhtml +105 -96
  144. data/lib/zen/package/users/lib/users/view/admin/access-rules/index.xhtml +48 -41
  145. data/lib/zen/package/users/lib/users/view/admin/user-groups/form.xhtml +42 -32
  146. data/lib/zen/package/users/lib/users/view/admin/user-groups/index.xhtml +43 -38
  147. data/lib/zen/package/users/lib/users/view/admin/users/form.xhtml +76 -67
  148. data/lib/zen/package/users/lib/users/view/admin/users/index.xhtml +43 -41
  149. data/lib/zen/package/users/lib/users/view/admin/users/login.xhtml +12 -9
  150. data/lib/zen/package/users/migrations/1295281013_create_schema.rb +2 -2
  151. data/lib/zen/plugin.rb +56 -50
  152. data/lib/zen/plugin/markup/lib/markup/markup.rb +33 -21
  153. data/lib/zen/public/admin/css/zen/buttons.css +11 -7
  154. data/lib/zen/public/admin/css/zen/datepicker.css +6 -6
  155. data/lib/zen/public/admin/css/zen/forms.css +2 -1
  156. data/lib/zen/public/admin/css/zen/general.css +15 -10
  157. data/lib/zen/public/admin/css/zen/layout.css +51 -20
  158. data/lib/zen/public/admin/css/zen/tables.css +39 -11
  159. data/lib/zen/public/admin/css/zen/tabs.css +6 -4
  160. data/lib/zen/public/admin/css/zen/window.css +11 -11
  161. data/lib/zen/public/{favicon.ico → admin/favicon.ico} +0 -0
  162. data/lib/zen/public/admin/images/zen/icons/asc.png +0 -0
  163. data/lib/zen/public/admin/images/zen/icons/desc.png +0 -0
  164. data/lib/zen/public/admin/js/vendor/datepicker.js +0 -11
  165. data/lib/zen/public/admin/js/{mootools → vendor/mootools}/core.js +0 -1
  166. data/lib/zen/public/admin/js/{mootools → vendor/mootools}/more.js +100 -29
  167. data/lib/zen/public/admin/js/zen/index.js +48 -0
  168. data/lib/zen/public/admin/js/zen/lib/asset.js +111 -0
  169. data/lib/zen/public/admin/js/zen/{editor.js → lib/editor.js} +107 -127
  170. data/lib/zen/public/admin/js/zen/{editor → lib/editor}/markdown.js +7 -9
  171. data/lib/zen/public/admin/js/zen/{editor → lib/editor}/textile.js +7 -9
  172. data/lib/zen/public/admin/js/zen/lib/html_table.js +143 -0
  173. data/lib/zen/public/admin/js/zen/{tabs.js → lib/tabs.js} +40 -37
  174. data/lib/zen/public/admin/js/zen/{window.js → lib/window.js} +24 -20
  175. data/lib/zen/spec/bacon/color_output.rb +39 -0
  176. data/lib/zen/spec/helper.rb +152 -0
  177. data/lib/zen/spec/simplecov.rb +22 -0
  178. data/lib/zen/task/build.rake +20 -43
  179. data/lib/zen/task/clean.rake +2 -6
  180. data/lib/zen/task/db.rake +8 -12
  181. data/lib/zen/task/package.rake +4 -10
  182. data/lib/zen/task/plugin.rake +3 -9
  183. data/lib/zen/task/proto.rake +0 -62
  184. data/lib/zen/task/test.rake +6 -3
  185. data/lib/zen/task/theme.rake +4 -11
  186. data/lib/zen/theme.rb +22 -24
  187. data/lib/zen/validation.rb +34 -27
  188. data/lib/zen/version.rb +2 -8
  189. data/lib/zen/view/head.xhtml +7 -0
  190. data/lib/zen/view/main.xhtml +7 -22
  191. data/{proto/package/migrations → pkg}/.gitkeep +0 -0
  192. data/proto/app/app.rb +1 -0
  193. data/proto/app/config/config.rb +5 -4
  194. data/proto/app/config/database.rb +19 -41
  195. data/proto/app/config/middlewares.rb +32 -29
  196. data/proto/{package/lib/package/view/admin/package/index.xhtml → app/log/database/dev/.gitkeep} +0 -0
  197. data/proto/app/log/database/live/.gitkeep +0 -0
  198. data/spec/Rakefile +26 -0
  199. data/spec/fixtures/zen/asset.rb +18 -0
  200. data/spec/fixtures/zen/helper/acl.rb +39 -0
  201. data/spec/fixtures/zen/helper/message.rb +19 -0
  202. data/spec/fixtures/zen/language/en/spec.yml +10 -0
  203. data/spec/fixtures/zen/language/nl/spec.yml +7 -0
  204. data/spec/fixtures/zen/package.rb +17 -0
  205. data/spec/fixtures/zen/package/comments/controller/comments_form.rb +27 -0
  206. data/spec/fixtures/zen/package/settings/plugin/settings.rb +20 -0
  207. data/spec/fixtures/zen/plugin.rb +7 -0
  208. data/spec/fixtures/zen/theme/404.xhtml +1 -0
  209. data/spec/fixtures/zen/theme/default-section/index.xhtml +1 -0
  210. data/spec/fixtures/zen/theme/helper/404.xhtml +1 -0
  211. data/spec/fixtures/zen/theme/helper/partial.xhtml +1 -0
  212. data/spec/fixtures/zen/theme/helper/wrong_partial.xhtml +1 -0
  213. data/spec/fixtures/zen/theme/partials/partial.xhtml +1 -0
  214. data/spec/fixtures/zen/theme/theme.rb +11 -0
  215. data/spec/fixtures/zen/validation.rb +22 -0
  216. data/spec/helper.rb +41 -0
  217. data/spec/zen/all.rb +5 -0
  218. data/spec/zen/asset.rb +97 -0
  219. data/spec/zen/bin/create.rb +89 -0
  220. data/spec/zen/bin/runner.rb +47 -0
  221. data/spec/zen/controller/admin_controller.rb +26 -0
  222. data/spec/zen/controller/main_controller.rb +81 -0
  223. data/spec/zen/controller/preview.rb +33 -0
  224. data/spec/zen/helper/acl.rb +149 -0
  225. data/spec/zen/helper/breadcrumb.rb +38 -0
  226. data/spec/zen/helper/message.rb +31 -0
  227. data/spec/zen/helper/theme.rb +58 -0
  228. data/spec/zen/language.rb +55 -0
  229. data/spec/zen/package.rb +23 -0
  230. data/spec/zen/package/categories/controller/categories.rb +123 -0
  231. data/spec/zen/package/categories/controller/category_groups.rb +108 -0
  232. data/spec/zen/package/categories/helper/category.rb +75 -0
  233. data/spec/zen/package/categories/plugin/categories.rb +92 -0
  234. data/spec/zen/package/comments/controller/comments.rb +134 -0
  235. data/spec/zen/package/comments/controller/comments_form.rb +343 -0
  236. data/spec/zen/package/comments/helper/comment.rb +47 -0
  237. data/spec/zen/package/comments/plugin/anti_spam.rb +59 -0
  238. data/spec/zen/package/comments/plugin/comments.rb +107 -0
  239. data/spec/zen/package/custom_fields/blue_form_parameters.rb +183 -0
  240. data/spec/zen/package/custom_fields/controller/custom_field_groups.rb +120 -0
  241. data/spec/zen/package/custom_fields/controller/custom_field_types.rb +169 -0
  242. data/spec/zen/package/custom_fields/controller/custom_fields.rb +158 -0
  243. data/spec/zen/package/custom_fields/helper/custom_field.rb +86 -0
  244. data/spec/zen/package/menus/controller/menu_items.rb +110 -0
  245. data/spec/zen/package/menus/controller/menus.rb +110 -0
  246. data/spec/zen/package/menus/helper/menu.rb +75 -0
  247. data/spec/zen/package/menus/plugin/menus.rb +120 -0
  248. data/spec/zen/package/sections/controller/section_entries.rb +201 -0
  249. data/spec/zen/package/sections/controller/sections.rb +116 -0
  250. data/spec/zen/package/sections/helper/section.rb +74 -0
  251. data/spec/zen/package/sections/plugin/section_entries.rb +161 -0
  252. data/spec/zen/package/sections/plugin/sections.rb +75 -0
  253. data/spec/zen/package/settings/controller/settings.rb +36 -0
  254. data/spec/zen/package/settings/plugin/settings.rb +33 -0
  255. data/spec/zen/package/users/controller/access_rules.rb +90 -0
  256. data/spec/zen/package/users/controller/user_groups.rb +101 -0
  257. data/spec/zen/package/users/controller/users.rb +130 -0
  258. data/spec/zen/package/users/helper/users.rb +97 -0
  259. data/spec/zen/plugin.rb +64 -0
  260. data/spec/zen/plugin/helper.rb +11 -0
  261. data/spec/zen/plugin/markup.rb +44 -0
  262. data/spec/zen/theme.rb +41 -0
  263. data/spec/zen/validation.rb +63 -0
  264. data/zen.gemspec +36 -0
  265. metadata +159 -113
  266. data/MANIFEST +0 -266
  267. data/lib/zen/bin/app.rb +0 -40
  268. data/lib/zen/ext/string.rb +0 -185
  269. data/lib/zen/helper/common.rb +0 -106
  270. data/lib/zen/package/categories/lib/categories/view/admin/categories/edit.xhtml +0 -7
  271. data/lib/zen/package/categories/lib/categories/view/admin/categories/new.xhtml +0 -7
  272. data/lib/zen/package/categories/lib/categories/view/admin/category-groups/edit.xhtml +0 -7
  273. data/lib/zen/package/categories/lib/categories/view/admin/category-groups/new.xhtml +0 -7
  274. data/lib/zen/package/comments/lib/comments/view/admin/comments/edit.xhtml +0 -7
  275. data/lib/zen/package/custom_fields/lib/custom_fields/view/admin/custom-field-groups/edit.xhtml +0 -7
  276. data/lib/zen/package/custom_fields/lib/custom_fields/view/admin/custom-field-groups/new.xhtml +0 -7
  277. data/lib/zen/package/custom_fields/lib/custom_fields/view/admin/custom-fields/edit.xhtml +0 -7
  278. data/lib/zen/package/custom_fields/lib/custom_fields/view/admin/custom-fields/new.xhtml +0 -7
  279. data/lib/zen/package/menus/lib/menus/view/admin/menu-items/edit.xhtml +0 -7
  280. data/lib/zen/package/menus/lib/menus/view/admin/menu-items/new.xhtml +0 -7
  281. data/lib/zen/package/menus/lib/menus/view/admin/menus/edit.xhtml +0 -7
  282. data/lib/zen/package/menus/lib/menus/view/admin/menus/new.xhtml +0 -7
  283. data/lib/zen/package/sections/lib/sections/view/admin/edit.xhtml +0 -7
  284. data/lib/zen/package/sections/lib/sections/view/admin/new.xhtml +0 -7
  285. data/lib/zen/package/sections/lib/sections/view/admin/section-entries/edit.xhtml +0 -7
  286. data/lib/zen/package/sections/lib/sections/view/admin/section-entries/new.xhtml +0 -7
  287. data/lib/zen/package/users/lib/users/view/admin/access-rules/edit.xhtml +0 -7
  288. data/lib/zen/package/users/lib/users/view/admin/access-rules/new.xhtml +0 -7
  289. data/lib/zen/package/users/lib/users/view/admin/user-groups/edit.xhtml +0 -7
  290. data/lib/zen/package/users/lib/users/view/admin/user-groups/new.xhtml +0 -7
  291. data/lib/zen/package/users/lib/users/view/admin/users/edit.xhtml +0 -7
  292. data/lib/zen/package/users/lib/users/view/admin/users/new.xhtml +0 -7
  293. data/lib/zen/plugin/controller.rb +0 -59
  294. data/lib/zen/public/admin/css/zen/notifications.css +0 -84
  295. data/lib/zen/public/admin/images/zen/icons/large/error.png +0 -0
  296. data/lib/zen/public/admin/images/zen/icons/large/notice.png +0 -0
  297. data/lib/zen/public/admin/images/zen/icons/large/success.png +0 -0
  298. data/lib/zen/public/admin/js/zen/core.js +0 -73
  299. data/lib/zen/public/admin/js/zen/init.js +0 -80
  300. data/proto/package/lib/package.rb +0 -21
  301. data/proto/package/lib/package/controller/controllers.rb +0 -50
  302. data/proto/package/lib/package/language/en/languages.yml +0 -4
  303. data/proto/package/lib/package/model/model.rb +0 -12
@@ -1,6 +1,9 @@
1
- desc 'Runs all the RSpec specifications'
1
+ desc 'Runs all the Bacon specifications'
2
2
  task :test do
3
3
  spec_dir = __DIR__('../../../spec')
4
- sh("cd #{spec_dir}; rake db:delete; rm resources/database.db; rake db:migrate; \
5
- rake db:test_user; rspec zen/all.rb")
4
+ db_path = File.join(spec_dir, 'database.db')
5
+
6
+ File.unlink(db_path) if File.exist?(db_path)
7
+
8
+ sh("cd #{spec_dir}; rake db:migrate; rake db:test_user; ruby zen/all.rb")
6
9
  end
@@ -1,21 +1,14 @@
1
- ##
2
1
  # Task group for managing themes.
3
- #
4
- # @author Yorick Peterse
5
- # @since 0.2.5
6
- #
7
2
  namespace :theme do
8
3
 
9
4
  desc 'Lists all installed themes'
10
5
  task :list do
11
6
  Zen::Theme::Registered.each do |name, pkg|
12
7
  message = <<-MSG
13
- --------------------------
14
- Name: #{name}
15
- Author: #{pkg.author}
16
- Template directory: #{pkg.template_dir}
17
-
8
+ #{name}
9
+ --------------------
18
10
  #{pkg.about}
11
+
19
12
  MSG
20
13
 
21
14
  puts message
@@ -43,7 +36,7 @@ MSG
43
36
 
44
37
  theme = Zen::Theme::Registered[name]
45
38
  table = 'migrations_theme_' + theme.name.to_s
46
-
39
+
47
40
  # Fetch the migrations directory
48
41
  if theme.respond_to?(:migration_dir) and !theme.migration_dir.nil?
49
42
  dir = theme.migration_dir
data/lib/zen/theme.rb CHANGED
@@ -5,23 +5,27 @@ require 'pathname'
5
5
  #:nodoc:
6
6
  module Zen
7
7
  ##
8
- # Themes in many ways are similar to plugins and packages but with a few differences.
9
- # Unlike packages themes aren't able to update the entire Ramaze root, this prevents
10
- # them from loading controllers and other classes unless the developer updates these
11
- # paths manually. However, themes can set the following paths:
8
+ # Themes in many ways are similar to plugins and packages but with a few
9
+ # differences. Unlike packages themes aren't able to update the entire Ramaze
10
+ # root, this prevents them from loading controllers and other classes unless
11
+ # the developer updates these paths manually. However, themes can set the
12
+ # following paths:
12
13
  #
13
- # * template_dir: the directory where all Liquid templates are located, always required.
14
+ # * template_dir: the directory where all Liquid templates are located,
15
+ # always required.
14
16
  # * partial_dir: the directory where all Liquid partials are located.
15
- # * public_dir: the public directory containing assets such as CSS and Javascript files.
16
- # * migration_dir: themes can use migrations to automatically add the required fields to
17
- # the database, this setting should point to the directory where all migrations are
18
- # located.
17
+ # * public_dir: the public directory containing assets such as CSS and
18
+ # Javascript files.
19
+ # * migration_dir: themes can use migrations to automatically add the required
20
+ # fields to the database, this setting should point to the directory where
21
+ # all migrations are located.
19
22
  #
20
23
  # ## Adding Themes
21
24
  #
22
- # Just like plugins and packages a theme can be added by calling Zen::Theme#add and
23
- # passing a block to it. Once a theme has been loaded it will *not* be used until the
24
- # user sets it as the active theme in the settings module.
25
+ # Just like plugins and packages a theme can be added by calling
26
+ # Zen::Theme#add and passing a block to it. Once a theme has been loaded it
27
+ # will *not* be used until the user sets it as the active theme in the
28
+ # settings module.
25
29
  #
26
30
  # Example:
27
31
  #
@@ -35,8 +39,8 @@ module Zen
35
39
  #
36
40
  module Theme
37
41
  ##
38
- # Hash containing all registered themes. The keys are the names of the themes and
39
- # the values instances of Zen::Theme::Base.
42
+ # Hash containing all registered themes. The keys are the names of the
43
+ # themes and the values instances of Zen::Theme::Base.
40
44
  #
41
45
  # @author Yorick Peterse
42
46
  # @since 0.2.5
@@ -44,8 +48,8 @@ module Zen
44
48
  Registered = {}
45
49
 
46
50
  ##
47
- # Adds a new theme to Zen. Note that the theme won't be used unless it has been set
48
- # as the active theme in the settings package.
51
+ # Adds a new theme to Zen. Note that the theme won't be used unless it has
52
+ # been set as the active theme in the settings package.
49
53
  #
50
54
  # @author Yorick Peterse
51
55
  # @since 0.2.4
@@ -83,15 +87,9 @@ module Zen
83
87
  # @return [Zen::Theme::Base]
84
88
  #
85
89
  def self.[](name)
86
- if name.class != Symbol
87
- name = name.to_sym
88
- end
89
-
90
- if Registered.nil?
91
- raise(Zen::ThemeError, "No themes have been added yet.")
92
- end
90
+ name = name.to_sym if name.class != Symbol
93
91
 
94
- if !Registered[name]
92
+ if !Registered.key?(name)
95
93
  raise(Zen::ThemeError, "The theme #{name} doesn't exist.")
96
94
  end
97
95
 
@@ -3,15 +3,15 @@ require __DIR__('error/validation_error')
3
3
  #:nodoc:
4
4
  module Zen
5
5
  ##
6
- # The Validation module is a very basic validation framework that's used by various
7
- # internal modules/classes such as Zen::Plugin and Zen::Package.
6
+ # The Validation module is a very basic validation framework that's used by
7
+ # various internal modules/classes such as Zen::Plugin and Zen::Package.
8
8
  #
9
9
  # ## Usage
10
10
  #
11
- # Using the module is pretty simple. Include it, specify the validation rules in a
12
- # method and call it. All official modules and classes use a method called "validate"
13
- # but you're free to name it whatever you want. A basic example looks like the
14
- # following:
11
+ # Using the module is pretty simple. Include it, specify the validation rules
12
+ # in a method and call it. All official modules and classes use a method
13
+ # called "validate" but you're free to name it whatever you want. A basic
14
+ # example looks like the following:
15
15
  #
16
16
  # class Something
17
17
  # include Zen::Validation
@@ -35,9 +35,10 @@ module Zen
35
35
  #
36
36
  # @author Yorick Peterse
37
37
  # @since 0.2.5
38
- # @param [Array/Symbol/String] attributes Either a single or multiple attributes to
39
- # validate.
40
- # @raise [ValidationError] Raised whenever a attribute is missing or is set to nil.
38
+ # @param [Array/Symbol/String] attributes Either a single or multiple
39
+ # attributes to validate.
40
+ # @raise [ValidationError] Raised whenever a attribute is missing or is
41
+ # set to nil.
41
42
  #
42
43
  def validates_presence(attributes)
43
44
  if attributes.class != Array
@@ -52,8 +53,8 @@ module Zen
52
53
  end
53
54
 
54
55
  ##
55
- # Checks if the length of a string matches the given length. You can specify a minimum
56
- # length, a maximum one as well as both.
56
+ # Checks if the length of a string matches the given length. You can specify
57
+ # a minimum length, a maximum one as well as both.
57
58
  #
58
59
  # @example
59
60
  # validates_length(:foobar, :min => 5, :max => 10)
@@ -61,12 +62,12 @@ module Zen
61
62
  # @author Yorick Peterse
62
63
  # @since 0.2.5
63
64
  # @param [String/Symbol] attribute The attribute to validate.
64
- # @param [Hash] options Hash containing the options to use for determining how long
65
- # the attribute's value should be.
65
+ # @param [Hash] options Hash containing the options to use for determining
66
+ # how long the attribute's value should be.
66
67
  # @option options [Fixnum] :min The minimum length of the attribute's value.
67
68
  # @option options [Fixnum] :max The maximum length of the value.
68
- # @raise [ValidationError] Raised then the value of the attribute isn't long or short
69
- # enough.
69
+ # @raise [ValidationError] Raised then the value of the attribute isn't
70
+ # long or short enough.
70
71
  #
71
72
  def validates_length(attribute, options)
72
73
  value = send(attribute)
@@ -74,8 +75,8 @@ module Zen
74
75
  if !value.respond_to?(:length)
75
76
  raise(
76
77
  ValidationError,
77
- "The length of \"#{attribute}\" can't be checked as the method \"length\" " +
78
- "doesn't exist."
78
+ "The length of \"#{attribute}\" can't be checked as the method " + \
79
+ "\"length\" doesn't exist."
79
80
  )
80
81
  end
81
82
 
@@ -93,8 +94,8 @@ module Zen
93
94
 
94
95
  ##
95
96
  # Checks if the given attributes match the specified regular expressions.
96
- # When a hash is specified the keys should be the names of the attributes to validate
97
- # and the values the regular expressions to use.
97
+ # When a hash is specified the keys should be the names of the attributes to
98
+ # validate and the values the regular expressions to use.
98
99
  #
99
100
  # @example
100
101
  # validates_format(:name, /[\w\-]+/)
@@ -102,12 +103,12 @@ module Zen
102
103
  #
103
104
  # @author Yorick Peterse
104
105
  # @since 0.2.5
105
- # @param [Hash/Symbol] attribute The name of the attribute to validate or a hash
106
- # containing all the attributes and their regular expressions.
107
- # @param [Regexp] regexp The regular expression to use when validating a single
108
- # attribute.
109
- # @raise [ValidationError] Raised when one of the attributes doesn't matches the
110
- # regular expression.
106
+ # @param [Hash/Symbol] attribute The name of the attribute to validate or
107
+ # a hash containing all the attributes and their regular expressions.
108
+ # @param [Regexp] regexp The regular expression to use when validating a
109
+ # single attribute.
110
+ # @raise [ValidationError] Raised when one of the attributes doesn't matches
111
+ # the regular expression.
111
112
  #
112
113
  def validates_format(attribute, regexp = nil)
113
114
  if attribute.class != Hash
@@ -120,7 +121,10 @@ module Zen
120
121
  match = val =~ regexp
121
122
 
122
123
  if !match
123
- raise(ValidationError, "The attribute \"#{attr}\" doesn't match #{regexp}.")
124
+ raise(
125
+ ValidationError,
126
+ "The attribute \"#{attr}\" doesn't match #{regexp}"
127
+ )
124
128
  end
125
129
  end
126
130
  end
@@ -140,7 +144,10 @@ module Zen
140
144
  path = send(attribute)
141
145
 
142
146
  if !File.exist?(path)
143
- raise(ValidationError, "The path #{path} in \"#{attribute}\" doesn't exist.")
147
+ raise(
148
+ ValidationError,
149
+ "The path #{path} in \"#{attribute}\" doesn't exist."
150
+ )
144
151
  end
145
152
  end
146
153
  end # Validation
data/lib/zen/version.rb CHANGED
@@ -1,11 +1,5 @@
1
1
  #:nodoc:
2
2
  module Zen
3
- ##
4
- # Defines the current version of Zen as a string. This constant is used to set the Gem
5
- # version when generating a new Rubygems package.
6
- #
7
- # @author Yorick Peterse
8
- # @since 0.1
9
- #
10
- Version = '0.2.7'
3
+ # :nodoc:
4
+ Version = '0.2.8'
11
5
  end
@@ -0,0 +1,7 @@
1
+ <meta charset="utf-8" />
2
+
3
+ <link rel="shortcut icon" href="/admin/favicon.ico" />
4
+
5
+ #{Zen::Asset.build(:stylesheet)}
6
+
7
+ <title>#{@page_title}</title>
@@ -1,9 +1,5 @@
1
1
  #{display_messages}
2
2
 
3
- <!--
4
- Main area of the admin panel. The content stretches across the entire screen and there
5
- are no silly sidebars.
6
- -->
7
3
  <div id="container" class="container">
8
4
  <div id="content" class="grid_12">
9
5
  #{@content}
@@ -12,23 +8,12 @@ are no silly sidebars.
12
8
 
13
9
  <footer id="main_footer" class="container">
14
10
  <div class="grid_12">
15
- <p>#{lang('zen_general.labels.zen_version') % Zen::Version}</p>
16
- <ul class="clearfix">
17
- <li>
18
- <a href="http://zen-cms.com/">
19
- #{lang('zen_general.labels.zen_website')}
20
- </a>
21
- </li>
22
- <li>
23
- <a href="http://zen-cms.com/userguide">
24
- #{lang('zen_general.labels.zen_docs')}
25
- </a>
26
- </li>
27
- <li>
28
- <a href="https://github.com/zen-cms/">
29
- #{lang('zen_general.labels.zen_github')}
30
- </a>
31
- </li>
32
- </ul>
11
+ <p>
12
+ #{lang('zen_general.labels.powered_by')}
13
+
14
+ <a href="http://zen-cms.com/">
15
+ Zen #{Zen::Version}
16
+ </a>
17
+ </p>
33
18
  </div>
34
19
  </footer>
File without changes
data/proto/app/app.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'zen'
2
+ require 'ramaze/log/rotatinginformer'
2
3
 
3
4
  # Load the configuration files
4
5
  require __DIR__('config/config')
@@ -1,5 +1,6 @@
1
- # Specify the root directory. This is required since there are multiple directories
2
- # to load resources from. This directory will be used for the database logger, modes, etc.
1
+ # Specify the root directory. This is required since there are multiple
2
+ # directories to load resources from. This directory will be used for the
3
+ # database logger, modes, etc.
3
4
  Zen.root = __DIR__('../')
4
5
 
5
6
  # Set the application's mode. Available modes are "dev" and "live"
@@ -8,8 +9,8 @@ Ramaze.options.mode = :dev
8
9
  # The session identifier to use for cookies.
9
10
  Ramaze.options.session.key = 'zen.sid'
10
11
 
11
- # Cache settings. These are turned off for the development server to make it easier
12
- # to debug potential errors.
12
+ # Cache settings. These are turned off for the development server to make it
13
+ # easier to debug potential errors.
13
14
  Ramaze::View.options.cache = false
14
15
  Ramaze::View.options.read_cache = false
15
16
 
@@ -1,14 +1,11 @@
1
- ##
2
- # Database group to use for developing the website.
3
- #
4
- # IMPORTANT: it's recommended to create a separate database user for your Zen application
5
- # and prevent it from being able to access other databases. Zen is new and may allow
6
- # hackers to exploit the system.
1
+ # It's recommended to create a separate database user for your Zen application
2
+ # and prevent it from being able to access other databases. Zen is new and may
3
+ # allow hackers to exploit the system.
7
4
  #
8
5
  # The following items can be set:
9
6
  #
10
- # * adapter: the adapter to use. When using MySQL it's best to use the mysql2 gem as it's
11
- # a lot faster than the mysql gem.
7
+ # * adapter: the adapter to use. When using MySQL it's best to use the mysql2
8
+ # gem as it's a lot faster than the mysql gem.
12
9
  # * host: the hostname where the database is located.
13
10
  # * username: the username to use for connecting to the database.
14
11
  # * password: the password to use for connecting to the database.
@@ -17,42 +14,23 @@
17
14
  # * encoding: the encoding type to use.
18
15
  # * logger: the logger used for logging queries and such.
19
16
  #
20
- # Fore more information see the Sequel documentation:
17
+ # Fore more information see the Sequel documentation:
21
18
  # http://sequel.rubyforge.org/rdoc/files/doc/opening_databases_rdoc.html
22
- #
23
- # Sets the connection for the development mode
24
- if Ramaze.options.mode === :dev
25
- Zen.database = Sequel.connect(
26
- :adapter => '',
27
- :host => 'localhost',
28
- :username => '',
29
- :password => '',
30
- :database => '',
31
- :test => true,
32
- :encoding => 'utf8',
33
- :logger => Ramaze::Logger::RotatingInformer.new(
34
- __DIR__("../log/database/dev"), '%d-%m-%Y.log'
35
- )
19
+ Zen.database = Sequel.connect(
20
+ :adapter => '',
21
+ :host => 'localhost',
22
+ :username => '',
23
+ :password => '',
24
+ :database => '',
25
+ :test => true,
26
+ :encoding => 'utf8',
27
+ :logger => Ramaze::Logger::RotatingInformer.new(
28
+ __DIR__("../log/database/dev"), '%d-%m-%Y.log'
36
29
  )
30
+ )
37
31
 
38
- # Does the same but for the live mode
39
- elsif Ramaze.options.mode === :live
40
- Zen.database = Sequel.connect(
41
- :adapter => 'mysql2',
42
- :host => '',
43
- :username => '',
44
- :password => '',
45
- :database => '',
46
- :test => true,
47
- :encoding => 'utf8',
48
- :logger => Ramaze::Logger::RotatingInformer.new(
49
- __DIR__("../log/database/live"), '%d-%m-%Y.log'
50
- )
51
- )
52
- end
53
-
54
- # IMPORTANT, when running MySQL the engine should be set to InnoDB in order for foreign
55
- # keys to work properly.
32
+ # IMPORTANT, when running MySQL the engine should be set to InnoDB in order for
33
+ # foreign keys to work properly.
56
34
  if Zen.database.adapter_scheme.to_s.include?('mysql')
57
35
  Sequel::MySQL.default_engine = 'InnoDB'
58
36
  end
@@ -1,48 +1,51 @@
1
- # All Rack middlewares should go in a block like the one below. Different combinations
2
- # can be used for different versions by setting the first argument of the middleware!
3
- # method to a symbol containing the name of the environment (e.g. :live).
1
+ # All Rack middlewares should go in a block like the one below. Different
2
+ # combinations can be used for different versions by setting the first argument
3
+ # of the middleware! method to a symbol containing the name of the environment
4
+ # (e.g. :live).
4
5
  #
5
- # For development purposes we'll be loading various middlewares to make it easier to
6
- # detect errors, reloading the code and so on.
6
+ # For development purposes we'll be loading various middlewares to make it
7
+ # easier to detect errors, reloading the code and so on.
7
8
  #
8
9
  Ramaze.middleware! :dev do |m|
9
10
  # Rack::Lint is used to validate all code according to the Rack specification.
10
- # It's not recommended to use this middleware in a production environment as it will
11
- # slow your application down a bit.
11
+ # It's not recommended to use this middleware in a production environment as
12
+ # it will slow your application down a bit.
12
13
  m.use Rack::Lint
13
14
 
14
- # Shows an error page whenever an exception was raised. It's not recommended to use
15
- # this middleware on a production server as it may reveal sensitive details to the
16
- # visitor.
15
+ # Shows an error page whenever an exception was raised. It's not recommended
16
+ # to use this middleware on a production server as it may reveal sensitive
17
+ # details to the visitor.
17
18
  m.use Rack::ShowExceptions
18
19
 
19
20
  # Pretty much the same as Rack::ShowExceptions.
20
21
  m.use Rack::ShowStatus
21
-
22
- # Routes exceptions to different actions, can be useful for catching 404's and such.
22
+
23
+ # Routes exceptions to different actions, can be useful for catching 404's and
24
+ # such.
23
25
  # m.use Rack::RouteExceptions
24
-
25
- # Middleware that enables conditional GET using If-None-Match and If-Modified-Since.
26
- # Currently Zen doesn't respond to conditional GET requests so it's fairly useless
27
- # out of the box, it can be useful for custom extensions and such.
26
+
27
+ # Middleware that enables conditional GET using If-None-Match and
28
+ # If-Modified-Since. Currently Zen doesn't respond to conditional GET
29
+ # requests so it's fairly useless out of the box, it can be useful for custom
30
+ # extensions and such.
28
31
  # m.use Rack::ConditionalGet
29
-
30
- # Automatically sets the ETag header on all string bodies. Etags can be useful for
31
- # checking if a certain page has been modified or not.
32
+
33
+ # Automatically sets the ETag header on all string bodies. Etags can be useful
34
+ # for checking if a certain page has been modified or not.
32
35
  #
33
- # IMPORTANT: Prior to Rack 1.2.2 Rack::ETag required the second argument of use() to
34
- # be set to 'public'. Newer versions no longer require this.
36
+ # IMPORTANT: Prior to Rack 1.2.2 Rack::ETag required the second argument of
37
+ # use() to be set to 'public'. Newer versions no longer require this.
35
38
  m.use Rack::ETag
36
-
37
- # Allows HEAD requests. HEAD requests are identical to GET requests but shouldn't
38
- # return the body.
39
+
40
+ # Allows HEAD requests. HEAD requests are identical to GET requests but
41
+ # shouldn't return the body.
39
42
  m.use Rack::Head
40
-
41
- # Automatically reloads your application whenever it detects changes. Note that this
42
- # middleware isn't always as accurate so there may be times when you have to manually
43
- # restart your server.
43
+
44
+ # Automatically reloads your application whenever it detects changes. Note
45
+ # that this middleware isn't always as accurate so there may be times when you
46
+ # have to manually restart your server.
44
47
  m.use Ramaze::Reloader
45
-
48
+
46
49
  # Runs Ramaze based on all mappings and such.
47
50
  m.run Ramaze::AppMap
48
51
  end