zen 0.2.7 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -2,21 +2,20 @@
2
2
  <header>
3
3
  <h1>#{get_breadcrumbs}</h1>
4
4
  </header>
5
-
6
- <form method="post" action="#{@form_delete_url}">
5
+
6
+ <form method="post" action="#{Users::Controller::AccessRules.r(:delete)}">
7
7
  <input type="hidden" name="csrf_token" value="#{get_csrf_token}" />
8
-
9
- <?r if @access_rules and !@access_rules.empty? ?>
10
-
11
- <table class="table">
8
+
9
+ <?r if !@access_rules.empty? ?>
10
+ <table>
12
11
  <thead>
13
12
  <tr>
14
13
  <?r if user_authorized?([:delete]) ?>
15
- <th>
14
+ <th class="no_sort">
16
15
  <input type="checkbox" />
17
16
  </th>
18
17
  <?r end ?>
19
-
18
+
20
19
  <th>#{lang('access_rules.labels.id')}</th>
21
20
  <th>#{lang('access_rules.labels.package')}</th>
22
21
  <th>#{lang('access_rules.labels.controller')}</th>
@@ -33,28 +32,32 @@
33
32
  <tr>
34
33
  <?r if user_authorized?([:delete]) ?>
35
34
  <td>
36
- <input type="checkbox" name="access_rule_ids[]" value="#{rule.id}" />
35
+ <input type="checkbox" name="access_rule_ids[]"
36
+ value="#{rule.id}" />
37
37
  </td>
38
38
  <?r end ?>
39
-
39
+
40
40
  <td>#{rule.id}</td>
41
41
  <td>#{rule.package}</td>
42
42
 
43
- <?r if user_authorized?([:update]) ?>
44
43
  <td>
45
- #{anchor_to(
46
- @form_controllers[rule.package].key(rule.controller),
47
- Users::Controller::AccessRules.r(:edit, rule.id)
48
- )}
44
+ #{
45
+ if user_authorized?([:update])
46
+ Users::Controller::AccessRules.a(
47
+ @form_controllers[rule.package].key(rule.controller),
48
+ :edit,
49
+ rule.id
50
+ )
51
+ else
52
+ @form_controllers[rule.package].key(rule.controller)
53
+ end
54
+ }
49
55
  </td>
50
- <?r else ?>
51
- <td>#{@form_controllers[rule.package].key(rule.controller)}</td>
52
- <?r end ?>
53
-
54
- <td>#{@boolean_hash.invert[rule.create_access]}</td>
55
- <td>#{@boolean_hash.invert[rule.read_access]}</td>
56
- <td>#{@boolean_hash.invert[rule.update_access]}</td>
57
- <td>#{@boolean_hash.invert[rule.delete_access]}</td>
56
+
57
+ <td>#{@boolean_hash[rule.create_access]}</td>
58
+ <td>#{@boolean_hash[rule.read_access]}</td>
59
+ <td>#{@boolean_hash[rule.update_access]}</td>
60
+ <td>#{@boolean_hash[rule.delete_access]}</td>
58
61
  <td>
59
62
  <?r if !rule.user_id.nil? ?>
60
63
  #{rule.user.name}
@@ -69,27 +72,31 @@
69
72
  <?r end ?>
70
73
  </tbody>
71
74
  </table>
72
-
75
+
76
+ #{
77
+ if @access_rules.respond_to?(:navigation) \
78
+ and @access_rules.page_count > 1
79
+ @access_rules.navigation
80
+ end
81
+ }
82
+
73
83
  <?r else ?>
74
84
  <p>#{lang('access_rules.messages.no_rules')}</p>
75
85
  <?r end ?>
76
-
77
- <div class="clearfix">
78
-
79
- <?r if user_authorized?([:create]) ?>
80
- <div class="button">
81
- #{anchor_to(
82
- lang('access_rules.buttons.new'),
83
- Users::Controller::AccessRules.r(:new)
84
- )}
85
- </div>
86
- <?r end ?>
87
-
88
- <?r if user_authorized?([:delete]) and @access_rules and !@access_rules.empty? ?>
89
- <div class="button">
90
- <input type="submit" value="#{lang('access_rules.buttons.delete')}" />
91
- </div>
92
- <?r end ?>
86
+
87
+ <?r if user_authorized?([:create]) ?>
88
+ <div class="button">
89
+ #{Users::Controller::AccessRules.a(
90
+ lang('access_rules.buttons.new'), :new
91
+ )}
92
+ </div>
93
+ <?r end ?>
94
+
95
+ <?r if user_authorized?([:delete]) and !@access_rules.empty? ?>
96
+ <div class="button">
97
+ <input type="submit"
98
+ value="#{lang('access_rules.buttons.delete')}" />
93
99
  </div>
100
+ <?r end ?>
94
101
  </form>
95
102
  </article>
@@ -1,37 +1,47 @@
1
- #{
2
- form_for(
3
- @user_group, :method => :post, :action => @form_save_url, :id => :user_group_form
4
- ) do |f|
5
- f.input_hidden(:id, @user_group.id)
6
- f.input_hidden(:csrf_token, get_csrf_token)
7
-
8
- f.input_text(
9
- lang('user_groups.labels.name'),
10
- :name
11
- )
1
+ <article>
2
+ <header>
3
+ <h1>#{get_breadcrumbs}</h1>
4
+ </header>
12
5
 
13
- f.input_text(
14
- lang('user_groups.labels.slug'),
15
- :slug
16
- )
6
+ #{
7
+ form_for(
8
+ @user_group,
9
+ :method => :post,
10
+ :action => Users::Controller::UserGroups.r(:save),
11
+ :id => :user_group_form
12
+ ) do |f|
13
+ f.input_hidden(:id, @user_group.id)
14
+ f.input_hidden(:csrf_token, get_csrf_token)
15
+
16
+ f.input_text(
17
+ lang('user_groups.labels.name'),
18
+ :name
19
+ )
20
+
21
+ f.input_text(
22
+ lang('user_groups.labels.slug'),
23
+ :slug
24
+ )
25
+
26
+ f.input_radio(
27
+ lang('user_groups.labels.super_group'),
28
+ :super_group,
29
+ @user_group.super_group,
30
+ :values => @boolean_hash.invert
31
+ )
32
+
33
+ f.textarea(
34
+ lang('user_groups.labels.description'),
35
+ :description,
36
+ :rows => 10
37
+ )
17
38
 
18
- f.input_radio(
19
- lang('user_groups.labels.super_group'),
20
- :super_group,
21
- @user_group.super_group,
22
- :values => @boolean_hash,
23
- )
24
-
25
- f.textarea(
26
- lang('user_groups.labels.description'),
27
- :description,
28
- :rows => 10
29
- )
30
-
31
- f.g.div(:class => 'clearfix') do
32
39
  f.g.div(:class => 'button') do
33
- f.g.input(:type => 'submit', :value => lang('user_groups.buttons.save'))
40
+ f.g.input(
41
+ :type => 'submit',
42
+ :value => lang('user_groups.buttons.save')
43
+ )
34
44
  end
35
45
  end
36
- end
37
- }
46
+ }
47
+ </article>
@@ -2,21 +2,20 @@
2
2
  <header>
3
3
  <h1>#{get_breadcrumbs}</h1>
4
4
  </header>
5
-
6
- <form method="post" action="#{@form_delete_url}">
5
+
6
+ <form method="post" action="#{Users::Controller::UserGroups.r(:delete)}">
7
7
  <input type="hidden" name="csrf_token" value="#{get_csrf_token}" />
8
-
9
- <?r if @user_groups and !@user_groups.empty? ?>
10
-
11
- <table class="table">
8
+
9
+ <?r if !@user_groups.empty? ?>
10
+ <table>
12
11
  <thead>
13
12
  <tr>
14
13
  <?r if user_authorized?([:delete]) ?>
15
- <th>
14
+ <th class="no_sort">
16
15
  <input type="checkbox" />
17
16
  </th>
18
17
  <?r end ?>
19
-
18
+
20
19
  <th>#{lang('user_groups.labels.id')}</th>
21
20
  <th>#{lang('user_groups.labels.name')}</th>
22
21
  <th>#{lang('user_groups.labels.slug')}</th>
@@ -28,49 +27,55 @@
28
27
  <tr>
29
28
  <?r if user_authorized?([:delete]) ?>
30
29
  <td>
31
- <input type="checkbox" name="user_group_ids[]" value="#{group.id}" />
30
+ <input type="checkbox" name="user_group_ids[]"
31
+ value="#{group.id}" />
32
32
  </td>
33
33
  <?r end ?>
34
-
34
+
35
35
  <td>#{group.id}</td>
36
-
37
- <?r if user_authorized?([:update]) ?>
38
36
  <td>
39
- #{anchor_to(
40
- group.name, Users::Controller::UserGroups.r(:edit, group.id)
41
- )}
37
+ #{
38
+ if user_authorized?([:update])
39
+ Users::Controller::UserGroups.a(
40
+ group.name, :edit, group.id
41
+ )
42
+ else
43
+ group.name
44
+ end
45
+ }
42
46
  </td>
43
- <?r else ?>
44
- <td>#{group.name}</td>
45
- <?r end ?>
46
-
47
47
  <td>#{group.slug}</td>
48
- <td>#{@boolean_hash.invert[group.super_group]}</td>
48
+ <td>#{@boolean_hash[group.super_group]}</td>
49
49
  </tr>
50
50
  <?r end ?>
51
51
  </tbody>
52
52
  </table>
53
-
53
+
54
+ #{
55
+ if @user_groups.respond_to?(:navigation) \
56
+ and @user_groups.page_count > 1
57
+ @user_groups.navigation
58
+ end
59
+ }
60
+
54
61
  <?r else ?>
55
62
  <p>#{lang('user_groups.messages.no_groups')}</p>
56
63
  <?r end ?>
57
-
58
- <div class="clearfix">
59
-
60
- <?r if user_authorized?([:create]) ?>
61
- <div class="button">
62
- #{anchor_to(
63
- lang('user_groups.buttons.new'),
64
- Users::Controller::UserGroups.r(:new)
65
- )}
66
- </div>
67
- <?r end ?>
68
-
69
- <?r if user_authorized?([:delete]) and @user_groups and !@user_groups.empty? ?>
70
- <div class="button">
71
- <input type="submit" value="#{lang('user_groups.buttons.delete')}" />
72
- </div>
73
- <?r end ?>
64
+
65
+ <?r if user_authorized?([:create]) ?>
66
+ <div class="button">
67
+ #{Users::Controller::UserGroups.a(
68
+ lang('user_groups.buttons.new'),
69
+ :new
70
+ )}
71
+ </div>
72
+ <?r end ?>
73
+
74
+ <?r if user_authorized?([:delete]) and !@user_groups.empty? ?>
75
+ <div class="button">
76
+ <input type="submit"
77
+ value="#{lang('user_groups.buttons.delete')}" />
74
78
  </div>
79
+ <?r end ?>
75
80
  </form>
76
81
  </article>
@@ -1,78 +1,87 @@
1
- #{
2
- form_for(@user, :method => :post, :action => @form_save_url, :id => :user_form) do |f|
3
- f.input_hidden(:csrf_token, get_csrf_token)
4
- f.input_hidden(:id, @user.id)
5
-
6
- f.input_text(
7
- lang('users.labels.name'),
8
- :name
9
- )
1
+ <article>
2
+ <header>
3
+ <h1>#{get_breadcrumbs}</h1>
4
+ </header>
10
5
 
11
- f.input_text(
12
- lang('users.labels.email'),
13
- :email
14
- )
6
+ #{
7
+ form_for(
8
+ @user,
9
+ :method => :post,
10
+ :action => Users::Controller::Users.r(:save),
11
+ :id => :user_form
12
+ ) do |f|
13
+ f.input_hidden(:csrf_token, get_csrf_token)
14
+ f.input_hidden(:id, @user.id)
15
15
 
16
- f.input_text(
17
- lang('users.labels.website'),
18
- :website
19
- )
20
-
21
- f.input_password(
22
- lang('users.labels.new_password'),
23
- :new_password
24
- )
16
+ f.input_text(
17
+ lang('users.labels.name'),
18
+ :name
19
+ )
25
20
 
26
- f.input_password(
27
- lang('users.labels.confirm_password'),
28
- :confirm_password
29
- )
30
-
31
- f.select(
32
- lang('users.labels.status'),
33
- :status,
34
- :values => @status_hash,
35
- :selected => @user.status,
36
- :size => 1
37
- )
38
-
39
- f.select(
40
- lang('users.labels.user_groups'),
41
- :user_group_pks,
42
- :values => @user_group_pks,
43
- :selected => @user.user_group_pks,
44
- :multiple => :multiple,
45
- :size => 1
46
- )
21
+ f.input_text(
22
+ lang('users.labels.email'),
23
+ :email
24
+ )
47
25
 
48
- f.select(
49
- lang('users.labels.language'),
50
- :language,
51
- :values => ::Zen::Language::Languages,
52
- :selected => @user.language,
53
- :size => 1
54
- )
26
+ f.input_text(
27
+ lang('users.labels.website'),
28
+ :website
29
+ )
55
30
 
56
- f.select(
57
- lang('users.labels.frontend_language'),
58
- :frontend_language,
59
- :values => ::Zen::Language::Languages,
60
- :selected => @user.frontend_language,
61
- :size => 1
62
- )
31
+ f.input_password(
32
+ lang('users.labels.new_password'),
33
+ :new_password
34
+ )
63
35
 
64
- f.select(
65
- lang('users.labels.date_format'),
66
- :date_format,
67
- :values => plugin(:settings, :get, 'date_format').values,
68
- :selected => @user.date_format,
69
- :size => 1
70
- )
36
+ f.input_password(
37
+ lang('users.labels.confirm_password'),
38
+ :confirm_password
39
+ )
40
+
41
+ f.select(
42
+ lang('users.labels.status'),
43
+ :status,
44
+ :values => @status_hash,
45
+ :selected => @user.status,
46
+ :size => 1
47
+ )
48
+
49
+ f.select(
50
+ lang('users.labels.user_groups'),
51
+ :user_group_pks,
52
+ :values => @user_group_pks,
53
+ :selected => @user.user_group_pks,
54
+ :multiple => :multiple,
55
+ :size => 1
56
+ )
57
+
58
+ f.select(
59
+ lang('users.labels.language'),
60
+ :language,
61
+ :values => ::Zen::Language::Languages,
62
+ :selected => @user.language,
63
+ :size => 1
64
+ )
65
+
66
+ f.select(
67
+ lang('users.labels.frontend_language'),
68
+ :frontend_language,
69
+ :values => ::Zen::Language::Languages,
70
+ :selected => @user.frontend_language,
71
+ :size => 1
72
+ )
73
+
74
+ f.select(
75
+ lang('users.labels.date_format'),
76
+ :date_format,
77
+ :values => plugin(:settings, :get, 'date_format').values,
78
+ :selected => @user.date_format,
79
+ :size => 1
80
+ )
71
81
 
72
- f.g.div(:class => 'clearfix') do
73
82
  f.g.div(:class => 'button') do
74
83
  f.g.input(:type => 'submit', :value => lang('users.buttons.save'))
75
84
  end
76
85
  end
77
- end
78
- }
86
+ }
87
+ </article>