zen 0.2.4.1 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (189) hide show
  1. data/MANIFEST +42 -33
  2. data/README.md +14 -27
  3. data/ROADMAP.md +20 -2
  4. data/{Thorfile → Rakefile} +2 -3
  5. data/bin/zen +27 -5
  6. data/lib/zen.rb +70 -52
  7. data/lib/zen/asset.rb +258 -0
  8. data/lib/zen/bin/app.rb +42 -0
  9. data/lib/zen/controller/admin_controller.rb +53 -36
  10. data/lib/zen/controller/base_controller.rb +13 -8
  11. data/lib/zen/controller/frontend_controller.rb +4 -3
  12. data/lib/zen/controller/main_controller.rb +17 -33
  13. data/lib/zen/error/validation_error.rb +10 -0
  14. data/lib/zen/ext/string.rb +185 -0
  15. data/lib/zen/helper/acl.rb +120 -92
  16. data/lib/zen/helper/common.rb +1 -3
  17. data/lib/zen/helper/theme.rb +73 -0
  18. data/lib/zen/language.rb +66 -57
  19. data/lib/zen/layout/admin.xhtml +5 -48
  20. data/lib/zen/layout/login.xhtml +4 -44
  21. data/lib/zen/model/methods.rb +1 -1
  22. data/lib/zen/model/settings.rb +0 -3
  23. data/lib/zen/package.rb +101 -83
  24. data/lib/zen/package/base.rb +62 -0
  25. data/lib/zen/package/categories/lib/categories.rb +29 -10
  26. data/lib/zen/package/categories/lib/categories/controller/categories.rb +4 -5
  27. data/lib/zen/package/categories/lib/categories/controller/category_groups.rb +4 -5
  28. data/lib/zen/package/categories/lib/categories/language/en/category_groups.yml +4 -3
  29. data/lib/zen/package/categories/lib/categories/model/category.rb +2 -2
  30. data/lib/zen/package/categories/lib/categories/model/category_group.rb +3 -3
  31. data/lib/zen/package/categories/lib/categories/plugin/categories.rb +130 -0
  32. data/lib/zen/package/categories/lib/categories/view/admin/categories/form.xhtml +1 -1
  33. data/lib/zen/package/categories/lib/categories/view/admin/categories/index.xhtml +2 -2
  34. data/lib/zen/package/categories/lib/categories/view/admin/category-groups/index.xhtml +11 -6
  35. data/lib/zen/package/comments/lib/comments.rb +23 -13
  36. data/lib/zen/package/comments/lib/comments/controller/comments.rb +4 -5
  37. data/lib/zen/package/comments/lib/comments/controller/comments_form.rb +7 -8
  38. data/lib/zen/package/comments/lib/comments/model/comment.rb +4 -4
  39. data/lib/zen/package/comments/lib/comments/plugin/comments.rb +111 -0
  40. data/lib/zen/package/comments/lib/comments/view/admin/comments/form.xhtml +2 -2
  41. data/lib/zen/package/comments/lib/comments/view/admin/comments/index.xhtml +3 -3
  42. data/lib/zen/package/custom_fields/lib/custom_fields.rb +18 -11
  43. data/lib/zen/package/custom_fields/lib/custom_fields/controller/custom_field_groups.rb +4 -5
  44. data/lib/zen/package/custom_fields/lib/custom_fields/controller/custom_fields.rb +4 -5
  45. data/lib/zen/package/custom_fields/lib/custom_fields/model/custom_field.rb +2 -2
  46. data/lib/zen/package/custom_fields/lib/custom_fields/model/custom_field_group.rb +3 -3
  47. data/lib/zen/package/custom_fields/lib/custom_fields/model/custom_field_value.rb +3 -3
  48. data/lib/zen/package/custom_fields/lib/custom_fields/view/admin/custom-field-groups/index.xhtml +9 -5
  49. data/lib/zen/package/custom_fields/lib/custom_fields/view/admin/custom-fields/form.xhtml +1 -1
  50. data/lib/zen/package/custom_fields/lib/custom_fields/view/admin/custom-fields/index.xhtml +3 -3
  51. data/lib/zen/package/menus/lib/menus.rb +25 -43
  52. data/lib/zen/package/menus/lib/menus/controller/menu_items.rb +5 -6
  53. data/lib/zen/package/menus/lib/menus/controller/menus.rb +9 -5
  54. data/lib/zen/package/menus/lib/menus/helper/menu_item.rb +4 -4
  55. data/lib/zen/package/menus/lib/menus/model/menu.rb +2 -2
  56. data/lib/zen/package/menus/lib/menus/model/menu_item.rb +4 -1
  57. data/lib/zen/package/menus/lib/menus/plugin/menus.rb +152 -0
  58. data/lib/zen/package/menus/lib/menus/view/admin/menu-items/form.xhtml +1 -1
  59. data/lib/zen/package/menus/lib/menus/view/admin/menu-items/index.xhtml +3 -3
  60. data/lib/zen/package/menus/lib/menus/view/admin/menus/index.xhtml +7 -7
  61. data/lib/zen/package/sections/lib/sections.rb +32 -16
  62. data/lib/zen/package/sections/lib/sections/controller/section_entries.rb +9 -18
  63. data/lib/zen/package/sections/lib/sections/controller/sections.rb +8 -9
  64. data/lib/zen/package/sections/lib/sections/language/en/section_entries.yml +1 -1
  65. data/lib/zen/package/sections/lib/sections/model/section.rb +4 -4
  66. data/lib/zen/package/sections/lib/sections/model/section_entry.rb +9 -10
  67. data/lib/zen/package/sections/lib/sections/plugin/section_entries.rb +224 -0
  68. data/lib/zen/package/sections/lib/sections/plugin/sections.rb +85 -0
  69. data/lib/zen/package/sections/lib/sections/view/admin/form.xhtml +1 -1
  70. data/lib/zen/package/sections/lib/sections/view/admin/index.xhtml +9 -5
  71. data/lib/zen/package/sections/lib/sections/view/admin/section-entries/index.xhtml +2 -2
  72. data/lib/zen/package/settings/lib/settings.rb +145 -10
  73. data/lib/zen/package/settings/lib/settings/controller/settings.rb +28 -24
  74. data/lib/zen/package/settings/lib/settings/language/en/settings.yml +10 -0
  75. data/lib/zen/package/settings/lib/settings/model/setting.rb +3 -64
  76. data/lib/zen/package/settings/lib/settings/plugin/group_base.rb +40 -0
  77. data/lib/zen/package/settings/lib/settings/plugin/setting_base.rb +76 -0
  78. data/lib/zen/package/settings/lib/settings/plugin/settings.rb +236 -0
  79. data/lib/zen/package/settings/lib/settings/view/admin/settings/index.xhtml +20 -49
  80. data/lib/zen/package/settings/migrations/1295597111_create_schema.rb +0 -12
  81. data/lib/zen/package/settings/migrations/1303196915_settings_plugin.rb +31 -0
  82. data/lib/zen/package/users/lib/users.rb +18 -15
  83. data/lib/zen/package/users/lib/users/controller/access_rules.rb +44 -8
  84. data/lib/zen/package/users/lib/users/controller/user_groups.rb +4 -5
  85. data/lib/zen/package/users/lib/users/controller/users.rb +5 -6
  86. data/lib/zen/package/users/lib/users/language/en/access_rules.yml +11 -9
  87. data/lib/zen/package/users/lib/users/model/access_rule.rb +7 -6
  88. data/lib/zen/package/users/lib/users/model/user.rb +4 -4
  89. data/lib/zen/package/users/lib/users/model/user_group.rb +3 -3
  90. data/lib/zen/package/users/lib/users/public/admin/js/users/access_rules.js +50 -0
  91. data/lib/zen/package/users/lib/users/view/admin/access-rules/form.xhtml +32 -29
  92. data/lib/zen/package/users/lib/users/view/admin/access-rules/index.xhtml +8 -6
  93. data/lib/zen/package/users/lib/users/view/admin/user-groups/index.xhtml +3 -3
  94. data/lib/zen/package/users/lib/users/view/admin/users/index.xhtml +2 -2
  95. data/lib/zen/package/users/migrations/1303510943_class_rules.rb +13 -0
  96. data/lib/zen/plugin.rb +110 -104
  97. data/lib/zen/plugin/base.rb +46 -0
  98. data/lib/zen/{liquid/controller_behavior.rb → plugin/controller.rb} +9 -7
  99. data/lib/zen/plugin/helper.rb +47 -0
  100. data/lib/zen/plugin/markup/lib/markup.rb +14 -0
  101. data/lib/zen/plugin/markup/lib/markup/language/en/markup.yml +6 -0
  102. data/lib/zen/plugin/markup/lib/markup/markup.rb +154 -0
  103. data/lib/zen/public/admin/css/forms.css +4 -0
  104. data/lib/zen/public/admin/css/general.css +15 -15
  105. data/lib/zen/public/admin/css/layout.css +10 -10
  106. data/lib/zen/public/admin/css/reset.css +123 -0
  107. data/lib/zen/public/admin/images/icons/accept.png +0 -0
  108. data/lib/zen/public/admin/images/icons/add.png +0 -0
  109. data/lib/zen/public/admin/images/icons/back.png +0 -0
  110. data/lib/zen/public/admin/images/icons/bold.png +0 -0
  111. data/lib/zen/public/admin/images/icons/close.png +0 -0
  112. data/lib/zen/public/admin/images/icons/delete.png +0 -0
  113. data/lib/zen/public/admin/images/icons/edit.png +0 -0
  114. data/lib/zen/public/admin/images/icons/error.png +0 -0
  115. data/lib/zen/public/admin/images/icons/help.png +0 -0
  116. data/lib/zen/public/admin/images/icons/info.png +0 -0
  117. data/lib/zen/public/admin/images/icons/italic.png +0 -0
  118. data/lib/zen/public/admin/images/icons/large/error.png +0 -0
  119. data/lib/zen/public/admin/images/icons/large/notice.png +0 -0
  120. data/lib/zen/public/admin/images/icons/large/success.png +0 -0
  121. data/lib/zen/public/admin/images/icons/link.png +0 -0
  122. data/lib/zen/public/admin/images/icons/logout.png +0 -0
  123. data/lib/zen/public/admin/images/icons/ol.png +0 -0
  124. data/lib/zen/public/admin/images/icons/pdf.png +0 -0
  125. data/lib/zen/public/admin/images/icons/ul.png +0 -0
  126. data/lib/zen/public/admin/images/icons/user.png +0 -0
  127. data/lib/zen/public/admin/images/icons/view.png +0 -0
  128. data/lib/zen/public/admin/js/mootools/core.js +384 -333
  129. data/lib/zen/public/admin/js/mootools/more.js +256 -231
  130. data/lib/zen/public/admin/js/vendor/{datepicker/Picker.Date.js → datepicker.js} +447 -0
  131. data/lib/zen/public/admin/js/vendor/yepnope.js +1 -0
  132. data/lib/zen/public/admin/js/zen/editor/base.js +8 -1
  133. data/lib/zen/public/admin/js/zen/init.js +89 -26
  134. data/lib/zen/public/favicon.ico +0 -0
  135. data/lib/zen/task.rb +7 -0
  136. data/lib/zen/task/build.rake +60 -0
  137. data/lib/zen/task/clean.rake +27 -0
  138. data/lib/zen/task/db.rake +111 -0
  139. data/lib/zen/task/package.rake +67 -0
  140. data/lib/zen/task/plugin.rake +24 -0
  141. data/lib/zen/task/proto.rake +95 -0
  142. data/lib/zen/task/theme.rake +68 -0
  143. data/lib/zen/theme.rb +28 -55
  144. data/lib/zen/theme/base.rb +64 -0
  145. data/lib/zen/validation.rb +149 -0
  146. data/lib/zen/version.rb +1 -1
  147. data/lib/zen/view/bottom.xhtml +6 -0
  148. data/lib/zen/view/main.xhtml +32 -0
  149. data/proto/app/Rakefile +12 -0
  150. data/proto/app/app.rb +6 -6
  151. data/proto/app/config/config.rb +7 -14
  152. data/proto/app/config/database.rb +0 -20
  153. data/proto/app/start.rb +0 -1
  154. data/proto/app/{vendor/themes → task}/.gitkeep +0 -0
  155. data/proto/app/vendor/theme/.gitkeep +0 -0
  156. data/proto/package/lib/package.rb +8 -17
  157. data/proto/package/lib/package/controller/controllers.rb +4 -4
  158. data/proto/package/lib/package/language/en/languages.yml +3 -3
  159. data/proto/package/lib/package/model/model.rb +1 -1
  160. metadata +73 -73
  161. data/lib/zen/bin/base.rb +0 -109
  162. data/lib/zen/helper/asset.rb +0 -106
  163. data/lib/zen/liquid/general.rb +0 -94
  164. data/lib/zen/liquid/redirect.rb +0 -70
  165. data/lib/zen/liquid/strip.rb +0 -60
  166. data/lib/zen/package/categories/lib/categories/liquid/categories.rb +0 -16
  167. data/lib/zen/package/comments/lib/comments/liquid/comment_form.rb +0 -127
  168. data/lib/zen/package/comments/lib/comments/liquid/comments.rb +0 -115
  169. data/lib/zen/package/menus/lib/menus/liquid/menus.rb +0 -152
  170. data/lib/zen/package/sections/lib/sections/liquid/section_entries.rb +0 -228
  171. data/lib/zen/package/sections/lib/sections/liquid/sections.rb +0 -77
  172. data/lib/zen/package/settings/lib/settings/liquid/setting.rb +0 -58
  173. data/lib/zen/package/users/lib/users/liquid/user.rb +0 -77
  174. data/lib/zen/package/users/lib/users/liquid/users.rb +0 -82
  175. data/lib/zen/plugin/markup.rb +0 -30
  176. data/lib/zen/public/admin/css/boilerplate.css +0 -176
  177. data/lib/zen/public/admin/images/general/noise.jpg +0 -0
  178. data/lib/zen/public/admin/js/vendor/datepicker/Picker.Attach.js +0 -137
  179. data/lib/zen/public/admin/js/vendor/datepicker/Picker.js +0 -291
  180. data/lib/zen/public/admin/js/vendor/datepicker/README.md +0 -325
  181. data/lib/zen/public/admin/js/vendor/datepicker/locale.js +0 -16
  182. data/lib/zen/strict_struct.rb +0 -36
  183. data/lib/zen/task/build.rb +0 -123
  184. data/lib/zen/task/clean.rb +0 -46
  185. data/lib/zen/task/db.rb +0 -130
  186. data/lib/zen/task/package.rb +0 -87
  187. data/lib/zen/task/proto.rb +0 -116
  188. data/lib/zen/task/theme.rb +0 -88
  189. data/proto/app/Thorfile +0 -4
data/MANIFEST CHANGED
@@ -2,9 +2,10 @@ CHANGELOG.md
2
2
  MANIFEST
3
3
  README.md
4
4
  ROADMAP.md
5
- Thorfile
5
+ Rakefile
6
6
  bin/zen
7
- lib/zen/bin/base.rb
7
+ lib/zen/asset.rb
8
+ lib/zen/bin/app.rb
8
9
  lib/zen/controller/admin_controller.rb
9
10
  lib/zen/controller/base_controller.rb
10
11
  lib/zen/controller/frontend_controller.rb
@@ -14,30 +15,29 @@ lib/zen/error/language_error.rb
14
15
  lib/zen/error/package_error.rb
15
16
  lib/zen/error/plugin_error.rb
16
17
  lib/zen/error/theme_error.rb
18
+ lib/zen/error/validation_error.rb
19
+ lib/zen/ext/string.rb
17
20
  lib/zen/helper/acl.rb
18
- lib/zen/helper/asset.rb
19
21
  lib/zen/helper/breadcrumb.rb
20
22
  lib/zen/helper/common.rb
23
+ lib/zen/helper/theme.rb
21
24
  lib/zen/language/en/zen_general.yml
22
25
  lib/zen/language/en/zen_models.yml
23
26
  lib/zen/language.rb
24
27
  lib/zen/layout/admin.xhtml
25
28
  lib/zen/layout/login.xhtml
26
- lib/zen/liquid/controller_behavior.rb
27
- lib/zen/liquid/general.rb
28
- lib/zen/liquid/redirect.rb
29
- lib/zen/liquid/strip.rb
30
29
  lib/zen/logger.rb
31
30
  lib/zen/model/methods.rb
32
31
  lib/zen/model/settings.rb
33
32
  lib/zen/package/all.rb
33
+ lib/zen/package/base.rb
34
34
  lib/zen/package/categories/lib/categories/controller/categories.rb
35
35
  lib/zen/package/categories/lib/categories/controller/category_groups.rb
36
36
  lib/zen/package/categories/lib/categories/language/en/categories.yml
37
37
  lib/zen/package/categories/lib/categories/language/en/category_groups.yml
38
- lib/zen/package/categories/lib/categories/liquid/categories.rb
39
38
  lib/zen/package/categories/lib/categories/model/category.rb
40
39
  lib/zen/package/categories/lib/categories/model/category_group.rb
40
+ lib/zen/package/categories/lib/categories/plugin/categories.rb
41
41
  lib/zen/package/categories/lib/categories/view/admin/categories/edit.xhtml
42
42
  lib/zen/package/categories/lib/categories/view/admin/categories/form.xhtml
43
43
  lib/zen/package/categories/lib/categories/view/admin/categories/index.xhtml
@@ -52,9 +52,8 @@ lib/zen/package/categories/migrations/1295282303_create_schema.rb
52
52
  lib/zen/package/comments/lib/comments/controller/comments.rb
53
53
  lib/zen/package/comments/lib/comments/controller/comments_form.rb
54
54
  lib/zen/package/comments/lib/comments/language/en/comments.yml
55
- lib/zen/package/comments/lib/comments/liquid/comment_form.rb
56
- lib/zen/package/comments/lib/comments/liquid/comments.rb
57
55
  lib/zen/package/comments/lib/comments/model/comment.rb
56
+ lib/zen/package/comments/lib/comments/plugin/comments.rb
58
57
  lib/zen/package/comments/lib/comments/view/admin/comments/edit.xhtml
59
58
  lib/zen/package/comments/lib/comments/view/admin/comments/form.xhtml
60
59
  lib/zen/package/comments/lib/comments/view/admin/comments/index.xhtml
@@ -84,9 +83,9 @@ lib/zen/package/menus/lib/menus/controller/menus.rb
84
83
  lib/zen/package/menus/lib/menus/helper/menu_item.rb
85
84
  lib/zen/package/menus/lib/menus/language/en/menu_items.yml
86
85
  lib/zen/package/menus/lib/menus/language/en/menus.yml
87
- lib/zen/package/menus/lib/menus/liquid/menus.rb
88
86
  lib/zen/package/menus/lib/menus/model/menu.rb
89
87
  lib/zen/package/menus/lib/menus/model/menu_item.rb
88
+ lib/zen/package/menus/lib/menus/plugin/menus.rb
90
89
  lib/zen/package/menus/lib/menus/view/admin/menu-items/edit.xhtml
91
90
  lib/zen/package/menus/lib/menus/view/admin/menu-items/form.xhtml
92
91
  lib/zen/package/menus/lib/menus/view/admin/menu-items/index.xhtml
@@ -102,10 +101,10 @@ lib/zen/package/sections/lib/sections/controller/section_entries.rb
102
101
  lib/zen/package/sections/lib/sections/controller/sections.rb
103
102
  lib/zen/package/sections/lib/sections/language/en/section_entries.yml
104
103
  lib/zen/package/sections/lib/sections/language/en/sections.yml
105
- lib/zen/package/sections/lib/sections/liquid/section_entries.rb
106
- lib/zen/package/sections/lib/sections/liquid/sections.rb
107
104
  lib/zen/package/sections/lib/sections/model/section.rb
108
105
  lib/zen/package/sections/lib/sections/model/section_entry.rb
106
+ lib/zen/package/sections/lib/sections/plugin/section_entries.rb
107
+ lib/zen/package/sections/lib/sections/plugin/sections.rb
109
108
  lib/zen/package/sections/lib/sections/view/admin/edit.xhtml
110
109
  lib/zen/package/sections/lib/sections/view/admin/form.xhtml
111
110
  lib/zen/package/sections/lib/sections/view/admin/index.xhtml
@@ -119,21 +118,22 @@ lib/zen/package/sections/migrations/.gitkeep
119
118
  lib/zen/package/sections/migrations/1295251836_create_schema.rb
120
119
  lib/zen/package/settings/lib/settings/controller/settings.rb
121
120
  lib/zen/package/settings/lib/settings/language/en/settings.yml
122
- lib/zen/package/settings/lib/settings/liquid/setting.rb
123
121
  lib/zen/package/settings/lib/settings/model/setting.rb
122
+ lib/zen/package/settings/lib/settings/plugin/group_base.rb
123
+ lib/zen/package/settings/lib/settings/plugin/setting_base.rb
124
+ lib/zen/package/settings/lib/settings/plugin/settings.rb
124
125
  lib/zen/package/settings/lib/settings/view/admin/settings/index.xhtml
125
126
  lib/zen/package/settings/lib/settings.rb
126
127
  lib/zen/package/settings/migrations/.gitkeep
127
128
  lib/zen/package/settings/migrations/1295597111_create_schema.rb
128
129
  lib/zen/package/settings/migrations/1299538742_add_language_key.rb
130
+ lib/zen/package/settings/migrations/1303196915_settings_plugin.rb
129
131
  lib/zen/package/users/lib/users/controller/access_rules.rb
130
132
  lib/zen/package/users/lib/users/controller/user_groups.rb
131
133
  lib/zen/package/users/lib/users/controller/users.rb
132
134
  lib/zen/package/users/lib/users/language/en/access_rules.yml
133
135
  lib/zen/package/users/lib/users/language/en/user_groups.yml
134
136
  lib/zen/package/users/lib/users/language/en/users.yml
135
- lib/zen/package/users/lib/users/liquid/user.rb
136
- lib/zen/package/users/lib/users/liquid/users.rb
137
137
  lib/zen/package/users/lib/users/model/access_rule.rb
138
138
  lib/zen/package/users/lib/users/model/user.rb
139
139
  lib/zen/package/users/lib/users/model/user_group.rb
@@ -154,10 +154,15 @@ lib/zen/package/users/lib/users/view/admin/users/new.xhtml
154
154
  lib/zen/package/users/lib/users.rb
155
155
  lib/zen/package/users/migrations/.gitkeep
156
156
  lib/zen/package/users/migrations/1295281013_create_schema.rb
157
+ lib/zen/package/users/migrations/1303510943_class_rules.rb
157
158
  lib/zen/package.rb
158
- lib/zen/plugin/markup.rb
159
+ lib/zen/plugin/base.rb
160
+ lib/zen/plugin/controller.rb
161
+ lib/zen/plugin/helper.rb
162
+ lib/zen/plugin/markup/lib/markup/language/en/markup.yml
163
+ lib/zen/plugin/markup/lib/markup/markup.rb
164
+ lib/zen/plugin/markup/lib/markup.rb
159
165
  lib/zen/plugin.rb
160
- lib/zen/public/admin/css/boilerplate.css
161
166
  lib/zen/public/admin/css/buttons.css
162
167
  lib/zen/public/admin/css/datepicker.css
163
168
  lib/zen/public/admin/css/editor.css
@@ -167,9 +172,9 @@ lib/zen/public/admin/css/grid.css
167
172
  lib/zen/public/admin/css/layout.css
168
173
  lib/zen/public/admin/css/modals.css
169
174
  lib/zen/public/admin/css/notifications.css
175
+ lib/zen/public/admin/css/reset.css
170
176
  lib/zen/public/admin/css/tables.css
171
177
  lib/zen/public/admin/css/tabs.css
172
- lib/zen/public/admin/images/general/noise.jpg
173
178
  lib/zen/public/admin/images/icons/accept.png
174
179
  lib/zen/public/admin/images/icons/add.png
175
180
  lib/zen/public/admin/images/icons/back.png
@@ -193,11 +198,8 @@ lib/zen/public/admin/images/icons/user.png
193
198
  lib/zen/public/admin/images/icons/view.png
194
199
  lib/zen/public/admin/js/mootools/core.js
195
200
  lib/zen/public/admin/js/mootools/more.js
196
- lib/zen/public/admin/js/vendor/datepicker/Picker.Attach.js
197
- lib/zen/public/admin/js/vendor/datepicker/Picker.Date.js
198
- lib/zen/public/admin/js/vendor/datepicker/Picker.js
199
- lib/zen/public/admin/js/vendor/datepicker/README.md
200
- lib/zen/public/admin/js/vendor/datepicker/locale.js
201
+ lib/zen/public/admin/js/vendor/datepicker.js
202
+ lib/zen/public/admin/js/vendor/yepnope.js
201
203
  lib/zen/public/admin/js/zen/editor/base.js
202
204
  lib/zen/public/admin/js/zen/editor/drivers/html.js
203
205
  lib/zen/public/admin/js/zen/editor/drivers/markdown.js
@@ -206,18 +208,24 @@ lib/zen/public/admin/js/zen/init.js
206
208
  lib/zen/public/admin/js/zen/modal.js
207
209
  lib/zen/public/admin/js/zen/notification.js
208
210
  lib/zen/public/admin/js/zen/tabs.js
209
- lib/zen/strict_struct.rb
210
- lib/zen/task/build.rb
211
- lib/zen/task/clean.rb
212
- lib/zen/task/db.rb
213
- lib/zen/task/package.rb
214
- lib/zen/task/proto.rb
215
- lib/zen/task/theme.rb
211
+ lib/zen/public/favicon.ico
212
+ lib/zen/task/build.rake
213
+ lib/zen/task/clean.rake
214
+ lib/zen/task/db.rake
215
+ lib/zen/task/package.rake
216
+ lib/zen/task/plugin.rake
217
+ lib/zen/task/proto.rake
218
+ lib/zen/task/theme.rake
219
+ lib/zen/task.rb
220
+ lib/zen/theme/base.rb
216
221
  lib/zen/theme.rb
222
+ lib/zen/validation.rb
217
223
  lib/zen/version.rb
224
+ lib/zen/view/bottom.xhtml
225
+ lib/zen/view/main.xhtml
218
226
  lib/zen.rb
219
227
  license.txt
220
- proto/app/Thorfile
228
+ proto/app/Rakefile
221
229
  proto/app/app.rb
222
230
  proto/app/config/config.rb
223
231
  proto/app/config/database.rb
@@ -227,8 +235,9 @@ proto/app/config.ru
227
235
  proto/app/log/.gitkeep
228
236
  proto/app/public/.gitkeep
229
237
  proto/app/start.rb
238
+ proto/app/task/.gitkeep
230
239
  proto/app/vendor/.gitkeep
231
- proto/app/vendor/themes/.gitkeep
240
+ proto/app/vendor/theme/.gitkeep
232
241
  proto/migration.rb
233
242
  proto/package/lib/package/controller/controllers.rb
234
243
  proto/package/lib/package/language/en/languages.yml
data/README.md CHANGED
@@ -2,32 +2,19 @@
2
2
 
3
3
  Zen is a modular CMS written on top of the awesome Ramaze framework.
4
4
  Zen was built out of the frustration with Expression Engine, a popular CMS built on top of
5
- the Codeigniter framework which in turn is written using PHP. While I really like Codeigniter,
6
- ExpressionEngine and EllisLab there were several problems that bothered me.
5
+ the Codeigniter framework which in turn is written using PHP. While I really like
6
+ Codeigniter, ExpressionEngine and EllisLab there were several problems that bothered me.
7
7
  So I set out to write a system that's loosely based on ExpressionEngine but fits my needs.
8
8
  Because of this certain features may seem similar to those provided by EE and while at
9
9
  certain points there are similarities there are also pretty big differences.
10
10
 
11
11
  ## Requirements
12
12
 
13
- The following Gems are always required:
14
-
15
- * Ramaze
16
- * Sequel
17
- * Liquid
18
- * BCrypt
19
- * JSON
20
- * Ruby 1.9
21
- * Defensio
22
- * Thor
23
- * Sequel Sluggable
24
-
25
- These Gems are only required when developing/hacking Zen itself:
26
-
27
- * RDiscount
28
- * YARD
29
- * RSpec 2
30
- * Webrat
13
+ * Ramaze 2011.01.30 or newer
14
+ * Ruby 1.9 or newer
15
+ * A Defensio API key (for the comments system)
16
+ * A database (MySQL, PostgreSQL, etc)
17
+ * A HDD with some space left, mostly for the log files
31
18
 
32
19
  ## Installation
33
20
 
@@ -40,7 +27,7 @@ If you like to hack with the core of Zen it's best to install it using Git:
40
27
 
41
28
  $ git clone git://github.com/zen-cms/zen-core.git
42
29
  $ cd zen-core
43
- $ thor build:gem_clean
30
+ $ rake build:gem_clean
44
31
 
45
32
  ## Database Support
46
33
 
@@ -97,12 +84,12 @@ to read code in terminals or when using split view modes.
97
84
  * Mailing list
98
85
 
99
86
  Zen does not have it's own IRC channel at this time but you can usually find me in any
100
- of the following channels on Freenode (all are prefixed with a hash sign):
87
+ of the following channels on Freenode:
101
88
 
102
- * forrst-chat
103
- * ramaze
104
- * codeigniter
105
- * mootools
89
+ * \#forrst-chat
90
+ * \#ramaze
91
+ * \#codeigniter
92
+ * \#mootools
106
93
 
107
94
  ## License
108
95
 
@@ -110,5 +97,5 @@ Zen is licensed under the MIT license. For more information about this license o
110
97
  the file "license.txt".
111
98
 
112
99
  [zen website]: http://zen-cms.com/
113
- [zen documentation]: http://zen-cms.com/documentation/
100
+ [zen documentation]: http://zen-cms.com/userguide/
114
101
  [nvie branch model]: http://nvie.com/posts/a-successful-git-branching-model/
data/ROADMAP.md CHANGED
@@ -10,8 +10,26 @@ to be unverified/undecided and might not be added/completed at all.
10
10
  ### 0.3 - June 2011
11
11
 
12
12
  * Website completely up and running. (!)
13
- * Translation system for the Javascript used in the backend
14
- * Documentation/Userguide online
13
+ * Translation system for the Javascript used in the backend.
14
+ * Documentation online.
15
+
16
+ ### 0.2.6 - May 2011
17
+
18
+ * Implement something like Sprockets that can combine CSS/Javascript files and ditch the
19
+ rather crappy helper Ramaze::Helper::Asset.
20
+ * Add some sort of UI framework making it easier to create modal windows, tables, etc.
21
+ * Improve/overhaul the text editor used in the backend, it's rather basic at the moment.
22
+ * Improve the comment system so that people can save their data in some way (perhaps
23
+ allow people to register).
24
+
25
+ ### 0.2.5 - April 2011
26
+
27
+ * Replaced Liquid by a combination of Etanni and a set of plugins.
28
+ * Allow developers to register and load Javascript and CSS files globally.
29
+ * Replace all CSS files by Less CSS if this turns out to have an advantage over regular
30
+ css files. (?)
31
+ * Remove the methods from Settings::Model::Setting that are used to generate the possible
32
+ values for system settings. These should go in a plugin or something similar.
15
33
 
16
34
  ### 0.2.4 - March 2011
17
35
 
@@ -1,8 +1,7 @@
1
1
  require File.expand_path('../lib/zen', __FILE__)
2
- require 'thor'
3
2
 
4
3
  task_dir = File.expand_path('../lib/zen/task', __FILE__)
5
4
 
6
- Dir.glob("#{task_dir}/*.rb").each do |f|
7
- require(f)
5
+ Dir.glob("#{task_dir}/*.rake").each do |f|
6
+ import(f)
8
7
  end
data/bin/zen CHANGED
@@ -1,8 +1,30 @@
1
1
  #!/usr/bin/env ruby
2
- zen_path = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'zen'))
3
2
 
4
- require 'thor'
5
- require zen_path
6
- require zen_path + "/bin/base"
3
+ require File.expand_path('../../lib/zen/version', __FILE__)
4
+ require 'commander'
5
+ require 'commander/import'
7
6
 
8
- Zen::Bin::Base.start
7
+ # Set the extra information message
8
+ information = <<-MSG
9
+ * Website: http://zen-cms.com/
10
+ * Github: https://github.com/zen-cms
11
+ * License: MIT License (found in "license.txt")
12
+ MSG
13
+
14
+ # Set the details of the application
15
+ program :name , 'Zen'
16
+ program :version , Zen::Version
17
+ program :description, 'Zen is a modular CMS written using Ramaze.'
18
+
19
+ program :help, 'Example' , '$ zen [COMMAND] [OPTIONS]'
20
+ program :help, 'Information', information.strip
21
+
22
+ program :help_formatter, Commander::HelpFormatter::TerminalCompact
23
+
24
+ # Load all the commands
25
+ commands = File.expand_path('../../lib/zen/bin/*.rb', __FILE__)
26
+ commands = Dir.glob(commands)
27
+
28
+ commands.each do |cmd|
29
+ require cmd
30
+ end
data/lib/zen.rb CHANGED
@@ -1,3 +1,12 @@
1
+ require 'sequel'
2
+ require 'ramaze'
3
+ require 'bcrypt'
4
+ require 'json'
5
+ require 'defensio'
6
+ require 'sequel_sluggable'
7
+ require 'yaml'
8
+ require __DIR__('zen/version')
9
+
1
10
  ##
2
11
  # Main module for Zen, all other modules and classes will be placed inside this module.
3
12
  # This module loads all required classes and is used for starting the application.
@@ -8,21 +17,7 @@
8
17
  # files stored as hashes.
9
18
  #
10
19
  module Zen
11
- require 'sequel'
12
- require 'ramaze'
13
- require 'bcrypt'
14
- require 'liquid'
15
- require 'json'
16
- require 'defensio'
17
- require 'sequel_sluggable'
18
- require 'yaml'
19
- require __DIR__('zen/version')
20
-
21
20
  include Innate::Optioned
22
-
23
- class << self
24
- attr_reader :languages
25
- end
26
21
 
27
22
  # Update several paths so we can load helpers/layouts from the Zen gem
28
23
  Innate::HelpersHelper.options.paths.push(__DIR__('zen'))
@@ -31,42 +26,19 @@ module Zen
31
26
  options.dsl do
32
27
  o 'The character encoding to use when dealing with data', :encoding, 'utf8'
33
28
  o 'The date format to use for log files and such.', :date_format, '%d-%m-%Y'
34
- o 'The base directory of Zen.', :root, ''
29
+ o 'The root directory of Zen.', :root, ''
35
30
  end
36
-
37
- # Load all classes/modules provided by Zen itself.
38
- require __DIR__ 'zen/strict_struct'
39
- require __DIR__ 'zen/logger'
40
- require __DIR__ 'zen/database'
41
- require __DIR__ 'zen/package'
42
- require __DIR__ 'zen/language'
43
- require __DIR__ 'zen/plugin'
44
- require __DIR__ 'zen/theme'
45
31
 
46
- # Load all required plugins
47
- require __DIR__ 'zen/plugin/markup'
48
-
49
- # Load all the base controllers
50
- require __DIR__ 'zen/controller/base_controller'
51
- require __DIR__ 'zen/controller/frontend_controller'
52
- require __DIR__ 'zen/controller/admin_controller'
53
- require __DIR__ 'zen/controller/main_controller'
54
-
55
- # Load all default Liquid tags
56
- require __DIR__ 'zen/liquid/general'
57
- require __DIR__ 'zen/liquid/controller_behavior'
58
- require __DIR__ 'zen/liquid/redirect'
59
- require __DIR__ 'zen/liquid/strip'
60
-
61
- # Update the language paths
62
- Zen::Language.options.paths.push(__DIR__('zen'))
63
-
64
- # Register our Liquid tags
65
- ::Liquid::Template.register_tag('strip' , Liquid::Strip)
66
- ::Liquid::Template.register_tag('redirect', Liquid::Redirect)
32
+ ##
33
+ # Hash containing all system settings.
34
+ #
35
+ # @author Yorick Peterse
36
+ # @since 0.2.5
37
+ #
38
+ Settings = {}
67
39
 
68
40
  ##
69
- # Intitializes Zen by connecting the database and setting up various other things.
41
+ # Loads the database and the required models.
70
42
  #
71
43
  # @author Yorick Peterse
72
44
  # @since 0.1
@@ -76,11 +48,57 @@ module Zen
76
48
  Zen::Database.init
77
49
  Zen::Language.load('zen_general')
78
50
 
79
- require __DIR__ 'zen/model/settings'
80
- require __DIR__ 'zen/model/methods'
81
-
82
- @languages = {
83
- 'en' => lang('zen_general.special.language_hash.en')
84
- }
51
+ require __DIR__('zen/model/settings')
52
+ require __DIR__('zen/model/methods')
53
+
54
+ # Load the global stylesheet and Javascript file if they're located in
55
+ # ROOT/public/css/admin/global.css and ROOT/public/js/admin/global.js
56
+ publics = ::Ramaze.options.publics
57
+
58
+ publics.each do |p|
59
+ p = File.join(Zen.options.root, p)
60
+ css = File.join(p, 'admin/css/global.css')
61
+ js = File.join(p, 'admin/js/global.js')
62
+
63
+ # Load the CSS file if it's there
64
+ if File.exist?(css)
65
+ ::Zen::Asset.stylesheet(['global'], :global => true)
66
+ end
67
+
68
+ # Load the JS file if it's there
69
+ if File.exist?(js)
70
+ ::Zen::Asset.javascript(['global'], :global => true)
71
+ end
72
+ end
85
73
  end
74
+
86
75
  end
76
+
77
+ # Load all classes/modules provided by Zen itself.
78
+ require __DIR__('zen/validation')
79
+ require __DIR__('zen/database')
80
+ require __DIR__('zen/plugin')
81
+ require __DIR__('zen/language')
82
+ require __DIR__('zen/logger')
83
+ require __DIR__('zen/asset')
84
+
85
+ # Load a set of modules into the global namespace
86
+ include Zen::Plugin::SingletonMethods
87
+ include Zen::Language::SingletonMethods
88
+
89
+ # Update the language path
90
+ Zen::Language.options.paths.push(__DIR__('zen'))
91
+
92
+ # Load all additional files
93
+ require __DIR__('zen/plugin/helper')
94
+ require __DIR__('zen/plugin/controller')
95
+ require __DIR__('zen/plugin/markup/lib/markup')
96
+
97
+ require __DIR__('zen/package')
98
+ require __DIR__('zen/theme')
99
+
100
+ # Load all the base controllers
101
+ require __DIR__('zen/controller/base_controller')
102
+ require __DIR__('zen/controller/frontend_controller')
103
+ require __DIR__('zen/controller/admin_controller')
104
+ require __DIR__('zen/controller/main_controller')