typus 3.0.2 → 3.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +20 -9
- data/Gemfile.lock +93 -65
- data/MIT-LICENSE +1 -1
- data/README.md +61 -0
- data/Rakefile +5 -0
- data/app/controllers/admin/account_controller.rb +7 -10
- data/app/controllers/admin/base_controller.rb +16 -1
- data/app/controllers/admin/resources_controller.rb +270 -159
- data/app/controllers/admin/session_controller.rb +8 -9
- data/app/helpers/admin/base_helper.rb +13 -28
- data/app/helpers/admin/dashboard_helper.rb +4 -10
- data/app/helpers/admin/file_preview_helper.rb +70 -0
- data/app/helpers/admin/filters_helper.rb +64 -45
- data/app/helpers/admin/form_helper.rb +37 -62
- data/app/helpers/admin/relationships_helper.rb +63 -78
- data/app/helpers/admin/resources_helper.rb +10 -31
- data/app/helpers/admin/search_helper.rb +6 -9
- data/app/helpers/admin/sidebar_helper.rb +15 -20
- data/app/helpers/admin/table_helper.rb +79 -170
- data/app/mailers/admin/mailer.rb +1 -1
- data/app/views/admin/account/forgot_password.html.erb +2 -2
- data/app/views/admin/account/new.html.erb +8 -4
- data/app/views/admin/base/user_guide.html.erb +85 -0
- data/app/views/admin/dashboard/_sidebar.html.erb +3 -1
- data/app/views/admin/dashboard/show.html.erb +2 -2
- data/app/views/admin/dashboard/styles.html.erb +2 -2
- data/app/views/admin/helpers/_apps.html.erb +5 -4
- data/app/views/admin/helpers/_file_preview.html.erb +3 -0
- data/app/views/admin/helpers/_header.html.erb +3 -3
- data/app/views/admin/helpers/_login_info.html.erb +2 -2
- data/app/views/admin/helpers/dashboard/_applications.html.erb +6 -9
- data/app/views/admin/helpers/dashboard/_resources.html.erb +2 -3
- data/app/views/admin/helpers/filters/_filters.html.erb +1 -1
- data/app/views/admin/helpers/resources/_display_link_to_previous.html.erb +1 -1
- data/app/views/admin/helpers/resources/_errors.html.erb +10 -0
- data/app/views/admin/helpers/search/_search.html.erb +1 -1
- data/app/views/admin/helpers/sidebar/_sidebar.html.erb +6 -3
- data/app/views/admin/helpers/table/_table.html.erb +17 -5
- data/app/views/admin/mailer/reset_password_link.text.erb +2 -2
- data/app/views/admin/resources/_form.html.erb +3 -12
- data/app/views/admin/resources/edit.html.erb +7 -5
- data/app/views/admin/resources/index.html.erb +13 -18
- data/app/views/admin/resources/new.html.erb +4 -4
- data/app/views/admin/resources/show.html.erb +9 -13
- data/app/views/admin/session/new.html.erb +8 -4
- data/app/views/admin/templates/_belongs_to.html.erb +1 -1
- data/app/views/admin/templates/_boolean.html.erb +2 -2
- data/app/views/admin/templates/_date.html.erb +2 -2
- data/app/views/admin/templates/_datetime.html.erb +2 -2
- data/app/views/admin/templates/_file.html.erb +3 -19
- data/app/views/admin/templates/_has_n.html.erb +4 -4
- data/app/views/admin/templates/_has_one.html.erb +14 -0
- data/app/views/admin/templates/_password.html.erb +2 -2
- data/app/views/admin/templates/_profile_sidebar.html.erb +3 -0
- data/app/views/admin/templates/_relate_form.html.erb +2 -1
- data/app/views/admin/templates/_selector.html.erb +1 -1
- data/app/views/admin/templates/_string.html.erb +6 -6
- data/app/views/admin/templates/_text.html.erb +11 -4
- data/app/views/admin/templates/_time.html.erb +2 -2
- data/app/views/admin/templates/_tree.html.erb +1 -1
- data/app/views/layouts/admin/base.html.erb +7 -6
- data/app/views/layouts/admin/session.html.erb +4 -14
- data/config/{available_locales/ca_models.yml → locales/typus.ca.models.yml} +5 -4
- data/config/locales/typus.ca.yml +81 -0
- data/config/{available_locales/de_models.yml → locales/typus.de.models.yml} +6 -2
- data/config/locales/typus.de.yml +80 -0
- data/config/locales/typus.el.models.yml +17 -0
- data/config/locales/typus.el.yml +82 -0
- data/config/{available_locales/es_models.yml → locales/typus.es.models.yml} +9 -4
- data/config/locales/typus.es.yml +82 -0
- data/config/{available_locales/fr_models.yml → locales/typus.fr.models.yml} +8 -3
- data/config/locales/typus.fr.yml +87 -0
- data/config/{available_locales/hu_models.yml → locales/typus.hu.models.yml} +6 -2
- data/config/locales/typus.hu.yml +80 -0
- data/config/{available_locales/it_models.yml → locales/typus.it.models.yml} +7 -4
- data/config/locales/typus.it.yml +89 -0
- data/config/{available_locales/language_models.yml.template → locales/typus.locale.models.yml.template} +8 -4
- data/config/locales/typus.locale.yml.template +81 -0
- data/config/{available_locales/pt-BR_models.yml → locales/typus.pt-BR.models.yml} +6 -2
- data/config/locales/typus.pt-BR.yml +80 -0
- data/config/{available_locales/ru_models.yml → locales/typus.ru.models.yml} +6 -2
- data/config/locales/typus.ru.yml +80 -0
- data/config/locales/typus.zh-CN.models.yml +17 -0
- data/config/locales/typus.zh-CN.yml +79 -0
- data/config/routes.rb +11 -7
- data/lib/generators/templates/config/initializers/typus.rb +8 -5
- data/lib/generators/templates/config/initializers/typus_resources.rb +0 -3
- data/lib/generators/templates/config/typus/README +6 -6
- data/lib/generators/templates/config/typus/typus.yml +5 -5
- data/lib/generators/templates/controller.rb +1 -1
- data/lib/generators/templates/migration.rb +1 -0
- data/lib/generators/templates/public/admin/javascripts/application.js +0 -4
- data/lib/generators/templates/public/admin/javascripts/jquery-1.4.4.min.js +167 -0
- data/lib/generators/templates/public/admin/javascripts/jquery.application.js +16 -0
- data/lib/generators/templates/public/admin/javascripts/jquery.rails.js +50 -22
- data/lib/generators/templates/public/admin/stylesheets/screen.css +43 -34
- data/lib/generators/templates/public/admin/vendor/fancybox/fancy_loading.png +0 -0
- data/lib/generators/templates/public/admin/vendor/fancybox/jquery.easing-1.3.pack.js +32 -32
- data/lib/generators/templates/public/admin/vendor/fancybox/{jquery.fancybox-1.3.1.css → jquery.fancybox-1.3.4.css} +359 -363
- data/lib/generators/templates/public/admin/vendor/fancybox/jquery.fancybox-1.3.4.js +1156 -0
- data/lib/generators/templates/public/admin/vendor/fancybox/jquery.fancybox-1.3.4.pack.js +46 -0
- data/lib/generators/templates/public/admin/vendor/fancybox/jquery.mousewheel-3.0.4.pack.js +14 -0
- data/lib/generators/typus/assets_generator.rb +23 -0
- data/lib/generators/typus/controller_generator.rb +29 -0
- data/lib/generators/typus/migration_generator.rb +39 -20
- data/lib/generators/typus/typus_generator.rb +17 -57
- data/lib/generators/typus/views_generator.rb +2 -6
- data/lib/support/active_record.rb +8 -20
- data/lib/support/fake_user.rb +6 -1
- data/lib/support/hash.rb +1 -2
- data/lib/support/object.rb +4 -17
- data/lib/support/string.rb +34 -3
- data/lib/tasks/typus.rake +1 -1
- data/lib/typus.rb +60 -48
- data/lib/typus/actions.rb +27 -0
- data/lib/typus/authentication/base.rb +3 -4
- data/lib/typus/authentication/http_basic.rb +1 -1
- data/lib/typus/authentication/none.rb +1 -1
- data/lib/typus/authentication/session.rb +53 -108
- data/lib/typus/configuration.rb +13 -11
- data/lib/typus/filters.rb +12 -0
- data/lib/typus/format.rb +9 -13
- data/lib/typus/i18n.rb +30 -0
- data/lib/typus/orm/active_record.rb +97 -194
- data/lib/typus/orm/active_record/search.rb +91 -0
- data/lib/typus/resources.rb +6 -10
- data/lib/typus/user.rb +20 -40
- data/lib/typus/version.rb +1 -1
- metadata +77 -231
- data/CHANGELOG +0 -102
- data/README.rdoc +0 -48
- data/app/helpers/admin/preview_helper.rb +0 -46
- data/app/views/admin/helpers/_preview.html.erb +0 -13
- data/app/views/admin/templates/_has_many.html.erb +0 -22
- data/config/available_locales/ca.yml +0 -122
- data/config/available_locales/de.yml +0 -122
- data/config/available_locales/es.yml +0 -122
- data/config/available_locales/fr.yml +0 -127
- data/config/available_locales/hu.yml +0 -122
- data/config/available_locales/it.yml +0 -132
- data/config/available_locales/language.yml.template +0 -120
- data/config/available_locales/pt-BR.yml +0 -122
- data/config/available_locales/ru.yml +0 -122
- data/lib/generators/templates/functional_test.rb +0 -10
- data/lib/generators/templates/model.rb +0 -8
- data/lib/generators/templates/public/admin/images/ui-icons.png +0 -0
- data/lib/generators/templates/public/admin/javascripts/jquery-1.4.2.min.js +0 -154
- data/lib/generators/templates/public/admin/vendor/fancybox/jquery.fancybox-1.3.1.js +0 -1077
- data/lib/generators/templates/public/admin/vendor/fancybox/jquery.fancybox-1.3.1.pack.js +0 -44
- data/lib/generators/templates/public/admin/vendor/fancybox/jquery.mousewheel-3.0.2.pack.js +0 -13
- data/lib/typus/pagination.rb +0 -18
- data/test/factories.rb +0 -43
- data/test/fixtures/config/broken/application.yml +0 -68
- data/test/fixtures/config/broken/application_roles.yml +0 -20
- 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 +0 -3
- data/test/fixtures/config/broken/undefined_roles.yml +0 -6
- data/test/fixtures/config/default/typus.yml +0 -13
- data/test/fixtures/config/default/typus_roles.yml +0 -2
- 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 +0 -10
- data/test/fixtures/config/namespaced/application.yml +0 -5
- data/test/fixtures/config/namespaced/application_roles.yml +0 -2
- data/test/fixtures/config/ordered/001_roles.yml +0 -2
- data/test/fixtures/config/ordered/002_roles.yml +0 -2
- data/test/fixtures/config/unordered/app_one_roles.yml +0 -2
- data/test/fixtures/config/unordered/app_two_roles.yml +0 -2
- data/test/fixtures/config/working/application.yml +0 -73
- data/test/fixtures/config/working/application_roles.yml +0 -24
- data/test/fixtures/config/working/typus.yml +0 -13
- data/test/fixtures/config/working/typus_roles.yml +0 -2
- data/test/fixtures/rails_app/Rakefile +0 -7
- data/test/fixtures/rails_app/app/controllers/admin/assets_controller.rb +0 -2
- data/test/fixtures/rails_app/app/controllers/admin/categories_controller.rb +0 -2
- data/test/fixtures/rails_app/app/controllers/admin/comments_controller.rb +0 -2
- data/test/fixtures/rails_app/app/controllers/admin/pages_controller.rb +0 -2
- data/test/fixtures/rails_app/app/controllers/admin/pictures_controller.rb +0 -2
- data/test/fixtures/rails_app/app/controllers/admin/posts_controller.rb +0 -2
- data/test/fixtures/rails_app/app/controllers/admin/status_controller.rb +0 -2
- data/test/fixtures/rails_app/app/controllers/admin/typus_users_controller.rb +0 -2
- data/test/fixtures/rails_app/app/controllers/admin/watch_dog_controller.rb +0 -2
- data/test/fixtures/rails_app/app/controllers/application_controller.rb +0 -3
- data/test/fixtures/rails_app/app/models/asset.rb +0 -5
- data/test/fixtures/rails_app/app/models/category.rb +0 -11
- data/test/fixtures/rails_app/app/models/comment.rb +0 -6
- data/test/fixtures/rails_app/app/models/custom_user.rb +0 -2
- data/test/fixtures/rails_app/app/models/delayed/task.rb +0 -5
- data/test/fixtures/rails_app/app/models/page.rb +0 -5
- data/test/fixtures/rails_app/app/models/picture.rb +0 -6
- data/test/fixtures/rails_app/app/models/post.rb +0 -21
- data/test/fixtures/rails_app/app/models/typus_user.rb +0 -8
- data/test/fixtures/rails_app/app/models/view.rb +0 -5
- data/test/fixtures/rails_app/app/views/admin/categories/_form.html.erb +0 -1
- data/test/fixtures/rails_app/app/views/admin/dashboard/_sidebar.html.erb +0 -1
- data/test/fixtures/rails_app/app/views/admin/mailer/reset_password_link.text.erb +0 -6
- data/test/fixtures/rails_app/app/views/admin/posts/_edit.html.erb +0 -1
- data/test/fixtures/rails_app/app/views/admin/posts/_index.html.erb +0 -1
- data/test/fixtures/rails_app/app/views/admin/posts/_new.html.erb +0 -1
- data/test/fixtures/rails_app/app/views/admin/posts/_show.html.erb +0 -1
- data/test/fixtures/rails_app/app/views/admin/posts/_sidebar.html.erb +0 -1
- data/test/fixtures/rails_app/app/views/admin/resources/_sidebar.html.erb +0 -1
- data/test/fixtures/rails_app/app/views/admin/status/index.html.erb +0 -1
- data/test/fixtures/rails_app/app/views/admin/templates/_datepicker.html.erb +0 -1
- data/test/fixtures/rails_app/config.ru +0 -4
- data/test/fixtures/rails_app/config/application.rb +0 -53
- data/test/fixtures/rails_app/config/boot.rb +0 -13
- data/test/fixtures/rails_app/config/database.yml +0 -14
- data/test/fixtures/rails_app/config/environment.rb +0 -5
- data/test/fixtures/rails_app/config/environments/test.rb +0 -34
- data/test/fixtures/rails_app/config/initializers/secret_token.rb +0 -7
- data/test/fixtures/rails_app/config/initializers/session_store.rb +0 -8
- data/test/fixtures/rails_app/config/initializers/typus.rb +0 -6
- data/test/fixtures/rails_app/config/routes.rb +0 -5
- data/test/fixtures/rails_app/config/typus/application.yml +0 -79
- data/test/fixtures/rails_app/config/typus/application_roles.yml +0 -25
- data/test/fixtures/rails_app/config/typus/typus.yml +0 -12
- data/test/fixtures/rails_app/config/typus/typus_roles.yml +0 -2
- data/test/fixtures/rails_app/db/test.sqlite3 +0 -0
- data/test/fixtures/rails_app/tmp/export-posts-20101012213057.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012213132.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012213234.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012213506.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012215057.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012215217.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012215415.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012215443.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012215509.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012215528.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012215551.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012215615.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012215640.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012215714.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012215744.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012215814.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012215836.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012215906.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012220659.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012221043.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012221258.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012222558.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012222752.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012222848.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012223433.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012223535.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012224003.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012224052.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012224109.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012224139.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012224205.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012224243.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101012225119.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013063215.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013063300.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013063352.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013063427.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013063448.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013063530.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013063559.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013063646.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013063737.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013063822.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013063837.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013063919.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013063939.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013063952.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013064220.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013064253.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013064318.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013064404.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013064452.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013064536.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013064652.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013064845.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013065023.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013065137.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013065713.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013065954.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013070057.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013070116.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013070156.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013070349.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013070429.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013070448.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013070514.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013070709.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013070745.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013070809.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013070905.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013070955.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013071116.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013071209.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013071335.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013071632.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013071643.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013071735.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013071749.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013072030.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013072050.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013072108.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013072713.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013072751.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013072912.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101013074546.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101018180512.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101018183359.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101018183608.csv +0 -2
- data/test/fixtures/rails_app/tmp/export-posts-20101018183759.csv +0 -2
- data/test/functional/admin/account_controller_test.rb +0 -90
- data/test/functional/admin/assets_controller_test.rb +0 -55
- data/test/functional/admin/categories_controller_test.rb +0 -62
- data/test/functional/admin/comments_controller_test.rb +0 -21
- data/test/functional/admin/dashboard_controller_test.rb +0 -138
- data/test/functional/admin/posts_controller_test.rb +0 -548
- data/test/functional/admin/session_controller_test.rb +0 -85
- data/test/functional/admin/status_controller_test.rb +0 -46
- data/test/functional/admin/typus_users_controller_test.rb +0 -159
- data/test/helpers/admin/base_helper_test.rb +0 -67
- data/test/helpers/admin/dashboard_helper_test.rb +0 -19
- data/test/helpers/admin/form_helper_test.rb +0 -117
- data/test/helpers/admin/resources_helper_test.rb +0 -64
- data/test/helpers/admin/sidebar_helper_test.rb +0 -274
- data/test/helpers/admin/table_helper_test.rb +0 -219
- data/test/integration/login_test.rb +0 -13
- data/test/integration_test_helper.rb +0 -21
- data/test/lib/support/active_record_test.rb +0 -86
- data/test/lib/support/array_test.rb +0 -11
- data/test/lib/support/hash_test.rb +0 -11
- data/test/lib/support/string_test.rb +0 -39
- data/test/lib/typus/active_record_test.rb +0 -451
- data/test/lib/typus/configuration_test.rb +0 -52
- data/test/lib/typus/resource_test.rb +0 -17
- data/test/lib/typus/routes_test.rb +0 -29
- data/test/lib/typus_test.rb +0 -107
- data/test/schema.rb +0 -100
- data/test/test_helper.rb +0 -16
- data/test/unit/admin/mailer_test.rb +0 -32
- data/test/unit/typus_user_roles_test.rb +0 -105
- data/test/unit/typus_user_test.rb +0 -142
- data/typus.gemspec +0 -25
@@ -1,21 +0,0 @@
|
|
1
|
-
class Post < ActiveRecord::Base
|
2
|
-
|
3
|
-
validates_presence_of :title, :body
|
4
|
-
has_and_belongs_to_many :categories
|
5
|
-
has_many :assets, :as => :resource, :dependent => :destroy
|
6
|
-
has_many :comments
|
7
|
-
has_many :views
|
8
|
-
|
9
|
-
belongs_to :favorite_comment, :class_name => "Comment"
|
10
|
-
belongs_to :typus_user
|
11
|
-
|
12
|
-
STATUS = %w( pending published unpublished )
|
13
|
-
|
14
|
-
def self.typus
|
15
|
-
"plugin"
|
16
|
-
end
|
17
|
-
|
18
|
-
def asset_file_name
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
categories#_form.html.erb
|
@@ -1 +0,0 @@
|
|
1
|
-
dashboard#_sidebar.html.erb
|
@@ -1 +0,0 @@
|
|
1
|
-
posts#_edit.html.erb
|
@@ -1 +0,0 @@
|
|
1
|
-
posts#_index.html.erb
|
@@ -1 +0,0 @@
|
|
1
|
-
posts#_new.html.erb
|
@@ -1 +0,0 @@
|
|
1
|
-
posts#_show.html.erb
|
@@ -1 +0,0 @@
|
|
1
|
-
posts#_sidebar.html.erb
|
@@ -1 +0,0 @@
|
|
1
|
-
resources#_sidebar.html.erb
|
@@ -1 +0,0 @@
|
|
1
|
-
status#index.html.erb
|
@@ -1 +0,0 @@
|
|
1
|
-
templates#datepicker_template_<%= attribute %>
|
@@ -1,53 +0,0 @@
|
|
1
|
-
require File.expand_path('../boot', __FILE__)
|
2
|
-
|
3
|
-
require 'rails/all'
|
4
|
-
|
5
|
-
# If you have a Gemfile, require the gems listed there, including any gems
|
6
|
-
# you've limited to :test, :development, or :production.
|
7
|
-
Bundler.require(:default, Rails.env) if defined?(Bundler)
|
8
|
-
|
9
|
-
module RailsApp
|
10
|
-
class Application < Rails::Application
|
11
|
-
# Settings in config/environments/* take precedence over those specified here.
|
12
|
-
# Application configuration should go into files in config/initializers
|
13
|
-
# -- all .rb files in that directory are automatically loaded.
|
14
|
-
|
15
|
-
# Add additional load paths for your own custom dirs
|
16
|
-
# config.load_paths += %W( #{config.root}/extras )
|
17
|
-
|
18
|
-
# Only load the plugins named here, in the order given (default is alphabetical).
|
19
|
-
# :all can be used as a placeholder for all plugins not explicitly named
|
20
|
-
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
21
|
-
|
22
|
-
# Activate observers that should always be running
|
23
|
-
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
24
|
-
|
25
|
-
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
26
|
-
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
27
|
-
# config.time_zone = 'Central Time (US & Canada)'
|
28
|
-
|
29
|
-
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
30
|
-
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
31
|
-
# config.i18n.default_locale = :de
|
32
|
-
|
33
|
-
# Configure generators values. Many other options are available, be sure to check the documentation.
|
34
|
-
# config.generators do |g|
|
35
|
-
# g.orm :active_record
|
36
|
-
# g.template_engine :erb
|
37
|
-
# g.test_framework :test_unit, :fixture => true
|
38
|
-
# end
|
39
|
-
|
40
|
-
# Configure the default encoding used in templates for Ruby 1.9.
|
41
|
-
config.encoding = "utf-8"
|
42
|
-
|
43
|
-
# Configure sensitive parameters which will be filtered from the log file.
|
44
|
-
config.filter_parameters += [:password]
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
##
|
49
|
-
# NOTE: This is here to fake the first request!
|
50
|
-
##
|
51
|
-
|
52
|
-
require "typus"
|
53
|
-
Typus.reload!
|
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
|
3
|
-
# Set up gems listed in the Gemfile.
|
4
|
-
gemfile = File.expand_path('../../../../../Gemfile', __FILE__)
|
5
|
-
begin
|
6
|
-
ENV['BUNDLE_GEMFILE'] = gemfile
|
7
|
-
require 'bundler'
|
8
|
-
Bundler.setup
|
9
|
-
rescue Bundler::GemNotFound => e
|
10
|
-
STDERR.puts e.message
|
11
|
-
STDERR.puts "Try running `bundle install`."
|
12
|
-
exit!
|
13
|
-
end if File.exist?(gemfile)
|
@@ -1,14 +0,0 @@
|
|
1
|
-
<%
|
2
|
-
connection = case ENV["DB"]
|
3
|
-
when "mysql"
|
4
|
-
{ :adapter => "mysql", :database => "typus_test" }
|
5
|
-
when "postgresql"
|
6
|
-
{ :adapter => "postgresql", :database => "typus_test", :encoding => "unicode" }
|
7
|
-
else
|
8
|
-
{ :adapter => "sqlite3", :database => "db/test.sqlite3" }
|
9
|
-
end
|
10
|
-
%>
|
11
|
-
|
12
|
-
test:
|
13
|
-
adapter: <%= connection[:adapter] %>
|
14
|
-
database: <%= connection[:database] %>
|
@@ -1,34 +0,0 @@
|
|
1
|
-
RailsApp::Application.configure do
|
2
|
-
# Settings specified here will take precedence over those in config/environment.rb
|
3
|
-
|
4
|
-
# The test environment is used exclusively to run your application's
|
5
|
-
# test suite. You never need to work with it otherwise. Remember that
|
6
|
-
# your test database is "scratch space" for the test suite and is wiped
|
7
|
-
# and recreated between test runs. Don't rely on the data there!
|
8
|
-
config.cache_classes = true
|
9
|
-
|
10
|
-
# Log error messages when you accidentally call methods on nil.
|
11
|
-
config.whiny_nils = true
|
12
|
-
|
13
|
-
# Show full error reports and disable caching
|
14
|
-
config.consider_all_requests_local = true
|
15
|
-
config.action_controller.perform_caching = false
|
16
|
-
|
17
|
-
# Raise exceptions instead of rendering exception templates
|
18
|
-
config.action_dispatch.show_exceptions = false
|
19
|
-
|
20
|
-
# Disable request forgery protection in test environment
|
21
|
-
config.action_controller.allow_forgery_protection = false
|
22
|
-
|
23
|
-
# Tell Action Mailer not to deliver emails to the real world.
|
24
|
-
# The :test delivery method accumulates sent emails in the
|
25
|
-
# ActionMailer::Base.deliveries array.
|
26
|
-
config.action_mailer.delivery_method = :test
|
27
|
-
|
28
|
-
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
29
|
-
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
30
|
-
# like if you have constraints or database-specific column types
|
31
|
-
# config.active_record.schema_format = :sql
|
32
|
-
|
33
|
-
config.active_support.deprecation = :stderr
|
34
|
-
end
|
@@ -1,7 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
# Your secret key for verifying the integrity of signed cookies.
|
4
|
-
# If you change this key, all old signed cookies will become invalid!
|
5
|
-
# Make sure the secret is at least 30 characters and all random,
|
6
|
-
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
-
Rails.application.config.secret_token = '8660609acb6dc60544378c5856f376749079cee1a656841975b2be2ae70ad981eb785ff68222216bcfafb813cd4bdd0c848f3c2c53d6ec24a8cef2bd220cd5cd'
|
@@ -1,8 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
Rails.application.config.session_store :cookie_store, :key => '_rails_app_session'
|
4
|
-
|
5
|
-
# Use the database for sessions instead of the cookie-based default,
|
6
|
-
# which shouldn't be used to store highly confidential information
|
7
|
-
# (create the session table with "rake db:sessions:create")
|
8
|
-
# Rails.application.config.session_store :active_record_store
|
@@ -1,79 +0,0 @@
|
|
1
|
-
Asset:
|
2
|
-
fields:
|
3
|
-
default: caption
|
4
|
-
application: Site
|
5
|
-
|
6
|
-
Category:
|
7
|
-
fields:
|
8
|
-
list: name, position
|
9
|
-
form: name, permalink, position
|
10
|
-
order_by: position
|
11
|
-
module: Post
|
12
|
-
|
13
|
-
Comment:
|
14
|
-
fields:
|
15
|
-
list: email, post, post_id
|
16
|
-
form: email, post
|
17
|
-
csv: email, post_id
|
18
|
-
export: csv
|
19
|
-
filters: post
|
20
|
-
search: email, body
|
21
|
-
application: Blog
|
22
|
-
|
23
|
-
Delayed::Task:
|
24
|
-
fields:
|
25
|
-
default: name
|
26
|
-
search: name
|
27
|
-
application: System
|
28
|
-
|
29
|
-
Page:
|
30
|
-
fields:
|
31
|
-
# Body field is overwrited from a Page class method.
|
32
|
-
list: title
|
33
|
-
form: title, body
|
34
|
-
actions:
|
35
|
-
index: rebuild_all
|
36
|
-
edit: rebuild
|
37
|
-
application: Site
|
38
|
-
options:
|
39
|
-
form_rows: 25
|
40
|
-
|
41
|
-
Post:
|
42
|
-
fields:
|
43
|
-
list: title, created_at, status
|
44
|
-
form: title, body, created_at, status, published_at
|
45
|
-
relationship: title, created_at
|
46
|
-
csv: title, status
|
47
|
-
xml: title, status
|
48
|
-
options:
|
49
|
-
selectors: status
|
50
|
-
read_only: permalink
|
51
|
-
auto_generated: created_at
|
52
|
-
date_formats:
|
53
|
-
created_at: post_short
|
54
|
-
templates:
|
55
|
-
published_at: datepicker
|
56
|
-
relationships: assets, categories, comments, views
|
57
|
-
actions:
|
58
|
-
index: cleanup
|
59
|
-
edit: send_as_newsletter, preview
|
60
|
-
filters: status, created_at, user, user_id
|
61
|
-
search: title
|
62
|
-
order_by: title, -created_at
|
63
|
-
application: Blog
|
64
|
-
export: csv, xml
|
65
|
-
|
66
|
-
Picture:
|
67
|
-
fields:
|
68
|
-
default: title, picture
|
69
|
-
list: title, created_at
|
70
|
-
search: title
|
71
|
-
application: Blog
|
72
|
-
|
73
|
-
CustomUser:
|
74
|
-
fields:
|
75
|
-
list: first_name, last_name, email
|
76
|
-
|
77
|
-
View:
|
78
|
-
fields:
|
79
|
-
default: ip, post
|
@@ -1,25 +0,0 @@
|
|
1
|
-
admin:
|
2
|
-
Asset: create, read, update, delete
|
3
|
-
Category: create, read, update, delete
|
4
|
-
Comment: create, read, update, delete
|
5
|
-
Delayed::Task: all
|
6
|
-
Git: index, commit
|
7
|
-
Order:
|
8
|
-
Page: create, read, update, delete, rebuild, rebuild_all
|
9
|
-
Post: create, read, update, delete
|
10
|
-
Status: index
|
11
|
-
WatchDog: index, cleanup
|
12
|
-
View: create, read, update, delete
|
13
|
-
|
14
|
-
editor:
|
15
|
-
Category: create, read, update
|
16
|
-
Comment: read, update, delete
|
17
|
-
Git: index
|
18
|
-
Post: create, read, update
|
19
|
-
TypusUser: read, update
|
20
|
-
View: create, read, update, delete
|
21
|
-
|
22
|
-
designer:
|
23
|
-
Category: read, update
|
24
|
-
Comment: read
|
25
|
-
Post: read, update
|