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,79 @@
|
|
1
|
+
module Cardboard
|
2
|
+
class PagePart < ActiveRecord::Base
|
3
|
+
has_many :fields, :as => :object_with_field, class_name: "Cardboard::Field", :dependent => :destroy, :inverse_of => :object_with_field
|
4
|
+
has_many :subparts, class_name: "Cardboard::PagePart", :dependent => :destroy, :foreign_key => "parent_part_id", :inverse_of => :parent
|
5
|
+
|
6
|
+
belongs_to :parent, class_name: "Cardboard::PagePart", :foreign_key => "parent_part_id", :inverse_of => :subparts
|
7
|
+
belongs_to :page
|
8
|
+
|
9
|
+
accepts_nested_attributes_for :subparts, :allow_destroy => true #, :reject_if => :all_blank
|
10
|
+
accepts_nested_attributes_for :fields #, :allow_destroy => true (maybe for super admin?)
|
11
|
+
|
12
|
+
validates :identifier, uniqueness: {:case_sensitive => false, :scope => :page_id},
|
13
|
+
:format => {:with => /\A[a-z\_0-9]+\z/, :message => "Only downcase letters, numbers and underscores are allowed"},
|
14
|
+
:unless => :subpart?
|
15
|
+
validates_associated :fields
|
16
|
+
# validates :subparts, presence:true, unless: -> {new_record? || subpart?}
|
17
|
+
validate :at_least_one_subpart
|
18
|
+
|
19
|
+
# Scopes
|
20
|
+
scope :is_subparts, ->{ where("parent_part_id IS NOT NULL")}
|
21
|
+
scope :is_parent, ->{where("parent_part_id IS NULL")}
|
22
|
+
|
23
|
+
#gem
|
24
|
+
include RankedModel
|
25
|
+
ranks :subpart_position, :with_same => :parent_part_id, :column => :position, :scope => :is_subparts
|
26
|
+
ranks :part_position, :with_same => :page_id, :column => :position, :scope => :is_parent
|
27
|
+
default_scope {order("position ASC")}
|
28
|
+
|
29
|
+
|
30
|
+
def subpart?
|
31
|
+
!self.parent_part_id.nil?
|
32
|
+
end
|
33
|
+
|
34
|
+
def repeatable?
|
35
|
+
@parent_repeatable ||= self.parent ? self.parent[:repeatable] : super
|
36
|
+
end
|
37
|
+
|
38
|
+
def new_subpart
|
39
|
+
return nil if !repeatable? || subpart?
|
40
|
+
master = self.subparts.first
|
41
|
+
master_hash = master.attributes.select do |key, value|
|
42
|
+
["parent_part_id"].include? key
|
43
|
+
end
|
44
|
+
subpart = Cardboard::PagePart.new(master_hash)
|
45
|
+
for field in master.fields
|
46
|
+
field_hash = field.attributes.select do |key, value|
|
47
|
+
["identifier", "label", "type", "required", "hint", "placeholder"].include? key
|
48
|
+
end
|
49
|
+
subpart.fields << Cardboard::Field.new(field_hash)
|
50
|
+
end
|
51
|
+
return subpart
|
52
|
+
end
|
53
|
+
|
54
|
+
def attr(field)
|
55
|
+
field = field.to_s
|
56
|
+
@attr ||= {}
|
57
|
+
@attr[field] ||= begin
|
58
|
+
f = self.fields.where(identifier: field).first
|
59
|
+
return nil unless f
|
60
|
+
out = f.value_uid.nil? ? nil : f.value
|
61
|
+
out = f.default if f.required? && out.nil?
|
62
|
+
out
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
private
|
67
|
+
|
68
|
+
def at_least_one_subpart
|
69
|
+
return true if subpart? || new_record?
|
70
|
+
# require a minimum of one task
|
71
|
+
undestroyed_part_count = 0
|
72
|
+
|
73
|
+
subparts.each { |t| undestroyed_part_count += 1 unless t.marked_for_destruction? }
|
74
|
+
if undestroyed_part_count < 1
|
75
|
+
errors.add(:base, 'There must be at least one')
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module Cardboard
|
2
|
+
class Setting < ActiveRecord::Base
|
3
|
+
# self.table_name = "cardboard_settings"
|
4
|
+
# attr_accessible :name, :fields_attributes
|
5
|
+
|
6
|
+
has_many :fields, :as => :object_with_field
|
7
|
+
accepts_nested_attributes_for :fields, :allow_destroy => true
|
8
|
+
|
9
|
+
# thread save caching of the settings
|
10
|
+
@lock = ::Mutex.new
|
11
|
+
after_commit do
|
12
|
+
Setting.clear_saved_settings
|
13
|
+
end
|
14
|
+
|
15
|
+
class << self
|
16
|
+
def add(id, hash_attributes)
|
17
|
+
myself = self.first_or_create
|
18
|
+
field = myself.fields.where(identifier: id).first_or_initialize
|
19
|
+
field.update_attributes!(hash_attributes)
|
20
|
+
end
|
21
|
+
|
22
|
+
def clear_saved_settings
|
23
|
+
@lock.synchronize do
|
24
|
+
@_settings = nil
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def method_missing(sym, *args, &block)
|
29
|
+
begin
|
30
|
+
super
|
31
|
+
rescue
|
32
|
+
@lock.synchronize do
|
33
|
+
@_settings ||= {}
|
34
|
+
@_settings[sym.to_sym] ||= begin
|
35
|
+
return nil unless self.first
|
36
|
+
s = self.first.fields.where(identifier: sym.to_s).first
|
37
|
+
raise ::ActiveRecord::NoMethodError if s.nil?
|
38
|
+
s.value
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
h1 Dashboard
|
@@ -0,0 +1 @@
|
|
1
|
+
= f.input :value, label: f.object.label || f.object.identifier.titleize, as: f.object.type, hint: f.object.hint, placeholder: f.object.placeholder, required: f.object.required
|
@@ -0,0 +1,4 @@
|
|
1
|
+
- label = ""
|
2
|
+
/ - label += '<abbr title="required">*</abbr> ' if f.object.required
|
3
|
+
- label += f.object.label || f.object.identifier.titleize
|
4
|
+
= f.input :value, inline_label: label.html_safe, as: f.object.type, hint: f.object.hint, placeholder: f.object.placeholder, required: f.object.required, label: false
|
@@ -0,0 +1 @@
|
|
1
|
+
= f.input :value, label: f.object.label || f.object.identifier.titleize, as: :date_picker, hint: f.object.hint, placeholder: f.object.placeholder, required: f.object.required
|
@@ -0,0 +1,12 @@
|
|
1
|
+
= f.input :value, label: f.object.identifier, hint: f.object.hint, placeholder: f.object.placeholder, required: f.object.required do
|
2
|
+
|
3
|
+
- if f.object.value_uid.present?
|
4
|
+
p= link_to "#{f.object.value.name} (#{number_to_human_size f.object.value.size})", f.object.value.url, "data-skip-pjax" => true
|
5
|
+
- unless f.object.required
|
6
|
+
= f.input :remove_value, as: :boolean, inline_label: "Delete file?", label: false, :wrapper => :default
|
7
|
+
|
8
|
+
= f.hidden_field :retained_value
|
9
|
+
|
10
|
+
= f.input_field :value, as: :file
|
11
|
+
|
12
|
+
|
@@ -0,0 +1,11 @@
|
|
1
|
+
= f.input :value, label: f.object.label || f.object.identifier.titleize, hint: f.object.hint, placeholder: f.object.placeholder, required: f.object.required do
|
2
|
+
|
3
|
+
- if f.object.value_uid.present?
|
4
|
+
= image_tag f.object.value.thumb('600x150>').url
|
5
|
+
br
|
6
|
+
- unless f.object.required
|
7
|
+
= f.input :remove_value, inline_label: "Delete file?", label: false, as: :boolean, :wrapper => :default
|
8
|
+
|
9
|
+
= f.input_field :value, as: :file
|
10
|
+
|
11
|
+
= f.hidden_field :retained_value
|
@@ -0,0 +1 @@
|
|
1
|
+
= f.input :value, label: f.object.label || f.object.identifier.titleize, as: f.object.type, hint: f.object.hint, placeholder: f.object.placeholder, required: f.object.required
|
@@ -0,0 +1,29 @@
|
|
1
|
+
|
2
|
+
h1 Admin User settings
|
3
|
+
|
4
|
+
= simple_form_for @user, url: my_account_path do |f|
|
5
|
+
= f.input :email
|
6
|
+
= f.input :password
|
7
|
+
= f.input :password_confirmation
|
8
|
+
= f.button :submit
|
9
|
+
|
10
|
+
- if defined?(Devise)
|
11
|
+
.well
|
12
|
+
h3 Usage info
|
13
|
+
p
|
14
|
+
b sign in count:
|
15
|
+
=< @user.sign_in_count
|
16
|
+
p
|
17
|
+
b last sign in time:
|
18
|
+
=< l @user.last_sign_in_at, format: :long
|
19
|
+
p
|
20
|
+
b current sign in ip:
|
21
|
+
=< @user.current_sign_in_ip
|
22
|
+
p
|
23
|
+
b last sign in ip:
|
24
|
+
=< @user.last_sign_in_ip
|
25
|
+
|
26
|
+
- if @user.respond_to?(:failed_attempts)
|
27
|
+
p
|
28
|
+
b failed login attempts:
|
29
|
+
=< @user.failed_attempts
|
@@ -0,0 +1,17 @@
|
|
1
|
+
.input-append
|
2
|
+
input id="sidebar_page_search" type="text" placeholder="Search by Title"
|
3
|
+
button type="submit" class="btn"
|
4
|
+
i.icon-search
|
5
|
+
|
6
|
+
#content_pages data-update-url="#{pages_sort_path}"
|
7
|
+
= nested_pages do |page, subpages|
|
8
|
+
.page_link id= "pages_#{page.id}"
|
9
|
+
.link_wrap
|
10
|
+
= link_to page.title, edit_page_path(page), class: "offset-#{page.depth}"
|
11
|
+
.sort_handle
|
12
|
+
i.icon-reorder
|
13
|
+
- if subpages
|
14
|
+
.page_group= subpages
|
15
|
+
|
16
|
+
#sidebar_page_search_none style="display:none"
|
17
|
+
| No pages match your search
|
@@ -0,0 +1,20 @@
|
|
1
|
+
.nested-fields
|
2
|
+
|
3
|
+
- if subpart.repeatable?
|
4
|
+
.right= link_to_remove_association "x", f, class: "btn btn-danger"
|
5
|
+
|
6
|
+
- for field in subpart.fields.sort_by(&:position)
|
7
|
+
|
8
|
+
= f.simple_fields_for :fields, field do |w|
|
9
|
+
|
10
|
+
/ TODO: Refactor!
|
11
|
+
- if field.new_record?
|
12
|
+
|
13
|
+
- for attribute in [:identifier, :label, :type, :required, :position, :hint, :placeholder]
|
14
|
+
= w.input attribute, as: :hidden unless field.send(attribute).nil?
|
15
|
+
|
16
|
+
- begin
|
17
|
+
= render "cardboard/fields/#{field.type}", f: w
|
18
|
+
- rescue ActionView::MissingTemplate => e
|
19
|
+
= render "cardboard/fields/base_input", f: w
|
20
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
/ -# TODO: put the parent and slug side by side and name the new field URL
|
2
|
+
/ -# also maybe change the dropdown to an autocomplete
|
3
|
+
/ -# f.input :parent_url, :collection => Cardboard::Page.preordered.all.inject(["/"]){|result, elm| result << elm.url unless elm.id == @page.id; result}, include_blank: false
|
4
|
+
|
5
|
+
= f.input :url, required: true, wrapper_html:{class: f.object.errors.messages[:slug] ? "error" : nil}, hint: f.object.root? ? "This page is your home page" : nil do
|
6
|
+
- if f.object.root?
|
7
|
+
.btn(disabled)=> "/"
|
8
|
+
' or
|
9
|
+
.input-prepend style="display:inline"
|
10
|
+
.add-on
|
11
|
+
- if @page.new_record?
|
12
|
+
= f.select :parent_url, options_for_select(@page.parent_url_options, f.object.parent_url)
|
13
|
+
- else
|
14
|
+
= f.object.parent_url
|
15
|
+
|
16
|
+
= f.text_field :slug
|
17
|
+
|
18
|
+
br
|
19
|
+
= f.error :slug
|
20
|
+
|
@@ -0,0 +1,43 @@
|
|
1
|
+
h1
|
2
|
+
= @page.title
|
3
|
+
.right= link_to "Live preview", @page.url, class:"btn", target: '_blank', 'data-skip-pjax' => true
|
4
|
+
|
5
|
+
= simple_form_for @page, html: {:multipart => true} do |f|
|
6
|
+
= f.error_notification
|
7
|
+
= f.input :title
|
8
|
+
|
9
|
+
= render "url_field", f: f
|
10
|
+
|
11
|
+
= f.input :in_menu, label: false, inline_label: "Display in main menu?"
|
12
|
+
|
13
|
+
= field_set_tag "SEO" do
|
14
|
+
.nested-fields
|
15
|
+
= f.simple_fields_for :meta_seo, OpenStruct.new(@page.seo) do |seo|
|
16
|
+
= seo.input :title, label: "Browser titlebar", required: false
|
17
|
+
= seo.input :description, as: :text, required: false
|
18
|
+
- for key in seo.object.methods(nil).grep(/[^=]$/) - [:title, :description]
|
19
|
+
= seo.input key, required: false
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
- for part in @page.parts.sort_by(&:position)
|
24
|
+
= f.simple_fields_for :parts, part do |g|
|
25
|
+
|
26
|
+
= field_set_tag part.identifier.titleize do
|
27
|
+
= g.error :base, class: "alert-error"
|
28
|
+
|
29
|
+
/ sort puts nil at the end, in the case of new parts
|
30
|
+
- for subpart in part.subparts.sort{|a,b| a.position && b.position ? a.position <=> b.position : a.position ? -1 : 1 }
|
31
|
+
= g.simple_fields_for :subparts, subpart do |y|
|
32
|
+
|
33
|
+
= render "subpart_fields", f: y, subpart: subpart
|
34
|
+
|
35
|
+
- if part.repeatable?
|
36
|
+
.links
|
37
|
+
/ the "links" class is important for the cocoon gem
|
38
|
+
= link_to_add_association "Add another #{part.identifier.singularize.titleize}", g, :subparts, :render_options => {:locals => {:subpart => part.new_subpart }}, class: "btn btn-block"
|
39
|
+
|
40
|
+
.form-actions
|
41
|
+
= f.button :submit, "Save", class:"btn-primary"
|
42
|
+
= link_to "Cancel", dashboard_path, class:"btn"
|
43
|
+
|
@@ -0,0 +1,9 @@
|
|
1
|
+
- if lookup_context.exists?(current_page.identifier, 'pages', false)
|
2
|
+
|
3
|
+
- content_for :seo do
|
4
|
+
= render "cardboard/pages/seo"
|
5
|
+
|
6
|
+
= render template: "pages/#{current_page.identifier}"
|
7
|
+
|
8
|
+
- elsif Rails.env.development?
|
9
|
+
= render "cardboard/pages/error", missing_file: current_page.identifier
|
@@ -0,0 +1,40 @@
|
|
1
|
+
= search_form_for @q, url: {}, :html =>{"data-pjax"=>true} do |f|
|
2
|
+
= hidden_field_tag :s, "advanced"
|
3
|
+
- (params[:q] || {}).each do |q,v|
|
4
|
+
= f.hidden_field q, :value => v
|
5
|
+
|
6
|
+
.row-fluid.center
|
7
|
+
.input-append.input-prepend
|
8
|
+
.btn-group
|
9
|
+
= content_tag(:select, :disabled => elements.size < 2, id: "advanced_field") do
|
10
|
+
- for e in elements
|
11
|
+
option data-type=e[1] value=e[0] selected=(e[0] == main_element)
|
12
|
+
= e[0].to_s.titleize
|
13
|
+
|
14
|
+
= select_tag nil, grouped_options_for_select(ransack_options, "cont"), id: "ransack_options"
|
15
|
+
= f.text_field "#{main_element}_cont", id: "advanced_query"
|
16
|
+
.btn-group
|
17
|
+
|
18
|
+
= render "cardboard/resources/search_button", f: f
|
19
|
+
|
20
|
+
= link_to "Simple Search", "#", id: "simple_search_link"
|
21
|
+
/, class: "btn"
|
22
|
+
|
23
|
+
.row-fluid#filter_list
|
24
|
+
b= "Filters: " unless params[:q].blank?
|
25
|
+
- (params[:q] || {}).each do |q,v|
|
26
|
+
- if v.present?
|
27
|
+
.filter
|
28
|
+
|
29
|
+
= link_to url_for({q: params[:q].except(q), s: "advanced"}) do
|
30
|
+
'
|
31
|
+
i.icon-remove
|
32
|
+
- *a, b = q.split("_")
|
33
|
+
= a.join(" ")
|
34
|
+
'
|
35
|
+
= {cont: "~", not_cont: "!~", gt: ">", lt:"<", eq: "="}[b.to_sym] || b.pluralize + " with"
|
36
|
+
'
|
37
|
+
= v
|
38
|
+
|
39
|
+
|
40
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
- models = klass.pluralize
|
2
|
+
- model_title = klass.titleize
|
3
|
+
|
4
|
+
table#filter_search_header
|
5
|
+
tr
|
6
|
+
td style="text-align:left"
|
7
|
+
h3= options[:title] || model_title.pluralize
|
8
|
+
|
9
|
+
- if main_element
|
10
|
+
td style="text-align:center"
|
11
|
+
#simple_search= render "cardboard/resources/simple_search", main_element: main_element
|
12
|
+
|
13
|
+
- if options[:new_button]
|
14
|
+
td style="text-align:right"
|
15
|
+
= link_to(options[:new_button][:label] || "New #{model_title}", options[:new_button][:url] || {controller: "cardboard/#{models}", action: :new}, class: "btn pull-right", style:"min-width:90px;")
|
16
|
+
|
17
|
+
|
@@ -0,0 +1,6 @@
|
|
1
|
+
= search_form_for @q, url: {}, :html =>{"data-pjax"=>true} do |f|
|
2
|
+
= hidden_field_tag :s, "simple"
|
3
|
+
|
4
|
+
.input-append
|
5
|
+
= f.text_field main_element, class:"search span5", placeholder: "Search by #{main_element.sub(/_[a-z]+$/,'').titlecase}"
|
6
|
+
= render "cardboard/resources/search_button", f: f
|
@@ -0,0 +1,39 @@
|
|
1
|
+
li
|
2
|
+
div class="bootstrap-wysihtml5-insert-link-modal modal hide fade"
|
3
|
+
.modal-header
|
4
|
+
a class='close' data-dismiss='modal' ×
|
5
|
+
h3 Insert link
|
6
|
+
|
7
|
+
.modal-body
|
8
|
+
ul class="nav nav-tabs"
|
9
|
+
li
|
10
|
+
a href="#link_pages" data-toggle="tab" Pages
|
11
|
+
li
|
12
|
+
a href="#link_url" data-toggle="tab" URL
|
13
|
+
li
|
14
|
+
a href="#link_email" data-toggle="tab" Email
|
15
|
+
|
16
|
+
div class="tab-content"
|
17
|
+
div class="tab-pane" id="link_pages"
|
18
|
+
ul
|
19
|
+
= nested_pages do |page, subpages|
|
20
|
+
li
|
21
|
+
= link_to page.title, "#", "data-url" => page.url
|
22
|
+
= content_tag(:ul, subpages) if subpages
|
23
|
+
div class="tab-pane" id="link_url"
|
24
|
+
input placeholder='http://website.com' class='input-xlarge' value='http://'
|
25
|
+
div class="tab-pane" id="link_email"
|
26
|
+
input placeholder='mailto:email@example.com' class='input-xlarge'
|
27
|
+
|
28
|
+
input class='bootstrap-wysihtml5-insert-link-url' type="hidden"
|
29
|
+
|
30
|
+
.modal-footer
|
31
|
+
|
32
|
+
a id='insert_link' href='#' class='btn btn-primary' data-dismiss='modal' Insert Link
|
33
|
+
a href='#' class='btn' data-dismiss='modal' Cancel
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
/ Editor button
|
38
|
+
a.btn data-wysihtml5-command='createLink' title='Link' tabindex='-1'
|
39
|
+
i class='icon-share'
|