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.
- data/Gemfile +10 -16
- data/README.md +7 -10
- data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/blank.gif +0 -0
- data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_close.png +0 -0
- data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_loading.png +0 -0
- data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_nav_left.png +0 -0
- data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_nav_right.png +0 -0
- data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_shadow_e.png +0 -0
- data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_shadow_n.png +0 -0
- data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_shadow_ne.png +0 -0
- data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_shadow_nw.png +0 -0
- data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_shadow_s.png +0 -0
- data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_shadow_se.png +0 -0
- data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_shadow_sw.png +0 -0
- data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_shadow_w.png +0 -0
- data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_title_left.png +0 -0
- data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_title_main.png +0 -0
- data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_title_over.png +0 -0
- data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancy_title_right.png +0 -0
- data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancybox-x.png +0 -0
- data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancybox-y.png +0 -0
- data/app/assets/{vendor/typus/vendor/jquery.fancybox-1.3.4/fancybox → images/typus}/fancybox.png +0 -0
- data/app/assets/javascripts/typus/application.js +7 -0
- data/app/assets/{vendor/typus/javascripts/application.js → javascripts/typus/custom.js} +0 -0
- data/app/assets/{vendor/typus/javascripts → javascripts/typus}/jquery.application.js +6 -8
- data/app/assets/{vendor/typus/javascripts → javascripts/typus}/jquery.rails.autocomplete.js +0 -0
- data/app/assets/{vendor/typus/javascripts → javascripts/typus}/jquery.searchField.js +0 -0
- data/app/assets/stylesheets/typus/application.css +7 -0
- data/app/assets/{vendor/typus/stylesheets/application.css → stylesheets/typus/custom.css} +0 -0
- data/app/assets/stylesheets/typus/pagination.css +17 -0
- data/app/assets/{vendor/typus/stylesheets → stylesheets/typus}/reset.css +0 -0
- data/app/assets/{vendor/typus/stylesheets → stylesheets/typus}/screen.css +2 -27
- data/app/assets/vendor/{typus/vendor/jquery-tokeninput → jquery-tokeninput}/css/token-input-facebook.css +0 -0
- data/app/assets/vendor/{typus/vendor/jquery-tokeninput → jquery-tokeninput}/css/token-input-mac.css +0 -0
- data/app/assets/vendor/{typus/vendor/jquery-tokeninput → jquery-tokeninput}/css/token-input.css +0 -0
- data/app/assets/vendor/{typus/vendor/jquery-tokeninput → jquery-tokeninput}/js/jquery.tokeninput.js +0 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- data/app/assets/vendor/{typus/vendor/jquery-ui-1.8.12.custom → jquery-ui-1.8.12.custom}/index.html +0 -0
- 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
- data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/blank.gif +0 -0
- data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_close.png +0 -0
- data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_loading.png +0 -0
- data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_nav_left.png +0 -0
- data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_nav_right.png +0 -0
- data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_shadow_e.png +0 -0
- data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_shadow_n.png +0 -0
- data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_shadow_ne.png +0 -0
- data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_shadow_nw.png +0 -0
- data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_shadow_s.png +0 -0
- data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_shadow_se.png +0 -0
- data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_shadow_sw.png +0 -0
- data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_shadow_w.png +0 -0
- data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_title_left.png +0 -0
- data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_title_main.png +0 -0
- data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_title_over.png +0 -0
- data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancy_title_right.png +0 -0
- data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancybox-x.png +0 -0
- data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancybox-y.png +0 -0
- data/app/assets/vendor/jquery.fancybox-1.3.4/fancybox/fancybox.png +0 -0
- 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
- 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
- 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
- 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
- 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
- data/app/controllers/admin/base_controller.rb +5 -3
- data/app/controllers/admin/resources_controller.rb +3 -7
- data/app/controllers/admin/session_controller.rb +2 -5
- data/app/helpers/admin/base_helper.rb +1 -1
- data/app/helpers/admin/display_helper.rb +0 -2
- data/app/helpers/admin/file_preview_helper.rb +10 -10
- data/app/helpers/admin/filters_helper.rb +1 -1
- data/app/helpers/admin/relationships_helper.rb +20 -21
- data/app/helpers/admin/sidebar_helper.rb +1 -8
- data/app/helpers/admin/table_helper.rb +8 -8
- data/app/views/admin/dashboard/_applications.html.erb +1 -1
- data/app/views/admin/helpers/base/_apps.html.erb +2 -7
- data/app/views/admin/helpers/base/_header.html.erb +1 -1
- data/app/views/admin/helpers/resources/_errors.html.erb +1 -1
- data/app/views/admin/helpers/sidebar/_sidebar.html.erb +1 -1
- data/app/views/admin/resources/index.html.erb +4 -4
- data/app/views/admin/shared/_head.html.erb +2 -17
- data/app/views/admin/templates/_belongs_to_with_autocomplete.html.erb +1 -1
- data/app/views/admin/templates/_has_n.html.erb +3 -3
- data/app/views/admin/templates/_has_one.html.erb +2 -2
- data/app/views/admin/templates/_selector.html.erb +7 -2
- data/config/locales/typus.ca.yml +1 -1
- data/config/locales/typus.de.models.yml +5 -6
- data/config/locales/typus.de.yml +36 -39
- data/config/locales/typus.el.yml +1 -1
- data/config/locales/typus.es.yml +1 -1
- data/config/locales/typus.fr.yml +1 -2
- data/config/locales/typus.hu.yml +1 -1
- data/config/locales/typus.locale.yml.template +1 -1
- data/config/locales/typus.pt-BR.yml +1 -1
- data/config/locales/typus.ru.yml +1 -1
- data/config/locales/typus.zh-CN.yml +1 -1
- data/config/routes.rb +2 -2
- data/lib/generators/templates/config/initializers/typus.rb +1 -3
- data/lib/generators/templates/config/typus/README +0 -1
- data/lib/generators/typus/migration_generator.rb +0 -3
- data/lib/support/active_record.rb +7 -9
- data/lib/typus.rb +7 -8
- data/lib/typus/authentication/session.rb +3 -2
- data/lib/typus/controller/associations.rb +2 -2
- data/lib/typus/controller/format.rb +3 -3
- data/lib/typus/engine.rb +2 -6
- data/lib/typus/i18n.rb +4 -0
- data/lib/typus/orm/active_record/admin_user_v1.rb +13 -12
- data/lib/typus/orm/active_record/admin_user_v2.rb +31 -1
- data/lib/typus/orm/active_record/class_methods.rb +1 -0
- data/lib/typus/orm/base.rb +0 -4
- data/lib/typus/regex.rb +2 -0
- data/lib/typus/version.rb +1 -1
- data/test/app/controllers/admin/account_controller_test.rb +94 -0
- data/test/app/controllers/admin/assets_controller_test.rb +156 -0
- data/test/app/controllers/admin/base_controller_test.rb +25 -0
- data/test/app/controllers/admin/birds_controller_test.rb +33 -0
- data/test/app/controllers/admin/cases_controller_test.rb +20 -0
- data/test/app/controllers/admin/categories_controller_test.rb +134 -0
- data/test/app/controllers/admin/comments_controller_test.rb +71 -0
- data/test/app/controllers/admin/dashboard_controller_test.rb +150 -0
- data/test/app/controllers/admin/image_holders_controller_test.rb +74 -0
- data/test/app/controllers/admin/invoices_controller_test.rb +77 -0
- data/test/app/controllers/admin/orders_controller_test.rb +17 -0
- data/test/app/controllers/admin/pages_controller_test.rb +33 -0
- data/test/app/controllers/admin/posts_controller_test.rb +764 -0
- data/test/app/controllers/admin/projects_controller_test.rb +48 -0
- data/test/app/controllers/admin/session_controller_test.rb +91 -0
- data/test/app/controllers/admin/status_controller_test.rb +33 -0
- data/test/app/controllers/admin/typus_users_controller_test.rb +154 -0
- data/test/app/controllers/admin/users_controller_test.rb +101 -0
- data/test/app/controllers/admin/views_controller_test.rb +36 -0
- data/test/app/helpers/admin/base_helper_test.rb +75 -0
- data/test/app/helpers/admin/dashboard_helper_test.rb +28 -0
- data/test/app/helpers/admin/file_preview_helper_test.rb +90 -0
- data/test/app/helpers/admin/filters_helper_test.rb +166 -0
- data/test/app/helpers/admin/form_helper_test.rb +126 -0
- data/test/app/helpers/admin/list_helper_test.rb +76 -0
- data/test/app/helpers/admin/relationships_helper_test.rb +19 -0
- data/test/app/helpers/admin/resources_helper_test.rb +46 -0
- data/test/app/helpers/admin/search_helper_test.rb +56 -0
- data/test/app/helpers/admin/sidebar_helper_test.rb +20 -0
- data/test/app/helpers/admin/table_helper_test.rb +245 -0
- data/test/app/mailers/admin/mailer_test.rb +20 -0
- data/test/app/models/admin_user_test.rb +22 -0
- data/test/app/models/typus_user_roles_test.rb +125 -0
- data/test/app/models/typus_user_test.rb +145 -0
- data/test/app/models/user_test.rb +38 -0
- data/test/config/routes_test.rb +30 -0
- data/test/factories.rb +134 -0
- data/test/fixtures/config/broken/application.yml +68 -0
- data/test/fixtures/config/broken/application_roles.yml +20 -0
- data/test/fixtures/config/broken/empty.yml +0 -0
- data/test/fixtures/config/broken/empty_roles.yml +0 -0
- data/test/fixtures/config/broken/undefined.yml +3 -0
- data/test/fixtures/config/broken/undefined_roles.yml +6 -0
- data/test/fixtures/config/default/typus.yml +13 -0
- data/test/fixtures/config/default/typus_roles.yml +2 -0
- data/test/fixtures/config/empty/empty_01.yml +0 -0
- data/test/fixtures/config/empty/empty_01_roles.yml +0 -0
- data/test/fixtures/config/empty/empty_02.yml +0 -0
- data/test/fixtures/config/empty/empty_02_roles.yml +0 -0
- data/test/fixtures/config/locales/es.yml +10 -0
- data/test/fixtures/config/namespaced/application.yml +5 -0
- data/test/fixtures/config/namespaced/application_roles.yml +2 -0
- data/test/fixtures/config/ordered/001_roles.yml +2 -0
- data/test/fixtures/config/ordered/002_roles.yml +2 -0
- data/test/fixtures/config/unordered/app_one_roles.yml +2 -0
- data/test/fixtures/config/unordered/app_two_roles.yml +2 -0
- data/test/fixtures/rails_app/.gitignore +4 -0
- data/test/fixtures/rails_app/Capfile +7 -0
- data/test/fixtures/rails_app/README +256 -0
- data/test/fixtures/rails_app/Rakefile +7 -0
- data/test/fixtures/rails_app/app/controllers/admin/admin_users_controller.rb +2 -0
- data/test/fixtures/rails_app/app/controllers/admin/animals_controller.rb +2 -0
- data/test/fixtures/rails_app/app/controllers/admin/article/entries_controller.rb +2 -0
- data/test/fixtures/rails_app/app/controllers/admin/assets_controller.rb +51 -0
- data/test/fixtures/rails_app/app/controllers/admin/birds_controller.rb +2 -0
- data/test/fixtures/rails_app/app/controllers/admin/cases_controller.rb +2 -0
- data/test/fixtures/rails_app/app/controllers/admin/categories_controller.rb +2 -0
- data/test/fixtures/rails_app/app/controllers/admin/comments_controller.rb +2 -0
- data/test/fixtures/rails_app/app/controllers/admin/dogs_controller.rb +2 -0
- data/test/fixtures/rails_app/app/controllers/admin/entries_controller.rb +2 -0
- data/test/fixtures/rails_app/app/controllers/admin/hits_controller.rb +37 -0
- data/test/fixtures/rails_app/app/controllers/admin/image_holders_controller.rb +2 -0
- data/test/fixtures/rails_app/app/controllers/admin/invoices_controller.rb +2 -0
- data/test/fixtures/rails_app/app/controllers/admin/orders_controller.rb +2 -0
- data/test/fixtures/rails_app/app/controllers/admin/pages_controller.rb +7 -0
- data/test/fixtures/rails_app/app/controllers/admin/posts_controller.rb +2 -0
- data/test/fixtures/rails_app/app/controllers/admin/project_collaborators_controller.rb +2 -0
- data/test/fixtures/rails_app/app/controllers/admin/projects_controller.rb +2 -0
- data/test/fixtures/rails_app/app/controllers/admin/status_controller.rb +2 -0
- data/test/fixtures/rails_app/app/controllers/admin/typus_users_controller.rb +2 -0
- data/test/fixtures/rails_app/app/controllers/admin/users_controller.rb +2 -0
- data/test/fixtures/rails_app/app/controllers/admin/views_controller.rb +8 -0
- data/test/fixtures/rails_app/app/controllers/admin/watch_dog_controller.rb +2 -0
- data/test/fixtures/rails_app/app/controllers/application_controller.rb +3 -0
- data/test/fixtures/rails_app/app/helpers/application_helper.rb +2 -0
- data/test/fixtures/rails_app/app/helpers/form_helper.rb +3 -0
- data/test/fixtures/rails_app/app/models/admin_user.rb +7 -0
- data/test/fixtures/rails_app/app/models/animal.rb +21 -0
- data/test/fixtures/rails_app/app/models/article.rb +10 -0
- data/test/fixtures/rails_app/app/models/article/entry.rb +2 -0
- data/test/fixtures/rails_app/app/models/asset.rb +45 -0
- data/test/fixtures/rails_app/app/models/bird.rb +2 -0
- data/test/fixtures/rails_app/app/models/case.rb +2 -0
- data/test/fixtures/rails_app/app/models/category.rb +31 -0
- data/test/fixtures/rails_app/app/models/comment.rb +17 -0
- data/test/fixtures/rails_app/app/models/delayed/task.rb +5 -0
- data/test/fixtures/rails_app/app/models/dog.rb +2 -0
- data/test/fixtures/rails_app/app/models/entry.rb +23 -0
- data/test/fixtures/rails_app/app/models/hit.rb +27 -0
- data/test/fixtures/rails_app/app/models/image_holder.rb +21 -0
- data/test/fixtures/rails_app/app/models/invoice.rb +10 -0
- data/test/fixtures/rails_app/app/models/order.rb +9 -0
- data/test/fixtures/rails_app/app/models/page.rb +24 -0
- data/test/fixtures/rails_app/app/models/post.rb +32 -0
- data/test/fixtures/rails_app/app/models/project.rb +17 -0
- data/test/fixtures/rails_app/app/models/project_collaborator.rb +16 -0
- data/test/fixtures/rails_app/app/models/site.rb +16 -0
- data/test/fixtures/rails_app/app/models/typus_user.rb +15 -0
- data/test/fixtures/rails_app/app/models/user.rb +16 -0
- data/test/fixtures/rails_app/app/models/view.rb +19 -0
- data/test/fixtures/rails_app/app/views/admin/assets/_index.html.erb +3 -0
- data/test/fixtures/rails_app/app/views/admin/cases/_index.html.erb +3 -0
- data/test/fixtures/rails_app/app/views/admin/categories/_index.html.erb +3 -0
- data/test/fixtures/rails_app/app/views/admin/dashboard/_sidebar.html.erb +11 -0
- data/test/fixtures/rails_app/app/views/admin/entries/_index.html.erb +3 -0
- data/test/fixtures/rails_app/app/views/admin/hits/_edit.html.erb +7 -0
- data/test/fixtures/rails_app/app/views/admin/hits/_index.html.erb +3 -0
- data/test/fixtures/rails_app/app/views/admin/hits/index.html.erb +28 -0
- data/test/fixtures/rails_app/app/views/admin/pages/_index.html.erb +3 -0
- data/test/fixtures/rails_app/app/views/admin/posts/_edit.html.erb +1 -0
- data/test/fixtures/rails_app/app/views/admin/posts/_index.html.erb +5 -0
- data/test/fixtures/rails_app/app/views/admin/posts/_new.html.erb +1 -0
- data/test/fixtures/rails_app/app/views/admin/posts/_show.html.erb +1 -0
- data/test/fixtures/rails_app/app/views/admin/resources/_sidebar.html.erb +1 -0
- data/test/fixtures/rails_app/app/views/admin/status/index.html.erb +9 -0
- data/test/fixtures/rails_app/app/views/admin/templates/_datepicker.html.erb +1 -0
- data/test/fixtures/rails_app/app/views/admin/watch_dog/index.html.erb +9 -0
- data/test/fixtures/rails_app/config.ru +4 -0
- data/test/fixtures/rails_app/config/application.rb +55 -0
- data/test/fixtures/rails_app/config/boot.rb +6 -0
- data/test/fixtures/rails_app/config/database.yml +42 -0
- data/test/fixtures/rails_app/config/deploy.rb +36 -0
- data/test/fixtures/rails_app/config/environment.rb +5 -0
- data/test/fixtures/rails_app/config/environments/development.rb +38 -0
- data/test/fixtures/rails_app/config/environments/production.rb +57 -0
- data/test/fixtures/rails_app/config/environments/test.rb +44 -0
- data/test/fixtures/rails_app/config/initializers/backtrace_silencers.rb +7 -0
- data/test/fixtures/rails_app/config/initializers/dragonfly.rb +1 -0
- data/test/fixtures/rails_app/config/initializers/inflections.rb +11 -0
- data/test/fixtures/rails_app/config/initializers/mime_types.rb +5 -0
- data/test/fixtures/rails_app/config/initializers/secret_token.rb +7 -0
- data/test/fixtures/rails_app/config/initializers/session_store.rb +8 -0
- data/test/fixtures/rails_app/config/initializers/wrap_parameters.rb +12 -0
- data/test/fixtures/rails_app/config/locales/en.yml +5 -0
- data/test/fixtures/rails_app/config/mongoid.yml +20 -0
- data/test/fixtures/rails_app/config/routes.rb +61 -0
- data/test/fixtures/rails_app/config/typus/README +68 -0
- data/test/fixtures/rails_app/config/typus/admin.yml +16 -0
- data/test/fixtures/rails_app/config/typus/admin_roles.yml +3 -0
- data/test/fixtures/rails_app/config/typus/crud_basic.yml +10 -0
- data/test/fixtures/rails_app/config/typus/crud_basic_roles.yml +2 -0
- data/test/fixtures/rails_app/config/typus/crud_extended.yml +66 -0
- data/test/fixtures/rails_app/config/typus/crud_extended_roles.yml +18 -0
- data/test/fixtures/rails_app/config/typus/crud_namespaced.yml +10 -0
- data/test/fixtures/rails_app/config/typus/crud_namespaced_roles.yml +2 -0
- data/test/fixtures/rails_app/config/typus/has_many.yml +0 -0
- data/test/fixtures/rails_app/config/typus/has_many_roles.yml +0 -0
- data/test/fixtures/rails_app/config/typus/has_many_through.yml +23 -0
- data/test/fixtures/rails_app/config/typus/has_many_through_roles.yml +4 -0
- data/test/fixtures/rails_app/config/typus/has_one.yml +12 -0
- data/test/fixtures/rails_app/config/typus/has_one_roles.yml +3 -0
- data/test/fixtures/rails_app/config/typus/mongo_db.yml +4 -0
- data/test/fixtures/rails_app/config/typus/mongo_db_roles.yml +2 -0
- data/test/fixtures/rails_app/config/typus/polymorphic.yml +17 -0
- data/test/fixtures/rails_app/config/typus/polymorphic_roles.yml +5 -0
- data/test/fixtures/rails_app/config/typus/resource_roles.yml +7 -0
- data/test/fixtures/rails_app/config/typus/sti.yml +5 -0
- data/test/fixtures/rails_app/config/typus/sti_roles.yml +2 -0
- data/test/fixtures/rails_app/config/typus/unknown.yml +3 -0
- data/test/fixtures/rails_app/config/typus/unknown_roles.yml +5 -0
- data/test/fixtures/rails_app/db/.gitkeep +0 -0
- data/test/fixtures/rails_app/db/schema.rb +209 -0
- data/test/fixtures/rails_app/db/seeds.rb +58 -0
- data/test/fixtures/rails_app/db/seeds/assets/000.jpg +0 -0
- data/test/fixtures/rails_app/db/seeds/assets/001.jpg +0 -0
- data/test/fixtures/rails_app/db/seeds/assets/002.jpg +0 -0
- data/test/fixtures/rails_app/db/seeds/assets/003.jpg +0 -0
- data/test/fixtures/rails_app/db/seeds/assets/004.jpg +0 -0
- data/test/fixtures/rails_app/public/404.html +26 -0
- data/test/fixtures/rails_app/public/422.html +26 -0
- data/test/fixtures/rails_app/public/500.html +26 -0
- data/test/fixtures/rails_app/public/favicon.ico +0 -0
- data/test/fixtures/rails_app/public/images/rails.png +0 -0
- data/test/fixtures/rails_app/public/robots.txt +5 -0
- data/test/fixtures/rails_app/public/stylesheets/.gitkeep +0 -0
- data/test/fixtures/rails_app/script/rails +6 -0
- data/test/lib/support/active_record_test.rb +139 -0
- data/test/lib/support/fake_user_test.rb +63 -0
- data/test/lib/support/hash_test.rb +25 -0
- data/test/lib/support/object_test.rb +10 -0
- data/test/lib/support/string_test.rb +80 -0
- data/test/lib/typus/configuration_test.rb +48 -0
- data/test/lib/typus/controller/actions_test.rb +141 -0
- data/test/lib/typus/controller/associations_test.rb +7 -0
- data/test/lib/typus/controller/autocomplete_test.rb +7 -0
- data/test/lib/typus/controller/filters_test.rb +73 -0
- data/test/lib/typus/controller/format_test.rb +7 -0
- data/test/lib/typus/i18n_test.rb +13 -0
- data/test/lib/typus/orm/active_record/class_methods_test.rb +381 -0
- data/test/lib/typus/orm/active_record/search_test.rb +328 -0
- data/test/lib/typus/regex_test.rb +62 -0
- data/test/lib/typus/resources_test.rb +41 -0
- data/test/lib/typus_test.rb +132 -0
- data/test/test_helper.rb +41 -0
- data/typus.gemspec +3 -10
- metadata +525 -137
- data/.gitmodules +0 -3
- data/app/assets/vendor/typus/javascripts/jquery.rails.js +0 -158
- data/app/assets/vendor/typus/vendor/jquery-ui-1.8.12.custom/js/jquery-1.5.1.min.js +0 -16
- data/app/views/admin/templates/_text_with_ckeditor.html.erb +0 -13
- data/config/locales/typus.pt-PT.models.yml +0 -17
- data/config/locales/typus.pt-PT.yml +0 -83
@@ -0,0 +1,18 @@
|
|
1
|
+
admin:
|
2
|
+
Asset: create, read, update, delete
|
3
|
+
Category: create, read, update, delete
|
4
|
+
Comment: create, read, update, delete
|
5
|
+
Order:
|
6
|
+
Page: create, read, update, delete, rebuild, rebuild_all
|
7
|
+
Post: create, read, update, delete
|
8
|
+
|
9
|
+
editor:
|
10
|
+
Category: create, read, update
|
11
|
+
Comment: read, update, delete
|
12
|
+
Post: create, read, update
|
13
|
+
TypusUser: read, update
|
14
|
+
|
15
|
+
designer:
|
16
|
+
Category: read, update
|
17
|
+
Comment: read
|
18
|
+
Post: read, update
|
File without changes
|
File without changes
|
@@ -0,0 +1,23 @@
|
|
1
|
+
Project:
|
2
|
+
fields:
|
3
|
+
default: name, user
|
4
|
+
form: name, user
|
5
|
+
relationships: collaborators
|
6
|
+
application: HasManyThrough
|
7
|
+
filters: user
|
8
|
+
|
9
|
+
ProjectCollaborator:
|
10
|
+
fields:
|
11
|
+
default: user
|
12
|
+
form: user, project
|
13
|
+
filters: project, user
|
14
|
+
application: HasManyThrough
|
15
|
+
|
16
|
+
User:
|
17
|
+
fields:
|
18
|
+
default: name, email
|
19
|
+
list: name, email, projects
|
20
|
+
relationships: projects #, third_party_projects
|
21
|
+
application: HasManyThrough
|
22
|
+
filters: projects
|
23
|
+
order_by: name
|
@@ -0,0 +1,17 @@
|
|
1
|
+
Animal: &ANIMAL_BASE
|
2
|
+
fields:
|
3
|
+
default: name
|
4
|
+
relationships: image_holders
|
5
|
+
application: Polymorphic
|
6
|
+
|
7
|
+
Bird:
|
8
|
+
<<: *ANIMAL_BASE
|
9
|
+
|
10
|
+
Dog:
|
11
|
+
<<: *ANIMAL_BASE
|
12
|
+
|
13
|
+
ImageHolder:
|
14
|
+
fields:
|
15
|
+
default: name, imageable_id, imageable_type
|
16
|
+
form: name
|
17
|
+
application: Polymorphic
|
File without changes
|
@@ -0,0 +1,209 @@
|
|
1
|
+
ActiveRecord::Migration.verbose = false
|
2
|
+
|
3
|
+
ActiveRecord::Schema.define do
|
4
|
+
|
5
|
+
create_table :admin_users, :force => true do |t|
|
6
|
+
t.string :first_name
|
7
|
+
t.string :last_name
|
8
|
+
t.string :role, :null => false
|
9
|
+
t.string :email, :null => false
|
10
|
+
t.string :password_digest, :null => false
|
11
|
+
t.string :preferences
|
12
|
+
t.boolean :status, :default => false
|
13
|
+
t.string :token
|
14
|
+
t.timestamps
|
15
|
+
end
|
16
|
+
|
17
|
+
create_table :articles, :force => true do |t|
|
18
|
+
t.string :title
|
19
|
+
t.text :body
|
20
|
+
t.timestamps
|
21
|
+
end
|
22
|
+
|
23
|
+
create_table :assets, :force => true do |t|
|
24
|
+
t.string :caption
|
25
|
+
# Dragonfly Attachment
|
26
|
+
t.string :dragonfly_uid
|
27
|
+
t.string :dragonfly_required_uid
|
28
|
+
# Paperclip Attachment
|
29
|
+
t.string :paperclip_file_name
|
30
|
+
t.string :paperclip_content_type
|
31
|
+
t.integer :paperclip_file_size
|
32
|
+
t.datetime :paperclip_updated_at
|
33
|
+
# Paperclip Required Attachment
|
34
|
+
t.string :paperclip_required_file_name
|
35
|
+
t.string :paperclip_required_content_type
|
36
|
+
t.integer :paperclip_required_file_size
|
37
|
+
t.datetime :paperclip_required_updated_at
|
38
|
+
end
|
39
|
+
|
40
|
+
create_table :categories, :force => true do |t|
|
41
|
+
t.string :name
|
42
|
+
t.string :permalink
|
43
|
+
t.text :description
|
44
|
+
t.integer :position
|
45
|
+
end
|
46
|
+
|
47
|
+
create_table :comments, :force => true do |t|
|
48
|
+
t.string :email, :name
|
49
|
+
t.text :body
|
50
|
+
t.integer :post_id
|
51
|
+
t.boolean :spam, :default => false
|
52
|
+
end
|
53
|
+
|
54
|
+
add_index :comments, :post_id
|
55
|
+
|
56
|
+
create_table :delayed_tasks, :force => true do |t|
|
57
|
+
t.string :name
|
58
|
+
end
|
59
|
+
|
60
|
+
create_table :entries, :force => true do |t|
|
61
|
+
t.string :title, :null => false
|
62
|
+
t.text :content
|
63
|
+
t.string :type
|
64
|
+
t.boolean :published, :null => false, :default => false
|
65
|
+
end
|
66
|
+
|
67
|
+
create_table :categories_entries, :force => true, :id => false do |t|
|
68
|
+
t.column :category_id, :integer
|
69
|
+
t.column :entry_id, :integer
|
70
|
+
end
|
71
|
+
|
72
|
+
create_table :pages, :force => true do |t|
|
73
|
+
t.string :title
|
74
|
+
t.text :body
|
75
|
+
t.boolean :status
|
76
|
+
t.integer :parent_id
|
77
|
+
end
|
78
|
+
|
79
|
+
add_index :pages, :parent_id
|
80
|
+
|
81
|
+
create_table :posts, :force => true do |t|
|
82
|
+
t.string :title
|
83
|
+
t.text :body
|
84
|
+
t.string :status
|
85
|
+
t.integer :favorite_comment_id
|
86
|
+
t.datetime :published_at
|
87
|
+
t.integer :typus_user_id
|
88
|
+
t.boolean :published
|
89
|
+
t.timestamps
|
90
|
+
end
|
91
|
+
|
92
|
+
add_index :posts, :favorite_comment_id
|
93
|
+
add_index :posts, :typus_user_id
|
94
|
+
|
95
|
+
create_table :pictures, :force => true do |t|
|
96
|
+
t.string :title
|
97
|
+
t.string :picture_file_name
|
98
|
+
t.string :picture_content_type
|
99
|
+
t.integer :picture_file_size
|
100
|
+
t.datetime :picture_updated_at
|
101
|
+
t.integer :typus_user_id
|
102
|
+
t.timestamps
|
103
|
+
end
|
104
|
+
|
105
|
+
add_index :pictures, :typus_user_id
|
106
|
+
|
107
|
+
create_table :typus_users, :force => true do |t|
|
108
|
+
t.string :first_name, :default => "", :null => false
|
109
|
+
t.string :last_name, :default => "", :null => false
|
110
|
+
t.string :role, :null => false
|
111
|
+
t.string :email, :null => false
|
112
|
+
t.boolean :status, :default => false
|
113
|
+
t.string :token, :null => false
|
114
|
+
t.string :salt, :null => false
|
115
|
+
t.string :crypted_password, :null => false
|
116
|
+
t.string :preferences
|
117
|
+
t.timestamps
|
118
|
+
end
|
119
|
+
|
120
|
+
add_index :typus_users, :token
|
121
|
+
|
122
|
+
create_table :views, :force => true do |t|
|
123
|
+
t.string :ip, :default => '127.0.0.1'
|
124
|
+
t.integer :post_id
|
125
|
+
t.integer :site_id
|
126
|
+
t.timestamps
|
127
|
+
end
|
128
|
+
|
129
|
+
add_index :views, :post_id
|
130
|
+
|
131
|
+
create_table :categories_posts, :force => true, :id => false do |t|
|
132
|
+
t.column :category_id, :integer
|
133
|
+
t.column :post_id, :integer
|
134
|
+
end
|
135
|
+
|
136
|
+
add_index :categories_posts, :category_id
|
137
|
+
add_index :categories_posts, :post_id
|
138
|
+
|
139
|
+
##
|
140
|
+
# has_one relationships
|
141
|
+
#
|
142
|
+
|
143
|
+
create_table :invoices, :force => true do |t|
|
144
|
+
t.string :number
|
145
|
+
t.integer :order_id
|
146
|
+
t.integer :typus_user_id
|
147
|
+
t.timestamps
|
148
|
+
end
|
149
|
+
|
150
|
+
create_table :orders, :force => true do |t|
|
151
|
+
t.string :number
|
152
|
+
t.timestamps
|
153
|
+
end
|
154
|
+
|
155
|
+
##
|
156
|
+
# has_many through relationships
|
157
|
+
#
|
158
|
+
|
159
|
+
create_table :users, :force => true do |t|
|
160
|
+
t.string :name, :null => false
|
161
|
+
t.string :first_name, :default => ""
|
162
|
+
t.string :last_name, :default => ""
|
163
|
+
t.string :role
|
164
|
+
t.string :email, :null => false
|
165
|
+
t.boolean :status, :default => false
|
166
|
+
t.string :token
|
167
|
+
t.string :salt
|
168
|
+
t.string :crypted_password
|
169
|
+
t.string :preferences
|
170
|
+
t.timestamps
|
171
|
+
end
|
172
|
+
|
173
|
+
create_table :projects, :force => true do |t|
|
174
|
+
t.string :name, :null => false
|
175
|
+
t.integer :user_id, :null => false
|
176
|
+
t.timestamps
|
177
|
+
end
|
178
|
+
|
179
|
+
create_table :project_collaborators, :force => true do |t|
|
180
|
+
t.integer :user_id, :null => false
|
181
|
+
t.integer :project_id, :null => false
|
182
|
+
t.timestamps
|
183
|
+
end
|
184
|
+
|
185
|
+
##
|
186
|
+
# Polymorphic
|
187
|
+
#
|
188
|
+
|
189
|
+
create_table :animals, :force => true do |t|
|
190
|
+
t.string :name, :null => false
|
191
|
+
t.string :type
|
192
|
+
end
|
193
|
+
|
194
|
+
create_table :image_holders, :force => true do |t|
|
195
|
+
t.string :name
|
196
|
+
t.integer :imageable_id
|
197
|
+
t.string :imageable_type
|
198
|
+
end
|
199
|
+
|
200
|
+
##
|
201
|
+
# Context
|
202
|
+
#
|
203
|
+
|
204
|
+
create_table :sites, :force => true do |t|
|
205
|
+
t.string :name, :null => false
|
206
|
+
t.string :domain, :null => false
|
207
|
+
end
|
208
|
+
|
209
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# This file should contain all the record creation needed to seed the database with its default values.
|
2
|
+
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
|
3
|
+
#
|
4
|
+
# Examples:
|
5
|
+
#
|
6
|
+
# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
|
7
|
+
# Mayor.create(:name => 'Daley', :city => cities.first)
|
8
|
+
|
9
|
+
require '../../factories'
|
10
|
+
|
11
|
+
##
|
12
|
+
# CRUD
|
13
|
+
##
|
14
|
+
|
15
|
+
20.times do
|
16
|
+
Factory(:entry)
|
17
|
+
end
|
18
|
+
|
19
|
+
##
|
20
|
+
# CRUD Extended
|
21
|
+
##
|
22
|
+
|
23
|
+
5.times do
|
24
|
+
Factory(:category)
|
25
|
+
Factory(:post)
|
26
|
+
end
|
27
|
+
|
28
|
+
assets_path = "#{Rails.root}/db/seeds/assets"
|
29
|
+
5.times { |i| Factory(:asset,
|
30
|
+
:dragonfly => File.new("#{assets_path}/00#{i}.jpg"),
|
31
|
+
:dragonfly_required => File.new("#{assets_path}/00#{i}.jpg"),
|
32
|
+
:paperclip => File.new("#{assets_path}/00#{i}.jpg")) }
|
33
|
+
|
34
|
+
##
|
35
|
+
# HasManyThrough
|
36
|
+
##
|
37
|
+
|
38
|
+
5.times do
|
39
|
+
project = Factory(:project)
|
40
|
+
5.times { project.collaborators << Factory(:user) }
|
41
|
+
end
|
42
|
+
|
43
|
+
##
|
44
|
+
# HasOne
|
45
|
+
##
|
46
|
+
|
47
|
+
5.times do
|
48
|
+
Factory(:invoice)
|
49
|
+
end
|
50
|
+
|
51
|
+
##
|
52
|
+
# Polymorphic
|
53
|
+
##
|
54
|
+
|
55
|
+
5.times do
|
56
|
+
Factory(:bird)
|
57
|
+
Factory(:dog)
|
58
|
+
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/404.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
23
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|