typus 3.0.6 → 3.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (295) hide show
  1. data/.gemtest +0 -0
  2. data/.gitignore +15 -0
  3. data/Gemfile +9 -5
  4. data/Rakefile +34 -21
  5. data/app/controllers/admin/base_controller.rb +0 -4
  6. data/app/controllers/admin/resources_controller.rb +77 -213
  7. data/app/controllers/admin/session_controller.rb +1 -1
  8. data/app/helpers/admin/base_helper.rb +4 -4
  9. data/app/helpers/admin/dashboard_helper.rb +1 -3
  10. data/app/helpers/admin/display_helper.rb +49 -0
  11. data/app/helpers/admin/file_preview_helper.rb +10 -12
  12. data/app/helpers/admin/filters_helper.rb +1 -1
  13. data/app/helpers/admin/form_helper.rb +2 -13
  14. data/app/helpers/admin/list_helper.rb +14 -3
  15. data/app/helpers/admin/relationships_helper.rb +79 -62
  16. data/app/helpers/admin/resources_helper.rb +17 -16
  17. data/app/helpers/admin/search_helper.rb +1 -1
  18. data/app/helpers/admin/sidebar_helper.rb +1 -2
  19. data/app/helpers/admin/table_helper.rb +9 -4
  20. data/app/views/admin/helpers/_file_preview.html.erb +1 -1
  21. data/app/views/admin/helpers/base/_apps.html.erb +23 -0
  22. data/app/views/admin/helpers/{_flash_message.html.erb → base/_flash_message.html.erb} +0 -0
  23. data/app/views/admin/helpers/{_header.html.erb → base/_header.html.erb} +0 -0
  24. data/app/views/admin/helpers/{_login_info.html.erb → base/_login_info.html.erb} +0 -0
  25. data/app/views/admin/helpers/resources/_display_link_to_previous.html.erb +1 -1
  26. data/app/views/admin/resources/show.html.erb +4 -27
  27. data/app/views/admin/templates/_belongs_to_with_autocomplete.html.erb +11 -0
  28. data/app/views/admin/templates/_has_n.html.erb +1 -1
  29. data/app/views/admin/templates/_has_one.html.erb +3 -3
  30. data/app/views/admin/templates/_relate_form.html.erb +1 -1
  31. data/app/views/admin/templates/_relate_form_with_autocomplete.html.erb +24 -0
  32. data/app/views/layouts/admin/base.html.erb +15 -9
  33. data/app/views/layouts/admin/headless.html.erb +44 -0
  34. data/app/views/layouts/admin/session.html.erb +3 -2
  35. data/doc/hudson_setup.md +19 -0
  36. data/lib/generators/typus/assets_generator.rb +0 -4
  37. data/lib/generators/typus/config_generator.rb +107 -0
  38. data/lib/generators/typus/controller_generator.rb +0 -4
  39. data/lib/generators/typus/initializers_generator.rb +22 -0
  40. data/lib/generators/typus/migration_generator.rb +0 -4
  41. data/lib/generators/typus/typus_generator.rb +8 -101
  42. data/lib/generators/typus/views_generator.rb +0 -4
  43. data/lib/support/active_record.rb +8 -2
  44. data/lib/support/fake_user.rb +2 -0
  45. data/lib/support/hash.rb +1 -1
  46. data/lib/support/string.rb +3 -3
  47. data/lib/tasks/typus.rake +1 -1
  48. data/lib/typus.rb +15 -6
  49. data/lib/typus/controller/actions.rb +69 -0
  50. data/lib/typus/controller/associations.rb +82 -0
  51. data/lib/typus/controller/autocomplete.rb +16 -0
  52. data/lib/typus/controller/filters.rb +24 -0
  53. data/lib/typus/controller/format.rb +70 -0
  54. data/lib/typus/orm/active_record.rb +9 -240
  55. data/lib/typus/orm/active_record/class_methods.rb +227 -0
  56. data/lib/typus/orm/active_record/instance_methods.rb +13 -0
  57. data/lib/typus/orm/active_record/search.rb +17 -5
  58. data/lib/typus/orm/active_record/user.rb +157 -0
  59. data/lib/typus/regex.rb +11 -0
  60. data/lib/typus/version.rb +1 -1
  61. data/test/app/controllers/admin/account_controller_test.rb +104 -0
  62. data/test/app/controllers/admin/assets_controller_test.rb +153 -0
  63. data/test/app/controllers/admin/base_controller_test.rb +41 -0
  64. data/test/app/controllers/admin/birds_controller_test.rb +42 -0
  65. data/test/app/controllers/admin/cases_controller_test.rb +21 -0
  66. data/test/app/controllers/admin/categories_controller_test.rb +141 -0
  67. data/test/app/controllers/admin/comments_controller_test.rb +79 -0
  68. data/test/app/controllers/admin/dashboard_controller_test.rb +162 -0
  69. data/test/app/controllers/admin/image_holders_controller_test.rb +75 -0
  70. data/test/app/controllers/admin/invoices_controller_test.rb +78 -0
  71. data/test/app/controllers/admin/orders_controller_test.rb +18 -0
  72. data/test/app/controllers/admin/pages_controller_test.rb +37 -0
  73. data/test/app/controllers/admin/posts_controller_test.rb +745 -0
  74. data/test/app/controllers/admin/projects_controller_test.rb +52 -0
  75. data/test/app/controllers/admin/session_controller_test.rb +92 -0
  76. data/test/app/controllers/admin/status_controller_test.rb +54 -0
  77. data/test/app/controllers/admin/typus_users_controller_test.rb +160 -0
  78. data/test/app/controllers/admin/users_controller_test.rb +106 -0
  79. data/test/app/helpers/admin/base_helper_test.rb +83 -0
  80. data/test/app/helpers/admin/dashboard_helper_test.rb +32 -0
  81. data/test/app/helpers/admin/file_preview_helper_test.rb +82 -0
  82. data/test/app/helpers/admin/filters_helper_test.rb +161 -0
  83. data/test/app/helpers/admin/form_helper_test.rb +126 -0
  84. data/test/app/helpers/admin/list_helper_test.rb +59 -0
  85. data/test/app/helpers/admin/relationships_helper_test.rb +19 -0
  86. data/test/app/helpers/admin/resources_helper_test.rb +46 -0
  87. data/test/app/helpers/admin/search_helper_test.rb +60 -0
  88. data/test/app/helpers/admin/sidebar_helper_test.rb +34 -0
  89. data/test/app/helpers/admin/table_helper_test.rb +215 -0
  90. data/test/app/mailers/admin/mailer_test.rb +32 -0
  91. data/test/app/models/typus_user_roles_test.rb +124 -0
  92. data/test/app/models/typus_user_test.rb +194 -0
  93. data/test/config/routes_test.rb +29 -0
  94. data/test/factories.rb +111 -0
  95. data/test/fixtures/config/broken/application.yml +68 -0
  96. data/test/fixtures/config/broken/application_roles.yml +20 -0
  97. data/test/fixtures/config/broken/empty.yml +0 -0
  98. data/test/fixtures/config/broken/empty_roles.yml +0 -0
  99. data/test/fixtures/config/broken/undefined.yml +3 -0
  100. data/test/fixtures/config/broken/undefined_roles.yml +6 -0
  101. data/test/fixtures/config/default/typus.yml +13 -0
  102. data/test/fixtures/config/default/typus_roles.yml +2 -0
  103. data/test/fixtures/config/empty/empty_01.yml +0 -0
  104. data/test/fixtures/config/empty/empty_01_roles.yml +0 -0
  105. data/test/fixtures/config/empty/empty_02.yml +0 -0
  106. data/test/fixtures/config/empty/empty_02_roles.yml +0 -0
  107. data/test/fixtures/config/locales/es.yml +10 -0
  108. data/test/fixtures/config/namespaced/application.yml +5 -0
  109. data/test/fixtures/config/namespaced/application_roles.yml +2 -0
  110. data/test/fixtures/config/ordered/001_roles.yml +2 -0
  111. data/test/fixtures/config/ordered/002_roles.yml +2 -0
  112. data/test/fixtures/config/unordered/app_one_roles.yml +2 -0
  113. data/test/fixtures/config/unordered/app_two_roles.yml +2 -0
  114. data/test/fixtures/rails_app/.gitignore +4 -0
  115. data/test/fixtures/rails_app/Capfile +6 -0
  116. data/test/fixtures/rails_app/README +256 -0
  117. data/test/fixtures/rails_app/Rakefile +7 -0
  118. data/test/fixtures/rails_app/app/controllers/admin/animals_controller.rb +2 -0
  119. data/test/fixtures/rails_app/app/controllers/admin/articles_controller.rb +2 -0
  120. data/test/fixtures/rails_app/app/controllers/admin/assets_controller.rb +51 -0
  121. data/test/fixtures/rails_app/app/controllers/admin/birds_controller.rb +2 -0
  122. data/test/fixtures/rails_app/app/controllers/admin/cases_controller.rb +2 -0
  123. data/test/fixtures/rails_app/app/controllers/admin/categories_controller.rb +2 -0
  124. data/test/fixtures/rails_app/app/controllers/admin/comments_controller.rb +2 -0
  125. data/test/fixtures/rails_app/app/controllers/admin/dogs_controller.rb +2 -0
  126. data/test/fixtures/rails_app/app/controllers/admin/entries_controller.rb +2 -0
  127. data/test/fixtures/rails_app/app/controllers/admin/image_holders_controller.rb +2 -0
  128. data/test/fixtures/rails_app/app/controllers/admin/invoices_controller.rb +2 -0
  129. data/test/fixtures/rails_app/app/controllers/admin/orders_controller.rb +2 -0
  130. data/test/fixtures/rails_app/app/controllers/admin/pages_controller.rb +7 -0
  131. data/test/fixtures/rails_app/app/controllers/admin/posts_controller.rb +2 -0
  132. data/test/fixtures/rails_app/app/controllers/admin/project_collaborators_controller.rb +2 -0
  133. data/test/fixtures/rails_app/app/controllers/admin/projects_controller.rb +2 -0
  134. data/test/fixtures/rails_app/app/controllers/admin/status_controller.rb +2 -0
  135. data/test/fixtures/rails_app/app/controllers/admin/typus_users_controller.rb +2 -0
  136. data/test/fixtures/rails_app/app/controllers/admin/users_controller.rb +2 -0
  137. data/test/fixtures/rails_app/app/controllers/admin/views_controller.rb +2 -0
  138. data/test/fixtures/rails_app/app/controllers/admin/watch_dog_controller.rb +2 -0
  139. data/test/fixtures/rails_app/app/controllers/application_controller.rb +3 -0
  140. data/test/fixtures/rails_app/app/helpers/application_helper.rb +2 -0
  141. data/test/fixtures/rails_app/app/helpers/form_helper.rb +3 -0
  142. data/test/fixtures/rails_app/app/models/animal.rb +21 -0
  143. data/test/fixtures/rails_app/app/models/article.rb +10 -0
  144. data/test/fixtures/rails_app/app/models/asset.rb +39 -0
  145. data/test/fixtures/rails_app/app/models/bird.rb +2 -0
  146. data/test/fixtures/rails_app/app/models/case.rb +2 -0
  147. data/test/fixtures/rails_app/app/models/category.rb +31 -0
  148. data/test/fixtures/rails_app/app/models/comment.rb +17 -0
  149. data/test/fixtures/rails_app/app/models/delayed/task.rb +5 -0
  150. data/test/fixtures/rails_app/app/models/dog.rb +2 -0
  151. data/test/fixtures/rails_app/app/models/entry.rb +23 -0
  152. data/test/fixtures/rails_app/app/models/image_holder.rb +21 -0
  153. data/test/fixtures/rails_app/app/models/invoice.rb +10 -0
  154. data/test/fixtures/rails_app/app/models/order.rb +9 -0
  155. data/test/fixtures/rails_app/app/models/page.rb +24 -0
  156. data/test/fixtures/rails_app/app/models/post.rb +32 -0
  157. data/test/fixtures/rails_app/app/models/project.rb +17 -0
  158. data/test/fixtures/rails_app/app/models/project_collaborator.rb +16 -0
  159. data/test/fixtures/rails_app/app/models/typus_user.rb +22 -0
  160. data/test/fixtures/rails_app/app/models/user.rb +10 -0
  161. data/test/fixtures/rails_app/app/models/view.rb +17 -0
  162. data/test/fixtures/rails_app/app/views/admin/assets/_index.html.erb +3 -0
  163. data/test/fixtures/rails_app/app/views/admin/cases/_index.html.erb +3 -0
  164. data/test/fixtures/rails_app/app/views/admin/categories/_index.html.erb +3 -0
  165. data/test/fixtures/rails_app/app/views/admin/dashboard/_sidebar.html.erb +11 -0
  166. data/test/fixtures/rails_app/app/views/admin/entries/_index.html.erb +3 -0
  167. data/test/fixtures/rails_app/app/views/admin/pages/_index.html.erb +3 -0
  168. data/test/fixtures/rails_app/app/views/admin/posts/_edit.html.erb +1 -0
  169. data/test/fixtures/rails_app/app/views/admin/posts/_index.html.erb +5 -0
  170. data/test/fixtures/rails_app/app/views/admin/posts/_new.html.erb +1 -0
  171. data/test/fixtures/rails_app/app/views/admin/posts/_show.html.erb +1 -0
  172. data/test/fixtures/rails_app/app/views/admin/resources/_sidebar.html.erb +1 -0
  173. data/test/fixtures/rails_app/app/views/admin/status/index.html.erb +9 -0
  174. data/test/fixtures/rails_app/app/views/admin/templates/_datepicker.html.erb +1 -0
  175. data/test/fixtures/rails_app/app/views/admin/watch_dog/index.html.erb +9 -0
  176. data/test/fixtures/rails_app/app/views/layouts/admin/headless.html.erb +38 -0
  177. data/test/fixtures/rails_app/config.ru +4 -0
  178. data/test/fixtures/rails_app/config/application.rb +44 -0
  179. data/test/fixtures/rails_app/config/boot.rb +13 -0
  180. data/test/fixtures/rails_app/config/database.yml +34 -0
  181. data/test/fixtures/rails_app/config/deploy.rb +32 -0
  182. data/test/fixtures/rails_app/config/environment.rb +5 -0
  183. data/test/fixtures/rails_app/config/environments/development.rb +32 -0
  184. data/test/fixtures/rails_app/config/environments/production.rb +54 -0
  185. data/test/fixtures/rails_app/config/environments/test.rb +40 -0
  186. data/test/fixtures/rails_app/config/initializers/backtrace_silencers.rb +7 -0
  187. data/test/fixtures/rails_app/config/initializers/dragonfly.rb +1 -0
  188. data/test/fixtures/rails_app/config/initializers/inflections.rb +12 -0
  189. data/test/fixtures/rails_app/config/initializers/mime_types.rb +5 -0
  190. data/test/fixtures/rails_app/config/initializers/secret_token.rb +7 -0
  191. data/test/fixtures/rails_app/config/initializers/session_store.rb +8 -0
  192. data/test/fixtures/rails_app/config/initializers/typus.rb +5 -0
  193. data/test/fixtures/rails_app/config/initializers/typus_resources.rb +27 -0
  194. data/test/fixtures/rails_app/config/locales/en.yml +5 -0
  195. data/test/fixtures/rails_app/config/routes.rb +61 -0
  196. data/test/fixtures/rails_app/config/typus/README +68 -0
  197. data/test/fixtures/rails_app/config/typus/crud_basic.yml +10 -0
  198. data/test/fixtures/rails_app/config/typus/crud_basic_roles.yml +2 -0
  199. data/test/fixtures/rails_app/config/typus/crud_extended.yml +64 -0
  200. data/test/fixtures/rails_app/config/typus/crud_extended_roles.yml +18 -0
  201. data/test/fixtures/rails_app/config/typus/has_many.yml +0 -0
  202. data/test/fixtures/rails_app/config/typus/has_many_roles.yml +0 -0
  203. data/test/fixtures/rails_app/config/typus/has_many_through.yml +23 -0
  204. data/test/fixtures/rails_app/config/typus/has_many_through_roles.yml +4 -0
  205. data/test/fixtures/rails_app/config/typus/has_one.yml +12 -0
  206. data/test/fixtures/rails_app/config/typus/has_one_roles.yml +3 -0
  207. data/test/fixtures/rails_app/config/typus/polymorphic.yml +17 -0
  208. data/test/fixtures/rails_app/config/typus/polymorphic_roles.yml +5 -0
  209. data/test/fixtures/rails_app/config/typus/resource_roles.yml +7 -0
  210. data/test/fixtures/rails_app/config/typus/sti.yml +5 -0
  211. data/test/fixtures/rails_app/config/typus/sti_roles.yml +2 -0
  212. data/test/fixtures/rails_app/config/typus/typus.yml +13 -0
  213. data/test/fixtures/rails_app/config/typus/typus_roles.yml +2 -0
  214. data/test/fixtures/rails_app/config/typus/unknown.yml +3 -0
  215. data/test/fixtures/rails_app/config/typus/unknown_roles.yml +5 -0
  216. data/test/fixtures/rails_app/db/.gitkeep +0 -0
  217. data/test/fixtures/rails_app/db/schema.rb +174 -0
  218. data/test/fixtures/rails_app/db/seeds.rb +54 -0
  219. data/test/fixtures/rails_app/db/seeds/assets/000.jpg +0 -0
  220. data/test/fixtures/rails_app/db/seeds/assets/001.jpg +0 -0
  221. data/test/fixtures/rails_app/db/seeds/assets/002.jpg +0 -0
  222. data/test/fixtures/rails_app/db/seeds/assets/003.jpg +0 -0
  223. data/test/fixtures/rails_app/db/seeds/assets/004.jpg +0 -0
  224. data/test/fixtures/rails_app/public/404.html +26 -0
  225. data/test/fixtures/rails_app/public/422.html +26 -0
  226. data/test/fixtures/rails_app/public/500.html +26 -0
  227. data/test/fixtures/rails_app/public/favicon.ico +0 -0
  228. data/test/fixtures/rails_app/public/images/rails.png +0 -0
  229. data/test/fixtures/rails_app/public/javascripts/application.js +2 -0
  230. data/test/fixtures/rails_app/public/javascripts/controls.js +965 -0
  231. data/test/fixtures/rails_app/public/javascripts/dragdrop.js +974 -0
  232. data/test/fixtures/rails_app/public/javascripts/effects.js +1123 -0
  233. data/test/fixtures/rails_app/public/javascripts/prototype.js +6001 -0
  234. data/test/fixtures/rails_app/public/javascripts/rails.js +175 -0
  235. data/test/fixtures/rails_app/public/robots.txt +5 -0
  236. data/test/fixtures/rails_app/public/stylesheets/.gitkeep +0 -0
  237. data/test/fixtures/rails_app/script/rails +6 -0
  238. data/test/lib/support/active_record_test.rb +150 -0
  239. data/test/lib/support/fake_user_test.rb +59 -0
  240. data/test/lib/support/hash_test.rb +29 -0
  241. data/test/lib/support/object_test.rb +17 -0
  242. data/test/lib/support/string_test.rb +116 -0
  243. data/test/lib/typus/configuration_test.rb +46 -0
  244. data/test/lib/typus/controller/actions_test.rb +141 -0
  245. data/test/lib/typus/controller/associations_test.rb +7 -0
  246. data/test/lib/typus/controller/autocomplete_test.rb +7 -0
  247. data/test/lib/typus/controller/filters_test.rb +73 -0
  248. data/test/lib/typus/controller/format_test.rb +7 -0
  249. data/test/lib/typus/i18n_test.rb +9 -0
  250. data/test/lib/typus/orm/active_record/class_methods_test.rb +378 -0
  251. data/test/lib/typus/orm/active_record/search_test.rb +330 -0
  252. data/test/lib/typus/regex_test.rb +53 -0
  253. data/test/lib/typus/resources_test.rb +41 -0
  254. data/test/lib/typus_test.rb +141 -0
  255. data/test/test_helper.rb +15 -0
  256. data/typus.gemspec +25 -0
  257. metadata +586 -64
  258. data/Gemfile.lock +0 -149
  259. data/app/views/admin/helpers/_apps.html.erb +0 -9
  260. data/lib/generators/templates/public/admin/javascripts/application.js +0 -2
  261. data/lib/generators/templates/public/admin/javascripts/jquery-1.4.4.min.js +0 -167
  262. data/lib/generators/templates/public/admin/javascripts/jquery.application.js +0 -16
  263. data/lib/generators/templates/public/admin/javascripts/jquery.rails.js +0 -160
  264. data/lib/generators/templates/public/admin/javascripts/jquery.searchField.js +0 -91
  265. data/lib/generators/templates/public/admin/stylesheets/application.css +0 -11
  266. data/lib/generators/templates/public/admin/stylesheets/screen.css +0 -367
  267. data/lib/generators/templates/public/admin/vendor/fancybox/blank.gif +0 -0
  268. data/lib/generators/templates/public/admin/vendor/fancybox/fancy_close.png +0 -0
  269. data/lib/generators/templates/public/admin/vendor/fancybox/fancy_loading.png +0 -0
  270. data/lib/generators/templates/public/admin/vendor/fancybox/fancy_nav_left.png +0 -0
  271. data/lib/generators/templates/public/admin/vendor/fancybox/fancy_nav_right.png +0 -0
  272. data/lib/generators/templates/public/admin/vendor/fancybox/fancy_shadow_e.png +0 -0
  273. data/lib/generators/templates/public/admin/vendor/fancybox/fancy_shadow_n.png +0 -0
  274. data/lib/generators/templates/public/admin/vendor/fancybox/fancy_shadow_ne.png +0 -0
  275. data/lib/generators/templates/public/admin/vendor/fancybox/fancy_shadow_nw.png +0 -0
  276. data/lib/generators/templates/public/admin/vendor/fancybox/fancy_shadow_s.png +0 -0
  277. data/lib/generators/templates/public/admin/vendor/fancybox/fancy_shadow_se.png +0 -0
  278. data/lib/generators/templates/public/admin/vendor/fancybox/fancy_shadow_sw.png +0 -0
  279. data/lib/generators/templates/public/admin/vendor/fancybox/fancy_shadow_w.png +0 -0
  280. data/lib/generators/templates/public/admin/vendor/fancybox/fancy_title_left.png +0 -0
  281. data/lib/generators/templates/public/admin/vendor/fancybox/fancy_title_main.png +0 -0
  282. data/lib/generators/templates/public/admin/vendor/fancybox/fancy_title_over.png +0 -0
  283. data/lib/generators/templates/public/admin/vendor/fancybox/fancy_title_right.png +0 -0
  284. data/lib/generators/templates/public/admin/vendor/fancybox/fancybox-x.png +0 -0
  285. data/lib/generators/templates/public/admin/vendor/fancybox/fancybox-y.png +0 -0
  286. data/lib/generators/templates/public/admin/vendor/fancybox/fancybox.png +0 -0
  287. data/lib/generators/templates/public/admin/vendor/fancybox/jquery.easing-1.3.pack.js +0 -72
  288. data/lib/generators/templates/public/admin/vendor/fancybox/jquery.fancybox-1.3.4.css +0 -359
  289. data/lib/generators/templates/public/admin/vendor/fancybox/jquery.fancybox-1.3.4.js +0 -1156
  290. data/lib/generators/templates/public/admin/vendor/fancybox/jquery.fancybox-1.3.4.pack.js +0 -46
  291. data/lib/generators/templates/public/admin/vendor/fancybox/jquery.mousewheel-3.0.4.pack.js +0 -14
  292. data/lib/typus/actions.rb +0 -41
  293. data/lib/typus/filters.rb +0 -12
  294. data/lib/typus/format.rb +0 -70
  295. data/lib/typus/user.rb +0 -157
@@ -0,0 +1,68 @@
1
+ Page:
2
+ fields:
3
+ # Body field is overrided from a Page class method.
4
+ list: title, body, status
5
+ form: title, body, status
6
+ relationships:
7
+ has_many: assets
8
+ application: Site
9
+
10
+ Asset:
11
+ fields:
12
+ list: caption
13
+ form: caption
14
+ application: Site
15
+
16
+ Category:
17
+ fields:
18
+ list: name, position
19
+ form: name, permalink, position
20
+ order_by: position
21
+ module: Post
22
+
23
+ Post:
24
+ fields:
25
+ list: title, created_at, status
26
+ form: title, body, created_at, status
27
+ relationship: title, created_at
28
+ options:
29
+ selectors: status
30
+ read_only: permalink
31
+ auto_generated: created_at
32
+ date_formats:
33
+ created_at: short
34
+ relationships: assets, categories
35
+ actions:
36
+ index: cleanup
37
+ edit: send_as_newsletter, preview
38
+ filters: status, created_at, user, user_id
39
+ search: title
40
+ order_by: title, -created_at
41
+ application: Blog
42
+
43
+ User:
44
+ fields:
45
+ list: first_name, last_name, email
46
+
47
+ Comment:
48
+ fields:
49
+ list: email, post, post_id
50
+ form: email, post
51
+ filters: post
52
+ search: email, body
53
+ application: Blog
54
+
55
+ TypusUser:
56
+ fields:
57
+ list: first_name, last_name, email, role, status
58
+ form: first_name, last_name, email, role, password, password_confirmation
59
+ relationship: first_name, last_name, role, email, status
60
+ options:
61
+ selectors: role
62
+ booleans:
63
+ status: active, inactive
64
+ filters: status, role, unexisting
65
+ search: first_name, last_name, email, role
66
+ module: Typus
67
+ description: System Users Administration
68
+ application: Typus
@@ -0,0 +1,20 @@
1
+ admin:
2
+ Asset: create, read, update, delete
3
+ Category: create, read, update, delete
4
+ Comment: create, read, update, delete
5
+ TypusUser: create, read, update, delete
6
+ Page: create, read, update, delete
7
+ Post: create, read, update, delete
8
+ Status: index
9
+ Order:
10
+
11
+ editor:
12
+ Category: create, read, update
13
+ Comment: read, update, delete
14
+ Post: create, read, update
15
+ TypusUser: read, update
16
+
17
+ designer:
18
+ Category: read, update
19
+ Comment: read
20
+ Post: read
File without changes
File without changes
@@ -0,0 +1,3 @@
1
+ Page:
2
+
3
+ User:
@@ -0,0 +1,6 @@
1
+ admin:
2
+
3
+ designer:
4
+ Category: read, update
5
+ Comment: read
6
+ Post: read
@@ -0,0 +1,13 @@
1
+ TypusUser:
2
+ fields:
3
+ default: first_name, last_name, role, email
4
+ list: email, role, status
5
+ form: first_name, last_name, role, email, password, password_confirmation
6
+ options:
7
+ selectors: role
8
+ booleans:
9
+ status: Active, Inactive
10
+ filters: status, role
11
+ search: first_name, last_name, email, role
12
+ application: Typus
13
+ description: System Users Administration
@@ -0,0 +1,2 @@
1
+ admin:
2
+ TypusUser: create, read, update, delete
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,10 @@
1
+ # Spanish translations for Rails
2
+ # by Francisco Fernando García Nieto (ffgarcianieto@gmail.com)
3
+
4
+ es:
5
+ activerecord:
6
+ models:
7
+ # Overrides default messages
8
+ comment: "Comentario"
9
+ attributes:
10
+ # Overrides model and default messages.
@@ -0,0 +1,5 @@
1
+ Delayed::Task:
2
+ fields:
3
+ default: name
4
+ search: name
5
+ application: System
@@ -0,0 +1,2 @@
1
+ admin:
2
+ Delayed::Task: all
@@ -0,0 +1,2 @@
1
+ admin:
2
+ categories: read, update
@@ -0,0 +1,2 @@
1
+ admin:
2
+ categories: read
@@ -0,0 +1,2 @@
1
+ admin:
2
+ categories: read
@@ -0,0 +1,2 @@
1
+ admin:
2
+ categories: read, update
@@ -0,0 +1,4 @@
1
+ .bundle
2
+ db/*.sqlite3
3
+ log/*.log
4
+ tmp/**/*
@@ -0,0 +1,6 @@
1
+ require 'bundler/capistrano'
2
+
3
+ load 'deploy' if respond_to?(:namespace) # cap2 differentiator
4
+ Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
5
+
6
+ load 'config/deploy' # remove this line to skip loading any of the default tasks
@@ -0,0 +1,256 @@
1
+ == Welcome to Rails
2
+
3
+ Rails is a web-application framework that includes everything needed to create
4
+ database-backed web applications according to the Model-View-Control pattern.
5
+
6
+ This pattern splits the view (also called the presentation) into "dumb"
7
+ templates that are primarily responsible for inserting pre-built data in between
8
+ HTML tags. The model contains the "smart" domain objects (such as Account,
9
+ Product, Person, Post) that holds all the business logic and knows how to
10
+ persist themselves to a database. The controller handles the incoming requests
11
+ (such as Save New Account, Update Product, Show Post) by manipulating the model
12
+ and directing data to the view.
13
+
14
+ In Rails, the model is handled by what's called an object-relational mapping
15
+ layer entitled Active Record. This layer allows you to present the data from
16
+ database rows as objects and embellish these data objects with business logic
17
+ methods. You can read more about Active Record in
18
+ link:files/vendor/rails/activerecord/README.html.
19
+
20
+ The controller and view are handled by the Action Pack, which handles both
21
+ layers by its two parts: Action View and Action Controller. These two layers
22
+ are bundled in a single package due to their heavy interdependence. This is
23
+ unlike the relationship between the Active Record and Action Pack that is much
24
+ more separate. Each of these packages can be used independently outside of
25
+ Rails. You can read more about Action Pack in
26
+ link:files/vendor/rails/actionpack/README.html.
27
+
28
+
29
+ == Getting Started
30
+
31
+ 1. At the command prompt, create a new Rails application:
32
+ <tt>rails new myapp</tt> (where <tt>myapp</tt> is the application name)
33
+
34
+ 2. Change directory to <tt>myapp</tt> and start the web server:
35
+ <tt>cd myapp; rails server</tt> (run with --help for options)
36
+
37
+ 3. Go to http://localhost:3000/ and you'll see:
38
+ "Welcome aboard: You're riding Ruby on Rails!"
39
+
40
+ 4. Follow the guidelines to start developing your application. You can find
41
+ the following resources handy:
42
+
43
+ * The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html
44
+ * Ruby on Rails Tutorial Book: http://www.railstutorial.org/
45
+
46
+
47
+ == Debugging Rails
48
+
49
+ Sometimes your application goes wrong. Fortunately there are a lot of tools that
50
+ will help you debug it and get it back on the rails.
51
+
52
+ First area to check is the application log files. Have "tail -f" commands
53
+ running on the server.log and development.log. Rails will automatically display
54
+ debugging and runtime information to these files. Debugging info will also be
55
+ shown in the browser on requests from 127.0.0.1.
56
+
57
+ You can also log your own messages directly into the log file from your code
58
+ using the Ruby logger class from inside your controllers. Example:
59
+
60
+ class WeblogController < ActionController::Base
61
+ def destroy
62
+ @weblog = Weblog.find(params[:id])
63
+ @weblog.destroy
64
+ logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
65
+ end
66
+ end
67
+
68
+ The result will be a message in your log file along the lines of:
69
+
70
+ Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1!
71
+
72
+ More information on how to use the logger is at http://www.ruby-doc.org/core/
73
+
74
+ Also, Ruby documentation can be found at http://www.ruby-lang.org/. There are
75
+ several books available online as well:
76
+
77
+ * Programming Ruby: http://www.ruby-doc.org/docs/ProgrammingRuby/ (Pickaxe)
78
+ * Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
79
+
80
+ These two books will bring you up to speed on the Ruby language and also on
81
+ programming in general.
82
+
83
+
84
+ == Debugger
85
+
86
+ Debugger support is available through the debugger command when you start your
87
+ Mongrel or WEBrick server with --debugger. This means that you can break out of
88
+ execution at any point in the code, investigate and change the model, and then,
89
+ resume execution! You need to install ruby-debug to run the server in debugging
90
+ mode. With gems, use <tt>sudo gem install ruby-debug</tt>. Example:
91
+
92
+ class WeblogController < ActionController::Base
93
+ def index
94
+ @posts = Post.find(:all)
95
+ debugger
96
+ end
97
+ end
98
+
99
+ So the controller will accept the action, run the first line, then present you
100
+ with a IRB prompt in the server window. Here you can do things like:
101
+
102
+ >> @posts.inspect
103
+ => "[#<Post:0x14a6be8
104
+ @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>,
105
+ #<Post:0x14a6620
106
+ @attributes={"title"=>"Rails", "body"=>"Only ten..", "id"=>"2"}>]"
107
+ >> @posts.first.title = "hello from a debugger"
108
+ => "hello from a debugger"
109
+
110
+ ...and even better, you can examine how your runtime objects actually work:
111
+
112
+ >> f = @posts.first
113
+ => #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
114
+ >> f.
115
+ Display all 152 possibilities? (y or n)
116
+
117
+ Finally, when you're ready to resume execution, you can enter "cont".
118
+
119
+
120
+ == Console
121
+
122
+ The console is a Ruby shell, which allows you to interact with your
123
+ application's domain model. Here you'll have all parts of the application
124
+ configured, just like it is when the application is running. You can inspect
125
+ domain models, change values, and save to the database. Starting the script
126
+ without arguments will launch it in the development environment.
127
+
128
+ To start the console, run <tt>rails console</tt> from the application
129
+ directory.
130
+
131
+ Options:
132
+
133
+ * Passing the <tt>-s, --sandbox</tt> argument will rollback any modifications
134
+ made to the database.
135
+ * Passing an environment name as an argument will load the corresponding
136
+ environment. Example: <tt>rails console production</tt>.
137
+
138
+ To reload your controllers and models after launching the console run
139
+ <tt>reload!</tt>
140
+
141
+ More information about irb can be found at:
142
+ link:http://www.rubycentral.com/pickaxe/irb.html
143
+
144
+
145
+ == dbconsole
146
+
147
+ You can go to the command line of your database directly through <tt>rails
148
+ dbconsole</tt>. You would be connected to the database with the credentials
149
+ defined in database.yml. Starting the script without arguments will connect you
150
+ to the development database. Passing an argument will connect you to a different
151
+ database, like <tt>rails dbconsole production</tt>. Currently works for MySQL,
152
+ PostgreSQL and SQLite 3.
153
+
154
+ == Description of Contents
155
+
156
+ The default directory structure of a generated Ruby on Rails application:
157
+
158
+ |-- app
159
+ | |-- controllers
160
+ | |-- helpers
161
+ | |-- mailers
162
+ | |-- models
163
+ | `-- views
164
+ | `-- layouts
165
+ |-- config
166
+ | |-- environments
167
+ | |-- initializers
168
+ | `-- locales
169
+ |-- db
170
+ |-- doc
171
+ |-- lib
172
+ | `-- tasks
173
+ |-- log
174
+ |-- public
175
+ | |-- images
176
+ | |-- javascripts
177
+ | `-- stylesheets
178
+ |-- script
179
+ |-- test
180
+ | |-- fixtures
181
+ | |-- functional
182
+ | |-- integration
183
+ | |-- performance
184
+ | `-- unit
185
+ |-- tmp
186
+ | |-- cache
187
+ | |-- pids
188
+ | |-- sessions
189
+ | `-- sockets
190
+ `-- vendor
191
+ `-- plugins
192
+
193
+ app
194
+ Holds all the code that's specific to this particular application.
195
+
196
+ app/controllers
197
+ Holds controllers that should be named like weblogs_controller.rb for
198
+ automated URL mapping. All controllers should descend from
199
+ ApplicationController which itself descends from ActionController::Base.
200
+
201
+ app/models
202
+ Holds models that should be named like post.rb. Models descend from
203
+ ActiveRecord::Base by default.
204
+
205
+ app/views
206
+ Holds the template files for the view that should be named like
207
+ weblogs/index.html.erb for the WeblogsController#index action. All views use
208
+ eRuby syntax by default.
209
+
210
+ app/views/layouts
211
+ Holds the template files for layouts to be used with views. This models the
212
+ common header/footer method of wrapping views. In your views, define a layout
213
+ using the <tt>layout :default</tt> and create a file named default.html.erb.
214
+ Inside default.html.erb, call <% yield %> to render the view using this
215
+ layout.
216
+
217
+ app/helpers
218
+ Holds view helpers that should be named like weblogs_helper.rb. These are
219
+ generated for you automatically when using generators for controllers.
220
+ Helpers can be used to wrap functionality for your views into methods.
221
+
222
+ config
223
+ Configuration files for the Rails environment, the routing map, the database,
224
+ and other dependencies.
225
+
226
+ db
227
+ Contains the database schema in schema.rb. db/migrate contains all the
228
+ sequence of Migrations for your schema.
229
+
230
+ doc
231
+ This directory is where your application documentation will be stored when
232
+ generated using <tt>rake doc:app</tt>
233
+
234
+ lib
235
+ Application specific libraries. Basically, any kind of custom code that
236
+ doesn't belong under controllers, models, or helpers. This directory is in
237
+ the load path.
238
+
239
+ public
240
+ The directory available for the web server. Contains subdirectories for
241
+ images, stylesheets, and javascripts. Also contains the dispatchers and the
242
+ default HTML files. This should be set as the DOCUMENT_ROOT of your web
243
+ server.
244
+
245
+ script
246
+ Helper scripts for automation and generation.
247
+
248
+ test
249
+ Unit and functional tests along with fixtures. When using the rails generate
250
+ command, template test files will be generated for you and placed in this
251
+ directory.
252
+
253
+ vendor
254
+ External libraries that the application depends on. Also includes the plugins
255
+ subdirectory. If the app has frozen rails, those gems also go here, under
256
+ vendor/rails/. This directory is in the load path.