zen 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (178) hide show
  1. data/.gems +34 -0
  2. data/.travis.yml +7 -0
  3. data/AUTHORS +5 -0
  4. data/CHANGELOG +14 -0
  5. data/{license.txt → LICENSE} +0 -0
  6. data/MANIFEST +67 -51
  7. data/README.md +18 -25
  8. data/Rakefile +2 -3
  9. data/bin/zen +2 -2
  10. data/lib/zen.rb +93 -57
  11. data/lib/zen/asset.rb +7 -8
  12. data/lib/zen/bin/app.rb +0 -2
  13. data/lib/zen/controller/admin_controller.rb +4 -9
  14. data/lib/zen/controller/base_controller.rb +0 -25
  15. data/lib/zen/controller/main_controller.rb +5 -5
  16. data/lib/zen/controller/preview.rb +50 -0
  17. data/lib/zen/helper/common.rb +4 -68
  18. data/lib/zen/helper/message.rb +82 -0
  19. data/lib/zen/helper/theme.rb +2 -2
  20. data/lib/zen/language.rb +68 -38
  21. data/lib/zen/language/en/zen_general.yml +1 -4
  22. data/lib/zen/language/nl/zen_general.yml +28 -0
  23. data/lib/zen/language/nl/zen_models.yml +13 -0
  24. data/lib/zen/layout/admin.xhtml +1 -1
  25. data/lib/zen/layout/login.xhtml +1 -1
  26. data/lib/zen/model/settings.rb +2 -0
  27. data/lib/zen/package.rb +29 -25
  28. data/lib/zen/package/all.rb +1 -1
  29. data/lib/zen/package/categories/lib/categories/controller/categories.rb +51 -63
  30. data/lib/zen/package/categories/lib/categories/controller/category_groups.rb +45 -52
  31. data/lib/zen/package/categories/lib/categories/language/en/categories.yml +2 -2
  32. data/lib/zen/package/categories/lib/categories/language/nl/categories.yml +39 -0
  33. data/lib/zen/package/categories/lib/categories/language/nl/category_groups.yml +33 -0
  34. data/lib/zen/package/categories/lib/categories/plugin/categories.rb +2 -2
  35. data/lib/zen/package/comments/lib/comments.rb +31 -2
  36. data/lib/zen/package/comments/lib/comments/controller/comments.rb +42 -57
  37. data/lib/zen/package/comments/lib/comments/controller/comments_form.rb +36 -51
  38. data/lib/zen/package/comments/lib/comments/language/en/comments.yml +7 -3
  39. data/lib/zen/package/comments/lib/comments/language/nl/comments.yml +48 -0
  40. data/lib/zen/package/comments/lib/comments/model/comment.rb +45 -4
  41. data/lib/zen/package/comments/lib/comments/plugin/anti_spam.rb +152 -0
  42. data/lib/zen/package/comments/lib/comments/plugin/comments.rb +5 -6
  43. data/lib/zen/package/comments/lib/comments/view/admin/comments/index.xhtml +2 -2
  44. data/lib/zen/package/custom_fields/lib/custom_fields/controller/custom_field_groups.rb +43 -52
  45. data/lib/zen/package/custom_fields/lib/custom_fields/controller/custom_fields.rb +68 -67
  46. data/lib/zen/package/custom_fields/lib/custom_fields/language/en/custom_fields.yml +1 -1
  47. data/lib/zen/package/custom_fields/lib/custom_fields/language/nl/custom_field_groups.yml +32 -0
  48. data/lib/zen/package/custom_fields/lib/custom_fields/language/nl/custom_fields.yml +52 -0
  49. data/lib/zen/package/custom_fields/lib/custom_fields/model/custom_field.rb +3 -3
  50. data/lib/zen/package/custom_fields/lib/custom_fields/model/custom_field_group.rb +4 -7
  51. data/lib/zen/package/custom_fields/lib/custom_fields/model/custom_field_value.rb +3 -3
  52. data/lib/zen/package/menus/lib/menus/controller/menu_items.rb +37 -44
  53. data/lib/zen/package/menus/lib/menus/controller/menus.rb +33 -43
  54. data/lib/zen/package/menus/lib/menus/helper/menu_item.rb +5 -10
  55. data/lib/zen/package/menus/lib/menus/language/nl/menu_items.yml +41 -0
  56. data/lib/zen/package/menus/lib/menus/language/nl/menus.yml +39 -0
  57. data/lib/zen/package/menus/lib/menus/model/menu.rb +3 -3
  58. data/lib/zen/package/menus/lib/menus/model/menu_item.rb +3 -3
  59. data/lib/zen/package/menus/lib/menus/plugin/menus.rb +5 -6
  60. data/lib/zen/package/menus/migrations/1297184342_create_schema.rb +1 -1
  61. data/lib/zen/package/sections/lib/sections.rb +20 -0
  62. data/lib/zen/package/sections/lib/sections/controller/section_entries.rb +85 -79
  63. data/lib/zen/package/sections/lib/sections/controller/sections.rb +58 -66
  64. data/lib/zen/package/sections/lib/sections/language/en/sections.yml +0 -1
  65. data/lib/zen/package/sections/lib/sections/language/nl/section_entries.yml +43 -0
  66. data/lib/zen/package/sections/lib/sections/language/nl/sections.yml +47 -0
  67. data/lib/zen/package/sections/lib/sections/model/section.rb +11 -15
  68. data/lib/zen/package/sections/lib/sections/model/section_entry.rb +9 -5
  69. data/lib/zen/package/sections/lib/sections/plugin/section_entries.rb +7 -8
  70. data/lib/zen/package/sections/lib/sections/plugin/sections.rb +3 -4
  71. data/lib/zen/package/sections/lib/sections/view/admin/section-entries/form.xhtml +0 -4
  72. data/lib/zen/package/sections/lib/sections/view/admin/section-entries/index.xhtml +8 -2
  73. data/lib/zen/package/sections/migrations/1306772479_remove_unique_slug.rb +28 -0
  74. data/lib/zen/package/settings/lib/settings.rb +21 -34
  75. data/lib/zen/package/settings/lib/settings/controller/settings.rb +29 -22
  76. data/lib/zen/package/settings/lib/settings/language/en/settings.yml +7 -5
  77. data/lib/zen/package/settings/lib/settings/language/nl/settings.yml +39 -0
  78. data/lib/zen/package/settings/lib/settings/model/setting.rb +3 -5
  79. data/lib/zen/package/settings/lib/settings/plugin/group_base.rb +3 -4
  80. data/lib/zen/package/settings/lib/settings/plugin/setting_base.rb +3 -5
  81. data/lib/zen/package/settings/lib/settings/plugin/settings.rb +11 -4
  82. data/lib/zen/package/settings/lib/settings/view/admin/settings/index.xhtml +5 -5
  83. data/lib/zen/package/settings/migrations/1299538742_add_language_key.rb +8 -8
  84. data/lib/zen/package/settings/migrations/1303196915_settings_plugin.rb +2 -5
  85. data/lib/zen/package/users/lib/users/controller/access_rules.rb +54 -61
  86. data/lib/zen/package/users/lib/users/controller/user_groups.rb +49 -57
  87. data/lib/zen/package/users/lib/users/controller/users.rb +58 -73
  88. data/lib/zen/package/users/lib/users/language/en/users.yml +6 -0
  89. data/lib/zen/package/users/lib/users/language/nl/access_rules.yml +37 -0
  90. data/lib/zen/package/users/lib/users/language/nl/user_groups.yml +31 -0
  91. data/lib/zen/package/users/lib/users/language/nl/users.yml +56 -0
  92. data/lib/zen/package/users/lib/users/model/user.rb +16 -1
  93. data/lib/zen/package/users/lib/users/view/admin/users/form.xhtml +27 -2
  94. data/lib/zen/package/users/lib/users/view/admin/users/index.xhtml +15 -3
  95. data/lib/zen/package/users/migrations/1304939855_user_settings.rb +15 -0
  96. data/lib/zen/plugin.rb +7 -9
  97. data/lib/zen/public/admin/css/{buttons.css → zen/buttons.css} +11 -7
  98. data/lib/zen/public/admin/css/{datepicker.css → zen/datepicker.css} +0 -0
  99. data/lib/zen/public/admin/css/{editor.css → zen/editor.css} +10 -5
  100. data/lib/zen/public/admin/css/{forms.css → zen/forms.css} +1 -1
  101. data/lib/zen/public/admin/css/{general.css → zen/general.css} +7 -7
  102. data/lib/zen/public/admin/css/{grid.css → zen/grid.css} +0 -0
  103. data/lib/zen/public/admin/css/{layout.css → zen/layout.css} +4 -5
  104. data/lib/zen/public/admin/css/zen/messages.css +61 -0
  105. data/lib/zen/public/admin/css/{notifications.css → zen/notifications.css} +4 -4
  106. data/lib/zen/public/admin/css/{reset.css → zen/reset.css} +0 -0
  107. data/lib/zen/public/admin/css/{tables.css → zen/tables.css} +3 -3
  108. data/lib/zen/public/admin/css/{tabs.css → zen/tabs.css} +5 -5
  109. data/lib/zen/public/admin/css/zen/window.css +79 -0
  110. data/lib/zen/public/admin/images/{icons → zen/icons}/accept.png +0 -0
  111. data/lib/zen/public/admin/images/{icons → zen/icons}/add.png +0 -0
  112. data/lib/zen/public/admin/images/{icons → zen/icons}/back.png +0 -0
  113. data/lib/zen/public/admin/images/{icons → zen/icons}/bold.png +0 -0
  114. data/lib/zen/public/admin/images/zen/icons/close.png +0 -0
  115. data/lib/zen/public/admin/images/{icons → zen/icons}/delete.png +0 -0
  116. data/lib/zen/public/admin/images/{icons → zen/icons}/edit.png +0 -0
  117. data/lib/zen/public/admin/images/{icons → zen/icons}/error.png +0 -0
  118. data/lib/zen/public/admin/images/{icons → zen/icons}/help.png +0 -0
  119. data/lib/zen/public/admin/images/{icons → zen/icons}/info.png +0 -0
  120. data/lib/zen/public/admin/images/{icons → zen/icons}/italic.png +0 -0
  121. data/lib/zen/public/admin/images/{icons → zen/icons}/large/error.png +0 -0
  122. data/lib/zen/public/admin/images/{icons → zen/icons}/large/notice.png +0 -0
  123. data/lib/zen/public/admin/images/{icons → zen/icons}/large/success.png +0 -0
  124. data/lib/zen/public/admin/images/{icons → zen/icons}/link.png +0 -0
  125. data/lib/zen/public/admin/images/{icons → zen/icons}/logout.png +0 -0
  126. data/lib/zen/public/admin/images/{icons → zen/icons}/ol.png +0 -0
  127. data/lib/zen/public/admin/images/{icons → zen/icons}/pdf.png +0 -0
  128. data/lib/zen/public/admin/images/zen/icons/preview.png +0 -0
  129. data/lib/zen/public/admin/images/{icons → zen/icons}/ul.png +0 -0
  130. data/lib/zen/public/admin/images/{icons → zen/icons}/user.png +0 -0
  131. data/lib/zen/public/admin/images/{icons → zen/icons}/view.png +0 -0
  132. data/lib/zen/public/admin/js/zen/core.js +73 -0
  133. data/lib/zen/public/admin/js/zen/editor.js +527 -0
  134. data/lib/zen/public/admin/js/zen/editor/markdown.js +84 -0
  135. data/lib/zen/public/admin/js/zen/editor/textile.js +84 -0
  136. data/lib/zen/public/admin/js/zen/init.js +12 -66
  137. data/lib/zen/public/admin/js/zen/tabs.js +5 -0
  138. data/lib/zen/public/admin/js/zen/window.js +206 -0
  139. data/lib/zen/task/build.rake +23 -6
  140. data/lib/zen/task/clean.rake +6 -7
  141. data/lib/zen/task/db.rake +7 -9
  142. data/lib/zen/task/package.rake +6 -6
  143. data/lib/zen/task/test.rake +6 -0
  144. data/lib/zen/task/theme.rake +3 -3
  145. data/lib/zen/theme.rb +3 -4
  146. data/lib/zen/validation.rb +7 -9
  147. data/lib/zen/version.rb +3 -4
  148. data/lib/zen/view/bottom.xhtml +0 -5
  149. data/lib/zen/view/main.xhtml +2 -0
  150. data/proto/app/app.rb +6 -4
  151. data/proto/app/config/config.rb +1 -7
  152. data/proto/app/config/database.rb +47 -43
  153. data/proto/app/config/middlewares.rb +0 -40
  154. data/proto/app/start.rb +1 -6
  155. data/proto/app/{vendor → theme}/.gitkeep +0 -0
  156. data/proto/migration.rb +3 -3
  157. data/proto/package/lib/package.rb +0 -1
  158. data/proto/package/lib/package/controller/controllers.rb +7 -40
  159. data/proto/package/lib/package/model/model.rb +3 -3
  160. metadata +106 -79
  161. data/CHANGELOG.md +0 -27
  162. data/ROADMAP.md +0 -53
  163. data/lib/zen/database.rb +0 -112
  164. data/lib/zen/logger.rb +0 -56
  165. data/lib/zen/public/admin/css/modals.css +0 -63
  166. data/lib/zen/public/admin/images/icons/close.png +0 -0
  167. data/lib/zen/public/admin/js/vendor/yepnope.js +0 -1
  168. data/lib/zen/public/admin/js/zen/editor/base.js +0 -262
  169. data/lib/zen/public/admin/js/zen/editor/drivers/html.js +0 -89
  170. data/lib/zen/public/admin/js/zen/editor/drivers/markdown.js +0 -87
  171. data/lib/zen/public/admin/js/zen/editor/drivers/textile.js +0 -87
  172. data/lib/zen/public/admin/js/zen/modal.js +0 -146
  173. data/lib/zen/public/admin/js/zen/notification.js +0 -211
  174. data/proto/app/config/requires.rb +0 -10
  175. data/proto/app/vendor/theme/.gitkeep +0 -0
  176. data/proto/package/lib/package/view/admin/package/edit.xhtml +0 -0
  177. data/proto/package/lib/package/view/admin/package/form.xhtml +0 -0
  178. data/proto/package/lib/package/view/admin/package/new.xhtml +0 -0
data/.gems ADDED
@@ -0,0 +1,34 @@
1
+ bcrypt-ruby -v2.1.4
2
+ bundler -v1.0.13
3
+ capybara -v0.4.1.2
4
+ celerity -v0.8.9
5
+ childprocess -v0.1.9
6
+ commander -v4.0.4
7
+ crack -v0.1.8
8
+ culerity -v0.2.15
9
+ defensio -v0.9.1
10
+ diff-lcs -v1.1.2
11
+ ffi -v1.0.9
12
+ highline -v1.6.2
13
+ httparty -v0.7.7
14
+ innate -v2011.04
15
+ loofah -v1.0.0
16
+ mime-types -v1.16
17
+ nokogiri -v1.4.4
18
+ rack -v1.2.3
19
+ rack-test -v0.6.0
20
+ rake -v0.9.0
21
+ ramaze -v2011.01.30
22
+ rdiscount -v1.6.8
23
+ RedCloth -v4.2.7
24
+ rspec -v2.6.0
25
+ rspec-core -v2.6.3
26
+ rspec-expectations -v2.6.0
27
+ rspec-mocks -v2.6.0
28
+ rubyzip -v0.9.4
29
+ selenium-webdriver -v0.2.0
30
+ sequel -v3.23.0
31
+ sequel_sluggable -v0.0.6
32
+ sqlite3 -v1.3.3
33
+ xpath -v0.1.4
34
+ yard -v0.7.1
@@ -0,0 +1,7 @@
1
+ script: "rvm gemset import .gems; rake test"
2
+ rvm:
3
+ - 1.9.2
4
+
5
+ notifications:
6
+ recipients:
7
+ - info@yorickpeterse.com
data/AUTHORS ADDED
@@ -0,0 +1,5 @@
1
+ Following persons have contributed to Zen.
2
+ (Sorted by number of submitted patches, then alphabetically)
3
+
4
+ 115 YorickPeterse <info@yorickpeterse.com>
5
+ 1 Yorick Peterse <info@yorickpeterse.com>
@@ -0,0 +1,14 @@
1
+ 0.2.6 May 29 2011
2
+
3
+ * Zen is now using RVM for gem management and such.
4
+ * Began working on making Zen compatible with at least JRuby. Rubinius isn't worth the
5
+ effort at this time.
6
+ * Removed Ramaze::Helper::Common.notification in favor of Ramaze::Helper::Message.
7
+ * Dropped Zen::Database, Zen::Settings and most of the options in favor of instance
8
+ variables set in the main Zen module. See commit d40ee1c2e518a323b2983e1bcfb7a0d863bf3b2f
9
+ for more information.
10
+ * Translated Zen to Dutch.
11
+ * Re-organized the application prototypes to make them easier to use/understand.
12
+ * Implemented the anti-spam system as a plugin and added a decent XSS protection system
13
+ using Loofah.
14
+ * Various changes to the Javascript classes.
File without changes
data/MANIFEST CHANGED
@@ -1,7 +1,10 @@
1
- CHANGELOG.md
1
+ .gems
2
+ .travis.yml
3
+ AUTHORS
4
+ CHANGELOG
5
+ LICENSE
2
6
  MANIFEST
3
7
  README.md
4
- ROADMAP.md
5
8
  Rakefile
6
9
  bin/zen
7
10
  lib/zen/asset.rb
@@ -10,7 +13,7 @@ lib/zen/controller/admin_controller.rb
10
13
  lib/zen/controller/base_controller.rb
11
14
  lib/zen/controller/frontend_controller.rb
12
15
  lib/zen/controller/main_controller.rb
13
- lib/zen/database.rb
16
+ lib/zen/controller/preview.rb
14
17
  lib/zen/error/language_error.rb
15
18
  lib/zen/error/package_error.rb
16
19
  lib/zen/error/plugin_error.rb
@@ -20,13 +23,15 @@ lib/zen/ext/string.rb
20
23
  lib/zen/helper/acl.rb
21
24
  lib/zen/helper/breadcrumb.rb
22
25
  lib/zen/helper/common.rb
26
+ lib/zen/helper/message.rb
23
27
  lib/zen/helper/theme.rb
24
28
  lib/zen/language/en/zen_general.yml
25
29
  lib/zen/language/en/zen_models.yml
30
+ lib/zen/language/nl/zen_general.yml
31
+ lib/zen/language/nl/zen_models.yml
26
32
  lib/zen/language.rb
27
33
  lib/zen/layout/admin.xhtml
28
34
  lib/zen/layout/login.xhtml
29
- lib/zen/logger.rb
30
35
  lib/zen/model/methods.rb
31
36
  lib/zen/model/settings.rb
32
37
  lib/zen/package/all.rb
@@ -35,6 +40,8 @@ lib/zen/package/categories/lib/categories/controller/categories.rb
35
40
  lib/zen/package/categories/lib/categories/controller/category_groups.rb
36
41
  lib/zen/package/categories/lib/categories/language/en/categories.yml
37
42
  lib/zen/package/categories/lib/categories/language/en/category_groups.yml
43
+ lib/zen/package/categories/lib/categories/language/nl/categories.yml
44
+ lib/zen/package/categories/lib/categories/language/nl/category_groups.yml
38
45
  lib/zen/package/categories/lib/categories/model/category.rb
39
46
  lib/zen/package/categories/lib/categories/model/category_group.rb
40
47
  lib/zen/package/categories/lib/categories/plugin/categories.rb
@@ -52,7 +59,9 @@ lib/zen/package/categories/migrations/1295282303_create_schema.rb
52
59
  lib/zen/package/comments/lib/comments/controller/comments.rb
53
60
  lib/zen/package/comments/lib/comments/controller/comments_form.rb
54
61
  lib/zen/package/comments/lib/comments/language/en/comments.yml
62
+ lib/zen/package/comments/lib/comments/language/nl/comments.yml
55
63
  lib/zen/package/comments/lib/comments/model/comment.rb
64
+ lib/zen/package/comments/lib/comments/plugin/anti_spam.rb
56
65
  lib/zen/package/comments/lib/comments/plugin/comments.rb
57
66
  lib/zen/package/comments/lib/comments/view/admin/comments/edit.xhtml
58
67
  lib/zen/package/comments/lib/comments/view/admin/comments/form.xhtml
@@ -64,6 +73,8 @@ lib/zen/package/custom_fields/lib/custom_fields/controller/custom_field_groups.r
64
73
  lib/zen/package/custom_fields/lib/custom_fields/controller/custom_fields.rb
65
74
  lib/zen/package/custom_fields/lib/custom_fields/language/en/custom_field_groups.yml
66
75
  lib/zen/package/custom_fields/lib/custom_fields/language/en/custom_fields.yml
76
+ lib/zen/package/custom_fields/lib/custom_fields/language/nl/custom_field_groups.yml
77
+ lib/zen/package/custom_fields/lib/custom_fields/language/nl/custom_fields.yml
67
78
  lib/zen/package/custom_fields/lib/custom_fields/model/custom_field.rb
68
79
  lib/zen/package/custom_fields/lib/custom_fields/model/custom_field_group.rb
69
80
  lib/zen/package/custom_fields/lib/custom_fields/model/custom_field_value.rb
@@ -83,6 +94,8 @@ lib/zen/package/menus/lib/menus/controller/menus.rb
83
94
  lib/zen/package/menus/lib/menus/helper/menu_item.rb
84
95
  lib/zen/package/menus/lib/menus/language/en/menu_items.yml
85
96
  lib/zen/package/menus/lib/menus/language/en/menus.yml
97
+ lib/zen/package/menus/lib/menus/language/nl/menu_items.yml
98
+ lib/zen/package/menus/lib/menus/language/nl/menus.yml
86
99
  lib/zen/package/menus/lib/menus/model/menu.rb
87
100
  lib/zen/package/menus/lib/menus/model/menu_item.rb
88
101
  lib/zen/package/menus/lib/menus/plugin/menus.rb
@@ -101,6 +114,8 @@ lib/zen/package/sections/lib/sections/controller/section_entries.rb
101
114
  lib/zen/package/sections/lib/sections/controller/sections.rb
102
115
  lib/zen/package/sections/lib/sections/language/en/section_entries.yml
103
116
  lib/zen/package/sections/lib/sections/language/en/sections.yml
117
+ lib/zen/package/sections/lib/sections/language/nl/section_entries.yml
118
+ lib/zen/package/sections/lib/sections/language/nl/sections.yml
104
119
  lib/zen/package/sections/lib/sections/model/section.rb
105
120
  lib/zen/package/sections/lib/sections/model/section_entry.rb
106
121
  lib/zen/package/sections/lib/sections/plugin/section_entries.rb
@@ -116,8 +131,10 @@ lib/zen/package/sections/lib/sections/view/admin/section-entries/new.xhtml
116
131
  lib/zen/package/sections/lib/sections.rb
117
132
  lib/zen/package/sections/migrations/.gitkeep
118
133
  lib/zen/package/sections/migrations/1295251836_create_schema.rb
134
+ lib/zen/package/sections/migrations/1306772479_remove_unique_slug.rb
119
135
  lib/zen/package/settings/lib/settings/controller/settings.rb
120
136
  lib/zen/package/settings/lib/settings/language/en/settings.yml
137
+ lib/zen/package/settings/lib/settings/language/nl/settings.yml
121
138
  lib/zen/package/settings/lib/settings/model/setting.rb
122
139
  lib/zen/package/settings/lib/settings/plugin/group_base.rb
123
140
  lib/zen/package/settings/lib/settings/plugin/setting_base.rb
@@ -134,6 +151,9 @@ lib/zen/package/users/lib/users/controller/users.rb
134
151
  lib/zen/package/users/lib/users/language/en/access_rules.yml
135
152
  lib/zen/package/users/lib/users/language/en/user_groups.yml
136
153
  lib/zen/package/users/lib/users/language/en/users.yml
154
+ lib/zen/package/users/lib/users/language/nl/access_rules.yml
155
+ lib/zen/package/users/lib/users/language/nl/user_groups.yml
156
+ lib/zen/package/users/lib/users/language/nl/users.yml
137
157
  lib/zen/package/users/lib/users/model/access_rule.rb
138
158
  lib/zen/package/users/lib/users/model/user.rb
139
159
  lib/zen/package/users/lib/users/model/user_group.rb
@@ -155,6 +175,7 @@ lib/zen/package/users/lib/users.rb
155
175
  lib/zen/package/users/migrations/.gitkeep
156
176
  lib/zen/package/users/migrations/1295281013_create_schema.rb
157
177
  lib/zen/package/users/migrations/1303510943_class_rules.rb
178
+ lib/zen/package/users/migrations/1304939855_user_settings.rb
158
179
  lib/zen/package.rb
159
180
  lib/zen/plugin/base.rb
160
181
  lib/zen/plugin/controller.rb
@@ -163,51 +184,51 @@ lib/zen/plugin/markup/lib/markup/language/en/markup.yml
163
184
  lib/zen/plugin/markup/lib/markup/markup.rb
164
185
  lib/zen/plugin/markup/lib/markup.rb
165
186
  lib/zen/plugin.rb
166
- lib/zen/public/admin/css/buttons.css
167
- lib/zen/public/admin/css/datepicker.css
168
- lib/zen/public/admin/css/editor.css
169
- lib/zen/public/admin/css/forms.css
170
- lib/zen/public/admin/css/general.css
171
- lib/zen/public/admin/css/grid.css
172
- lib/zen/public/admin/css/layout.css
173
- lib/zen/public/admin/css/modals.css
174
- lib/zen/public/admin/css/notifications.css
175
- lib/zen/public/admin/css/reset.css
176
- lib/zen/public/admin/css/tables.css
177
- lib/zen/public/admin/css/tabs.css
178
- lib/zen/public/admin/images/icons/accept.png
179
- lib/zen/public/admin/images/icons/add.png
180
- lib/zen/public/admin/images/icons/back.png
181
- lib/zen/public/admin/images/icons/bold.png
182
- lib/zen/public/admin/images/icons/close.png
183
- lib/zen/public/admin/images/icons/delete.png
184
- lib/zen/public/admin/images/icons/edit.png
185
- lib/zen/public/admin/images/icons/error.png
186
- lib/zen/public/admin/images/icons/help.png
187
- lib/zen/public/admin/images/icons/info.png
188
- lib/zen/public/admin/images/icons/italic.png
189
- lib/zen/public/admin/images/icons/large/error.png
190
- lib/zen/public/admin/images/icons/large/notice.png
191
- lib/zen/public/admin/images/icons/large/success.png
192
- lib/zen/public/admin/images/icons/link.png
193
- lib/zen/public/admin/images/icons/logout.png
194
- lib/zen/public/admin/images/icons/ol.png
195
- lib/zen/public/admin/images/icons/pdf.png
196
- lib/zen/public/admin/images/icons/ul.png
197
- lib/zen/public/admin/images/icons/user.png
198
- lib/zen/public/admin/images/icons/view.png
187
+ lib/zen/public/admin/css/zen/buttons.css
188
+ lib/zen/public/admin/css/zen/datepicker.css
189
+ lib/zen/public/admin/css/zen/editor.css
190
+ lib/zen/public/admin/css/zen/forms.css
191
+ lib/zen/public/admin/css/zen/general.css
192
+ lib/zen/public/admin/css/zen/grid.css
193
+ lib/zen/public/admin/css/zen/layout.css
194
+ lib/zen/public/admin/css/zen/messages.css
195
+ lib/zen/public/admin/css/zen/notifications.css
196
+ lib/zen/public/admin/css/zen/reset.css
197
+ lib/zen/public/admin/css/zen/tables.css
198
+ lib/zen/public/admin/css/zen/tabs.css
199
+ lib/zen/public/admin/css/zen/window.css
200
+ lib/zen/public/admin/images/zen/icons/accept.png
201
+ lib/zen/public/admin/images/zen/icons/add.png
202
+ lib/zen/public/admin/images/zen/icons/back.png
203
+ lib/zen/public/admin/images/zen/icons/bold.png
204
+ lib/zen/public/admin/images/zen/icons/close.png
205
+ lib/zen/public/admin/images/zen/icons/delete.png
206
+ lib/zen/public/admin/images/zen/icons/edit.png
207
+ lib/zen/public/admin/images/zen/icons/error.png
208
+ lib/zen/public/admin/images/zen/icons/help.png
209
+ lib/zen/public/admin/images/zen/icons/info.png
210
+ lib/zen/public/admin/images/zen/icons/italic.png
211
+ lib/zen/public/admin/images/zen/icons/large/error.png
212
+ lib/zen/public/admin/images/zen/icons/large/notice.png
213
+ lib/zen/public/admin/images/zen/icons/large/success.png
214
+ lib/zen/public/admin/images/zen/icons/link.png
215
+ lib/zen/public/admin/images/zen/icons/logout.png
216
+ lib/zen/public/admin/images/zen/icons/ol.png
217
+ lib/zen/public/admin/images/zen/icons/pdf.png
218
+ lib/zen/public/admin/images/zen/icons/preview.png
219
+ lib/zen/public/admin/images/zen/icons/ul.png
220
+ lib/zen/public/admin/images/zen/icons/user.png
221
+ lib/zen/public/admin/images/zen/icons/view.png
199
222
  lib/zen/public/admin/js/mootools/core.js
200
223
  lib/zen/public/admin/js/mootools/more.js
201
224
  lib/zen/public/admin/js/vendor/datepicker.js
202
- lib/zen/public/admin/js/vendor/yepnope.js
203
- lib/zen/public/admin/js/zen/editor/base.js
204
- lib/zen/public/admin/js/zen/editor/drivers/html.js
205
- lib/zen/public/admin/js/zen/editor/drivers/markdown.js
206
- lib/zen/public/admin/js/zen/editor/drivers/textile.js
225
+ lib/zen/public/admin/js/zen/core.js
226
+ lib/zen/public/admin/js/zen/editor/markdown.js
227
+ lib/zen/public/admin/js/zen/editor/textile.js
228
+ lib/zen/public/admin/js/zen/editor.js
207
229
  lib/zen/public/admin/js/zen/init.js
208
- lib/zen/public/admin/js/zen/modal.js
209
- lib/zen/public/admin/js/zen/notification.js
210
230
  lib/zen/public/admin/js/zen/tabs.js
231
+ lib/zen/public/admin/js/zen/window.js
211
232
  lib/zen/public/favicon.ico
212
233
  lib/zen/task/build.rake
213
234
  lib/zen/task/clean.rake
@@ -215,6 +236,7 @@ lib/zen/task/db.rake
215
236
  lib/zen/task/package.rake
216
237
  lib/zen/task/plugin.rake
217
238
  lib/zen/task/proto.rake
239
+ lib/zen/task/test.rake
218
240
  lib/zen/task/theme.rake
219
241
  lib/zen/task.rb
220
242
  lib/zen/theme/base.rb
@@ -224,27 +246,21 @@ lib/zen/version.rb
224
246
  lib/zen/view/bottom.xhtml
225
247
  lib/zen/view/main.xhtml
226
248
  lib/zen.rb
227
- license.txt
228
249
  proto/app/Rakefile
229
250
  proto/app/app.rb
230
251
  proto/app/config/config.rb
231
252
  proto/app/config/database.rb
232
253
  proto/app/config/middlewares.rb
233
- proto/app/config/requires.rb
234
254
  proto/app/config.ru
235
255
  proto/app/log/.gitkeep
236
256
  proto/app/public/.gitkeep
237
257
  proto/app/start.rb
238
258
  proto/app/task/.gitkeep
239
- proto/app/vendor/.gitkeep
240
- proto/app/vendor/theme/.gitkeep
259
+ proto/app/theme/.gitkeep
241
260
  proto/migration.rb
242
261
  proto/package/lib/package/controller/controllers.rb
243
262
  proto/package/lib/package/language/en/languages.yml
244
263
  proto/package/lib/package/model/model.rb
245
- proto/package/lib/package/view/admin/package/edit.xhtml
246
- proto/package/lib/package/view/admin/package/form.xhtml
247
264
  proto/package/lib/package/view/admin/package/index.xhtml
248
- proto/package/lib/package/view/admin/package/new.xhtml
249
265
  proto/package/lib/package.rb
250
266
  proto/package/migrations/.gitkeep
data/README.md CHANGED
@@ -1,20 +1,18 @@
1
1
  # README
2
2
 
3
- Zen is a modular CMS written on top of the awesome Ramaze framework.
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
6
- Codeigniter, ExpressionEngine and EllisLab there were several problems that bothered me.
7
- So I set out to write a system that's loosely based on ExpressionEngine but fits my needs.
8
- Because of this certain features may seem similar to those provided by EE and while at
9
- certain points there are similarities there are also pretty big differences.
3
+ Zen is a modular CMS written on top of the awesome Ramaze framework. Zen was built out of
4
+ the frustration with Expression Engine, a popular CMS built on top of the Codeigniter
5
+ framework which in turn is written using PHP. While I really like Codeigniter,
6
+ ExpressionEngine and EllisLab there were several problems that bothered me. So I set out
7
+ to write a system that's loosely based on ExpressionEngine but fits my needs. Because of
8
+ this certain features may seem similar to those provided by EE and while at certain
9
+ points there are similarities there are also pretty big differences.
10
10
 
11
11
  ## Requirements
12
12
 
13
13
  * Ramaze 2011.01.30 or newer
14
- * Ruby 1.9 or newer
15
- * A Defensio API key (for the comments system)
14
+ * Ruby 1.9.2
16
15
  * A database (MySQL, PostgreSQL, etc)
17
- * A HDD with some space left, mostly for the log files
18
16
 
19
17
  ## Installation
20
18
 
@@ -27,7 +25,7 @@ If you like to hack with the core of Zen it's best to install it using Git:
27
25
 
28
26
  $ git clone git://github.com/zen-cms/zen-core.git
29
27
  $ cd zen-core
30
- $ rake build:gem_clean
28
+ $ rake build:gem
31
29
 
32
30
  ## Database Support
33
31
 
@@ -42,8 +40,8 @@ PostgreSQL will be tested in the near future.
42
40
  ## Running Zen
43
41
 
44
42
  Zen can be run using any webserver as long as it supports Rack. Thin, Unicorn or Passenger,
45
- they should all work. The main website of Zen is served using Unicorn and Nginx, development
46
- is done using WEBRick and Unicorn.
43
+ they should all work. The main website of Zen is served using Unicorn and Nginx,
44
+ development is done using WEBRick and Unicorn.
47
45
 
48
46
  ## Documentation
49
47
 
@@ -60,23 +58,18 @@ is used to contain less stable (but not unstable) commits that will be pushed in
60
58
  from time to time. All other branches, e.g. "rspec2" will be used for individual features.
61
59
 
62
60
  Besides following this model developers are also expected to write tests using either
63
- RSpec or Webrat for their features. Webrat is used to test controllers and browser based
64
- tests while RSpec is used to test libraries, helpers, etc.
65
-
66
- If you have a cool idea, implemented it and think it's worth merging into Zen itself feel
67
- free to submit a pull request and I'll take a look at it.
61
+ RSpec or Capybara for their features. Capybara is used to test controllers and browser
62
+ based tests while RSpec is used to test libraries, helpers, etc.
68
63
 
69
64
  ## Coding Standards
70
65
 
71
66
  * 2 spaces per indentation level for Ruby code.
72
67
  * 4 spaces per indentation level for Javascript, CSS and HTML.
73
68
  * Document your code, that includes CSS and Javascript files.
74
- * No tabs at all times
75
- * Markdown is used for all markup
76
- * Comments should be in English
77
- * The maximum width of each line should be no more than 90 columns, this makes it easier
78
- to read code in terminals or when using split view modes.
79
- * Big changes should always be added to the file "CHANGELOG.md".
69
+ * No tabs at all times.
70
+ * Markdown is used for all markup.
71
+ * The maximum width of each line should be no more than 90 characters, this makes it
72
+ easier to read code in terminals or when using split view modes.
80
73
 
81
74
  ## Community
82
75
 
@@ -94,7 +87,7 @@ of the following channels on Freenode:
94
87
  ## License
95
88
 
96
89
  Zen is licensed under the MIT license. For more information about this license open
97
- the file "license.txt".
90
+ the file "LICENSE".
98
91
 
99
92
  [zen website]: http://zen-cms.com/
100
93
  [zen documentation]: http://zen-cms.com/userguide/
data/Rakefile CHANGED
@@ -1,7 +1,6 @@
1
1
  require File.expand_path('../lib/zen', __FILE__)
2
2
 
3
- task_dir = File.expand_path('../lib/zen/task', __FILE__)
4
-
5
- Dir.glob("#{task_dir}/*.rake").each do |f|
3
+ # Load all tasks
4
+ Dir.glob(File.expand_path('../lib/zen/task/*.rake', __FILE__)).each do |f|
6
5
  import(f)
7
6
  end
data/bin/zen CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
-
3
2
  require File.expand_path('../../lib/zen/version', __FILE__)
3
+
4
4
  require 'commander'
5
5
  require 'commander/import'
6
6
 
@@ -8,7 +8,7 @@ require 'commander/import'
8
8
  information = <<-MSG
9
9
  * Website: http://zen-cms.com/
10
10
  * Github: https://github.com/zen-cms
11
- * License: MIT License (found in "license.txt")
11
+ * License: MIT License
12
12
  MSG
13
13
 
14
14
  # Set the details of the application
data/lib/zen.rb CHANGED
@@ -1,9 +1,8 @@
1
- require 'sequel'
2
1
  require 'ramaze'
2
+ require 'sequel'
3
3
  require 'bcrypt'
4
- require 'json'
5
- require 'defensio'
6
4
  require 'sequel_sluggable'
5
+ require 'loofah'
7
6
  require 'yaml'
8
7
  require __DIR__('zen/version')
9
8
 
@@ -13,81 +12,117 @@ require __DIR__('zen/version')
13
12
  #
14
13
  # @author Yorick Peterse
15
14
  # @since 0.1
16
- # @attr_reader [Array] languages An array containing all the currently loaded language
17
- # files stored as hashes.
18
15
  #
19
16
  module Zen
20
- include Innate::Optioned
21
-
22
17
  # Update several paths so we can load helpers/layouts from the Zen gem
23
18
  Innate::HelpersHelper.options.paths.push(__DIR__('zen'))
24
19
  Ramaze.options.roots.push(__DIR__('zen'))
25
-
26
- options.dsl do
27
- o 'The character encoding to use when dealing with data', :encoding, 'utf8'
28
- o 'The date format to use for log files and such.', :date_format, '%d-%m-%Y'
29
- o 'The root directory of Zen.', :root, ''
30
- end
31
-
32
- ##
33
- # Hash containing all system settings.
34
- #
35
- # @author Yorick Peterse
36
- # @since 0.2.5
37
- #
38
- Settings = {}
39
-
40
- ##
41
- # Loads the database and the required models.
42
- #
43
- # @author Yorick Peterse
44
- # @since 0.1
45
- #
46
- def self.init
47
- # Initialize the database
48
- Zen::Database.init
49
- Zen::Language.load('zen_general')
50
-
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
20
 
68
- # Load the JS file if it's there
69
- if File.exist?(js)
70
- ::Zen::Asset.javascript(['global'], :global => true)
21
+ class << self
22
+ ##
23
+ # Variable that will contain a database connection that was established using
24
+ # Sequel.connect.
25
+ #
26
+ # @author Yorick Peterse
27
+ # @since 0.2.6
28
+ #
29
+ attr_accessor :database
30
+
31
+ ##
32
+ # Hash containing all system settings.
33
+ #
34
+ # @author Yorick Peterse
35
+ # @since 0.2.6
36
+ #
37
+ attr_accessor :settings
38
+
39
+ ##
40
+ # String containing the path to the root directory of the Zen application.
41
+ #
42
+ # @author Yorick Peterse
43
+ # @since 0.2.6
44
+ #
45
+ attr_accessor :root
46
+
47
+ ##
48
+ # Loads the database and the required models.
49
+ #
50
+ # @author Yorick Peterse
51
+ # @since 0.1
52
+ #
53
+ def init
54
+ @settings ||= {}
55
+
56
+ # Initialize the database
57
+ Zen::Language.load('zen_general')
58
+
59
+ require __DIR__('zen/model/settings')
60
+ require __DIR__('zen/model/methods')
61
+
62
+ # Load the global stylesheet and Javascript file if they're located in
63
+ # ROOT/public/css/admin/global.css and ROOT/public/js/admin/global.js
64
+ publics = ::Ramaze.options.publics
65
+
66
+ publics.each do |p|
67
+ p = File.join(Zen.root, p)
68
+ css = File.join(p, 'admin/css/global.css')
69
+ js = File.join(p, 'admin/js/global.js')
70
+
71
+ # Load the CSS file if it's there
72
+ if File.exist?(css)
73
+ ::Zen::Asset.stylesheet(['global'], :global => true)
74
+ end
75
+
76
+ # Load the JS file if it's there
77
+ if File.exist?(js)
78
+ ::Zen::Asset.javascript(['global'], :global => true)
79
+ end
71
80
  end
72
81
  end
73
- end
74
82
 
75
- end
83
+ ##
84
+ # Method executed after everything has been set up and loaded.
85
+ #
86
+ # @author Yorick Peterse
87
+ # @since 0.2.6
88
+ #
89
+ def post_init
90
+ # Migrate all settings
91
+ begin
92
+ plugin(:settings, :migrate)
93
+ rescue
94
+ Ramaze::Log.warn(
95
+ "Failed to migrate the settings, make sure the database table is up to date"
96
+ )
97
+ end
98
+
99
+ begin
100
+ ::Settings::Model::Setting.get_settings.each do |k, v|
101
+ Zen.settings[k] = v
102
+ end
103
+ rescue => e
104
+ Ramaze::Log.warn(
105
+ "Failed to retrieve the settings, are you sure the database is migrated?\n" +
106
+ "Error: #{e.message}"
107
+ )
108
+ end
109
+ end
110
+ end # class << self
111
+ end # Zen
76
112
 
77
113
  # Load all classes/modules provided by Zen itself.
78
114
  require __DIR__('zen/validation')
79
- require __DIR__('zen/database')
80
115
  require __DIR__('zen/plugin')
81
116
  require __DIR__('zen/language')
82
- require __DIR__('zen/logger')
83
117
  require __DIR__('zen/asset')
84
118
 
85
- # Load a set of modules into the global namespace
119
+ # Load a set of modules into the global namespace
86
120
  include Zen::Plugin::SingletonMethods
87
121
  include Zen::Language::SingletonMethods
88
122
 
89
123
  # Update the language path
90
124
  Zen::Language.options.paths.push(__DIR__('zen'))
125
+ Zen::Language.load('zen_general')
91
126
 
92
127
  # Load all additional files
93
128
  require __DIR__('zen/plugin/helper')
@@ -102,3 +137,4 @@ require __DIR__('zen/controller/base_controller')
102
137
  require __DIR__('zen/controller/frontend_controller')
103
138
  require __DIR__('zen/controller/admin_controller')
104
139
  require __DIR__('zen/controller/main_controller')
140
+ require __DIR__('zen/controller/preview')