typus 3.0.12 → 3.1.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (339) hide show
  1. data/Gemfile +10 -16
  2. data/README.md +7 -10
  3. data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/blank.gif +0 -0
  4. data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_close.png +0 -0
  5. data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_loading.png +0 -0
  6. data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_nav_left.png +0 -0
  7. data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_nav_right.png +0 -0
  8. data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_shadow_e.png +0 -0
  9. data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_shadow_n.png +0 -0
  10. data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_shadow_ne.png +0 -0
  11. data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_shadow_nw.png +0 -0
  12. data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_shadow_s.png +0 -0
  13. data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_shadow_se.png +0 -0
  14. data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_shadow_sw.png +0 -0
  15. data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_shadow_w.png +0 -0
  16. data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_title_left.png +0 -0
  17. data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_title_main.png +0 -0
  18. data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_title_over.png +0 -0
  19. data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_title_right.png +0 -0
  20. data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancybox-x.png +0 -0
  21. data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancybox-y.png +0 -0
  22. data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancybox.png +0 -0
  23. data/app/assets/javascripts/typus/application.js +7 -0
  24. data/app/assets/{vendor/typus/javascripts/application.js → javascripts/typus/custom.js} +0 -0
  25. data/app/assets/{vendor/typus/javascripts → javascripts/typus}/jquery.application.js +6 -8
  26. data/app/assets/{vendor/typus/javascripts → javascripts/typus}/jquery.rails.autocomplete.js +0 -0
  27. data/app/assets/{vendor/typus/javascripts → javascripts/typus}/jquery.searchField.js +0 -0
  28. data/app/assets/stylesheets/typus/application.css +7 -0
  29. data/app/assets/{vendor/typus/stylesheets/application.css → stylesheets/typus/custom.css} +0 -0
  30. data/app/assets/stylesheets/typus/pagination.css +17 -0
  31. data/app/assets/{vendor/typus/stylesheets → stylesheets/typus}/reset.css +0 -0
  32. data/app/assets/{vendor/typus/stylesheets → stylesheets/typus}/screen.css +2 -27
  33. data/app/assets/vendor/{typus/vendor/jquery-tokeninput → jquery-tokeninput}/css/token-input-facebook.css +0 -0
  34. data/app/assets/vendor/{typus/vendor/jquery-tokeninput → jquery-tokeninput}/css/token-input-mac.css +0 -0
  35. data/app/assets/vendor/{typus/vendor/jquery-tokeninput → jquery-tokeninput}/css/token-input.css +0 -0
  36. data/app/assets/vendor/{typus/vendor/jquery-tokeninput → jquery-tokeninput}/js/jquery.tokeninput.js +0 -0
  37. data/app/assets/vendor/{typus/vendor/jquery-ui-1.8.12.custom → jquery-ui-1.8.12.custom}/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  38. data/app/assets/vendor/{typus/vendor/jquery-ui-1.8.12.custom → jquery-ui-1.8.12.custom}/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  39. data/app/assets/vendor/{typus/vendor/jquery-ui-1.8.12.custom → jquery-ui-1.8.12.custom}/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  40. data/app/assets/vendor/{typus/vendor/jquery-ui-1.8.12.custom → jquery-ui-1.8.12.custom}/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  41. data/app/assets/vendor/{typus/vendor/jquery-ui-1.8.12.custom → jquery-ui-1.8.12.custom}/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  42. data/app/assets/vendor/{typus/vendor/jquery-ui-1.8.12.custom → jquery-ui-1.8.12.custom}/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  43. data/app/assets/vendor/{typus/vendor/jquery-ui-1.8.12.custom → jquery-ui-1.8.12.custom}/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  44. data/app/assets/vendor/{typus/vendor/jquery-ui-1.8.12.custom → jquery-ui-1.8.12.custom}/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  45. data/app/assets/vendor/{typus/vendor/jquery-ui-1.8.12.custom → jquery-ui-1.8.12.custom}/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  46. data/app/assets/vendor/{typus/vendor/jquery-ui-1.8.12.custom → jquery-ui-1.8.12.custom}/css/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  47. data/app/assets/vendor/{typus/vendor/jquery-ui-1.8.12.custom → jquery-ui-1.8.12.custom}/css/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  48. data/app/assets/vendor/{typus/vendor/jquery-ui-1.8.12.custom → jquery-ui-1.8.12.custom}/css/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  49. data/app/assets/vendor/{typus/vendor/jquery-ui-1.8.12.custom → jquery-ui-1.8.12.custom}/css/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  50. data/app/assets/vendor/{typus/vendor/jquery-ui-1.8.12.custom → jquery-ui-1.8.12.custom}/css/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  51. data/app/assets/vendor/{typus/vendor/jquery-ui-1.8.12.custom → jquery-ui-1.8.12.custom}/css/ui-lightness/jquery-ui-1.8.12.custom.css +0 -0
  52. data/app/assets/vendor/{typus/vendor/jquery-ui-1.8.12.custom → jquery-ui-1.8.12.custom}/index.html +0 -0
  53. data/app/assets/vendor/{typus/vendor/jquery-ui-1.8.12.custom → jquery-ui-1.8.12.custom}/js/jquery-ui-1.8.12.custom.min.js +0 -0
  54. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/blank.gif +0 -0
  55. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_close.png +0 -0
  56. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_loading.png +0 -0
  57. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_nav_left.png +0 -0
  58. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_nav_right.png +0 -0
  59. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_shadow_e.png +0 -0
  60. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_shadow_n.png +0 -0
  61. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_shadow_ne.png +0 -0
  62. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_shadow_nw.png +0 -0
  63. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_shadow_s.png +0 -0
  64. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_shadow_se.png +0 -0
  65. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_shadow_sw.png +0 -0
  66. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_shadow_w.png +0 -0
  67. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_title_left.png +0 -0
  68. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_title_main.png +0 -0
  69. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_title_over.png +0 -0
  70. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_title_right.png +0 -0
  71. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancybox-x.png +0 -0
  72. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancybox-y.png +0 -0
  73. data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancybox.png +0 -0
  74. data/app/assets/vendor/{typus/vendor/jquery.fancybox-1.3.4 → jquery.fancybox-1.3.4}/fancybox/jquery.easing-1.3.pack.js +0 -0
  75. data/app/assets/vendor/{typus/vendor/jquery.fancybox-1.3.4 → jquery.fancybox-1.3.4}/fancybox/jquery.fancybox-1.3.4.css +0 -0
  76. data/app/assets/vendor/{typus/vendor/jquery.fancybox-1.3.4 → jquery.fancybox-1.3.4}/fancybox/jquery.fancybox-1.3.4.js +0 -0
  77. data/app/assets/vendor/{typus/vendor/jquery.fancybox-1.3.4 → jquery.fancybox-1.3.4}/fancybox/jquery.fancybox-1.3.4.pack.js +0 -0
  78. data/app/assets/vendor/{typus/vendor/jquery.fancybox-1.3.4 → jquery.fancybox-1.3.4}/fancybox/jquery.mousewheel-3.0.4.pack.js +0 -0
  79. data/app/controllers/admin/base_controller.rb +5 -3
  80. data/app/controllers/admin/resources_controller.rb +3 -7
  81. data/app/controllers/admin/session_controller.rb +2 -5
  82. data/app/helpers/admin/base_helper.rb +1 -1
  83. data/app/helpers/admin/display_helper.rb +0 -2
  84. data/app/helpers/admin/file_preview_helper.rb +10 -10
  85. data/app/helpers/admin/filters_helper.rb +1 -1
  86. data/app/helpers/admin/relationships_helper.rb +20 -21
  87. data/app/helpers/admin/sidebar_helper.rb +1 -8
  88. data/app/helpers/admin/table_helper.rb +8 -8
  89. data/app/views/admin/dashboard/_applications.html.erb +1 -1
  90. data/app/views/admin/helpers/base/_apps.html.erb +2 -7
  91. data/app/views/admin/helpers/base/_header.html.erb +1 -1
  92. data/app/views/admin/helpers/resources/_errors.html.erb +1 -1
  93. data/app/views/admin/helpers/sidebar/_sidebar.html.erb +1 -1
  94. data/app/views/admin/resources/index.html.erb +4 -4
  95. data/app/views/admin/shared/_head.html.erb +2 -17
  96. data/app/views/admin/templates/_belongs_to_with_autocomplete.html.erb +1 -1
  97. data/app/views/admin/templates/_has_n.html.erb +3 -3
  98. data/app/views/admin/templates/_has_one.html.erb +2 -2
  99. data/app/views/admin/templates/_selector.html.erb +7 -2
  100. data/config/locales/typus.ca.yml +1 -1
  101. data/config/locales/typus.de.models.yml +5 -6
  102. data/config/locales/typus.de.yml +36 -39
  103. data/config/locales/typus.el.yml +1 -1
  104. data/config/locales/typus.es.yml +1 -1
  105. data/config/locales/typus.fr.yml +1 -2
  106. data/config/locales/typus.hu.yml +1 -1
  107. data/config/locales/typus.locale.yml.template +1 -1
  108. data/config/locales/typus.pt-BR.yml +1 -1
  109. data/config/locales/typus.ru.yml +1 -1
  110. data/config/locales/typus.zh-CN.yml +1 -1
  111. data/config/routes.rb +2 -2
  112. data/lib/generators/templates/config/initializers/typus.rb +1 -3
  113. data/lib/generators/templates/config/typus/README +0 -1
  114. data/lib/generators/typus/migration_generator.rb +0 -3
  115. data/lib/support/active_record.rb +7 -9
  116. data/lib/typus.rb +7 -8
  117. data/lib/typus/authentication/session.rb +3 -2
  118. data/lib/typus/controller/associations.rb +2 -2
  119. data/lib/typus/controller/format.rb +3 -3
  120. data/lib/typus/engine.rb +2 -6
  121. data/lib/typus/i18n.rb +4 -0
  122. data/lib/typus/orm/active_record/admin_user_v1.rb +13 -12
  123. data/lib/typus/orm/active_record/admin_user_v2.rb +31 -1
  124. data/lib/typus/orm/active_record/class_methods.rb +1 -0
  125. data/lib/typus/orm/base.rb +0 -4
  126. data/lib/typus/regex.rb +2 -0
  127. data/lib/typus/version.rb +1 -1
  128. data/test/app/controllers/admin/account_controller_test.rb +94 -0
  129. data/test/app/controllers/admin/assets_controller_test.rb +156 -0
  130. data/test/app/controllers/admin/base_controller_test.rb +25 -0
  131. data/test/app/controllers/admin/birds_controller_test.rb +33 -0
  132. data/test/app/controllers/admin/cases_controller_test.rb +20 -0
  133. data/test/app/controllers/admin/categories_controller_test.rb +134 -0
  134. data/test/app/controllers/admin/comments_controller_test.rb +71 -0
  135. data/test/app/controllers/admin/dashboard_controller_test.rb +150 -0
  136. data/test/app/controllers/admin/image_holders_controller_test.rb +74 -0
  137. data/test/app/controllers/admin/invoices_controller_test.rb +77 -0
  138. data/test/app/controllers/admin/orders_controller_test.rb +17 -0
  139. data/test/app/controllers/admin/pages_controller_test.rb +33 -0
  140. data/test/app/controllers/admin/posts_controller_test.rb +764 -0
  141. data/test/app/controllers/admin/projects_controller_test.rb +48 -0
  142. data/test/app/controllers/admin/session_controller_test.rb +91 -0
  143. data/test/app/controllers/admin/status_controller_test.rb +33 -0
  144. data/test/app/controllers/admin/typus_users_controller_test.rb +154 -0
  145. data/test/app/controllers/admin/users_controller_test.rb +101 -0
  146. data/test/app/controllers/admin/views_controller_test.rb +36 -0
  147. data/test/app/helpers/admin/base_helper_test.rb +75 -0
  148. data/test/app/helpers/admin/dashboard_helper_test.rb +28 -0
  149. data/test/app/helpers/admin/file_preview_helper_test.rb +90 -0
  150. data/test/app/helpers/admin/filters_helper_test.rb +166 -0
  151. data/test/app/helpers/admin/form_helper_test.rb +126 -0
  152. data/test/app/helpers/admin/list_helper_test.rb +76 -0
  153. data/test/app/helpers/admin/relationships_helper_test.rb +19 -0
  154. data/test/app/helpers/admin/resources_helper_test.rb +46 -0
  155. data/test/app/helpers/admin/search_helper_test.rb +56 -0
  156. data/test/app/helpers/admin/sidebar_helper_test.rb +20 -0
  157. data/test/app/helpers/admin/table_helper_test.rb +245 -0
  158. data/test/app/mailers/admin/mailer_test.rb +20 -0
  159. data/test/app/models/admin_user_test.rb +22 -0
  160. data/test/app/models/typus_user_roles_test.rb +125 -0
  161. data/test/app/models/typus_user_test.rb +145 -0
  162. data/test/app/models/user_test.rb +38 -0
  163. data/test/config/routes_test.rb +30 -0
  164. data/test/factories.rb +134 -0
  165. data/test/fixtures/config/broken/application.yml +68 -0
  166. data/test/fixtures/config/broken/application_roles.yml +20 -0
  167. data/test/fixtures/config/broken/empty.yml +0 -0
  168. data/test/fixtures/config/broken/empty_roles.yml +0 -0
  169. data/test/fixtures/config/broken/undefined.yml +3 -0
  170. data/test/fixtures/config/broken/undefined_roles.yml +6 -0
  171. data/test/fixtures/config/default/typus.yml +13 -0
  172. data/test/fixtures/config/default/typus_roles.yml +2 -0
  173. data/test/fixtures/config/empty/empty_01.yml +0 -0
  174. data/test/fixtures/config/empty/empty_01_roles.yml +0 -0
  175. data/test/fixtures/config/empty/empty_02.yml +0 -0
  176. data/test/fixtures/config/empty/empty_02_roles.yml +0 -0
  177. data/test/fixtures/config/locales/es.yml +10 -0
  178. data/test/fixtures/config/namespaced/application.yml +5 -0
  179. data/test/fixtures/config/namespaced/application_roles.yml +2 -0
  180. data/test/fixtures/config/ordered/001_roles.yml +2 -0
  181. data/test/fixtures/config/ordered/002_roles.yml +2 -0
  182. data/test/fixtures/config/unordered/app_one_roles.yml +2 -0
  183. data/test/fixtures/config/unordered/app_two_roles.yml +2 -0
  184. data/test/fixtures/rails_app/.gitignore +4 -0
  185. data/test/fixtures/rails_app/Capfile +7 -0
  186. data/test/fixtures/rails_app/README +256 -0
  187. data/test/fixtures/rails_app/Rakefile +7 -0
  188. data/test/fixtures/rails_app/app/controllers/admin/admin_users_controller.rb +2 -0
  189. data/test/fixtures/rails_app/app/controllers/admin/animals_controller.rb +2 -0
  190. data/test/fixtures/rails_app/app/controllers/admin/article/entries_controller.rb +2 -0
  191. data/test/fixtures/rails_app/app/controllers/admin/assets_controller.rb +51 -0
  192. data/test/fixtures/rails_app/app/controllers/admin/birds_controller.rb +2 -0
  193. data/test/fixtures/rails_app/app/controllers/admin/cases_controller.rb +2 -0
  194. data/test/fixtures/rails_app/app/controllers/admin/categories_controller.rb +2 -0
  195. data/test/fixtures/rails_app/app/controllers/admin/comments_controller.rb +2 -0
  196. data/test/fixtures/rails_app/app/controllers/admin/dogs_controller.rb +2 -0
  197. data/test/fixtures/rails_app/app/controllers/admin/entries_controller.rb +2 -0
  198. data/test/fixtures/rails_app/app/controllers/admin/hits_controller.rb +37 -0
  199. data/test/fixtures/rails_app/app/controllers/admin/image_holders_controller.rb +2 -0
  200. data/test/fixtures/rails_app/app/controllers/admin/invoices_controller.rb +2 -0
  201. data/test/fixtures/rails_app/app/controllers/admin/orders_controller.rb +2 -0
  202. data/test/fixtures/rails_app/app/controllers/admin/pages_controller.rb +7 -0
  203. data/test/fixtures/rails_app/app/controllers/admin/posts_controller.rb +2 -0
  204. data/test/fixtures/rails_app/app/controllers/admin/project_collaborators_controller.rb +2 -0
  205. data/test/fixtures/rails_app/app/controllers/admin/projects_controller.rb +2 -0
  206. data/test/fixtures/rails_app/app/controllers/admin/status_controller.rb +2 -0
  207. data/test/fixtures/rails_app/app/controllers/admin/typus_users_controller.rb +2 -0
  208. data/test/fixtures/rails_app/app/controllers/admin/users_controller.rb +2 -0
  209. data/test/fixtures/rails_app/app/controllers/admin/views_controller.rb +8 -0
  210. data/test/fixtures/rails_app/app/controllers/admin/watch_dog_controller.rb +2 -0
  211. data/test/fixtures/rails_app/app/controllers/application_controller.rb +3 -0
  212. data/test/fixtures/rails_app/app/helpers/application_helper.rb +2 -0
  213. data/test/fixtures/rails_app/app/helpers/form_helper.rb +3 -0
  214. data/test/fixtures/rails_app/app/models/admin_user.rb +7 -0
  215. data/test/fixtures/rails_app/app/models/animal.rb +21 -0
  216. data/test/fixtures/rails_app/app/models/article.rb +10 -0
  217. data/test/fixtures/rails_app/app/models/article/entry.rb +2 -0
  218. data/test/fixtures/rails_app/app/models/asset.rb +45 -0
  219. data/test/fixtures/rails_app/app/models/bird.rb +2 -0
  220. data/test/fixtures/rails_app/app/models/case.rb +2 -0
  221. data/test/fixtures/rails_app/app/models/category.rb +31 -0
  222. data/test/fixtures/rails_app/app/models/comment.rb +17 -0
  223. data/test/fixtures/rails_app/app/models/delayed/task.rb +5 -0
  224. data/test/fixtures/rails_app/app/models/dog.rb +2 -0
  225. data/test/fixtures/rails_app/app/models/entry.rb +23 -0
  226. data/test/fixtures/rails_app/app/models/hit.rb +27 -0
  227. data/test/fixtures/rails_app/app/models/image_holder.rb +21 -0
  228. data/test/fixtures/rails_app/app/models/invoice.rb +10 -0
  229. data/test/fixtures/rails_app/app/models/order.rb +9 -0
  230. data/test/fixtures/rails_app/app/models/page.rb +24 -0
  231. data/test/fixtures/rails_app/app/models/post.rb +32 -0
  232. data/test/fixtures/rails_app/app/models/project.rb +17 -0
  233. data/test/fixtures/rails_app/app/models/project_collaborator.rb +16 -0
  234. data/test/fixtures/rails_app/app/models/site.rb +16 -0
  235. data/test/fixtures/rails_app/app/models/typus_user.rb +15 -0
  236. data/test/fixtures/rails_app/app/models/user.rb +16 -0
  237. data/test/fixtures/rails_app/app/models/view.rb +19 -0
  238. data/test/fixtures/rails_app/app/views/admin/assets/_index.html.erb +3 -0
  239. data/test/fixtures/rails_app/app/views/admin/cases/_index.html.erb +3 -0
  240. data/test/fixtures/rails_app/app/views/admin/categories/_index.html.erb +3 -0
  241. data/test/fixtures/rails_app/app/views/admin/dashboard/_sidebar.html.erb +11 -0
  242. data/test/fixtures/rails_app/app/views/admin/entries/_index.html.erb +3 -0
  243. data/test/fixtures/rails_app/app/views/admin/hits/_edit.html.erb +7 -0
  244. data/test/fixtures/rails_app/app/views/admin/hits/_index.html.erb +3 -0
  245. data/test/fixtures/rails_app/app/views/admin/hits/index.html.erb +28 -0
  246. data/test/fixtures/rails_app/app/views/admin/pages/_index.html.erb +3 -0
  247. data/test/fixtures/rails_app/app/views/admin/posts/_edit.html.erb +1 -0
  248. data/test/fixtures/rails_app/app/views/admin/posts/_index.html.erb +5 -0
  249. data/test/fixtures/rails_app/app/views/admin/posts/_new.html.erb +1 -0
  250. data/test/fixtures/rails_app/app/views/admin/posts/_show.html.erb +1 -0
  251. data/test/fixtures/rails_app/app/views/admin/resources/_sidebar.html.erb +1 -0
  252. data/test/fixtures/rails_app/app/views/admin/status/index.html.erb +9 -0
  253. data/test/fixtures/rails_app/app/views/admin/templates/_datepicker.html.erb +1 -0
  254. data/test/fixtures/rails_app/app/views/admin/watch_dog/index.html.erb +9 -0
  255. data/test/fixtures/rails_app/config.ru +4 -0
  256. data/test/fixtures/rails_app/config/application.rb +55 -0
  257. data/test/fixtures/rails_app/config/boot.rb +6 -0
  258. data/test/fixtures/rails_app/config/database.yml +42 -0
  259. data/test/fixtures/rails_app/config/deploy.rb +36 -0
  260. data/test/fixtures/rails_app/config/environment.rb +5 -0
  261. data/test/fixtures/rails_app/config/environments/development.rb +38 -0
  262. data/test/fixtures/rails_app/config/environments/production.rb +57 -0
  263. data/test/fixtures/rails_app/config/environments/test.rb +44 -0
  264. data/test/fixtures/rails_app/config/initializers/backtrace_silencers.rb +7 -0
  265. data/test/fixtures/rails_app/config/initializers/dragonfly.rb +1 -0
  266. data/test/fixtures/rails_app/config/initializers/inflections.rb +11 -0
  267. data/test/fixtures/rails_app/config/initializers/mime_types.rb +5 -0
  268. data/test/fixtures/rails_app/config/initializers/secret_token.rb +7 -0
  269. data/test/fixtures/rails_app/config/initializers/session_store.rb +8 -0
  270. data/test/fixtures/rails_app/config/initializers/wrap_parameters.rb +12 -0
  271. data/test/fixtures/rails_app/config/locales/en.yml +5 -0
  272. data/test/fixtures/rails_app/config/mongoid.yml +20 -0
  273. data/test/fixtures/rails_app/config/routes.rb +61 -0
  274. data/test/fixtures/rails_app/config/typus/README +68 -0
  275. data/test/fixtures/rails_app/config/typus/admin.yml +16 -0
  276. data/test/fixtures/rails_app/config/typus/admin_roles.yml +3 -0
  277. data/test/fixtures/rails_app/config/typus/crud_basic.yml +10 -0
  278. data/test/fixtures/rails_app/config/typus/crud_basic_roles.yml +2 -0
  279. data/test/fixtures/rails_app/config/typus/crud_extended.yml +66 -0
  280. data/test/fixtures/rails_app/config/typus/crud_extended_roles.yml +18 -0
  281. data/test/fixtures/rails_app/config/typus/crud_namespaced.yml +10 -0
  282. data/test/fixtures/rails_app/config/typus/crud_namespaced_roles.yml +2 -0
  283. data/test/fixtures/rails_app/config/typus/has_many.yml +0 -0
  284. data/test/fixtures/rails_app/config/typus/has_many_roles.yml +0 -0
  285. data/test/fixtures/rails_app/config/typus/has_many_through.yml +23 -0
  286. data/test/fixtures/rails_app/config/typus/has_many_through_roles.yml +4 -0
  287. data/test/fixtures/rails_app/config/typus/has_one.yml +12 -0
  288. data/test/fixtures/rails_app/config/typus/has_one_roles.yml +3 -0
  289. data/test/fixtures/rails_app/config/typus/mongo_db.yml +4 -0
  290. data/test/fixtures/rails_app/config/typus/mongo_db_roles.yml +2 -0
  291. data/test/fixtures/rails_app/config/typus/polymorphic.yml +17 -0
  292. data/test/fixtures/rails_app/config/typus/polymorphic_roles.yml +5 -0
  293. data/test/fixtures/rails_app/config/typus/resource_roles.yml +7 -0
  294. data/test/fixtures/rails_app/config/typus/sti.yml +5 -0
  295. data/test/fixtures/rails_app/config/typus/sti_roles.yml +2 -0
  296. data/test/fixtures/rails_app/config/typus/unknown.yml +3 -0
  297. data/test/fixtures/rails_app/config/typus/unknown_roles.yml +5 -0
  298. data/test/fixtures/rails_app/db/.gitkeep +0 -0
  299. data/test/fixtures/rails_app/db/schema.rb +209 -0
  300. data/test/fixtures/rails_app/db/seeds.rb +58 -0
  301. data/test/fixtures/rails_app/db/seeds/assets/000.jpg +0 -0
  302. data/test/fixtures/rails_app/db/seeds/assets/001.jpg +0 -0
  303. data/test/fixtures/rails_app/db/seeds/assets/002.jpg +0 -0
  304. data/test/fixtures/rails_app/db/seeds/assets/003.jpg +0 -0
  305. data/test/fixtures/rails_app/db/seeds/assets/004.jpg +0 -0
  306. data/test/fixtures/rails_app/public/404.html +26 -0
  307. data/test/fixtures/rails_app/public/422.html +26 -0
  308. data/test/fixtures/rails_app/public/500.html +26 -0
  309. data/test/fixtures/rails_app/public/favicon.ico +0 -0
  310. data/test/fixtures/rails_app/public/images/rails.png +0 -0
  311. data/test/fixtures/rails_app/public/robots.txt +5 -0
  312. data/test/fixtures/rails_app/public/stylesheets/.gitkeep +0 -0
  313. data/test/fixtures/rails_app/script/rails +6 -0
  314. data/test/lib/support/active_record_test.rb +139 -0
  315. data/test/lib/support/fake_user_test.rb +63 -0
  316. data/test/lib/support/hash_test.rb +25 -0
  317. data/test/lib/support/object_test.rb +10 -0
  318. data/test/lib/support/string_test.rb +80 -0
  319. data/test/lib/typus/configuration_test.rb +48 -0
  320. data/test/lib/typus/controller/actions_test.rb +141 -0
  321. data/test/lib/typus/controller/associations_test.rb +7 -0
  322. data/test/lib/typus/controller/autocomplete_test.rb +7 -0
  323. data/test/lib/typus/controller/filters_test.rb +73 -0
  324. data/test/lib/typus/controller/format_test.rb +7 -0
  325. data/test/lib/typus/i18n_test.rb +13 -0
  326. data/test/lib/typus/orm/active_record/class_methods_test.rb +381 -0
  327. data/test/lib/typus/orm/active_record/search_test.rb +328 -0
  328. data/test/lib/typus/regex_test.rb +62 -0
  329. data/test/lib/typus/resources_test.rb +41 -0
  330. data/test/lib/typus_test.rb +132 -0
  331. data/test/test_helper.rb +41 -0
  332. data/typus.gemspec +3 -10
  333. metadata +525 -137
  334. data/.gitmodules +0 -3
  335. data/app/assets/vendor/typus/javascripts/jquery.rails.js +0 -158
  336. data/app/assets/vendor/typus/vendor/jquery-ui-1.8.12.custom/js/jquery-1.5.1.min.js +0 -16
  337. data/app/views/admin/templates/_text_with_ckeditor.html.erb +0 -13
  338. data/config/locales/typus.pt-PT.models.yml +0 -17
  339. data/config/locales/typus.pt-PT.yml +0 -83
@@ -63,16 +63,16 @@ module Admin
63
63
  end
64
64
 
65
65
  def typus_file_preview_for_paperclip(attachment, options = {})
66
- if attachment.exists?
67
- styles = attachment.styles.keys
68
- if styles.include?(Typus.file_preview) && styles.include?(Typus.file_thumbnail)
69
- render "admin/helpers/file_preview",
70
- :preview => attachment.url(Typus.file_preview, false),
71
- :thumb => attachment.url(Typus.file_thumbnail, false),
72
- :options => options
73
- else
74
- link_to attachment.original_filename, attachment.url(:original, false)
75
- end
66
+ return unless attachment.exists?
67
+
68
+ styles = attachment.styles.keys
69
+ if attachment.content_type =~ /^image\/.+/ && styles.include?(Typus.file_preview) && styles.include?(Typus.file_thumbnail)
70
+ render "admin/helpers/file_preview",
71
+ :preview => attachment.url(Typus.file_preview, false),
72
+ :thumb => attachment.url(Typus.file_thumbnail, false),
73
+ :options => options
74
+ else
75
+ link_to attachment.original_filename, attachment.url(:original, false)
76
76
  end
77
77
  end
78
78
 
@@ -42,7 +42,7 @@ module Admin
42
42
  att_assoc = @resource.reflect_on_association(key.to_sym)
43
43
  class_name = att_assoc.options[:class_name] || key.capitalize.camelize
44
44
  resource = class_name.typus_constantize
45
- att_assoc.primary_key_name
45
+ att_assoc.foreign_key
46
46
  else
47
47
  key
48
48
  end
@@ -12,12 +12,12 @@ module Admin
12
12
  def typus_form_has_many(field)
13
13
  setup_relationship(field)
14
14
 
15
- options = @reflection.through_reflection ? {} : { @reflection.primary_key_name => @item.id }
15
+ options = @reflection.through_reflection ? {} : { @reflection.foreign_key => @item.id }
16
16
 
17
17
  count_items_to_relate = @model_to_relate.order(@model_to_relate.typus_order_by).count - @item.send(field).count
18
18
 
19
19
  if set_condition && !count_items_to_relate.zero?
20
- form = if Typus.autocomplete
20
+ form = if Typus.autocomplete && (count_items_to_relate > Typus.autocomplete)
21
21
  build_relate_form('admin/templates/relate_form_with_autocomplete')
22
22
  else
23
23
  @items_to_relate = @model_to_relate.order(@model_to_relate.typus_order_by) - @item.send(field)
@@ -38,7 +38,6 @@ module Admin
38
38
 
39
39
  render "admin/templates/has_n",
40
40
  :association_name => @association_name,
41
- :association_title => @model_to_relate.model_name.human(:count => 2),
42
41
  :add_new => build_add_new(options),
43
42
  :form => form,
44
43
  :table => build_relationship_table
@@ -50,7 +49,7 @@ module Admin
50
49
  count_items_to_relate = @model_to_relate.order(@model_to_relate.typus_order_by).count - @item.send(field).count
51
50
 
52
51
  if set_condition && !count_items_to_relate.zero?
53
- form = if Typus.autocomplete
52
+ form = if Typus.autocomplete && (count_items_to_relate > Typus.autocomplete)
54
53
  build_relate_form('admin/templates/relate_form_with_autocomplete')
55
54
  else
56
55
  @items_to_relate = @model_to_relate.order(@model_to_relate.typus_order_by) - @item.send(field)
@@ -66,7 +65,6 @@ module Admin
66
65
 
67
66
  render "admin/templates/has_n",
68
67
  :association_name => @association_name,
69
- :association_title => @model_to_relate.model_name.human(:count => 2),
70
68
  :add_new => build_add_new,
71
69
  :form => form,
72
70
  :table => build_relationship_table
@@ -75,7 +73,7 @@ module Admin
75
73
  def build_pagination
76
74
  items_per_page = @model_to_relate.typus_options_for(:per_page)
77
75
  data = @item.send(@field).order(@model_to_relate.typus_order_by).where(set_conditions)
78
- @items = data.paginate(:per_page => items_per_page, :page => params[:page])
76
+ @items = data.page(params[:page]).per(items_per_page)
79
77
  end
80
78
 
81
79
  def build_relate_form(template = "admin/templates/relate_form")
@@ -132,11 +130,10 @@ module Admin
132
130
  @resource_actions = [["Edit", {:action=>"edit"}, {}],
133
131
  ["Trash", {:resource_id=>@item.id, :resource=>@resource.model_name, :action=>"destroy"}, {:confirm=>"Trash?"}]]
134
132
 
135
- options = { :resource_id => nil, @reflection.primary_key_name => @item.id }
133
+ options = { :resource_id => nil, @reflection.foreign_key => @item.id }
136
134
 
137
135
  render "admin/templates/has_one",
138
136
  :association_name => @association_name,
139
- :association_title => @model_to_relate.model_name.human,
140
137
  :add_new => @items.empty? ? build_add_new(options) : nil,
141
138
  :table => build_relationship_table
142
139
  end
@@ -148,7 +145,7 @@ module Admin
148
145
  else
149
146
  association.class_name.typus_constantize
150
147
  end
151
- related_fk = association.primary_key_name
148
+ related_fk = association.foreign_key
152
149
 
153
150
  # TODO: Use the build_add_new method.
154
151
  if admin_user.can?('create', related)
@@ -161,19 +158,21 @@ module Admin
161
158
  message = link_to Typus::I18n.t("Add new"), options
162
159
  end
163
160
 
164
- # By default the used template is ALWAYS `belongs_to` unless we have the
165
- # `Typus.autocomplete` feature enabled.
166
- template = Typus.autocomplete ? "belongs_to_with_autocomplete" : "belongs_to"
167
-
168
- # If `Typus.autocomplete` is enabled we don't set the values as will be
169
- # autocompleted.
170
- if related.respond_to?(:roots)
171
- values = expand_tree_into_select_field(related.roots, related_fk)
172
- elsif !Typus.autocomplete
173
- values = related.order(related.typus_order_by).map { |p| [p.to_label, p.id] }
174
- end
161
+ # Set the template.
162
+ template = if Typus.autocomplete && (related.respond_to?(:roots) || !(related.count > Typus.autocomplete))
163
+ "admin/templates/belongs_to"
164
+ else
165
+ "admin/templates/belongs_to_with_autocomplete"
166
+ end
167
+
168
+ # Set the values.
169
+ values = if related.respond_to?(:roots)
170
+ expand_tree_into_select_field(related.roots, related_fk)
171
+ elsif Typus.autocomplete && !(related.count > Typus.autocomplete)
172
+ related.order(related.typus_order_by).map { |p| [p.to_label, p.id] }
173
+ end
175
174
 
176
- render "admin/templates/#{template}",
175
+ render template,
177
176
  :association => association,
178
177
  :resource => @resource,
179
178
  :attribute => attribute,
@@ -5,12 +5,11 @@ module Admin
5
5
  resources = ActiveSupport::OrderedHash.new
6
6
  app_name = @resource.typus_application
7
7
 
8
- admin_user.application(app_name) {|a,b| a.typus_constantize.model_name.human <=> b.typus_constantize.model_name.human}.each do |resource|
8
+ admin_user.application(app_name).sort {|a,b| a.typus_constantize.model_name.human <=> b.typus_constantize.model_name.human}.each do |resource|
9
9
  klass = resource.typus_constantize
10
10
 
11
11
  resources[resource] = default_actions(klass)
12
12
  resources[resource] += custom_actions(klass)
13
- resources[resource] += export(klass) if params[:action] == 'index'
14
13
 
15
14
  resources[resource].compact!
16
15
  end
@@ -33,11 +32,5 @@ module Admin
33
32
  end
34
33
  end
35
34
 
36
- def export(klass, params = params)
37
- klass.typus_export_formats.map do |format|
38
- link_to Typus::I18n.t("Export as %{mime}", :mime => format.upcase), params.merge(:format => format)
39
- end
40
- end
41
-
42
35
  end
43
36
  end
@@ -19,7 +19,7 @@ module Admin
19
19
 
20
20
  if params[:action].eql?('index') && model.typus_options_for(:sortable)
21
21
  association = model.reflect_on_association(key.to_sym)
22
- order_by = association ? association.primary_key_name : key
22
+ order_by = association ? association.foreign_key : key
23
23
 
24
24
  if (model.model_fields.map(&:first).map { |i| i.to_s }.include?(key) || model.reflect_on_all_associations(:belongs_to).map(&:name).include?(key.to_sym))
25
25
  sort_order = case params[:sort_order]
@@ -85,22 +85,22 @@ module Admin
85
85
  (raw_content = item.send(attribute)).present? ? truncate(raw_content) : "&mdash;".html_safe
86
86
  end
87
87
 
88
- def table_string_field(attribute, item)
88
+ def table_generic_field(attribute, item)
89
89
  (raw_content = item.send(attribute)).present? ? raw_content : "&mdash;".html_safe
90
90
  end
91
91
 
92
- alias :table_float_field :table_string_field
93
- alias :table_integer_field :table_string_field
94
- alias :table_decimal_field :table_string_field
95
- alias :table_virtual_field :table_string_field
96
- alias :table_password_field :table_string_field
92
+ alias :table_float_field :table_generic_field
93
+ alias :table_integer_field :table_generic_field
94
+ alias :table_decimal_field :table_generic_field
95
+ alias :table_virtual_field :table_generic_field
96
+ alias :table_string_field :table_generic_field
97
97
 
98
98
  def table_selector_field(attribute, item)
99
99
  item.mapping(attribute)
100
100
  end
101
101
 
102
102
  def table_file_field(attribute, item)
103
- typus_file_preview(item, attribute, { :height => 60, :width => 60})
103
+ typus_file_preview(item, attribute, { :height => 25, :width => 25})
104
104
  end
105
105
 
106
106
  def table_tree_field(attribute, item)
@@ -12,7 +12,7 @@
12
12
 
13
13
  <%
14
14
  klass = model.typus_constantize
15
- klass_human_name = klass.model_name.human(:count => 2)
15
+ klass_human_name = klass.model_name.human.pluralize
16
16
  admin_items_path = { :controller => "/admin/#{klass.to_resource}" }
17
17
  %>
18
18
 
@@ -8,15 +8,10 @@
8
8
 
9
9
  <%
10
10
  apps = admin_user.application(application)
11
- klass = (@resource && apps.include?(@resource.model_name)) ? 'active' : nil
11
+ klass = 'active' if (@resource && apps.include?(@resource.model_name))
12
12
  %>
13
13
 
14
- <%
15
- url = { :controller => "/admin/#{apps.first.tableize}" }
16
- html_options = { :class => klass }
17
- %>
18
-
19
- <li><%= link_to Typus::I18n.t(application), url, html_options %></li>
14
+ <li><%= link_to Typus::I18n.t(application), { :controller => "/admin/#{apps.first.tableize}" }, { :class => klass } %></li>
20
15
 
21
16
  <% end %>
22
17
 
@@ -1,6 +1,6 @@
1
1
  <h1 class="logo">
2
2
  <% if has_root_path? %>
3
- <%= link_to Typus.admin_title, root_path, :title => Typus::I18n.t("View site") %>
3
+ <%= link_to Typus.admin_title, main_app.root_path, :title => Typus::I18n.t("View site") %>
4
4
  <% else %>
5
5
  <%= Typus.admin_title %>
6
6
  <% end %>
@@ -1,6 +1,6 @@
1
1
  <% if @item.errors.any? %>
2
2
  <div id="errorExplanation">
3
- <h3><%= Typus::I18n.t("%{errors} errors prohibited this page from being saved:", :errors => @item.errors.count) %></h3>
3
+ <h3><%= Typus::I18n.t("%{errors} prohibited this page from being saved:", :errors => pluralize(@item.errors.count, "error")) %></h3>
4
4
  <ul>
5
5
  <% @item.errors.full_messages.each do |full_message| %>
6
6
  <li><%= full_message %></li>
@@ -6,7 +6,7 @@
6
6
  %>
7
7
 
8
8
  <%= link_to :controller => resource, :action => "index" do %>
9
- <h3><%= klass.model_name.human(:count => 2) %></h3>
9
+ <h3><%= klass.model_name.human.pluralize %></h3>
10
10
  <% end %>
11
11
 
12
12
  <% if @resource.model_name.eql?(key) %>
@@ -1,5 +1,5 @@
1
1
  <%
2
- page_title = @resource.model_name.human(:count => 2)
2
+ page_title = @resource.model_name.human.pluralize
3
3
  title(page_title)
4
4
  %>
5
5
 
@@ -15,7 +15,7 @@
15
15
  <%= render 'index' %>
16
16
 
17
17
  <ul class="predefined_filters">
18
- <li><%= link_to Typus::I18n.t("All"), :action => 'index' %> (<%= resource.count %>)</li>
18
+ <li><%= link_to Typus::I18n.t("All"), :action => 'index' %> (<%= set_context.count %>)</li>
19
19
  <% predefined_filters.each do |filter, action, scope| %>
20
20
  <% url = action.is_a?(String) ? params.dup.cleanup.merge(:action => action) : action %>
21
21
  <li><%= link_to Typus::I18n.t(filter), url %> <%= "(#{@resource.send(scope).count})" if scope && @resource.respond_to?(scope) %></li>
@@ -31,7 +31,7 @@
31
31
 
32
32
  <% if @items.any? -%>
33
33
  <%= build_list(@resource, fields, @items) %>
34
- <%= will_paginate(@items, Typus.pagination) %>
34
+ <%= paginate(@items, Typus.pagination) %>
35
35
  <% else %>
36
- <p><%= Typus::I18n.t("No %{resources} found.", :resources => @resource.model_name.human(:count => 2)) %></p>
36
+ <p><%= Typus::I18n.t("No %{resources} found.", :resources => @resource.model_name.human.downcase.pluralize) %></p>
37
37
  <% end %>
@@ -6,25 +6,10 @@
6
6
 
7
7
  <title><%= Typus.admin_title %> &mdash; <%= yield :title %></title>
8
8
 
9
- <%= stylesheet_link_tag "/vendor/typus/stylesheets/reset",
10
- "/vendor/typus/vendor/jquery-ui-1.8.12.custom/css/ui-lightness/jquery-ui-1.8.12.custom.css",
11
- "/vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4.css",
12
- "/vendor/typus/vendor/jquery-tokeninput/css/token-input.css",
13
- "/vendor/typus/stylesheets/screen",
14
- "/vendor/typus/stylesheets/application" %>
9
+ <%= stylesheet_link_tag "typus/application" %>
10
+ <%= javascript_include_tag "typus/application" %>
15
11
 
16
12
  <%= yield :stylesheets -%>
17
-
18
- <%= javascript_include_tag "/vendor/typus/vendor/jquery-ui-1.8.12.custom/js/jquery-1.5.1.min.js",
19
- "/vendor/typus/vendor/jquery-ui-1.8.12.custom/js/jquery-ui-1.8.12.custom.min.js",
20
- "/vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4.pack.js",
21
- "/vendor/typus/vendor/jquery-tokeninput/js/jquery.tokeninput.js",
22
- "/vendor/typus/javascripts/jquery.searchField.js",
23
- "/vendor/typus/javascripts/jquery.rails.js",
24
- "/vendor/typus/javascripts/jquery.rails.autocomplete.js",
25
- "/vendor/typus/javascripts/jquery.application.js",
26
- "/vendor/typus/javascripts/application" %>
27
-
28
13
  <%= yield :javascripts -%>
29
14
 
30
15
  <%= csrf_meta_tag %>
@@ -2,7 +2,7 @@
2
2
  <% label = "#{@item.class.model_name.underscore.gsub("/","_")}_#{related_fk}" %>
3
3
  <script type="text/javascript">
4
4
  $(document).ready(function () {
5
- $("#tokenInput_for_<%= related_fk %>").tokenInput("/admin/<%= association.class_name.tableize %>/autocomplete", {
5
+ $("#tokenInput_for_<%= related_fk %>").tokenInput("/admin/<%= association.name.to_s.pluralize %>/autocomplete", {
6
6
  hintText: "",
7
7
  queryParam: 'term',
8
8
  tokenLimit: 1,
@@ -1,7 +1,7 @@
1
1
  <div class="box_relationships" id="<%= association_name %>">
2
2
 
3
3
  <h2>
4
- <%= association_title %>
4
+ <%= association_name.titleize.humanize.pluralize %>
5
5
  <small><%= add_new %></small>
6
6
  </h2>
7
7
 
@@ -9,9 +9,9 @@
9
9
 
10
10
  <% if @items.any? -%>
11
11
  <%= table %>
12
- <%= will_paginate(@items, Typus.pagination.merge(:anchor => association_name)) %>
12
+ <%= paginate(@items, Typus.pagination.merge(:anchor => association_name)) %>
13
13
  <% else %>
14
- <p><%= Typus::I18n.t("No %{resources} found.", :resources => association_title) %></p>
14
+ <p><%= Typus::I18n.t("No %{resources} found.", :resources => association_name.humanize.downcase.pluralize) %></p>
15
15
  <% end %>
16
16
 
17
17
  </div>
@@ -1,14 +1,14 @@
1
1
  <div class="box_relationships" id="<%= association_name %>">
2
2
 
3
3
  <h2>
4
- <%= association_title %>
4
+ <%= association_name.humanize %>
5
5
  <small><%= add_new %></small>
6
6
  </h2>
7
7
 
8
8
  <% if @items.any? -%>
9
9
  <%= table %>
10
10
  <% else %>
11
- <p><%= Typus::I18n.t("No %{resources} found.", :resources => association_title) %></p>
11
+ <p><%= Typus::I18n.t("No %{resources} found.", :resources => association_name.humanize.downcase) %></p>
12
12
  <% end %>
13
13
 
14
14
  </div>
@@ -4,9 +4,14 @@
4
4
  else
5
5
  @resource.send(attribute)
6
6
  end
7
+
8
+ if @resource.typus_field_options_for(:read_only).include?(attribute.to_sym)
9
+ html_options = { :disabled => 'disabled' }
10
+ message = Typus::I18n.t("Read only")
11
+ end
7
12
  %>
8
13
 
9
14
  <li id="<%= attribute %>">
10
- <%= form.label attribute, label_text %>
11
- <%= form.select attribute, values, options.merge!(:include_blank => false) %>
15
+ <%= form.label attribute, "#{label_text} <small>#{message}</small>".html_safe %>
16
+ <%= form.select attribute, values, options.merge!(:include_blank => false), html_options %>
12
17
  </li>
@@ -75,7 +75,7 @@ ca:
75
75
  "View all %{attribute}":
76
76
  "View site": "Veure la web"
77
77
 
78
- "%{errors} errors prohibited this page from being saved:":
78
+ "%{errors} prohibited this page from being saved:":
79
79
  "%{model} successfully created": "%{model} satisfactòriament creat."
80
80
  "%{model} successfully removed": "%{model} satisfactòriament eliminat."
81
81
  "%{model} successfully updated": "%{model} satisfactòriament actualitzat."
@@ -1,6 +1,5 @@
1
1
  # German (de) translations for Typus by:
2
2
  # - Michael Grunewalder <http://michael.grunewalder.com>
3
- # - Thomas von Deyen <http://thomas.vondeyen.com>
4
3
 
5
4
  de:
6
5
  activerecord:
@@ -8,11 +7,11 @@ de:
8
7
  admin_user:
9
8
  attributes:
10
9
  admin_user:
11
- email: "E-Mail"
10
+ email:
12
11
  first_name: "Vorname"
13
12
  last_name: "Nachname"
14
13
  password: "Passwort"
15
- password_confirmation: "Passwort Bestätigung"
16
- status: "Status"
17
- role: "Rolle"
18
- locale: "Sprache"
14
+ password_confirmation: "Passwort Best&auml;tigung"
15
+ status:
16
+ role:
17
+ locale:
@@ -1,83 +1,80 @@
1
1
  # German (de) translations for Typus by:
2
2
  # - Michael Grunewalder <http://michael.grunewalder.com>
3
- # - Thomas von Deyen <http://thomas.vondeyen.com>
4
3
 
5
4
  de:
5
+
6
6
  "Actions": "Aktionen"
7
- "Active": "Aktiv"
8
- "Add": "Hinzufügen"
7
+ "Active":
8
+ "Add": "Zuf&uuml;gen"
9
9
  "Add new": "Erstellen"
10
- "All" : 'Alle'
11
- "Are you sure?": "Sind Sie sicher?"
10
+ "Are you sure?":
12
11
  "Are you sure you want to sign out and end your session?": "Wollen Sie sich abmelden und die Sitzung beenden?"
13
- "Assign": "Zuweisen"
14
12
 
15
- "Change %{attribute}?": "%{attribute} ändern?"
16
- "Create %{resource}": "%{resource} erstellen"
13
+ "Change %{attribute}?": "%{attribute}&auml;ndern?"
14
+ "Create %{resource}": "Erstellen %{resource}"
17
15
 
18
16
  "Dashboard": "Dashboard"
19
17
  "Down": "Runter"
20
18
 
21
19
  "Edit": "Bearbeiten"
22
- "Edit %{resource}": "%{resource} bearbeiten"
20
+ "Edit %{resource}": "Bearbeiten %{resource}"
23
21
  "Enter your email below to create the first user": "Geben Sie Ihre Email Adresse unten ein, um den ersten Benutzer zu erstellen"
24
22
 
25
- "False": "Nein"
23
+ "False": "Falsch"
26
24
  "Filter": "Filter"
27
25
 
28
26
  "I remember my password": "Ich erinnere mein Passwort"
29
- "If you didn't request a password update, you can ignore this message": "Falls Sie keine Passwort Änderung beantragt haben, können Sie diese Nachricht ignorieren"
30
- "If you have made any changes to the fields without clicking the Save/Update entry button, your changes will be lost": "Wenn Sie Änderungen an Feldern vorgenommen haben, ohne den Speichern/Bearbeiten Knopf gedrückt zu haben, gehen diese Änderungen verloren"
27
+ "If you didn't request a password update, you can ignore this message": "Falls Sie keine Passwort &Auml;derung beantragt haben, k&ouml;nnen Sie diese nachricht ignorieren"
28
+ "If you have made any changes to the fields without clicking the Save/Update entry button, your changes will be lost": "Wenn Sie &Auml;nderungen an Feldern vorgenommen haben, ohne den Speichern/Bearbeiten Knopf gedr7uuml;ckt zu haben, gehen diese &Auml;nderungen verloren"
31
29
  "Inactive":
32
30
 
33
31
  "Last few days": "Letzten Tage"
34
32
  "Last 30 days": "Letzten 30 Tage"
35
33
  "Last 7 days": "Letzten 7 Tage"
36
- "List" : 'Liste'
37
- "Logged as": "Angemeldet als"
38
- "Login": "Anmelden"
34
+ "List":
35
+ "Logged as": "Aufgezeichnet als"
36
+ "Login": "Anmeldem"
39
37
 
40
38
  "New": "Neu"
41
- "New %{resource}": "%{resource} erstellen"
42
- "Next": "Nächste"
43
- "No %{resources} found": "Keine %{resources} gefunden"
39
+ "New %{resource}": "Neu %{resource}"
40
+ "Next": "N&auml;chster"
41
+ "No %{resources} found":
44
42
 
45
- "Password recovery link sent to your email": "Der Link zur Wiederherstelllung Ihres Passworts wurde an Ihre Email Adresse geschickt"
43
+ "Password recovery link sent to your email": "Der Link zur Wiederfindung des Passworts wurde an Ihre Email Adresse gechickt"
46
44
  "Previous": "Vorheriger"
47
45
 
48
- "Record moved %{to}": "Datensatz wurde verschoben nach %{to}"
46
+ "Record moved %{to}": "Datensatz verschoben nach %{to}"
49
47
  "Recover password": "Passwort vergessen?"
50
48
  "Remove": "Eintrag"
51
- "Remove %{resource}?": "%{resource} entfernen?"
52
- "Reset password": "Passwort zurücksetzen"
49
+ "Remove %{resource}?": "Eintrag %{resource}?"
50
+ "Reset password": "Passwort zur&uuml;cksetzen"
53
51
  "Resources": "Resourcen"
54
52
 
55
- "Save %{resource}": "%{resource} speichern"
53
+ "Save %{resource}":
56
54
  "Search": "Suchen"
57
55
  "Show": "Anzeigen"
58
- "Show all dates": "Alle anzeigen"
59
- "Show by %{attribute}": "An Hand von %{attribute} anzeigen"
60
- "Show %{resource}": "%{resource} anzeigen"
56
+ "Show all dates":
57
+ "Show by %{attribute}":
58
+ "Show %{resource}": "Anzeigen %{resource}"
61
59
  "Sign in": "Anmelden"
62
60
  "Sign out": "Abmelden"
63
61
  "Sign up": "Konto erstellen"
64
- "System Users Administration": "Admin Benutzer Verwaltung"
62
+ "System Users Administration": "System Benutzer Verwaltung"
65
63
 
66
64
  "Today": "Heute"
67
- "Trash": "Löschen"
68
- "True": "Ja"
65
+ "True": "Richtig"
69
66
 
70
- "Unrelate": "Trennen"
67
+ "Unrelate":
71
68
  "Up": "Hoch"
72
69
 
73
- "View all %{attribute}": "Alle %{attribute} anzeigen"
74
- "View site": "Webseite anzeigen"
70
+ "View all %{attribute}":
71
+ "View site": "Site anzeigen"
75
72
 
76
- "You can update your password at": "Sie können Ihr Passwort ändern unter"
77
- "You can't change your role": "Sie können Ihre Rolle nicht ändern"
78
- "You can't toggle your status": "Sie können Ihren Status nicht umschalten"
73
+ "You can update your password at": "Sie k7ouml;nnen Ihr Passwort &auml;ndern unter"
74
+ "You can't change your role": "Sie k&ouml;nnen Ihre Rolle nicht &auml;ndern"
75
+ "You can't toggle your status": "Sie k&ouml;nnen Ihren Status nicht umschalten"
79
76
 
80
- "%{errors} errors prohibited this page from being saved:": "%{errors} Fehler haben diese Seite davon abgehalten gespeichert zu werden:"
81
- "%{model} successfully created": "%{model} wurde erfolgreich erstellt"
82
- "%{model} successfully removed": "%{model} wurde erfolgreich gelöscht"
83
- "%{model} successfully updated": "%{model} wurde erfolgreich geändert"
77
+ "%{errors} prohibited this page from being saved:":
78
+ "%{model} successfully created": "%{model} erfolgreich erstellt"
79
+ "%{model} successfully removed": "%{model} erfolgreich gel&ouml;scht"
80
+ "%{model} successfully updated": "%{model} erfolgreich ge&auml;ndert"