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
@@ -0,0 +1,63 @@
|
|
1
|
+
//Only for Cardboard Admin Area
|
2
|
+
|
3
|
+
@import "variables";
|
4
|
+
|
5
|
+
@import "cardboard/framework";
|
6
|
+
@import "cardboard/rich_text";
|
7
|
+
@import "font-awesome";
|
8
|
+
@import "select2";
|
9
|
+
|
10
|
+
@import "main_topbar";
|
11
|
+
@import "main_sidebar";
|
12
|
+
@import "content";
|
13
|
+
@import "content_sidebar";
|
14
|
+
@import "resources";
|
15
|
+
|
16
|
+
html, body{
|
17
|
+
min-height: 100%;
|
18
|
+
height:100%;
|
19
|
+
}
|
20
|
+
body{
|
21
|
+
font-family: $font;
|
22
|
+
-webkit-font-smoothing: antialiased;
|
23
|
+
font-weight: 300;
|
24
|
+
overflow-x: hidden;
|
25
|
+
}
|
26
|
+
|
27
|
+
#main_content{
|
28
|
+
min-height:100%;
|
29
|
+
overflow: hidden;
|
30
|
+
width: 100%;
|
31
|
+
}
|
32
|
+
#main_sidebar, #content_sidebar{
|
33
|
+
margin-bottom: -9999px;
|
34
|
+
padding-bottom: 9999px;
|
35
|
+
float:left;
|
36
|
+
}
|
37
|
+
|
38
|
+
.center{
|
39
|
+
text-align: center;
|
40
|
+
}
|
41
|
+
|
42
|
+
.nested-fields{
|
43
|
+
margin-bottom: 20px;
|
44
|
+
padding: 20px;
|
45
|
+
background: #EFEFEF;
|
46
|
+
}
|
47
|
+
|
48
|
+
.header{
|
49
|
+
margin-top: 20px;
|
50
|
+
margin-bottom: 60px;
|
51
|
+
|
52
|
+
h1,h2,h3,h4{
|
53
|
+
float: left;
|
54
|
+
margin-top: 5px;
|
55
|
+
margin: 0;
|
56
|
+
line-height: inherit;
|
57
|
+
}
|
58
|
+
}
|
59
|
+
|
60
|
+
.icon-margin{
|
61
|
+
margin-right: 4px;
|
62
|
+
}
|
63
|
+
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module Cardboard
|
2
|
+
class ApplicationController < ActionController::Base
|
3
|
+
|
4
|
+
before_filter do #:authenticate_admin_user!
|
5
|
+
self.send(Cardboard.application.authentication_method)
|
6
|
+
end
|
7
|
+
before_filter :for_gon
|
8
|
+
protect_from_forgery
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def cardboard_user_can_manage?(resource)
|
13
|
+
if cardboard_user.respond_to?(:can_manage_cardboard?)
|
14
|
+
cardboard_user.can_manage_cardboard?(resource.to_sym)
|
15
|
+
else
|
16
|
+
true
|
17
|
+
end
|
18
|
+
end
|
19
|
+
helper_method :cardboard_user_can_manage?
|
20
|
+
|
21
|
+
# def active_resource_controller?
|
22
|
+
# for c in Cardboard.resource_controllers
|
23
|
+
# return true if current_admin_user.can_manage_cardboard?(c.controller_name.to_sym)
|
24
|
+
# end
|
25
|
+
# false
|
26
|
+
# end
|
27
|
+
# helper_method :active_resource_controller?
|
28
|
+
|
29
|
+
def cardboard_user
|
30
|
+
@cardboard_user ||= self.send(Cardboard.application.current_admin_user_method)
|
31
|
+
end
|
32
|
+
helper_method :cardboard_user
|
33
|
+
|
34
|
+
def for_gon
|
35
|
+
gon.rich_text_links_modal = render_to_string(:partial => "cardboard/rich_editor/links_modal", :layout => false)
|
36
|
+
end
|
37
|
+
|
38
|
+
def strong_params
|
39
|
+
return params if request.get? || params.blank? || params.class.to_s != "ActionController::Parameters"
|
40
|
+
# #remove once conversion to strong params is complete
|
41
|
+
params.permit!
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require_dependency "cardboard/application_controller"
|
2
|
+
|
3
|
+
module Cardboard
|
4
|
+
class MyAccountController < ApplicationController
|
5
|
+
|
6
|
+
def edit
|
7
|
+
@user = cardboard_user
|
8
|
+
end
|
9
|
+
|
10
|
+
def update
|
11
|
+
admin_user_method = Cardboard.user_class.to_s.underscore.gsub(/\//,'_').to_sym
|
12
|
+
@user = cardboard_user
|
13
|
+
if params[admin_user_method][:password].blank?
|
14
|
+
params[admin_user_method].delete("password")
|
15
|
+
params[admin_user_method].delete("password_confirmation")
|
16
|
+
end
|
17
|
+
|
18
|
+
if @user.update_attributes(strong_params[admin_user_method])
|
19
|
+
request.env['warden'].session_serializer.store(@user, admin_user_method)
|
20
|
+
flash[:success] = "User information updated successfully"
|
21
|
+
redirect_to my_account_path
|
22
|
+
else
|
23
|
+
render :edit
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require_dependency "cardboard/application_controller"
|
2
|
+
|
3
|
+
module Cardboard
|
4
|
+
class PagesController < ApplicationController
|
5
|
+
before_filter :check_ability
|
6
|
+
|
7
|
+
def edit
|
8
|
+
@page = Cardboard::Page.find(params[:id])
|
9
|
+
end
|
10
|
+
|
11
|
+
def update
|
12
|
+
@page = Cardboard::Page.find(params[:id])
|
13
|
+
|
14
|
+
if @page.update_attributes(strong_params[:page])
|
15
|
+
flash[:success] = "Your page was updated successfully"
|
16
|
+
redirect_to edit_page_path(@page)
|
17
|
+
else
|
18
|
+
render :edit
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def sort
|
23
|
+
Page.find(params[:id]).update_attribute(:position_position, params[:index])
|
24
|
+
render nothing: true
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
def check_ability
|
29
|
+
unless cardboard_user_can_manage?(:pages)
|
30
|
+
render :text => "You are not authorized to edit pages.", :status => :unauthorized
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
require_dependency "cardboard/application_controller"
|
2
|
+
|
3
|
+
class Cardboard::ResourceController < Cardboard::ApplicationController
|
4
|
+
inherit_resources
|
5
|
+
|
6
|
+
defaults :route_prefix => 'cardboard'
|
7
|
+
|
8
|
+
before_filter :check_ability
|
9
|
+
|
10
|
+
def collection
|
11
|
+
@q ||= end_of_association_chain.search(params[:q])
|
12
|
+
|
13
|
+
@q.sorts = self.class.default_order if @q.sorts.empty?
|
14
|
+
get_collection_ivar || begin
|
15
|
+
set_collection_ivar((@q.respond_to?(:scoped) ? @q.scoped.result : @q.result).page(params[:page]))
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def self.default_order(val = nil)
|
22
|
+
@default_order ||= 'updated_at desc'
|
23
|
+
return @default_order if val.nil?
|
24
|
+
@default_order = val.to_s
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.menu(hash = nil)
|
28
|
+
@menu = {priority: 999, label: self.controller_name.to_s.titleize} if @menu.nil? #menu might be false, so no ||=
|
29
|
+
return @menu if hash.nil?
|
30
|
+
@menu = hash.is_a?(Hash) ? @menu.merge(hash) : hash
|
31
|
+
end
|
32
|
+
|
33
|
+
def check_ability
|
34
|
+
unless cardboard_user_can_manage?(resource_collection_name)
|
35
|
+
render :text => "You are not authorized to access this resource.", :status => :unauthorized
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def permitted_strong_parameters
|
40
|
+
:all # bypass strong_parameters (unless overwritten in controller)
|
41
|
+
end
|
42
|
+
|
43
|
+
def resource_params
|
44
|
+
return [] if request.get? || permitted_strong_parameters.nil?
|
45
|
+
return super if params && params.class.to_s != "ActionController::Parameters"
|
46
|
+
|
47
|
+
if permitted_strong_parameters == :all
|
48
|
+
[ params.require(resource_instance_name.to_sym).permit! ]
|
49
|
+
else
|
50
|
+
[ params.require(resource_instance_name.to_sym).permit(*permitted_strong_parameters)]
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def self.inherited(base)
|
55
|
+
# https://github.com/josevalim/inherited_resources/issues/256
|
56
|
+
base.resource_class = nil
|
57
|
+
super(base)
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require_dependency "cardboard/application_controller"
|
2
|
+
|
3
|
+
module Cardboard
|
4
|
+
class SettingsController < ApplicationController
|
5
|
+
before_filter :check_ability
|
6
|
+
|
7
|
+
def index
|
8
|
+
@setting = Setting.first
|
9
|
+
end
|
10
|
+
|
11
|
+
def update
|
12
|
+
@setting = params[:id].present? ? Setting.find(params[:id]) : Setting.first
|
13
|
+
if @setting.update_attributes(strong_params[:setting])
|
14
|
+
flash[:success] = "Settings updated successfully"
|
15
|
+
redirect_to settings_path
|
16
|
+
else
|
17
|
+
render :index
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
def check_ability
|
23
|
+
unless cardboard_user_can_manage?(:settings)
|
24
|
+
render :text => "You are not authorized to edit settings.", :status => :unauthorized
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
class PagesController < ApplicationController
|
2
|
+
def show
|
3
|
+
|
4
|
+
raise ActionController::RoutingError.new("Page Not Found") if current_page.nil?
|
5
|
+
|
6
|
+
if current_page.using_slug_backup?
|
7
|
+
redirect_to current_page.url, status: :moved_permanently
|
8
|
+
else
|
9
|
+
# call controller hook
|
10
|
+
self.send(current_page.identifier) if self.respond_to? current_page.identifier
|
11
|
+
|
12
|
+
render "cardboard/pages/show", layout: @layout || "layouts/application"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
# def edit_link
|
19
|
+
# cardboard.edit_page_path(@page)
|
20
|
+
# end
|
21
|
+
# helper_method :edit_link
|
22
|
+
|
23
|
+
def current_page
|
24
|
+
@page ||= Cardboard::Page.find_by_url(params[:id]) ||
|
25
|
+
Cardboard::Page.root ||
|
26
|
+
raise(ActionController::RoutingError.new("No root page, make sure to run `rake cardboard:seed`"))
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
if Cardboard.user_class
|
2
|
+
Cardboard.user_class.class_eval do
|
3
|
+
|
4
|
+
# has_many :cardboard_blog_posts, :class_name => "CardboardBlog::Post", :foreign_key => "user_id"
|
5
|
+
|
6
|
+
# User class should overwrite these methods with his own
|
7
|
+
# ['pages', 'settings'].each do |m|
|
8
|
+
# method = "can_manage_cardboard_#{m}?"
|
9
|
+
# unless method_defined?(method.to_sym)
|
10
|
+
# define_method method do
|
11
|
+
# true
|
12
|
+
# end
|
13
|
+
# end
|
14
|
+
# end
|
15
|
+
unless method_defined?(:can_manage_cardboard_pages?)
|
16
|
+
def can_manage_cardboard_pages?
|
17
|
+
true
|
18
|
+
end
|
19
|
+
end
|
20
|
+
unless method_defined?(:can_manage_cardboard_settings?)
|
21
|
+
def can_manage_cardboard_settings?
|
22
|
+
true
|
23
|
+
end
|
24
|
+
end
|
25
|
+
unless method_defined?(:can_manage_cardboard_resource?)
|
26
|
+
def can_manage_cardboard_resource?(resource)
|
27
|
+
true
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
module Cardboard
|
2
|
+
module PublicHelper
|
3
|
+
|
4
|
+
# Example:
|
5
|
+
# link_to_page 123, class: "btn" do |page|
|
6
|
+
# "hello #{page.title}"
|
7
|
+
# end
|
8
|
+
#
|
9
|
+
# link_to_page "home"
|
10
|
+
#
|
11
|
+
def link_to_page(page_id, html_options={}, &block)
|
12
|
+
page = if page_id.is_a?(Integer)
|
13
|
+
Cardboard::Page.where(id: page_id).first
|
14
|
+
else #if page_id.is_a? String
|
15
|
+
Cardboard::Page.where(identifier: page_id).first
|
16
|
+
end
|
17
|
+
return nil if page.blank?
|
18
|
+
|
19
|
+
title = if block_given?
|
20
|
+
capture(page, &block)
|
21
|
+
else
|
22
|
+
page.title
|
23
|
+
end
|
24
|
+
link_to(title, page.url, html_options)
|
25
|
+
end
|
26
|
+
|
27
|
+
# Example 1:
|
28
|
+
# = nested_pages Cardboard::Page.arrange do |page, subpages|
|
29
|
+
# .indent
|
30
|
+
# = link_to(page.title, page.url) if page.in_menu?
|
31
|
+
# = subpages
|
32
|
+
# end
|
33
|
+
# Example 2:
|
34
|
+
# %ul
|
35
|
+
# = nested_pages do |page, subpages|
|
36
|
+
# %li
|
37
|
+
# = link_to page.title, edit_page_path(page)
|
38
|
+
# = content_tag(:ul, subpages) if subpages.present?
|
39
|
+
def nested_pages(page = nil, &block)
|
40
|
+
raise ArgumentError, "Missing block" unless block_given?
|
41
|
+
inner_nested_pages(Cardboard::Page.arrange(page), &block).try(:html_safe)
|
42
|
+
end
|
43
|
+
|
44
|
+
private
|
45
|
+
|
46
|
+
def inner_nested_pages(pages, &block)
|
47
|
+
return unless pages
|
48
|
+
pages.map do |page, sub_pages|
|
49
|
+
capture(page, sub_pages.present? ? inner_nested_pages(sub_pages, &block) : nil, &block)
|
50
|
+
end.join.html_safe
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
module Cardboard
|
2
|
+
module ResourceHelper
|
3
|
+
|
4
|
+
def l(val, options = {})
|
5
|
+
return nil if val.blank?
|
6
|
+
val = val.to_date if val.is_a? String
|
7
|
+
super(val, options)
|
8
|
+
end
|
9
|
+
|
10
|
+
# ActionView::Helpers::FormBuilder.class_eval do
|
11
|
+
# def date_field(conf,opts = {})
|
12
|
+
# options = opts.dup
|
13
|
+
# options[:class] = "#{options[:class]} datepicker"
|
14
|
+
# text_field(conf, options)
|
15
|
+
# end
|
16
|
+
# end
|
17
|
+
|
18
|
+
# .item
|
19
|
+
# = link_to dashboard_path, id:"nav_dashboard_link" do
|
20
|
+
# i.icon-dashboard
|
21
|
+
# span Dashboard
|
22
|
+
def main_sidebar_nav_link(text, link, options={})
|
23
|
+
options[:class] = "#{options[:class]} active" if request.path["#{link}/"] || request.path == link
|
24
|
+
out = content_tag(:div, class:"item") do
|
25
|
+
link_to("<span>#{text}</span>".html_safe, link, options)
|
26
|
+
end
|
27
|
+
out.html_safe
|
28
|
+
end
|
29
|
+
|
30
|
+
# "q"=>
|
31
|
+
# {"id_lt"=>"1",
|
32
|
+
# "id_gteq"=>"1",
|
33
|
+
# "color_cont"=>"1",
|
34
|
+
# "flavor_cont"=>"",
|
35
|
+
# "size_lt"=>"",
|
36
|
+
# "size_gteq"=>"",
|
37
|
+
# "created_at_lt"=>"",
|
38
|
+
# "created_at_gteq"=>"",
|
39
|
+
# "updated_at_lt"=>"",
|
40
|
+
# "updated_at_gteq"=>""},
|
41
|
+
|
42
|
+
def cardboard_filters(klass, main_element, options={})
|
43
|
+
raise "First argument needs to be a class" unless klass.is_a? Class
|
44
|
+
|
45
|
+
options[:new_button] = Hash.new if options[:new_button].nil? #careful for false
|
46
|
+
|
47
|
+
if main_element
|
48
|
+
# valid main elements:
|
49
|
+
# false (don't show the search form)
|
50
|
+
# :column_name
|
51
|
+
# "column_name_cont"
|
52
|
+
main_element = main_element.to_s
|
53
|
+
|
54
|
+
case type = klass.columns_hash[main_element].try(:type)
|
55
|
+
when :string, :text
|
56
|
+
main_element = "#{main_element}_cont"
|
57
|
+
when :integer, :decimal, :float
|
58
|
+
main_element = "#{main_element}_eq"
|
59
|
+
when :date, :datetime, :timestamp, :time, :binary, :boolean, :references
|
60
|
+
raise "Main search element cannot be of type #{type}. Use a custom ransack form."
|
61
|
+
else
|
62
|
+
main_element = "#{main_element}_cont" unless %w[cont eq lt gt gteq lteq matches in cont_any start end].include?(main_element.split("_").last)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
render "cardboard/resources/search_helper", klass: klass.to_s.demodulize.underscore, options: options, main_element: main_element #,elements: elements
|
67
|
+
end
|
68
|
+
|
69
|
+
|
70
|
+
def ransack_options
|
71
|
+
{
|
72
|
+
string: [["Contains","cont"],["Does not contain","not_cont"], ["Starts with","start"], ["Ends with","end"]],
|
73
|
+
datetime: [["On","eq"],["Before","lt"],["After","gt"]],
|
74
|
+
integer: [["Greater than","gt"],["Equals","eq"],["Less than","lt"]],
|
75
|
+
boolean: [["is False","blank"],["is True","true"]]
|
76
|
+
}
|
77
|
+
end
|
78
|
+
|
79
|
+
end
|
80
|
+
end
|