cardboard_cms 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +42 -0
- data/Gemfile.lock +324 -0
- data/Guardfile +23 -0
- data/LICENSE.txt +677 -0
- data/README.md +370 -0
- data/Rakefile +23 -0
- data/app/assets/images/cardboard/.gitkeep +0 -0
- data/app/assets/images/cardboard/bg.png +0 -0
- data/app/assets/images/cardboard/calendar.png +0 -0
- data/app/assets/images/cardboard/lorem-ipsum-coffe-mug.jpg +0 -0
- data/app/assets/javascripts/cardboard.js +1 -0
- data/app/assets/javascripts/cardboard/admin.js +62 -0
- data/app/assets/javascripts/cardboard/content_sidebar.js +27 -0
- data/app/assets/javascripts/cardboard/datepicker.js +19 -0
- data/app/assets/javascripts/cardboard/main_sidebar.js +32 -0
- data/app/assets/javascripts/cardboard/rich_text.js +81 -0
- data/app/assets/javascripts/cardboard/search_filter.js +28 -0
- data/app/assets/stylesheets/cardboard.css.scss +2 -0
- data/app/assets/stylesheets/cardboard/_bootstrap-select.css.scss +183 -0
- data/app/assets/stylesheets/cardboard/_content.css.scss +35 -0
- data/app/assets/stylesheets/cardboard/_content_sidebar.css.scss +96 -0
- data/app/assets/stylesheets/cardboard/_framework.css.scss +129 -0
- data/app/assets/stylesheets/cardboard/_main_sidebar.css.scss +38 -0
- data/app/assets/stylesheets/cardboard/_main_topbar.css.scss +62 -0
- data/app/assets/stylesheets/cardboard/_resources.css.scss +28 -0
- data/app/assets/stylesheets/cardboard/_rich_text.css.scss +6 -0
- data/app/assets/stylesheets/cardboard/_variables.scss +326 -0
- data/app/assets/stylesheets/cardboard/admin.css.scss +63 -0
- data/app/controllers/cardboard/application_controller.rb +45 -0
- data/app/controllers/cardboard/dashboard_controller.rb +9 -0
- data/app/controllers/cardboard/my_account_controller.rb +27 -0
- data/app/controllers/cardboard/pages_controller.rb +34 -0
- data/app/controllers/cardboard/resource_controller.rb +61 -0
- data/app/controllers/cardboard/settings_controller.rb +28 -0
- data/app/controllers/cardboard/super_user_controller.rb +8 -0
- data/app/controllers/pages_controller.rb +29 -0
- data/app/decorators/controllers/application_controller_decorator.rb +9 -0
- data/app/decorators/lib/cardboard/user_class_decorator.rb +32 -0
- data/app/helpers/cardboard/application_helper.rb +4 -0
- data/app/helpers/cardboard/public_helper.rb +53 -0
- data/app/helpers/cardboard/resource_helper.rb +80 -0
- data/app/inputs/date_picker_input.rb +10 -0
- data/app/inputs/date_time_input.rb +7 -0
- data/app/inputs/image_input.rb +3 -0
- data/app/inputs/rich_text_input.rb +6 -0
- data/app/models/cardboard/field.rb +67 -0
- data/app/models/cardboard/field/boolean.rb +29 -0
- data/app/models/cardboard/field/date.rb +24 -0
- data/app/models/cardboard/field/decimal.rb +25 -0
- data/app/models/cardboard/field/external_link.rb +4 -0
- data/app/models/cardboard/field/file.rb +19 -0
- data/app/models/cardboard/field/image.rb +33 -0
- data/app/models/cardboard/field/integer.rb +26 -0
- data/app/models/cardboard/field/resource_link.rb +4 -0
- data/app/models/cardboard/field/rich_text.rb +21 -0
- data/app/models/cardboard/field/string.rb +16 -0
- data/app/models/cardboard/field/text.rb +15 -0
- data/app/models/cardboard/page.rb +253 -0
- data/app/models/cardboard/page_part.rb +79 -0
- data/app/models/cardboard/setting.rb +46 -0
- data/app/views/cardboard/dashboard/index.html.slim +1 -0
- data/app/views/cardboard/fields/_base_input.html.slim +1 -0
- data/app/views/cardboard/fields/_boolean.html.slim +4 -0
- data/app/views/cardboard/fields/_date.html.slim +1 -0
- data/app/views/cardboard/fields/_external_link.html.slim +2 -0
- data/app/views/cardboard/fields/_file.html.slim +12 -0
- data/app/views/cardboard/fields/_image.html.slim +11 -0
- data/app/views/cardboard/fields/_resource_link.html.slim +2 -0
- data/app/views/cardboard/fields/_rich_text.html.slim +3 -0
- data/app/views/cardboard/fields/_string.html.slim +1 -0
- data/app/views/cardboard/my_account/edit.html.slim +29 -0
- data/app/views/cardboard/pages/_error.html.slim +7 -0
- data/app/views/cardboard/pages/_seo.html.slim +6 -0
- data/app/views/cardboard/pages/_sidebar.html.slim +17 -0
- data/app/views/cardboard/pages/_subpart_fields.html.slim +20 -0
- data/app/views/cardboard/pages/_url_field.html.slim +20 -0
- data/app/views/cardboard/pages/edit.html.slim +43 -0
- data/app/views/cardboard/pages/index.html.slim +2 -0
- data/app/views/cardboard/pages/show.html.slim +9 -0
- data/app/views/cardboard/resources/_advanced_search.html.slim +40 -0
- data/app/views/cardboard/resources/_search_button.html.slim +2 -0
- data/app/views/cardboard/resources/_search_helper.html.slim +17 -0
- data/app/views/cardboard/resources/_simple_search.html.slim +6 -0
- data/app/views/cardboard/rich_editor/_links_modal.html.slim +39 -0
- data/app/views/cardboard/settings/index.html.slim +8 -0
- data/app/views/cardboard/super_user/index.html.slim +10 -0
- data/app/views/layouts/cardboard/_flash_message.html.slim +6 -0
- data/app/views/layouts/cardboard/_head.html.slim +16 -0
- data/app/views/layouts/cardboard/_main_sidebar.html.slim +12 -0
- data/app/views/layouts/cardboard/_main_topbar.html.slim +32 -0
- data/app/views/layouts/cardboard/application.html.slim +28 -0
- data/cardboard.gemspec +57 -0
- data/config/initializers/dragonfly.rb +27 -0
- data/config/initializers/ranker_mapper_finder_bugfix.rb +43 -0
- data/config/initializers/simple_form.rb +142 -0
- data/config/initializers/simple_form_bootstrap.rb +45 -0
- data/config/locales/simple_form.en.yml +26 -0
- data/config/routes.rb +53 -0
- data/doc/apple-touch-icon.png +0 -0
- data/doc/classes/Cardboard.html +190 -0
- data/doc/classes/Cardboard/AdminController.html +134 -0
- data/doc/classes/Cardboard/AdminHelper.html +307 -0
- data/doc/classes/Cardboard/ApplicationController.html +76 -0
- data/doc/classes/Cardboard/ApplicationHelper.html +70 -0
- data/doc/classes/Cardboard/DashboardController.html +131 -0
- data/doc/classes/Cardboard/Field.html +283 -0
- data/doc/classes/Cardboard/Field/Boolean.html +218 -0
- data/doc/classes/Cardboard/Field/Date.html +218 -0
- data/doc/classes/Cardboard/Field/Decimal.html +218 -0
- data/doc/classes/Cardboard/Field/ExternalLink.html +76 -0
- data/doc/classes/Cardboard/Field/File.html +131 -0
- data/doc/classes/Cardboard/Field/Image.html +181 -0
- data/doc/classes/Cardboard/Field/Integer.html +218 -0
- data/doc/classes/Cardboard/Field/ResourceLink.html +76 -0
- data/doc/classes/Cardboard/Field/RichText.html +131 -0
- data/doc/classes/Cardboard/Field/String.html +131 -0
- data/doc/classes/Cardboard/Page.html +1184 -0
- data/doc/classes/Cardboard/PagePart.html +304 -0
- data/doc/classes/Cardboard/PagesController.html +186 -0
- data/doc/classes/Cardboard/PublicHelper.html +252 -0
- data/doc/classes/Cardboard/Setting.html +240 -0
- data/doc/classes/Cardboard/SettingsController.html +184 -0
- data/doc/classes/Cardboard/SuperUserController.html +130 -0
- data/doc/classes/Cardboard/UsersController.html +191 -0
- data/doc/classes/DatePickerInput.html +132 -0
- data/doc/classes/ImageInput.html +76 -0
- data/doc/classes/Object.html +211 -0
- data/doc/classes/PagesController.html +145 -0
- data/doc/classes/RichTextInput.html +132 -0
- data/doc/created.rid +31 -0
- data/doc/css/github.css +129 -0
- data/doc/css/main.css +333 -0
- data/doc/css/panel.css +384 -0
- data/doc/css/reset.css +48 -0
- data/doc/favicon.ico +0 -0
- data/doc/files/app/controllers/cardboard/admin_controller_rb.html +79 -0
- data/doc/files/app/controllers/cardboard/application_controller_rb.html +84 -0
- data/doc/files/app/controllers/cardboard/dashboard_controller_rb.html +84 -0
- data/doc/files/app/controllers/cardboard/pages_controller_rb.html +84 -0
- data/doc/files/app/controllers/cardboard/settings_controller_rb.html +84 -0
- data/doc/files/app/controllers/cardboard/super_user_controller_rb.html +84 -0
- data/doc/files/app/controllers/cardboard/users_controller_rb.html +84 -0
- data/doc/files/app/controllers/pages_controller_rb.html +79 -0
- data/doc/files/app/decorators/controllers/application_controller_decorator_rb.html +68 -0
- data/doc/files/app/decorators/lib/cardboard/user_class_decorator_rb.html +68 -0
- data/doc/files/app/helpers/cardboard/admin_helper_rb.html +84 -0
- data/doc/files/app/helpers/cardboard/application_helper_rb.html +84 -0
- data/doc/files/app/helpers/cardboard/public_helper_rb.html +84 -0
- data/doc/files/app/inputs/date_picker_input_rb.html +79 -0
- data/doc/files/app/inputs/image_input_rb.html +79 -0
- data/doc/files/app/inputs/rich_text_input_rb.html +79 -0
- data/doc/files/app/models/cardboard/field/boolean_rb.html +84 -0
- data/doc/files/app/models/cardboard/field/date_rb.html +84 -0
- data/doc/files/app/models/cardboard/field/decimal_rb.html +84 -0
- data/doc/files/app/models/cardboard/field/external_link_rb.html +84 -0
- data/doc/files/app/models/cardboard/field/file_rb.html +84 -0
- data/doc/files/app/models/cardboard/field/image_rb.html +84 -0
- data/doc/files/app/models/cardboard/field/integer_rb.html +84 -0
- data/doc/files/app/models/cardboard/field/resource_link_rb.html +84 -0
- data/doc/files/app/models/cardboard/field/rich_text_rb.html +84 -0
- data/doc/files/app/models/cardboard/field/string_rb.html +84 -0
- data/doc/files/app/models/cardboard/field_rb.html +84 -0
- data/doc/files/app/models/cardboard/page_part_rb.html +84 -0
- data/doc/files/app/models/cardboard/page_rb.html +84 -0
- data/doc/files/app/models/cardboard/setting_rb.html +84 -0
- data/doc/i/arrows.png +0 -0
- data/doc/i/results_bg.png +0 -0
- data/doc/i/tree_bg.png +0 -0
- data/doc/index.html +13 -0
- data/doc/js/highlight.pack.js +1 -0
- data/doc/js/jquery-1.3.2.min.js +19 -0
- data/doc/js/jquery-effect.js +593 -0
- data/doc/js/main.js +24 -0
- data/doc/js/navigation.js +142 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/searchdoc.js +449 -0
- data/doc/js/searcher.js +228 -0
- data/doc/panel/index.html +73 -0
- data/doc/panel/links.html +66 -0
- data/doc/panel/tree.js +1 -0
- data/lib/cardboard/application.rb +67 -0
- data/lib/cardboard/engine.rb +83 -0
- data/lib/cardboard/helpers/seed.rb +80 -0
- data/lib/cardboard/helpers/settings.rb +58 -0
- data/lib/cardboard/version.rb +3 -0
- data/lib/cardboard_cms.rb +34 -0
- data/lib/generators/cardboard/assets/assets_generator.rb +18 -0
- data/lib/generators/cardboard/install/install_generator.rb +96 -0
- data/lib/generators/cardboard/install/templates/cardboard.rb.erb +53 -0
- data/lib/generators/cardboard/install/templates/cardboard.yml +29 -0
- data/lib/generators/cardboard/install/templates/index.html.erb +0 -0
- data/lib/generators/cardboard/install/templates/migrations/1_create_cardboard_fields.rb +21 -0
- data/lib/generators/cardboard/install/templates/migrations/2_create_cardboard_page_parts.rb +17 -0
- data/lib/generators/cardboard/install/templates/migrations/3_create_cardboard_pages.rb +18 -0
- data/lib/generators/cardboard/install/templates/migrations/4_create_cardboard_settings.rb +14 -0
- data/lib/generators/cardboard/resource/resource_generator.rb +52 -0
- data/lib/generators/cardboard/resource/templates/admin_controller.rb +9 -0
- data/lib/generators/cardboard/resource/templates/slim/_fields.html.slim +5 -0
- data/lib/generators/cardboard/resource/templates/slim/edit.html.slim +4 -0
- data/lib/generators/cardboard/resource/templates/slim/index.html.slim +18 -0
- data/lib/generators/cardboard/resource/templates/slim/new.html.slim +4 -0
- data/lib/tasks/cardboard_tasks.rake +22 -0
- data/lib/templates/erb/scaffold/_form.html.erb +13 -0
- data/script/rails +8 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/images/defaults/CrashTest.jpg +0 -0
- data/test/dummy/app/assets/javascripts/admins.js +2 -0
- data/test/dummy/app/assets/javascripts/application.js +5 -0
- data/test/dummy/app/assets/javascripts/beans.js +2 -0
- data/test/dummy/app/assets/javascripts/cardboard.js +1 -0
- data/test/dummy/app/assets/javascripts/icescreams.js +2 -0
- data/test/dummy/app/assets/javascripts/main.js +2 -0
- data/test/dummy/app/assets/javascripts/news_posts.js +2 -0
- data/test/dummy/app/assets/javascripts/pianos.js +2 -0
- data/test/dummy/app/assets/stylesheets/admins.css.scss +3 -0
- data/test/dummy/app/assets/stylesheets/application.css.scss +9 -0
- data/test/dummy/app/assets/stylesheets/beans.css.scss +3 -0
- data/test/dummy/app/assets/stylesheets/cardboard.css.scss +5 -0
- data/test/dummy/app/assets/stylesheets/icescreams.css.scss +3 -0
- data/test/dummy/app/assets/stylesheets/main.css +4 -0
- data/test/dummy/app/assets/stylesheets/news_posts.css.scss +3 -0
- data/test/dummy/app/assets/stylesheets/pianos.css.scss +3 -0
- data/test/dummy/app/assets/stylesheets/scaffolds.css.scss +69 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/controllers/cardboard/pianos_controller.rb +6 -0
- data/test/dummy/app/controllers/pianos_controller.rb +83 -0
- data/test/dummy/app/helpers/application_helper.rb +9 -0
- data/test/dummy/app/helpers/cardboard/pianos_helper.rb +7 -0
- data/test/dummy/app/mailers/.gitkeep +0 -0
- data/test/dummy/app/models/.gitkeep +0 -0
- data/test/dummy/app/models/admin_user.rb +28 -0
- data/test/dummy/app/models/piano.rb +3 -0
- data/test/dummy/app/views/cardboard/pianos/_fields.html.slim +5 -0
- data/test/dummy/app/views/cardboard/pianos/edit.html.slim +6 -0
- data/test/dummy/app/views/cardboard/pianos/index.html.slim +18 -0
- data/test/dummy/app/views/cardboard/pianos/new.html.slim +6 -0
- data/test/dummy/app/views/cardboard/pianos/show.html.slim +11 -0
- data/test/dummy/app/views/layouts/application.html.slim +24 -0
- data/test/dummy/app/views/main/index.html.slim +1 -0
- data/test/dummy/app/views/pages/about-us.html.slim +1 -0
- data/test/dummy/app/views/pages/home.html.slim +3 -0
- data/test/dummy/app/views/pianos/_form.html.erb +25 -0
- data/test/dummy/app/views/pianos/edit.html.erb +6 -0
- data/test/dummy/app/views/pianos/index.html.erb +25 -0
- data/test/dummy/app/views/pianos/new.html.erb +5 -0
- data/test/dummy/app/views/pianos/show.html.erb +15 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +50 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/cardboard.yml +126 -0
- data/test/dummy/config/database.yml +17 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +24 -0
- data/test/dummy/config/environments/production.rb +70 -0
- data/test/dummy/config/environments/test.rb +33 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/cardboard.rb +53 -0
- data/test/dummy/config/initializers/devise.rb +240 -0
- data/test/dummy/config/initializers/inflections.rb +15 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +8 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/devise.en.yml +59 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +16 -0
- data/test/dummy/db/migrate/20130403142235_create_pianos.rb +10 -0
- data/test/dummy/db/migrate/20130417134832_add_devise_to_admin_users.rb +53 -0
- data/test/dummy/db/migrate/20130426021522_create_news_posts.rb +10 -0
- data/test/dummy/db/migrate/20130501195423_create_icescreams.rb +10 -0
- data/test/dummy/db/migrate/20130502165540_create_beans.rb +12 -0
- data/test/dummy/db/migrate/20130522151358_create_cardboard_fields.rb +21 -0
- data/test/dummy/db/migrate/20130522151359_create_cardboard_page_parts.rb +17 -0
- data/test/dummy/db/migrate/20130522151400_create_cardboard_pages.rb +18 -0
- data/test/dummy/db/migrate/20130522151401_create_cardboard_settings.rb +14 -0
- data/test/dummy/db/migrate/20130607132558_create_admins.rb +9 -0
- data/test/dummy/db/schema.rb +129 -0
- data/test/dummy/db/seeds.rb +2 -0
- data/test/dummy/lib/assets/.gitkeep +0 -0
- data/test/dummy/log/.gitkeep +0 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/16/10_39_10_816_404_no_file.png +0 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/16/10_39_10_816_404_no_file.png.meta +2 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/16/10_39_17_87_404_no_file.png +0 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/16/10_39_17_87_404_no_file.png.meta +2 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/16/10_39_34_680_404_no_file.png +0 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/16/10_39_34_680_404_no_file.png.meta +2 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/16/10_44_00_698_404_no_file.png +0 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/16/10_44_00_698_404_no_file.png.meta +2 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/16/10_46_49_55_6152message_in_a_bottle.jpeg +0 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/16/10_46_49_55_6152message_in_a_bottle.jpeg.meta +2 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/16/14_10_30_773_404_no_file.png +0 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/16/14_10_30_773_404_no_file.png.meta +2 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/16/14_10_38_856_airport_shuttles_20130207_1647.csv +8 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/16/14_10_38_856_airport_shuttles_20130207_1647.csv.meta +2 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/16/14_12_12_144_1361696555_GMail_Android_R.png +0 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/16/14_12_12_144_1361696555_GMail_Android_R.png.meta +2 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/16/14_16_40_989_404_no_file.png +0 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/16/14_16_40_989_404_no_file.png.meta +2 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/16/14_19_19_40_6152message_in_a_bottle.jpeg +0 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/16/14_19_19_40_6152message_in_a_bottle.jpeg.meta +2 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/16/14_21_21_825_6152message_in_a_bottle.jpeg +0 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/16/14_21_21_825_6152message_in_a_bottle.jpeg.meta +2 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/16/15_46_33_341_bio.jpg +0 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/16/15_46_33_341_bio.jpg.meta +2 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/16/15_52_55_892_404_no_file.png +0 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/16/15_52_55_892_404_no_file.png.meta +2 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/16/15_52_56_30_404_no_file.png +0 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/16/15_52_56_30_404_no_file.png.meta +2 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/17/15_24_04_585_Sky_3920445.jpg +0 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/17/15_24_04_585_Sky_3920445.jpg.meta +2 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/17/15_25_41_111_Sky_3920445.jpg +0 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/17/15_25_41_111_Sky_3920445.jpg.meta +2 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/17/15_27_16_937_Sky_3920445.jpg +0 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/17/15_27_16_937_Sky_3920445.jpg.meta +2 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/17/15_27_57_585_Sky_3920445.jpg +0 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/17/15_27_57_585_Sky_3920445.jpg.meta +2 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/17/15_28_24_991_Sky_3920445.jpg +0 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/17/15_28_24_991_Sky_3920445.jpg.meta +2 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/17/15_33_30_610_Sky_3920445.jpg +0 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/17/15_33_30_610_Sky_3920445.jpg.meta +2 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/17/15_35_18_437_Sky_3920445.jpg +0 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/17/15_35_18_437_Sky_3920445.jpg.meta +2 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/17/16_45_07_162_Vehicle_Types.jpg +0 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/17/16_45_07_162_Vehicle_Types.jpg.meta +2 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/18/22_27_35_733_hall.jpg +0 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/18/22_27_35_733_hall.jpg.meta +2 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/18/22_29_15_808_fluidicon.png +0 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/18/22_29_15_808_fluidicon.png.meta +2 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/18/22_29_15_989_fluidicon.png +0 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/18/22_29_15_989_fluidicon.png.meta +2 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/19/09_54_44_881_hall3.jpg +0 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/19/09_54_44_881_hall3.jpg.meta +2 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/19/09_54_45_450_hall3.jpg +0 -0
- data/test/dummy/public/system/dragonfly/development/2013/04/19/09_54_45_450_hall3.jpg.meta +2 -0
- data/test/dummy/script/rails +6 -0
- data/test/dummy/test/fixtures/admins.yml +7 -0
- data/test/dummy/test/functional/admins_controller_test.rb +49 -0
- data/test/dummy/test/unit/admin_test.rb +7 -0
- data/test/dummy/test/unit/helpers/admins_helper_test.rb +4 -0
- data/test/factories.rb +47 -0
- data/test/integration/page_editing_test.rb +77 -0
- data/test/integration/seeding_test.rb +96 -0
- data/test/models/field_test.rb +102 -0
- data/test/models/page_test.rb +105 -0
- data/test/test_helper.rb +40 -0
- data/vendor/assets/javascripts/cardboard/bootstrap-select.js +590 -0
- data/vendor/assets/javascripts/cardboard/jquery.livesearch.js +48 -0
- data/vendor/assets/javascripts/cardboard/jquery.pjax.js +822 -0
- data/vendor/assets/javascripts/cardboard/jquery.wysihtml5_size_matters.js.coffee +44 -0
- data/vendor/assets/javascripts/cardboard/jquery.wysihtml5imgresizer.js +320 -0
- data/vendor/assets/javascripts/cardboard/wysihtml5-0.4.0pre.js +9579 -0
- metadata +1011 -0
data/doc/js/searcher.js
ADDED
@@ -0,0 +1,228 @@
|
|
1
|
+
Searcher = function(data) {
|
2
|
+
this.data = data;
|
3
|
+
this.handlers = [];
|
4
|
+
}
|
5
|
+
|
6
|
+
Searcher.prototype = new function() {
|
7
|
+
// search is performed in chunks of 1000 for non-blocking user input
|
8
|
+
var CHUNK_SIZE = 1000;
|
9
|
+
// do not try to find more than 100 results
|
10
|
+
var MAX_RESULTS = 100;
|
11
|
+
var huid = 1;
|
12
|
+
var suid = 1;
|
13
|
+
var runs = 0;
|
14
|
+
|
15
|
+
this.find = function(query) {
|
16
|
+
var queries = splitQuery(query);
|
17
|
+
var regexps = buildRegexps(queries);
|
18
|
+
var highlighters = buildHilighters(queries);
|
19
|
+
var state = { from: 0, pass: 0, limit: MAX_RESULTS, n: suid++};
|
20
|
+
var _this = this;
|
21
|
+
|
22
|
+
this.currentSuid = state.n;
|
23
|
+
|
24
|
+
if (!query) return;
|
25
|
+
|
26
|
+
var run = function() {
|
27
|
+
// stop current search thread if new search started
|
28
|
+
if (state.n != _this.currentSuid) return;
|
29
|
+
|
30
|
+
var results =
|
31
|
+
performSearch(_this.data, regexps, queries, highlighters, state);
|
32
|
+
var hasMore = (state.limit > 0 && state.pass < 4);
|
33
|
+
|
34
|
+
triggerResults.call(_this, results, !hasMore);
|
35
|
+
if (hasMore) {
|
36
|
+
setTimeout(run, 2);
|
37
|
+
}
|
38
|
+
runs++;
|
39
|
+
};
|
40
|
+
runs = 0;
|
41
|
+
|
42
|
+
// start search thread
|
43
|
+
run();
|
44
|
+
}
|
45
|
+
|
46
|
+
/* ----- Events ------ */
|
47
|
+
this.ready = function(fn) {
|
48
|
+
fn.huid = huid;
|
49
|
+
this.handlers.push(fn);
|
50
|
+
}
|
51
|
+
|
52
|
+
/* ----- Utilities ------ */
|
53
|
+
function splitQuery(query) {
|
54
|
+
return jQuery.grep(query.split(/(\s+|::?|\(\)?)/), function(string) {
|
55
|
+
return string.match(/\S/)
|
56
|
+
});
|
57
|
+
}
|
58
|
+
|
59
|
+
function buildRegexps(queries) {
|
60
|
+
return jQuery.map(queries, function(query) {
|
61
|
+
return new RegExp(query.replace(/(.)/g, '([$1])([^$1]*?)'), 'i')
|
62
|
+
});
|
63
|
+
}
|
64
|
+
|
65
|
+
function buildHilighters(queries) {
|
66
|
+
return jQuery.map(queries, function(query) {
|
67
|
+
return jQuery.map(query.split(''), function(l, i) {
|
68
|
+
return '\u0001$' + (i*2+1) + '\u0002$' + (i*2+2);
|
69
|
+
}).join('');
|
70
|
+
});
|
71
|
+
}
|
72
|
+
|
73
|
+
// function longMatchRegexp(index, longIndex, regexps) {
|
74
|
+
// for (var i = regexps.length - 1; i >= 0; i--){
|
75
|
+
// if (!index.match(regexps[i]) && !longIndex.match(regexps[i])) return false;
|
76
|
+
// };
|
77
|
+
// return true;
|
78
|
+
// }
|
79
|
+
|
80
|
+
|
81
|
+
/* ----- Mathchers ------ */
|
82
|
+
|
83
|
+
/*
|
84
|
+
* This record matches if the index starts with queries[0] and the record
|
85
|
+
* matches all of the regexps
|
86
|
+
*/
|
87
|
+
function matchPassBeginning(index, longIndex, queries, regexps) {
|
88
|
+
if (index.indexOf(queries[0]) != 0) return false;
|
89
|
+
for (var i=1, l = regexps.length; i < l; i++) {
|
90
|
+
if (!index.match(regexps[i]) && !longIndex.match(regexps[i]))
|
91
|
+
return false;
|
92
|
+
};
|
93
|
+
return true;
|
94
|
+
}
|
95
|
+
|
96
|
+
/*
|
97
|
+
* This record matches if the longIndex starts with queries[0] and the
|
98
|
+
* longIndex matches all of the regexps
|
99
|
+
*/
|
100
|
+
function matchPassLongIndex(index, longIndex, queries, regexps) {
|
101
|
+
if (longIndex.indexOf(queries[0]) != 0) return false;
|
102
|
+
for (var i=1, l = regexps.length; i < l; i++) {
|
103
|
+
if (!longIndex.match(regexps[i]))
|
104
|
+
return false;
|
105
|
+
};
|
106
|
+
return true;
|
107
|
+
}
|
108
|
+
|
109
|
+
/*
|
110
|
+
* This record matches if the index contains queries[0] and the record
|
111
|
+
* matches all of the regexps
|
112
|
+
*/
|
113
|
+
function matchPassContains(index, longIndex, queries, regexps) {
|
114
|
+
if (index.indexOf(queries[0]) == -1) return false;
|
115
|
+
for (var i=1, l = regexps.length; i < l; i++) {
|
116
|
+
if (!index.match(regexps[i]) && !longIndex.match(regexps[i]))
|
117
|
+
return false;
|
118
|
+
};
|
119
|
+
return true;
|
120
|
+
}
|
121
|
+
|
122
|
+
/*
|
123
|
+
* This record matches if regexps[0] matches the index and the record
|
124
|
+
* matches all of the regexps
|
125
|
+
*/
|
126
|
+
function matchPassRegexp(index, longIndex, queries, regexps) {
|
127
|
+
if (!index.match(regexps[0])) return false;
|
128
|
+
for (var i=1, l = regexps.length; i < l; i++) {
|
129
|
+
if (!index.match(regexps[i]) && !longIndex.match(regexps[i]))
|
130
|
+
return false;
|
131
|
+
};
|
132
|
+
return true;
|
133
|
+
}
|
134
|
+
|
135
|
+
|
136
|
+
/* ----- Highlighters ------ */
|
137
|
+
function highlightRegexp(info, queries, regexps, highlighters) {
|
138
|
+
var result = createResult(info);
|
139
|
+
for (var i=0, l = regexps.length; i < l; i++) {
|
140
|
+
result.title = result.title.replace(regexps[i], highlighters[i]);
|
141
|
+
result.namespace = result.namespace.replace(regexps[i], highlighters[i]);
|
142
|
+
};
|
143
|
+
return result;
|
144
|
+
}
|
145
|
+
|
146
|
+
function hltSubstring(string, pos, length) {
|
147
|
+
return string.substring(0, pos) + '\u0001' + string.substring(pos, pos + length) + '\u0002' + string.substring(pos + length);
|
148
|
+
}
|
149
|
+
|
150
|
+
function highlightQuery(info, queries, regexps, highlighters) {
|
151
|
+
var result = createResult(info);
|
152
|
+
var pos = 0;
|
153
|
+
var lcTitle = result.title.toLowerCase();
|
154
|
+
|
155
|
+
pos = lcTitle.indexOf(queries[0]);
|
156
|
+
if (pos != -1) {
|
157
|
+
result.title = hltSubstring(result.title, pos, queries[0].length);
|
158
|
+
}
|
159
|
+
|
160
|
+
result.namespace = result.namespace.replace(regexps[0], highlighters[0]);
|
161
|
+
for (var i=1, l = regexps.length; i < l; i++) {
|
162
|
+
result.title = result.title.replace(regexps[i], highlighters[i]);
|
163
|
+
result.namespace = result.namespace.replace(regexps[i], highlighters[i]);
|
164
|
+
};
|
165
|
+
return result;
|
166
|
+
}
|
167
|
+
|
168
|
+
function createResult(info) {
|
169
|
+
var result = {};
|
170
|
+
result.title = info[0];
|
171
|
+
result.namespace = info[1];
|
172
|
+
result.path = info[2];
|
173
|
+
result.params = info[3];
|
174
|
+
result.snippet = info[4];
|
175
|
+
return result;
|
176
|
+
}
|
177
|
+
|
178
|
+
/* ----- Searching ------ */
|
179
|
+
function performSearch(data, regexps, queries, highlighters, state) {
|
180
|
+
var searchIndex = data.searchIndex;
|
181
|
+
var longSearchIndex = data.longSearchIndex;
|
182
|
+
var info = data.info;
|
183
|
+
var result = [];
|
184
|
+
var i = state.from;
|
185
|
+
var l = searchIndex.length;
|
186
|
+
var togo = CHUNK_SIZE;
|
187
|
+
var matchFunc, hltFunc;
|
188
|
+
|
189
|
+
while (state.pass < 4 && state.limit > 0 && togo > 0) {
|
190
|
+
if (state.pass == 0) {
|
191
|
+
matchFunc = matchPassBeginning;
|
192
|
+
hltFunc = highlightQuery;
|
193
|
+
} else if (state.pass == 1) {
|
194
|
+
matchFunc = matchPassLongIndex;
|
195
|
+
hltFunc = highlightQuery;
|
196
|
+
} else if (state.pass == 2) {
|
197
|
+
matchFunc = matchPassContains;
|
198
|
+
hltFunc = highlightQuery;
|
199
|
+
} else if (state.pass == 3) {
|
200
|
+
matchFunc = matchPassRegexp;
|
201
|
+
hltFunc = highlightRegexp;
|
202
|
+
}
|
203
|
+
|
204
|
+
for (; togo > 0 && i < l && state.limit > 0; i++, togo--) {
|
205
|
+
if (info[i].n == state.n) continue;
|
206
|
+
if (matchFunc(searchIndex[i], longSearchIndex[i], queries, regexps)) {
|
207
|
+
info[i].n = state.n;
|
208
|
+
result.push(hltFunc(info[i], queries, regexps, highlighters));
|
209
|
+
state.limit--;
|
210
|
+
}
|
211
|
+
};
|
212
|
+
if (searchIndex.length <= i) {
|
213
|
+
state.pass++;
|
214
|
+
i = state.from = 0;
|
215
|
+
} else {
|
216
|
+
state.from = i;
|
217
|
+
}
|
218
|
+
}
|
219
|
+
return result;
|
220
|
+
}
|
221
|
+
|
222
|
+
function triggerResults(results, isLast) {
|
223
|
+
jQuery.each(this.handlers, function(i, fn) {
|
224
|
+
fn.call(this, results, isLast)
|
225
|
+
})
|
226
|
+
}
|
227
|
+
}
|
228
|
+
|
@@ -0,0 +1,73 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
4
|
+
|
5
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
6
|
+
<head>
|
7
|
+
<title>search index</title>
|
8
|
+
<link rel="stylesheet" href="../css/reset.css" type="text/css" media="screen" charset="utf-8" />
|
9
|
+
<link rel="stylesheet" href="../css/panel.css" type="text/css" media="screen" charset="utf-8" />
|
10
|
+
<script src="../js/search_index.js" type="text/javascript" charset="utf-8"></script>
|
11
|
+
<script src="../js/searcher.js" type="text/javascript" charset="utf-8"></script>
|
12
|
+
<script src="tree.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
<script src="../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
|
14
|
+
<script src="../js/searchdoc.js" type="text/javascript" charset="utf-8"></script>
|
15
|
+
<script type="text/javascript" charset="utf-8">
|
16
|
+
function placeholder() {
|
17
|
+
if ($('<input type="text">')[0].placeholder !== undefined) return;
|
18
|
+
|
19
|
+
$('#search-label').click(function() {
|
20
|
+
$('#search').focus();
|
21
|
+
$('#search-label').hide();
|
22
|
+
});
|
23
|
+
|
24
|
+
$('#search').focus(function() {
|
25
|
+
$('#search-label').hide();
|
26
|
+
});
|
27
|
+
$('#search').blur(function() {
|
28
|
+
this.value == '' && $('#search-label').show()
|
29
|
+
});
|
30
|
+
|
31
|
+
$('#search')[0].value == '' && $('#search-label').show();
|
32
|
+
}
|
33
|
+
$(function() {
|
34
|
+
placeholder();
|
35
|
+
$('#links').hide();
|
36
|
+
var panel = new Searchdoc.Panel($('#panel'), search_data, tree, window.parent.frames[1]);
|
37
|
+
$('#search').focus();
|
38
|
+
|
39
|
+
var s = window.parent.location.search.match(/\?q=([^&]+)/);
|
40
|
+
if (s) {
|
41
|
+
s = decodeURIComponent(s[1]).replace(/\+/g, ' ');
|
42
|
+
if (s.length > 0)
|
43
|
+
{
|
44
|
+
$('#search').val(s);
|
45
|
+
panel.search(s, true);
|
46
|
+
}
|
47
|
+
}
|
48
|
+
})
|
49
|
+
</script>
|
50
|
+
</head>
|
51
|
+
<body>
|
52
|
+
<div class="panel panel_tree" id="panel">
|
53
|
+
<div class="header">
|
54
|
+
<div>
|
55
|
+
<label for="search" id="search-label" style="display: none">Search</label>
|
56
|
+
<table>
|
57
|
+
<tr><td>
|
58
|
+
<input type="Search" placeholder="Search" autosave="searchdoc" results="10" id="search" autocomplete="off"/>
|
59
|
+
</td></tr>
|
60
|
+
</table></div>
|
61
|
+
</div>
|
62
|
+
<div class="tree">
|
63
|
+
<ul>
|
64
|
+
</ul>
|
65
|
+
</div>
|
66
|
+
<div class="result">
|
67
|
+
<ul>
|
68
|
+
</ul>
|
69
|
+
</div>
|
70
|
+
</div>
|
71
|
+
<a href="links.html" id="links">index</a>
|
72
|
+
</body>
|
73
|
+
</html>
|
@@ -0,0 +1,66 @@
|
|
1
|
+
<html>
|
2
|
+
<head>File index</head>
|
3
|
+
<body>
|
4
|
+
|
5
|
+
<a href="../files/app/controllers/cardboard/admin_controller_rb.html">app/controllers/cardboard/admin_controller.rb</a>
|
6
|
+
|
7
|
+
<a href="../files/app/controllers/cardboard/application_controller_rb.html">app/controllers/cardboard/application_controller.rb</a>
|
8
|
+
|
9
|
+
<a href="../files/app/controllers/cardboard/dashboard_controller_rb.html">app/controllers/cardboard/dashboard_controller.rb</a>
|
10
|
+
|
11
|
+
<a href="../files/app/controllers/cardboard/pages_controller_rb.html">app/controllers/cardboard/pages_controller.rb</a>
|
12
|
+
|
13
|
+
<a href="../files/app/controllers/cardboard/settings_controller_rb.html">app/controllers/cardboard/settings_controller.rb</a>
|
14
|
+
|
15
|
+
<a href="../files/app/controllers/cardboard/super_user_controller_rb.html">app/controllers/cardboard/super_user_controller.rb</a>
|
16
|
+
|
17
|
+
<a href="../files/app/controllers/cardboard/users_controller_rb.html">app/controllers/cardboard/users_controller.rb</a>
|
18
|
+
|
19
|
+
<a href="../files/app/controllers/pages_controller_rb.html">app/controllers/pages_controller.rb</a>
|
20
|
+
|
21
|
+
<a href="../files/app/decorators/controllers/application_controller_decorator_rb.html">app/decorators/controllers/application_controller_decorator.rb</a>
|
22
|
+
|
23
|
+
<a href="../files/app/decorators/lib/cardboard/user_class_decorator_rb.html">app/decorators/lib/cardboard/user_class_decorator.rb</a>
|
24
|
+
|
25
|
+
<a href="../files/app/helpers/cardboard/admin_helper_rb.html">app/helpers/cardboard/admin_helper.rb</a>
|
26
|
+
|
27
|
+
<a href="../files/app/helpers/cardboard/application_helper_rb.html">app/helpers/cardboard/application_helper.rb</a>
|
28
|
+
|
29
|
+
<a href="../files/app/helpers/cardboard/public_helper_rb.html">app/helpers/cardboard/public_helper.rb</a>
|
30
|
+
|
31
|
+
<a href="../files/app/inputs/date_picker_input_rb.html">app/inputs/date_picker_input.rb</a>
|
32
|
+
|
33
|
+
<a href="../files/app/inputs/image_input_rb.html">app/inputs/image_input.rb</a>
|
34
|
+
|
35
|
+
<a href="../files/app/inputs/rich_text_input_rb.html">app/inputs/rich_text_input.rb</a>
|
36
|
+
|
37
|
+
<a href="../files/app/models/cardboard/field_rb.html">app/models/cardboard/field.rb</a>
|
38
|
+
|
39
|
+
<a href="../files/app/models/cardboard/field/boolean_rb.html">app/models/cardboard/field/boolean.rb</a>
|
40
|
+
|
41
|
+
<a href="../files/app/models/cardboard/field/date_rb.html">app/models/cardboard/field/date.rb</a>
|
42
|
+
|
43
|
+
<a href="../files/app/models/cardboard/field/decimal_rb.html">app/models/cardboard/field/decimal.rb</a>
|
44
|
+
|
45
|
+
<a href="../files/app/models/cardboard/field/external_link_rb.html">app/models/cardboard/field/external_link.rb</a>
|
46
|
+
|
47
|
+
<a href="../files/app/models/cardboard/field/file_rb.html">app/models/cardboard/field/file.rb</a>
|
48
|
+
|
49
|
+
<a href="../files/app/models/cardboard/field/image_rb.html">app/models/cardboard/field/image.rb</a>
|
50
|
+
|
51
|
+
<a href="../files/app/models/cardboard/field/integer_rb.html">app/models/cardboard/field/integer.rb</a>
|
52
|
+
|
53
|
+
<a href="../files/app/models/cardboard/field/resource_link_rb.html">app/models/cardboard/field/resource_link.rb</a>
|
54
|
+
|
55
|
+
<a href="../files/app/models/cardboard/field/rich_text_rb.html">app/models/cardboard/field/rich_text.rb</a>
|
56
|
+
|
57
|
+
<a href="../files/app/models/cardboard/field/string_rb.html">app/models/cardboard/field/string.rb</a>
|
58
|
+
|
59
|
+
<a href="../files/app/models/cardboard/page_rb.html">app/models/cardboard/page.rb</a>
|
60
|
+
|
61
|
+
<a href="../files/app/models/cardboard/page_part_rb.html">app/models/cardboard/page_part.rb</a>
|
62
|
+
|
63
|
+
<a href="../files/app/models/cardboard/setting_rb.html">app/models/cardboard/setting.rb</a>
|
64
|
+
|
65
|
+
</body>
|
66
|
+
</html>
|
data/doc/panel/tree.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
var tree = [["","","files",[["","","app",[["","","controllers",[["","","cardboard",[["admin_controller.rb","files/app/controllers/cardboard/admin_controller_rb.html","",[]],["application_controller.rb","files/app/controllers/cardboard/application_controller_rb.html","",[]],["dashboard_controller.rb","files/app/controllers/cardboard/dashboard_controller_rb.html","",[]],["pages_controller.rb","files/app/controllers/cardboard/pages_controller_rb.html","",[]],["settings_controller.rb","files/app/controllers/cardboard/settings_controller_rb.html","",[]],["super_user_controller.rb","files/app/controllers/cardboard/super_user_controller_rb.html","",[]],["users_controller.rb","files/app/controllers/cardboard/users_controller_rb.html","",[]]]],["pages_controller.rb","files/app/controllers/pages_controller_rb.html","",[]]]],["","","decorators",[["","","controllers",[["application_controller_decorator.rb","files/app/decorators/controllers/application_controller_decorator_rb.html","",[]]]],["","","lib",[["","","cardboard",[["user_class_decorator.rb","files/app/decorators/lib/cardboard/user_class_decorator_rb.html","",[]]]]]]]],["","","helpers",[["","","cardboard",[["admin_helper.rb","files/app/helpers/cardboard/admin_helper_rb.html","",[]],["application_helper.rb","files/app/helpers/cardboard/application_helper_rb.html","",[]],["public_helper.rb","files/app/helpers/cardboard/public_helper_rb.html","",[]]]]]],["","","inputs",[["date_picker_input.rb","files/app/inputs/date_picker_input_rb.html","",[]],["image_input.rb","files/app/inputs/image_input_rb.html","",[]],["rich_text_input.rb","files/app/inputs/rich_text_input_rb.html","",[]]]],["","","models",[["","","cardboard",[["","","field",[["boolean.rb","files/app/models/cardboard/field/boolean_rb.html","",[]],["date.rb","files/app/models/cardboard/field/date_rb.html","",[]],["decimal.rb","files/app/models/cardboard/field/decimal_rb.html","",[]],["external_link.rb","files/app/models/cardboard/field/external_link_rb.html","",[]],["file.rb","files/app/models/cardboard/field/file_rb.html","",[]],["image.rb","files/app/models/cardboard/field/image_rb.html","",[]],["integer.rb","files/app/models/cardboard/field/integer_rb.html","",[]],["resource_link.rb","files/app/models/cardboard/field/resource_link_rb.html","",[]],["rich_text.rb","files/app/models/cardboard/field/rich_text_rb.html","",[]],["string.rb","files/app/models/cardboard/field/string_rb.html","",[]]]],["field.rb","files/app/models/cardboard/field_rb.html","",[]],["page.rb","files/app/models/cardboard/page_rb.html","",[]],["page_part.rb","files/app/models/cardboard/page_part_rb.html","",[]],["setting.rb","files/app/models/cardboard/setting_rb.html","",[]]]]]]]]]],["Cardboard","classes/Cardboard.html","",[["AdminController","classes/Cardboard/AdminController.html"," < Cardboard::ApplicationController",[]],["AdminHelper","classes/Cardboard/AdminHelper.html","",[]],["ApplicationController","classes/Cardboard/ApplicationController.html"," < ActionController::Base",[]],["ApplicationHelper","classes/Cardboard/ApplicationHelper.html","",[]],["DashboardController","classes/Cardboard/DashboardController.html"," < Cardboard::ApplicationController",[]],["Field","classes/Cardboard/Field.html"," < ActiveRecord::Base",[["Date","classes/Cardboard/Field/Date.html"," < Cardboard::Field",[]],["Decimal","classes/Cardboard/Field/Decimal.html"," < Cardboard::Field",[]],["ExternalLink","classes/Cardboard/Field/ExternalLink.html"," < Cardboard::Field",[]],["File","classes/Cardboard/Field/File.html"," < Cardboard::Field",[]],["Image","classes/Cardboard/Field/Image.html"," < Cardboard::Field",[]],["Integer","classes/Cardboard/Field/Integer.html"," < Cardboard::Field",[]],["ResourceLink","classes/Cardboard/Field/ResourceLink.html"," < Cardboard::Field",[]],["RichText","classes/Cardboard/Field/RichText.html"," < Cardboard::Field",[]],["String","classes/Cardboard/Field/String.html"," < Cardboard::Field",[]]]],["Page","classes/Cardboard/Page.html"," < ActiveRecord::Base",[]],["PagePart","classes/Cardboard/PagePart.html"," < ActiveRecord::Base",[]],["PagesController","classes/Cardboard/PagesController.html"," < Cardboard::ApplicationController",[]],["PublicHelper","classes/Cardboard/PublicHelper.html","",[]],["Setting","classes/Cardboard/Setting.html"," < ActiveRecord::Base",[]],["SettingsController","classes/Cardboard/SettingsController.html"," < Cardboard::ApplicationController",[]],["SuperUserController","classes/Cardboard/SuperUserController.html"," < Cardboard::ApplicationController",[]],["UsersController","classes/Cardboard/UsersController.html"," < Cardboard::ApplicationController",[]]]],["DatePickerInput","classes/DatePickerInput.html"," < SimpleForm::Inputs::StringInput",[]],["ImageInput","classes/ImageInput.html"," < SimpleForm::Inputs::FileInput",[]],["Object","classes/Object.html"," < BasicObject",[]],["PagesController","classes/PagesController.html"," < ApplicationController",[]],["RichTextInput","classes/RichTextInput.html"," < SimpleForm::Inputs::TextInput",[]]]
|
@@ -0,0 +1,67 @@
|
|
1
|
+
require 'cardboard/helpers/settings'
|
2
|
+
|
3
|
+
module Cardboard
|
4
|
+
class Application
|
5
|
+
include Settings
|
6
|
+
|
7
|
+
# The default namespace to put controllers and routes inside. Set this
|
8
|
+
# in config/initializers/cardboard.rb using:
|
9
|
+
#
|
10
|
+
# config.default_namespace = :admin
|
11
|
+
setting :default_namespace, :cardboard
|
12
|
+
|
13
|
+
# The default site title (can be overwritten by user)
|
14
|
+
setting :site_title, "Cardboard"
|
15
|
+
|
16
|
+
# The user class that will be using cardboard
|
17
|
+
setting :user_class, nil
|
18
|
+
|
19
|
+
# The default number of resources to display on index pages
|
20
|
+
setting :default_per_page, 30
|
21
|
+
|
22
|
+
# The method to call in controllers to get the current user
|
23
|
+
setting :current_admin_user_method, false
|
24
|
+
|
25
|
+
# The method to call in the controllers to ensure that there
|
26
|
+
# is a currently authenticated admin user
|
27
|
+
setting :authentication_method, false
|
28
|
+
|
29
|
+
# The path to log user's out with. If set to a symbol, we assume
|
30
|
+
# that it's a method to call which returns the path
|
31
|
+
setting :logout_link_path, :destroy_admin_user_session_path
|
32
|
+
|
33
|
+
# The method to use when generating the link for user logout
|
34
|
+
setting :logout_link_method, :get
|
35
|
+
|
36
|
+
# Cardboard makes educated guesses when displaying objects, this is
|
37
|
+
# the list of methods it tries calling in order
|
38
|
+
setting :display_name_methods, [ :display_name,
|
39
|
+
:full_name,
|
40
|
+
:name,
|
41
|
+
:username,
|
42
|
+
:login,
|
43
|
+
:title,
|
44
|
+
:email,
|
45
|
+
:to_s ]
|
46
|
+
|
47
|
+
# private
|
48
|
+
|
49
|
+
# def register_default_assets
|
50
|
+
# register_stylesheet 'cardboard.css', :media => 'screen'
|
51
|
+
# register_stylesheet 'cardboard/print.css', :media => 'print'
|
52
|
+
|
53
|
+
# register_javascript 'cardboard.js'
|
54
|
+
# end
|
55
|
+
|
56
|
+
# # Since we're dealing with all our own file loading, we need
|
57
|
+
# # to remove our paths from the ActiveSupport autoload paths.
|
58
|
+
# # If not, file naming becomes very important and can cause clashes.
|
59
|
+
# def remove_cardboard_load_paths_from_rails_autoload_and_eager_load
|
60
|
+
# ActiveSupport::Dependencies.autoload_paths.reject!{|path| load_paths.include?(path) }
|
61
|
+
# # Don't eagerload our configs, we'll deal with them ourselves
|
62
|
+
# Rails.application.config.eager_load_paths = Rails.application.config.eager_load_paths.reject do |path|
|
63
|
+
# load_paths.include?(path)
|
64
|
+
# end
|
65
|
+
# end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,83 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'simple_form'
|
3
|
+
require 'stringex'
|
4
|
+
require 'ranked-model'
|
5
|
+
require 'cocoon'
|
6
|
+
require 'inherited_resources'
|
7
|
+
require 'gon'
|
8
|
+
require 'rack/cache'
|
9
|
+
require 'dragonfly'
|
10
|
+
require 'chronic'
|
11
|
+
require 'font-awesome-sass-rails'
|
12
|
+
require 'bootstrap-sass'
|
13
|
+
require 'bootstrap-datepicker-rails'
|
14
|
+
require 'slim'
|
15
|
+
require 'ransack'
|
16
|
+
require 'kaminari'
|
17
|
+
require 'kaminari-bootstrap'
|
18
|
+
require 'rack-pjax'
|
19
|
+
require 'jquery-ui-rails'
|
20
|
+
require 'decorators'
|
21
|
+
require 'bootstrap-wysihtml5-rails'
|
22
|
+
require 'select2-rails'
|
23
|
+
|
24
|
+
|
25
|
+
module Cardboard
|
26
|
+
class Engine < ::Rails::Engine
|
27
|
+
isolate_namespace Cardboard
|
28
|
+
railtie_name "cardboard"
|
29
|
+
|
30
|
+
config.generators do |g|
|
31
|
+
g.test_framework :mini_test, :fixture => false, :spec => true
|
32
|
+
end
|
33
|
+
|
34
|
+
# Let the main app use the cardboard helpers
|
35
|
+
initializer "public cardboard helpers" do |app|
|
36
|
+
ActiveSupport.on_load(:action_controller) do
|
37
|
+
#helper Cardboard::Engine.helpers
|
38
|
+
helper Cardboard::PublicHelper
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
initializer "set resource controller for generator" do |app|
|
43
|
+
Cardboard.set_resource_controllers
|
44
|
+
end
|
45
|
+
|
46
|
+
initializer "load decorators" do |app|
|
47
|
+
Decorators.register! Rails.root, Engine.root
|
48
|
+
end
|
49
|
+
|
50
|
+
# the to_prepare gets executed even before autoreloads
|
51
|
+
config.to_prepare do
|
52
|
+
#Decorators.register! Engine.root, Rails.root
|
53
|
+
#TODO: figure out why the decorator doesn't auto reload
|
54
|
+
|
55
|
+
# Load custom resource controllers in development (already loaded in production)
|
56
|
+
Cardboard.set_resource_controllers
|
57
|
+
# if Rails.env.development?
|
58
|
+
# Dir[Rails.root.join('app/controllers/cardboard/*_controller.rb')].map.each do |controller|
|
59
|
+
# require_dependency controller
|
60
|
+
# end
|
61
|
+
# end
|
62
|
+
# Cardboard.resource_controllers = Cardboard::AdminController.descendants
|
63
|
+
end
|
64
|
+
|
65
|
+
initializer "precompile hook", :group => :all do |app|
|
66
|
+
app.config.assets.precompile += ["cardboard.js", "cardboard.css"]
|
67
|
+
end
|
68
|
+
|
69
|
+
initializer "dragonfly whitelist" do |app|
|
70
|
+
Dragonfly.app.fetch_file_whitelist.push(/app\/assets\/images/)
|
71
|
+
Dragonfly.app.fetch_file_whitelist.push(/app\/assets\/files/)
|
72
|
+
end
|
73
|
+
|
74
|
+
initializer "pjax hook" do |app|
|
75
|
+
app.config.middleware.use Rack::Pjax
|
76
|
+
end
|
77
|
+
|
78
|
+
rake_tasks do
|
79
|
+
Dir[File.join(File.dirname(__FILE__),'../tasks/*.rake')].each { |f| load f }
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
83
|
+
end
|