typus 0.9.39 → 1.0.0.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +104 -0
- data/Gemfile +17 -0
- data/Gemfile.lock +96 -0
- data/MIT-LICENSE +1 -1
- data/README.rdoc +45 -0
- data/Rakefile +19 -48
- data/app/controllers/admin/account_controller.rb +54 -0
- data/app/controllers/admin/dashboard_controller.rb +7 -0
- data/app/controllers/admin/resource_controller.rb +8 -0
- data/app/controllers/admin/resources_controller.rb +307 -0
- data/app/controllers/admin/session_controller.rb +38 -0
- data/app/controllers/admin_controller.rb +26 -0
- data/app/helpers/admin/dashboard_helper.rb +38 -0
- data/app/helpers/admin/filters_helper.rb +81 -0
- data/app/helpers/admin/form_helper.rb +68 -261
- data/app/helpers/admin/preview_helper.rb +48 -0
- data/app/helpers/admin/relationships_helper.rb +192 -0
- data/app/helpers/admin/resources_helper.rb +80 -0
- data/app/helpers/admin/search_helper.rb +19 -0
- data/app/helpers/admin/sidebar_helper.rb +32 -210
- data/app/helpers/admin/table_helper.rb +207 -200
- data/app/helpers/admin_helper.rb +56 -0
- data/app/mailers/admin/mailer.rb +13 -0
- data/app/models/admin/fake_user.rb +38 -0
- data/app/views/admin/account/forgot_password.html.erb +21 -0
- data/app/views/admin/account/new.html.erb +21 -0
- data/app/views/admin/dashboard/_sidebar.html.erb +3 -3
- data/app/views/admin/dashboard/show.html.erb +16 -0
- data/app/views/admin/dashboard/styles.html.erb +154 -0
- data/app/views/admin/helpers/_apps.html.erb +6 -0
- data/app/views/admin/helpers/_flash_message.html.erb +3 -0
- data/app/views/admin/helpers/_header.html.erb +7 -0
- data/app/views/admin/helpers/_login_info.html.erb +4 -0
- data/app/views/admin/helpers/_preview.html.erb +13 -0
- data/app/views/admin/helpers/dashboard/_applications.html.erb +32 -0
- data/app/views/admin/helpers/dashboard/_resources.html.erb +16 -0
- data/app/views/admin/helpers/filters/_filters.html.erb +31 -0
- data/app/views/admin/helpers/resources/_display_link_to_previous.html.erb +3 -0
- data/app/views/admin/helpers/resources/_pagination.html.erb +28 -0
- data/app/views/admin/helpers/search/_search.html.erb +12 -0
- data/app/views/admin/helpers/sidebar/_sidebar.html.erb +17 -0
- data/app/views/admin/helpers/table/_table.html.erb +22 -0
- data/app/views/{typus_mailer/reset_password_link.erb → admin/mailer/reset_password_link.text.erb} +2 -2
- data/{test/config/broken/empty.yml → app/views/admin/resources/_edit.html.erb} +0 -0
- data/app/views/admin/resources/_form.html.erb +26 -0
- data/{test/config/broken/empty_roles.yml → app/views/admin/resources/_index.html.erb} +0 -0
- data/{test/config/empty/empty_01.yml → app/views/admin/resources/_new.html.erb} +0 -0
- data/{test/config/empty/empty_01_roles.yml → app/views/admin/resources/_show.html.erb} +0 -0
- data/app/views/admin/resources/edit.html.erb +23 -21
- data/app/views/admin/resources/index.html.erb +31 -18
- data/app/views/admin/resources/new.html.erb +20 -18
- data/app/views/admin/resources/show.html.erb +29 -20
- data/app/views/admin/session/new.html.erb +26 -0
- data/app/views/admin/templates/_belongs_to.html.erb +4 -0
- data/app/views/admin/templates/_boolean.html.erb +4 -8
- data/app/views/admin/templates/_date.html.erb +9 -2
- data/app/views/admin/templates/_datetime.html.erb +9 -2
- data/app/views/admin/templates/_file.html.erb +20 -5
- data/app/views/admin/templates/_has_many.html.erb +24 -0
- data/app/views/admin/templates/_has_n.html.erb +17 -0
- data/{test/config/empty/empty_02.yml → app/views/admin/templates/_has_one.html.erb} +0 -0
- data/app/views/admin/templates/_password.html.erb +4 -2
- data/app/views/admin/templates/_relate_form.html.erb +4 -0
- data/app/views/admin/templates/_selector.html.erb +6 -18
- data/app/views/admin/templates/_string.html.erb +11 -10
- data/app/views/admin/templates/_text.html.erb +9 -2
- data/app/views/admin/templates/_time.html.erb +9 -2
- data/app/views/admin/templates/_tree.html.erb +4 -0
- data/app/views/layouts/admin/session.html.erb +44 -0
- data/app/views/layouts/admin.html.erb +45 -39
- data/config/available_locales/ca.yml +124 -0
- data/config/available_locales/ca_models.yml +16 -0
- data/config/{locales → available_locales}/de.yml +108 -89
- data/config/available_locales/de_models.yml +13 -0
- data/config/available_locales/es.yml +124 -0
- data/config/available_locales/es_models.yml +13 -0
- data/config/available_locales/fr.yml +124 -0
- data/config/available_locales/fr_models.yml +13 -0
- data/config/available_locales/hu.yml +124 -0
- data/config/available_locales/hu_models.yml +13 -0
- data/config/available_locales/it.yml +136 -0
- data/config/available_locales/it_models.yml +15 -0
- data/config/available_locales/language.yml.template +122 -0
- data/config/available_locales/language_models.yml.template +13 -0
- data/config/{locales → available_locales}/pt-BR.yml +97 -74
- data/config/available_locales/pt-BR_models.yml +13 -0
- data/config/{locales → available_locales}/ru.yml +107 -85
- data/config/available_locales/ru_models.yml +13 -0
- data/config/routes.rb +18 -11
- data/lib/generators/templates/config/initializers/typus.rb +26 -0
- data/lib/generators/templates/config/initializers/typus_authentication.rb +18 -0
- data/lib/generators/templates/config/initializers/typus_resources.rb +30 -0
- data/{generators/typus → lib/generators}/templates/config/typus/README +34 -16
- data/lib/generators/templates/config/typus/application.yml +5 -0
- data/lib/generators/templates/config/typus/application_roles.yml +6 -0
- data/lib/generators/templates/config/typus/typus.yml +17 -0
- data/lib/generators/templates/config/typus/typus_roles.yml +6 -0
- data/lib/generators/templates/controller.rb +4 -0
- data/lib/generators/templates/functional_test.rb +21 -0
- data/{generators/typus/templates/db/create_typus_users.rb → lib/generators/templates/migration.rb} +4 -4
- data/lib/generators/templates/model.rb +8 -0
- data/lib/generators/templates/model.yml +10 -0
- data/{generators/typus/templates/public/images/admin → lib/generators/templates/public/admin/images}/ui-icons.png +0 -0
- data/lib/generators/templates/public/admin/javascripts/application.js +6 -0
- data/lib/generators/templates/public/admin/javascripts/jquery-1.4.2.min.js +154 -0
- data/lib/generators/templates/public/admin/javascripts/jquery.rails.js +126 -0
- data/lib/generators/templates/public/admin/javascripts/jquery.searchField.js +91 -0
- data/lib/generators/templates/public/admin/stylesheets/application.css +11 -0
- data/lib/generators/templates/public/admin/stylesheets/screen.css +356 -0
- data/lib/generators/templates/public/admin/vendor/fancybox/blank.gif +0 -0
- data/lib/generators/templates/public/admin/vendor/fancybox/fancy_close.png +0 -0
- data/lib/generators/templates/public/admin/vendor/fancybox/fancy_loading.png +0 -0
- data/lib/generators/templates/public/admin/vendor/fancybox/fancy_nav_left.png +0 -0
- data/lib/generators/templates/public/admin/vendor/fancybox/fancy_nav_right.png +0 -0
- data/lib/generators/templates/public/admin/vendor/fancybox/fancy_shadow_e.png +0 -0
- data/lib/generators/templates/public/admin/vendor/fancybox/fancy_shadow_n.png +0 -0
- data/lib/generators/templates/public/admin/vendor/fancybox/fancy_shadow_ne.png +0 -0
- data/lib/generators/templates/public/admin/vendor/fancybox/fancy_shadow_nw.png +0 -0
- data/lib/generators/templates/public/admin/vendor/fancybox/fancy_shadow_s.png +0 -0
- data/lib/generators/templates/public/admin/vendor/fancybox/fancy_shadow_se.png +0 -0
- data/lib/generators/templates/public/admin/vendor/fancybox/fancy_shadow_sw.png +0 -0
- data/lib/generators/templates/public/admin/vendor/fancybox/fancy_shadow_w.png +0 -0
- data/lib/generators/templates/public/admin/vendor/fancybox/fancy_title_left.png +0 -0
- data/lib/generators/templates/public/admin/vendor/fancybox/fancy_title_main.png +0 -0
- data/lib/generators/templates/public/admin/vendor/fancybox/fancy_title_over.png +0 -0
- data/{generators/typus/templates/public/images/admin → lib/generators/templates/public/admin/vendor}/fancybox/fancy_title_right.png +0 -0
- data/lib/generators/templates/public/admin/vendor/fancybox/fancybox-x.png +0 -0
- data/lib/generators/templates/public/admin/vendor/fancybox/fancybox-y.png +0 -0
- data/lib/generators/templates/public/admin/vendor/fancybox/fancybox.png +0 -0
- data/lib/generators/templates/public/admin/vendor/fancybox/jquery.easing-1.3.pack.js +72 -0
- data/lib/generators/templates/public/admin/vendor/fancybox/jquery.fancybox-1.3.1.css +363 -0
- data/lib/generators/templates/public/admin/vendor/fancybox/jquery.fancybox-1.3.1.js +1077 -0
- data/lib/generators/templates/public/admin/vendor/fancybox/jquery.fancybox-1.3.1.pack.js +44 -0
- data/lib/generators/templates/public/admin/vendor/fancybox/jquery.mousewheel-3.0.2.pack.js +13 -0
- data/lib/generators/templates/view.html.erb +9 -0
- data/lib/generators/typus/migration_generator.rb +85 -0
- data/lib/generators/typus/typus_generator.rb +190 -0
- data/lib/generators/typus/views_generator.rb +27 -0
- data/lib/support/active_record.rb +60 -0
- data/lib/support/array.rb +13 -0
- data/lib/{typus → support}/hash.rb +2 -2
- data/lib/{typus → support}/object.rb +2 -2
- data/lib/support/string.rb +47 -0
- data/lib/tasks/typus.rake +19 -0
- data/lib/typus/authentication.rb +146 -40
- data/lib/typus/configuration.rb +14 -49
- data/lib/typus/engine.rb +6 -0
- data/lib/typus/format.rb +41 -18
- data/lib/typus/orm/active_record.rb +378 -0
- data/lib/typus/resources.rb +57 -0
- data/lib/typus/user.rb +54 -37
- data/lib/typus/version.rb +3 -0
- data/lib/typus.rb +118 -80
- data/lib/vendor/paginator.rb +2 -2
- data/test/factories/assets.rb +5 -0
- data/test/factories/categories.rb +3 -0
- data/test/factories/comments.rb +6 -0
- data/test/factories/pages.rb +5 -0
- data/test/factories/pictures.rb +7 -0
- data/test/factories/posts.rb +6 -0
- data/test/factories/typus_users.rb +8 -0
- data/test/{config → fixtures/config}/broken/application.yml +0 -0
- data/test/{config → fixtures/config}/broken/application_roles.yml +0 -0
- data/test/{config/empty/empty_02_roles.yml → fixtures/config/broken/empty.yml} +0 -0
- data/test/fixtures/config/broken/empty_roles.yml +0 -0
- data/test/{config → fixtures/config}/broken/undefined.yml +0 -0
- data/test/{config → fixtures/config}/broken/undefined_roles.yml +0 -0
- data/test/{config → fixtures/config}/default/typus.yml +2 -1
- data/{generators/typus/templates/config/typus → test/fixtures/config/default}/typus_roles.yml +0 -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/{config → fixtures/config}/locales/es.yml +0 -0
- data/test/fixtures/config/namespaced/application.yml +5 -0
- data/test/fixtures/config/namespaced/application_roles.yml +2 -0
- data/test/{config → fixtures/config}/ordered/001_roles.yml +0 -0
- data/test/{config → fixtures/config}/ordered/002_roles.yml +0 -0
- data/test/{config → fixtures/config}/unordered/app_one_roles.yml +0 -0
- data/test/{config → fixtures/config}/unordered/app_two_roles.yml +0 -0
- data/test/fixtures/config/working/application.yml +73 -0
- data/test/fixtures/config/working/application_roles.yml +24 -0
- data/{generators/typus/templates/config/typus → test/fixtures/config/working}/typus.yml +2 -1
- data/test/{config/default → fixtures/config/working}/typus_roles.yml +0 -0
- data/test/fixtures/rails_app/README +244 -0
- data/test/fixtures/rails_app/Rakefile +7 -0
- data/test/fixtures/rails_app/app/controllers/admin/assets_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/pages_controller.rb +2 -0
- data/test/fixtures/rails_app/app/controllers/admin/pictures_controller.rb +2 -0
- data/test/fixtures/rails_app/app/controllers/admin/posts_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/watch_dog_controller.rb +2 -0
- data/test/fixtures/rails_app/app/controllers/application_controller.rb +4 -0
- data/test/fixtures/rails_app/app/helpers/application_helper.rb +2 -0
- data/test/fixtures/{app → rails_app/app}/models/asset.rb +1 -1
- data/test/fixtures/{app → rails_app/app}/models/category.rb +2 -2
- data/test/fixtures/{app → rails_app/app}/models/comment.rb +1 -1
- data/test/fixtures/{app → rails_app/app}/models/custom_user.rb +1 -1
- data/test/fixtures/{app → rails_app/app}/models/delayed/task.rb +2 -2
- data/test/fixtures/rails_app/app/models/page.rb +9 -0
- data/test/fixtures/rails_app/app/models/picture.rb +6 -0
- data/test/fixtures/{app → rails_app/app}/models/post.rb +6 -6
- data/test/fixtures/rails_app/app/models/typus_user.rb +8 -0
- data/test/fixtures/{app → rails_app/app}/models/view.rb +1 -1
- data/test/fixtures/rails_app/app/views/admin/categories/_form.html.erb +1 -0
- data/test/fixtures/rails_app/app/views/admin/dashboard/_sidebar.html.erb +1 -0
- data/test/fixtures/rails_app/app/views/admin/mailer/reset_password_link.text.erb +6 -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 +1 -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/posts/_sidebar.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 +1 -0
- data/test/fixtures/rails_app/app/views/admin/templates/_datepicker.html.erb +1 -0
- data/test/fixtures/rails_app/app/views/layouts/application.html.erb +14 -0
- data/test/fixtures/rails_app/config/application.rb +50 -0
- data/test/fixtures/rails_app/config/boot.rb +13 -0
- data/test/fixtures/rails_app/config/database.yml +22 -0
- data/test/fixtures/rails_app/config/environment.rb +5 -0
- data/test/fixtures/rails_app/config/environments/development.rb +19 -0
- data/test/fixtures/rails_app/config/environments/production.rb +42 -0
- data/test/fixtures/rails_app/config/environments/test.rb +34 -0
- data/test/fixtures/rails_app/config/initializers/acts_as_list.rb +258 -0
- data/test/fixtures/rails_app/config/initializers/acts_as_tree.rb +98 -0
- data/test/fixtures/rails_app/config/initializers/backtrace_silencers.rb +7 -0
- data/test/fixtures/rails_app/config/initializers/inflections.rb +10 -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/typus.rb +6 -0
- data/test/fixtures/rails_app/config/locales/en.yml +5 -0
- data/test/fixtures/rails_app/config/routes.rb +8 -0
- data/test/{config/working → fixtures/rails_app/config/typus}/application.yml +11 -9
- data/test/{config/working → fixtures/rails_app/config/typus}/application_roles.yml +0 -0
- data/{generators/typus_update_schema_to_01/templates/config → test/fixtures/rails_app/config/typus}/typus.yml +0 -0
- data/test/{config/working → fixtures/rails_app/config/typus}/typus_roles.yml +0 -0
- data/test/fixtures/rails_app/config.ru +4 -0
- data/test/fixtures/rails_app/db/seeds.rb +7 -0
- data/test/fixtures/rails_app/db/test.sqlite3 +0 -0
- data/test/fixtures/rails_app/log/test.log +4268 -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/index.html +279 -0
- data/test/fixtures/rails_app/public/javascripts/application.js +2 -0
- data/test/fixtures/rails_app/public/javascripts/controls.js +965 -0
- data/test/fixtures/rails_app/public/javascripts/dragdrop.js +974 -0
- data/test/fixtures/rails_app/public/javascripts/effects.js +1123 -0
- data/test/fixtures/rails_app/public/javascripts/prototype.js +4874 -0
- data/test/fixtures/rails_app/public/javascripts/rails.js +118 -0
- data/test/fixtures/rails_app/public/robots.txt +5 -0
- data/test/fixtures/rails_app/script/rails +9 -0
- data/test/fixtures/rails_app/tmp/export-posts-20100902120447.csv +2 -0
- data/test/fixtures/rails_app/tmp/export-posts-20100902120700.csv +2 -0
- data/test/functional/admin/account_controller_test.rb +90 -0
- data/test/functional/admin/dashboard_controller_http_basic_test.rb +24 -0
- data/test/functional/admin/dashboard_controller_none_test.rb +18 -0
- data/test/functional/admin/dashboard_controller_test.rb +106 -0
- data/test/functional/admin/resources_controller_assets_relationships.rb +59 -0
- data/test/functional/admin/resources_controller_categories_before_test.rb +10 -0
- data/test/functional/admin/resources_controller_categories_lists_test.rb +44 -0
- data/test/functional/admin/resources_controller_categories_views_test.rb +10 -0
- data/test/functional/admin/resources_controller_comments_toggle_test.rb +21 -0
- data/test/functional/admin/{master_controller_posts_before_test.rb → resources_controller_posts_before_test.rb} +3 -3
- data/test/functional/admin/resources_controller_posts_crud_custom_test.rb +27 -0
- data/test/functional/admin/resources_controller_posts_crud_test.rb +44 -0
- data/test/functional/admin/resources_controller_posts_formats_test.rb +39 -0
- data/test/functional/admin/resources_controller_posts_forms_test.rb +58 -0
- data/test/functional/admin/resources_controller_posts_permissions_test.rb +100 -0
- data/test/functional/admin/{master_controller_posts_relationships_test.rb → resources_controller_posts_relationships_test.rb} +25 -20
- data/test/functional/admin/resources_controller_posts_roles.rb +52 -0
- data/test/functional/admin/resources_controller_posts_views_test.rb +143 -0
- data/test/functional/admin/resources_controller_tableless_resource_test.rb +51 -0
- data/test/functional/admin/resources_controller_typus_users_test.rb +159 -0
- data/test/functional/admin/session_controller_test.rb +85 -0
- data/test/helpers/admin/dashboard_helper_test.rb +42 -0
- data/test/helpers/admin/form_helper_test.rb +52 -276
- data/test/helpers/admin/resources_helper_test.rb +52 -0
- data/test/helpers/admin/sidebar_helper_test.rb +133 -224
- data/test/helpers/admin/table_helper_test.rb +136 -144
- data/test/helpers/admin_helper_test.rb +69 -0
- data/test/lib/support/active_record_test.rb +35 -0
- data/test/lib/support/array_test.rb +15 -0
- data/test/lib/support/hash_test.rb +11 -0
- data/test/lib/support/string_test.rb +48 -0
- data/test/lib/typus/active_record_test.rb +385 -0
- data/test/lib/typus/configuration_test.rb +52 -0
- data/test/lib/typus/resource_test.rb +17 -0
- data/test/lib/typus/routes_test.rb +29 -0
- data/test/lib/typus_test.rb +72 -40
- data/test/{vendor → lib/vendor}/paginator_test.rb +7 -4
- data/test/schema.rb +28 -3
- data/test/test_helper.rb +29 -0
- data/test/unit/admin/mailer_test.rb +32 -0
- data/test/unit/typus_user_roles_test.rb +69 -61
- data/test/unit/typus_user_test.rb +56 -143
- data/typus.gemspec +18 -276
- metadata +305 -231
- data/.gitignore +0 -1
- data/AUTHORS.md +0 -34
- data/CHANGES +0 -3
- data/README.md +0 -75
- data/VERSION +0 -1
- data/app/controllers/admin/master_controller.rb +0 -394
- data/app/controllers/typus_controller.rb +0 -152
- data/app/helpers/admin/master_helper.rb +0 -104
- data/app/helpers/admin/public_helper.rb +0 -27
- data/app/helpers/typus_helper.rb +0 -181
- data/app/models/typus_mailer.rb +0 -14
- data/app/models/typus_user.rb +0 -5
- data/app/views/admin/shared/_feedback.html.erb +0 -6
- data/app/views/admin/shared/_footer.html.erb +0 -2
- data/app/views/admin/shared/_pagination.html.erb +0 -28
- data/app/views/admin/templates/_tiny_mce.html.erb +0 -2
- data/app/views/layouts/typus.html.erb +0 -29
- data/app/views/typus/dashboard.html.erb +0 -9
- data/app/views/typus/recover_password.html.erb +0 -7
- data/app/views/typus/reset_password.html.erb +0 -15
- data/app/views/typus/sign_in.html.erb +0 -9
- data/app/views/typus/sign_up.html.erb +0 -7
- data/config/locales/es.yml +0 -105
- data/config/locales/fr.yml +0 -98
- data/config/locales/language.yml.template +0 -106
- data/generators/typus/templates/auto/index.html.erb +0 -11
- data/generators/typus/templates/auto/resource_controller.rb.erb +0 -15
- data/generators/typus/templates/auto/resource_controller_test.rb.erb +0 -11
- data/generators/typus/templates/auto/resources_controller.rb.erb +0 -37
- data/generators/typus/templates/config/initializers/typus.rb +0 -34
- data/generators/typus/templates/config/typus/application.yml +0 -6
- data/generators/typus/templates/config/typus/application_roles.yml +0 -23
- data/generators/typus/templates/lib/tasks/typus_tasks.rake +0 -32
- data/generators/typus/templates/public/images/admin/fancybox/fancy_closebox.png +0 -0
- data/generators/typus/templates/public/images/admin/fancybox/fancy_left.png +0 -0
- data/generators/typus/templates/public/images/admin/fancybox/fancy_progress.png +0 -0
- data/generators/typus/templates/public/images/admin/fancybox/fancy_right.png +0 -0
- data/generators/typus/templates/public/images/admin/fancybox/fancy_shadow_e.png +0 -0
- data/generators/typus/templates/public/images/admin/fancybox/fancy_shadow_n.png +0 -0
- data/generators/typus/templates/public/images/admin/fancybox/fancy_shadow_ne.png +0 -0
- data/generators/typus/templates/public/images/admin/fancybox/fancy_shadow_nw.png +0 -0
- data/generators/typus/templates/public/images/admin/fancybox/fancy_shadow_s.png +0 -0
- data/generators/typus/templates/public/images/admin/fancybox/fancy_shadow_se.png +0 -0
- data/generators/typus/templates/public/images/admin/fancybox/fancy_shadow_sw.png +0 -0
- data/generators/typus/templates/public/images/admin/fancybox/fancy_shadow_w.png +0 -0
- data/generators/typus/templates/public/images/admin/fancybox/fancy_title_left.png +0 -0
- data/generators/typus/templates/public/images/admin/fancybox/fancy_title_main.png +0 -0
- data/generators/typus/templates/public/javascripts/admin/application.js +0 -14
- data/generators/typus/templates/public/javascripts/admin/jquery-1.3.2.min.js +0 -19
- data/generators/typus/templates/public/javascripts/admin/jquery.fancybox-1.2.1.min.js +0 -9
- data/generators/typus/templates/public/stylesheets/admin/jquery.fancybox.css +0 -315
- data/generators/typus/templates/public/stylesheets/admin/reset.css +0 -68
- data/generators/typus/templates/public/stylesheets/admin/screen.css +0 -361
- data/generators/typus/typus_generator.rb +0 -191
- data/generators/typus_update_schema_to_01/templates/migration.rb +0 -11
- data/generators/typus_update_schema_to_01/typus_update_schema_to_01_generator.rb +0 -19
- data/generators/typus_update_schema_to_02/templates/migration.rb +0 -11
- data/generators/typus_update_schema_to_02/typus_update_schema_to_02_generator.rb +0 -11
- data/lib/typus/active_record.rb +0 -323
- data/lib/typus/extensions/routes.rb +0 -15
- data/lib/typus/extensions/routes_hack.rb +0 -15
- data/lib/typus/preferences.rb +0 -11
- data/lib/typus/preview.rb +0 -76
- data/lib/typus/quick_edit.rb +0 -40
- data/lib/typus/reloader.rb +0 -14
- data/lib/typus/string.rb +0 -27
- data/lib/vendor/active_record.rb +0 -15
- data/lib/vendor/rss_parser.rb +0 -20
- data/rails/init.rb +0 -3
- data/tasks/typus_tasks.rake +0 -32
- data/test/config/working/typus.yml +0 -12
- data/test/fixtures/app/controllers/admin/assets_controller.rb +0 -2
- data/test/fixtures/app/controllers/admin/categories_controller.rb +0 -2
- data/test/fixtures/app/controllers/admin/comments_controller.rb +0 -2
- data/test/fixtures/app/controllers/admin/pages_controller.rb +0 -2
- data/test/fixtures/app/controllers/admin/posts_controller.rb +0 -2
- data/test/fixtures/app/controllers/admin/status_controller.rb +0 -6
- data/test/fixtures/app/controllers/admin/typus_users_controller.rb +0 -2
- data/test/fixtures/app/controllers/admin/watch_dog_controller.rb +0 -6
- data/test/fixtures/app/models/page.rb +0 -5
- data/test/fixtures/app/views/admin/dashboard/_content.html.erb +0 -1
- data/test/fixtures/app/views/admin/dashboard/_sidebar.html.erb +0 -1
- data/test/fixtures/app/views/admin/posts/_edit.html.erb +0 -1
- data/test/fixtures/app/views/admin/posts/_index.html.erb +0 -1
- data/test/fixtures/app/views/admin/posts/_new.html.erb +0 -1
- data/test/fixtures/app/views/admin/posts/_show.html.erb +0 -1
- data/test/fixtures/app/views/admin/posts/_sidebar.html.erb +0 -1
- data/test/fixtures/app/views/admin/resources/_sidebar.html.erb +0 -1
- data/test/fixtures/app/views/admin/shared/_footer.html.erb +0 -1
- data/test/fixtures/app/views/admin/status/index.html.erb +0 -1
- data/test/fixtures/app/views/admin/templates/_datepicker.html.erb +0 -1
- data/test/fixtures/assets.yml +0 -11
- data/test/fixtures/categories.yml +0 -14
- data/test/fixtures/comments.yml +0 -27
- data/test/fixtures/pages.yml +0 -41
- data/test/fixtures/posts.yml +0 -37
- data/test/fixtures/typus_users.yml +0 -59
- data/test/functional/admin/master_controller_assets_relationships.rb +0 -66
- data/test/functional/admin/master_controller_categories_lists_test.rb +0 -64
- data/test/functional/admin/master_controller_posts_crud_test.rb +0 -97
- data/test/functional/admin/master_controller_posts_formats_test.rb +0 -53
- data/test/functional/admin/master_controller_posts_permissions_test.rb +0 -127
- data/test/functional/admin/master_controller_posts_roles.rb +0 -50
- data/test/functional/admin/master_controller_posts_toggle_test.rb +0 -35
- data/test/functional/admin/master_controller_posts_views_test.rb +0 -209
- data/test/functional/admin/master_controller_tableless_resource_test.rb +0 -36
- data/test/functional/admin/master_controller_typus_users_test.rb +0 -211
- data/test/functional/typus_controller_test.rb +0 -342
- data/test/helper.rb +0 -51
- data/test/helpers/admin/master_helper_test.rb +0 -70
- data/test/helpers/admin/public_helper_test.rb +0 -26
- data/test/helpers/typus_helper_test.rb +0 -96
- data/test/lib/active_record_test.rb +0 -377
- data/test/lib/configuration_test.rb +0 -95
- data/test/lib/hash_test.rb +0 -11
- data/test/lib/routes_test.rb +0 -71
- data/test/lib/string_test.rb +0 -55
- data/test/unit/typus_mailer_test.rb +0 -29
- data/test/unit/typus_test.rb +0 -17
- data/test/vendor/active_record_test.rb +0 -18
data/CHANGELOG
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
= 0.9.40 / 2010-04-??
|
|
2
|
+
|
|
3
|
+
[X] Refactor all forms to be able to use formtastic.
|
|
4
|
+
[X] Cleanup translation files.
|
|
5
|
+
[X] Removed FIXME tests.
|
|
6
|
+
[X] Pass attribute as symbol.
|
|
7
|
+
[X] Simplify configuration files.
|
|
8
|
+
[X] Added '/' to admin_edit_typus_user_path because was not linking to
|
|
9
|
+
the right path on the namespaced models.
|
|
10
|
+
[X] Updated generator defaults.
|
|
11
|
+
[X] Write CSV file to disk and then send_file.
|
|
12
|
+
[X] Replaced CSV separator. Now uses ';' instead of ','.
|
|
13
|
+
[X] Do not show selector on habtm if there are more than 500 records.
|
|
14
|
+
[X] Paginate habtm relationships. Was implemented in the has_many.
|
|
15
|
+
[X] Fixed unrelate action. Was not working properly when not using
|
|
16
|
+
Rails default table names.
|
|
17
|
+
[X] Do not humanize fields on the csv generator. We want to keep the
|
|
18
|
+
real field name.
|
|
19
|
+
[X] Recover password functionality now only needs the email to be defined.
|
|
20
|
+
[X] Added json export format.
|
|
21
|
+
[X] Added default route with conditions. (Ben Scofield)
|
|
22
|
+
[X] We should be able to set preferences and store them on the database.
|
|
23
|
+
[X] Fixed stylesheet and search to be able to use `relative_url_root`.
|
|
24
|
+
[X] Cleanup `display_link_to_previous` helper.
|
|
25
|
+
[X] Cleanup `build_typus_list` helper.
|
|
26
|
+
[X] Fix back_to when using `relative_url_root`.
|
|
27
|
+
[X] Remove toggle option. We always enable it so it's a good default.
|
|
28
|
+
[X] When displaying an item with multiple attachments fancybox preview
|
|
29
|
+
was not working properly because there where multiple items with the
|
|
30
|
+
same id.
|
|
31
|
+
[X] Move partial helpers to `app/views/admin/helpers`.
|
|
32
|
+
[X] Do not set ActionMailer::Base.default_url_options[:host] on the
|
|
33
|
+
controller.
|
|
34
|
+
[X] Cleanup `applications` & `resources`.
|
|
35
|
+
[X] Fix problems on routes.rb when using namespaced models.
|
|
36
|
+
[X] Show the right content on the selectors when listing records on tables.
|
|
37
|
+
[X] Update fancybox to the latest version. Fix paths to make it work when
|
|
38
|
+
`relative_url_root` is active. (and make a donation)
|
|
39
|
+
[X] Test _form.html.erb can be overwrited by model.
|
|
40
|
+
[X] Make tests work again.
|
|
41
|
+
[X] Replace "render :partial => 'template', :locals => {}", by
|
|
42
|
+
"render 'template', :local => 'local'".
|
|
43
|
+
[X] Add support for custom typus_user on the generator.
|
|
44
|
+
[X] Shorten sidebar selectors. (AFS)
|
|
45
|
+
[X] Clicking on a filter removes is. (Gaston Kleiman)
|
|
46
|
+
[X] Possibility to filter by date ranges. (Gaston Kleiman)
|
|
47
|
+
[X] Use `inherit_views` code to `inherit_views`.
|
|
48
|
+
[X] Decide what to do with the QuickEdit. (Removed on 20100409)
|
|
49
|
+
[X] Refactored all sessions/account handling.
|
|
50
|
+
[X] Improved usability on password recovery based on how GitHub works.
|
|
51
|
+
[X] Removed footer links and added them to dashboard#sidebar.
|
|
52
|
+
[X] Add defaults options for the fields and do not fallback into list.
|
|
53
|
+
[X] Support for XSS.
|
|
54
|
+
[X] Fix problem on entries with attachment when using to_label.
|
|
55
|
+
[X] "Remove entry" should become "Remove {{resource}}"
|
|
56
|
+
[X] Merge generator methods to create resource/service controllers.
|
|
57
|
+
[X] Remove Typus "blue" color and use something more neutral.
|
|
58
|
+
[X] Split typus generator in two: typus and typus_migration
|
|
59
|
+
[X] Enable mechanism to skip Typus authentication so we can use other engines.
|
|
60
|
+
[X] Make sure TypusUser model is created in the application.
|
|
61
|
+
[X] Review documentation and decide where to publish it.
|
|
62
|
+
[X] Fix sidebar texts.
|
|
63
|
+
[X] Allow users to download the demo hosted at heroku.com
|
|
64
|
+
[ ] Removed javascript from filters. Now there's a form to submit the
|
|
65
|
+
search. This is how Wordpress works.
|
|
66
|
+
[X] Applications without application name defined will appear as
|
|
67
|
+
unknown on the dashboard.
|
|
68
|
+
[X] Search fields now support exact match, beginning of the field and
|
|
69
|
+
full-text match which is the default.
|
|
70
|
+
[X] Do not depend on Rdiscount when rendering content on resources#show.
|
|
71
|
+
|
|
72
|
+
[-] Move html code from helpers to partials.
|
|
73
|
+
[ ] Add `has_many` through relationships.
|
|
74
|
+
[ ] Test default typus forms and remove old tests.
|
|
75
|
+
[ ] Fixed and tested read-only fields.
|
|
76
|
+
[ ] Fixed and tested auto-generated fields.
|
|
77
|
+
[ ] Fixed and tested trees.
|
|
78
|
+
[ ] Fix all fixme tests.
|
|
79
|
+
[ ] Show auto_generated, read_only on string fields. (_string.html.erb)
|
|
80
|
+
[ ] Pass options hash to form fields.
|
|
81
|
+
[ ] Fix css to display correctly "select" fields in relationships.
|
|
82
|
+
[ ] Ajax pagination. (?)
|
|
83
|
+
[ ] Add test for `typus_table_selector`.
|
|
84
|
+
[ ] Forever loop when schema has not been migrated.
|
|
85
|
+
[ ] Pagination doesn't work properly when having multiple paginators on edit page
|
|
86
|
+
[ ] Add support for `has_one` relationships.
|
|
87
|
+
[ ] Remove all crappy rescues.
|
|
88
|
+
[ ] Search in multiple models.
|
|
89
|
+
[ ] Nested models.
|
|
90
|
+
[ ] Contextual content depending on the logged user.
|
|
91
|
+
[ ] Include dashboard#sidebar in the generator so use can easily overwrite it.
|
|
92
|
+
[ ] Verify generator is working properly.
|
|
93
|
+
[ ] Test generator?
|
|
94
|
+
[ ] Added comment on all FIXME tests. Try to fix them first.
|
|
95
|
+
[ ] Remove all raw calls.
|
|
96
|
+
[ ] Refactor typus_form_has_one.
|
|
97
|
+
[ ] Convert plugin to engine.
|
|
98
|
+
[ ] Verify lightbox is working as expected.
|
|
99
|
+
[ ] Fix footer to the bottom.
|
|
100
|
+
[ ] Show sort arrow on hover.
|
|
101
|
+
[ ] Clicking on h1 should open website (root_path) when available.
|
|
102
|
+
[ ] `Typus.applications` should become `Typus.groups`.
|
|
103
|
+
[ ] Decide where to put the search box.
|
|
104
|
+
[ ] Removing an item should redirect to back without the page params.
|
data/Gemfile
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
source 'http://rubygems.org'
|
|
2
|
+
|
|
3
|
+
# gemspec
|
|
4
|
+
|
|
5
|
+
gem "rails", "3.0.0"
|
|
6
|
+
gem "fastercsv", "1.5.3"
|
|
7
|
+
|
|
8
|
+
gem "sqlite3-ruby"
|
|
9
|
+
gem "mysql"
|
|
10
|
+
gem "pg"
|
|
11
|
+
gem "factory_girl"
|
|
12
|
+
gem "acts_as_tree"
|
|
13
|
+
gem "acts_as_list"
|
|
14
|
+
gem "paperclip"
|
|
15
|
+
gem "shoulda"
|
|
16
|
+
gem "mocha"
|
|
17
|
+
gem "redgreen"
|
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
GEM
|
|
2
|
+
remote: http://rubygems.org/
|
|
3
|
+
specs:
|
|
4
|
+
abstract (1.0.0)
|
|
5
|
+
actionmailer (3.0.0)
|
|
6
|
+
actionpack (= 3.0.0)
|
|
7
|
+
mail (~> 2.2.5)
|
|
8
|
+
actionpack (3.0.0)
|
|
9
|
+
activemodel (= 3.0.0)
|
|
10
|
+
activesupport (= 3.0.0)
|
|
11
|
+
builder (~> 2.1.2)
|
|
12
|
+
erubis (~> 2.6.6)
|
|
13
|
+
i18n (~> 0.4.1)
|
|
14
|
+
rack (~> 1.2.1)
|
|
15
|
+
rack-mount (~> 0.6.12)
|
|
16
|
+
rack-test (~> 0.5.4)
|
|
17
|
+
tzinfo (~> 0.3.23)
|
|
18
|
+
activemodel (3.0.0)
|
|
19
|
+
activesupport (= 3.0.0)
|
|
20
|
+
builder (~> 2.1.2)
|
|
21
|
+
i18n (~> 0.4.1)
|
|
22
|
+
activerecord (3.0.0)
|
|
23
|
+
activemodel (= 3.0.0)
|
|
24
|
+
activesupport (= 3.0.0)
|
|
25
|
+
arel (~> 1.0.0)
|
|
26
|
+
tzinfo (~> 0.3.23)
|
|
27
|
+
activeresource (3.0.0)
|
|
28
|
+
activemodel (= 3.0.0)
|
|
29
|
+
activesupport (= 3.0.0)
|
|
30
|
+
activesupport (3.0.0)
|
|
31
|
+
acts_as_list (0.1.2)
|
|
32
|
+
acts_as_tree (0.1.1)
|
|
33
|
+
arel (1.0.1)
|
|
34
|
+
activesupport (~> 3.0.0)
|
|
35
|
+
builder (2.1.2)
|
|
36
|
+
erubis (2.6.6)
|
|
37
|
+
abstract (>= 1.0.0)
|
|
38
|
+
factory_girl (1.3.2)
|
|
39
|
+
fastercsv (1.5.3)
|
|
40
|
+
i18n (0.4.1)
|
|
41
|
+
mail (2.2.5)
|
|
42
|
+
activesupport (>= 2.3.6)
|
|
43
|
+
mime-types
|
|
44
|
+
treetop (>= 1.4.5)
|
|
45
|
+
mime-types (1.16)
|
|
46
|
+
mocha (0.9.8)
|
|
47
|
+
rake
|
|
48
|
+
mysql (2.8.1)
|
|
49
|
+
paperclip (2.3.3)
|
|
50
|
+
activerecord
|
|
51
|
+
activesupport
|
|
52
|
+
pg (0.9.0)
|
|
53
|
+
polyglot (0.3.1)
|
|
54
|
+
rack (1.2.1)
|
|
55
|
+
rack-mount (0.6.13)
|
|
56
|
+
rack (>= 1.0.0)
|
|
57
|
+
rack-test (0.5.4)
|
|
58
|
+
rack (>= 1.0)
|
|
59
|
+
rails (3.0.0)
|
|
60
|
+
actionmailer (= 3.0.0)
|
|
61
|
+
actionpack (= 3.0.0)
|
|
62
|
+
activerecord (= 3.0.0)
|
|
63
|
+
activeresource (= 3.0.0)
|
|
64
|
+
activesupport (= 3.0.0)
|
|
65
|
+
bundler (~> 1.0.0)
|
|
66
|
+
railties (= 3.0.0)
|
|
67
|
+
railties (3.0.0)
|
|
68
|
+
actionpack (= 3.0.0)
|
|
69
|
+
activesupport (= 3.0.0)
|
|
70
|
+
rake (>= 0.8.4)
|
|
71
|
+
thor (~> 0.14.0)
|
|
72
|
+
rake (0.8.7)
|
|
73
|
+
redgreen (1.2.2)
|
|
74
|
+
shoulda (2.11.3)
|
|
75
|
+
sqlite3-ruby (1.3.1)
|
|
76
|
+
thor (0.14.0)
|
|
77
|
+
treetop (1.4.8)
|
|
78
|
+
polyglot (>= 0.3.1)
|
|
79
|
+
tzinfo (0.3.23)
|
|
80
|
+
|
|
81
|
+
PLATFORMS
|
|
82
|
+
ruby
|
|
83
|
+
|
|
84
|
+
DEPENDENCIES
|
|
85
|
+
acts_as_list
|
|
86
|
+
acts_as_tree
|
|
87
|
+
factory_girl
|
|
88
|
+
fastercsv (= 1.5.3)
|
|
89
|
+
mocha
|
|
90
|
+
mysql
|
|
91
|
+
paperclip
|
|
92
|
+
pg
|
|
93
|
+
rails (= 3.0.0)
|
|
94
|
+
redgreen
|
|
95
|
+
shoulda
|
|
96
|
+
sqlite3-ruby
|
data/MIT-LICENSE
CHANGED
data/README.rdoc
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
= Typus: Admin interface for Rails applications
|
|
2
|
+
|
|
3
|
+
Typus is designed for a single activity:
|
|
4
|
+
|
|
5
|
+
Trusted users editing structured content.
|
|
6
|
+
|
|
7
|
+
Typus doesn't try to be all the things to all the people but it's extensible
|
|
8
|
+
enough to match lots of use cases.
|
|
9
|
+
|
|
10
|
+
== Key Features
|
|
11
|
+
|
|
12
|
+
- User Authentication with registration and account activation
|
|
13
|
+
- User Permissions by using Access Control Lists (stored in yaml files)
|
|
14
|
+
- CRUD and custom actions for your models on a clean interface.
|
|
15
|
+
- Internationalized interface.
|
|
16
|
+
- Extensible and overwritable templates.
|
|
17
|
+
- Low memory footprint.
|
|
18
|
+
- Works with Rails 3.0.0 and is Ruby 1.9.2 compatible.
|
|
19
|
+
- Tested with SQLite, MySQL and PostgreSQL.
|
|
20
|
+
- MIT License, the same as Rails.
|
|
21
|
+
|
|
22
|
+
== Links
|
|
23
|
+
|
|
24
|
+
- {Project page and documentation }[http://core.typuscms.com/]
|
|
25
|
+
- {Plugin source code}[http://github.com/fesplugas/typus]
|
|
26
|
+
- {Mailing list}[http://groups.google.com/group/typus]
|
|
27
|
+
- {Gems}[http://rubygems.org/gems/typus]
|
|
28
|
+
- {Contributors}[http://github.com/fesplugas/typus/contributors]
|
|
29
|
+
|
|
30
|
+
== Installing
|
|
31
|
+
|
|
32
|
+
Install from GitHub the latest version which it's compatible with
|
|
33
|
+
<tt>Rails 3.0.0</tt>.
|
|
34
|
+
|
|
35
|
+
$ rails plugin install git://github.com/fesplugas/typus.git
|
|
36
|
+
|
|
37
|
+
Once installed, run the generator to create required files.
|
|
38
|
+
|
|
39
|
+
$ rails generate typus
|
|
40
|
+
|
|
41
|
+
Start the application server and go to {http://0.0.0.0:3000/admin}[http://0.0.0.0:3000/admin].
|
|
42
|
+
|
|
43
|
+
== License
|
|
44
|
+
|
|
45
|
+
Copyright © 2007-2010 Francesc Esplugas, released under the MIT license.
|
data/Rakefile
CHANGED
|
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
|
2
2
|
require 'rake/testtask'
|
|
3
3
|
require 'rake/rdoctask'
|
|
4
4
|
|
|
5
|
-
$LOAD_PATH.unshift 'lib'
|
|
5
|
+
$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
|
|
6
6
|
require 'typus/version'
|
|
7
7
|
|
|
8
8
|
desc 'Default: run unit tests.'
|
|
@@ -11,60 +11,31 @@ task :default => :test
|
|
|
11
11
|
desc 'Test the typus plugin.'
|
|
12
12
|
Rake::TestTask.new(:test) do |t|
|
|
13
13
|
t.libs << 'lib'
|
|
14
|
+
t.libs << 'test'
|
|
14
15
|
t.pattern = 'test/**/*_test.rb'
|
|
15
16
|
t.verbose = true
|
|
16
17
|
end
|
|
17
18
|
|
|
18
|
-
desc 'Generate
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
Dir.glob('test/**/*_test.rb').each do |test|
|
|
26
|
-
test =~ /.*\/([^\/].*)_test.rb$/
|
|
27
|
-
file.puts "#{$1.gsub('_', ' ').capitalize} should:" if $1
|
|
28
|
-
File.read(test).map { |line| /test_(.*)$/.match line }.compact.each do |spec|
|
|
29
|
-
file.puts "- #{spec[1].gsub('_', ' ')}"
|
|
30
|
-
sleep 0.001; print '.'; $stdout.flush; count += 1
|
|
31
|
-
end
|
|
32
|
-
file.puts
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
puts "\nFinished in #{Time.now - timer} seconds.\n"
|
|
37
|
-
puts "#{count} specifications documented"
|
|
38
|
-
|
|
19
|
+
desc 'Generate plugin documentation.'
|
|
20
|
+
Rake::RDocTask.new(:rdoc) do |rdoc|
|
|
21
|
+
rdoc.rdoc_dir = 'rdoc'
|
|
22
|
+
rdoc.title = 'Typus'
|
|
23
|
+
rdoc.options << '--line-numbers' << '--inline-source'
|
|
24
|
+
rdoc.rdoc_files.include('README.rdoc')
|
|
25
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
39
26
|
end
|
|
40
27
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
gemspec.name = "typus"
|
|
45
|
-
gemspec.summary = "Effortless backend interface for Ruby on Rails applications. (Admin scaffold generator.)"
|
|
46
|
-
gemspec.description = "Effortless backend interface for Ruby on Rails applications. (Admin scaffold generator.)"
|
|
47
|
-
gemspec.email = "francesc@intraducibles.com"
|
|
48
|
-
gemspec.homepage = "http://intraducibles.com/projects/typus"
|
|
49
|
-
gemspec.authors = ["Francesc Esplugas"]
|
|
50
|
-
gemspec.version = Typus::Version
|
|
51
|
-
end
|
|
52
|
-
rescue LoadError
|
|
53
|
-
puts "Jeweler not available."
|
|
54
|
-
puts "Install it with: gem install jeweler -s http://gemcutter.org"
|
|
28
|
+
desc 'Build the gem.'
|
|
29
|
+
task :build do
|
|
30
|
+
system "gem build typus.gemspec"
|
|
55
31
|
end
|
|
56
32
|
|
|
57
|
-
desc
|
|
58
|
-
task :
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
system "
|
|
63
|
-
system "git push origin v#{Typus::Version}"
|
|
64
|
-
system "gem push pkg/typus-#{Typus::Version}.gem"
|
|
33
|
+
desc 'Build and release the gem.'
|
|
34
|
+
task :release => :build do
|
|
35
|
+
version = Typus::VERSION
|
|
36
|
+
system "git tag v#{version}"
|
|
37
|
+
system "git push origin v#{version}"
|
|
38
|
+
system "gem push pkg/typus-#{version}.gem"
|
|
65
39
|
system "git clean -fd"
|
|
40
|
+
system "gem push typus-#{version}"
|
|
66
41
|
end
|
|
67
|
-
|
|
68
|
-
task :write_version do
|
|
69
|
-
File.open('VERSION', 'w') {|f| f.write(Typus::Version) }
|
|
70
|
-
end
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
class Admin::AccountController < AdminController
|
|
2
|
+
|
|
3
|
+
layout 'admin/session'
|
|
4
|
+
|
|
5
|
+
skip_before_filter :reload_config_and_roles
|
|
6
|
+
skip_before_filter :set_preferences
|
|
7
|
+
skip_before_filter :authenticate
|
|
8
|
+
|
|
9
|
+
before_filter :sign_in?, :except => [:forgot_password, :show]
|
|
10
|
+
before_filter :new?, :only => [:forgot_password]
|
|
11
|
+
|
|
12
|
+
def new
|
|
13
|
+
flash[:notice] = _("Enter your email below to create the first user.")
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def create
|
|
17
|
+
user = Typus.user_class.generate(:email => params[:typus_user][:email])
|
|
18
|
+
user.status = true
|
|
19
|
+
redirect_to (user.save ? { :action => "show", :id => user.token } : { :action => :new })
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def forgot_password
|
|
23
|
+
return unless request.post?
|
|
24
|
+
|
|
25
|
+
if user = Typus.user_class.find_by_email(params[:typus_user][:email])
|
|
26
|
+
url = admin_account_url(user.token)
|
|
27
|
+
Admin::Mailer.reset_password_link(user, url).deliver
|
|
28
|
+
notice = _("Password recovery link sent to your email.")
|
|
29
|
+
path = new_admin_session_path
|
|
30
|
+
else
|
|
31
|
+
render :action => :forgot_password and return
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
redirect_to path, :notice => notice
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def show
|
|
38
|
+
flash[:notice] = _("Please set a new password.")
|
|
39
|
+
typus_user = Typus.user_class.find_by_token!(params[:id])
|
|
40
|
+
session[:typus_user_id] = typus_user.id
|
|
41
|
+
redirect_to :controller => "admin/#{Typus.user_class.to_resource}", :action => "edit", :id => typus_user.id
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
private
|
|
45
|
+
|
|
46
|
+
def sign_in?
|
|
47
|
+
redirect_to new_admin_session_path unless Typus.user_class.count.zero?
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def new?
|
|
51
|
+
redirect_to new_admin_account_path if Typus.user_class.count.zero?
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
end
|