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,26 @@
|
|
1
|
+
en:
|
2
|
+
simple_form:
|
3
|
+
"yes": 'Yes'
|
4
|
+
"no": 'No'
|
5
|
+
required:
|
6
|
+
text: 'required'
|
7
|
+
mark: '*'
|
8
|
+
# You can uncomment the line below if you need to overwrite the whole required html.
|
9
|
+
# When using html, text and mark won't be used.
|
10
|
+
# html: '<abbr title="required">*</abbr>'
|
11
|
+
error_notification:
|
12
|
+
default_message: "Please review the problems below:"
|
13
|
+
# Labels and hints examples
|
14
|
+
# labels:
|
15
|
+
# defaults:
|
16
|
+
# password: 'Password'
|
17
|
+
# user:
|
18
|
+
# new:
|
19
|
+
# email: 'E-mail to sign in.'
|
20
|
+
# edit:
|
21
|
+
# email: 'E-mail.'
|
22
|
+
# hints:
|
23
|
+
# defaults:
|
24
|
+
# username: 'User name to sign in.'
|
25
|
+
# password: 'No special characters, please.'
|
26
|
+
|
data/config/routes.rb
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# Routes for admin interface
|
2
|
+
Cardboard::Engine.routes.draw do
|
3
|
+
|
4
|
+
get "my_account", to: "my_account#edit"
|
5
|
+
patch "my_account", to: "my_account#update"
|
6
|
+
|
7
|
+
post "pages/sort", to: "pages#sort"
|
8
|
+
get "pages/:id", to: "pages#edit"
|
9
|
+
resources :pages
|
10
|
+
|
11
|
+
get "/yoda", to: "super_user#index"
|
12
|
+
|
13
|
+
get "/settings", to: "settings#index"
|
14
|
+
patch "/settings/update", to: "settings#update", as: "setting"
|
15
|
+
|
16
|
+
get "/", to: "dashboard#index", as: "dashboard"
|
17
|
+
#Don't put a root path here, use "/" instead... (to be able to use root_path in the pages)
|
18
|
+
|
19
|
+
|
20
|
+
scope as: 'cardboard' do
|
21
|
+
#generate routes for custom cardboard resources controllers
|
22
|
+
Cardboard.resource_controllers.map{|x|x.controller_name}.each do |controller|
|
23
|
+
if controller.singularize == controller && controller.pluralize != controller
|
24
|
+
resource controller #singular controller
|
25
|
+
else
|
26
|
+
resources controller
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
# Routes for public pages
|
34
|
+
Rails.application.routes.draw do
|
35
|
+
scope :constraints => { :format => 'html' } do #:format => true,
|
36
|
+
get "*id", to: "pages#show"
|
37
|
+
end
|
38
|
+
|
39
|
+
root :to => "pages#show" unless @set.named_routes.routes[:root] #has_named_route?
|
40
|
+
end
|
41
|
+
|
42
|
+
|
43
|
+
Rails.application.routes.named_routes.module.module_eval do
|
44
|
+
def page_path(identifier, options = {})
|
45
|
+
url = Cardboard::Page.where(identifier: identifier.to_s).first.try(:url)
|
46
|
+
options.present? && url ? "#{url}?#{options.to_query}" : url
|
47
|
+
end
|
48
|
+
|
49
|
+
def page_url(identifier, options = {})
|
50
|
+
return nil unless url = page_path(identifier, options)
|
51
|
+
root_url + url[1..-1]
|
52
|
+
end
|
53
|
+
end
|
Binary file
|
@@ -0,0 +1,190 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<title>Cardboard</title>
|
7
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
8
|
+
<link rel="stylesheet" href="../css/reset.css" type="text/css" media="screen" />
|
9
|
+
<link rel="stylesheet" href="../css/main.css" type="text/css" media="screen" />
|
10
|
+
<link rel="stylesheet" href="../css/github.css" type="text/css" media="screen" />
|
11
|
+
<script src="../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
|
12
|
+
<script src="../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
<script src="../js/main.js" type="text/javascript" charset="utf-8"></script>
|
14
|
+
<script src="../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>
|
15
|
+
|
16
|
+
</head>
|
17
|
+
|
18
|
+
<body>
|
19
|
+
<div class="banner">
|
20
|
+
|
21
|
+
<h1>
|
22
|
+
<span class="type">Module</span>
|
23
|
+
Cardboard
|
24
|
+
|
25
|
+
</h1>
|
26
|
+
<ul class="files">
|
27
|
+
|
28
|
+
<li><a href="../files/app/controllers/cardboard/application_controller_rb.html">app/controllers/cardboard/application_controller.rb</a></li>
|
29
|
+
|
30
|
+
<li><a href="../files/app/controllers/cardboard/dashboard_controller_rb.html">app/controllers/cardboard/dashboard_controller.rb</a></li>
|
31
|
+
|
32
|
+
<li><a href="../files/app/controllers/cardboard/pages_controller_rb.html">app/controllers/cardboard/pages_controller.rb</a></li>
|
33
|
+
|
34
|
+
<li><a href="../files/app/controllers/cardboard/settings_controller_rb.html">app/controllers/cardboard/settings_controller.rb</a></li>
|
35
|
+
|
36
|
+
<li><a href="../files/app/controllers/cardboard/super_user_controller_rb.html">app/controllers/cardboard/super_user_controller.rb</a></li>
|
37
|
+
|
38
|
+
<li><a href="../files/app/controllers/cardboard/users_controller_rb.html">app/controllers/cardboard/users_controller.rb</a></li>
|
39
|
+
|
40
|
+
<li><a href="../files/app/helpers/cardboard/admin_helper_rb.html">app/helpers/cardboard/admin_helper.rb</a></li>
|
41
|
+
|
42
|
+
<li><a href="../files/app/helpers/cardboard/application_helper_rb.html">app/helpers/cardboard/application_helper.rb</a></li>
|
43
|
+
|
44
|
+
<li><a href="../files/app/helpers/cardboard/public_helper_rb.html">app/helpers/cardboard/public_helper.rb</a></li>
|
45
|
+
|
46
|
+
<li><a href="../files/app/models/cardboard/field/boolean_rb.html">app/models/cardboard/field/boolean.rb</a></li>
|
47
|
+
|
48
|
+
<li><a href="../files/app/models/cardboard/field/date_rb.html">app/models/cardboard/field/date.rb</a></li>
|
49
|
+
|
50
|
+
<li><a href="../files/app/models/cardboard/field/decimal_rb.html">app/models/cardboard/field/decimal.rb</a></li>
|
51
|
+
|
52
|
+
<li><a href="../files/app/models/cardboard/field/external_link_rb.html">app/models/cardboard/field/external_link.rb</a></li>
|
53
|
+
|
54
|
+
<li><a href="../files/app/models/cardboard/field/file_rb.html">app/models/cardboard/field/file.rb</a></li>
|
55
|
+
|
56
|
+
<li><a href="../files/app/models/cardboard/field/image_rb.html">app/models/cardboard/field/image.rb</a></li>
|
57
|
+
|
58
|
+
<li><a href="../files/app/models/cardboard/field/integer_rb.html">app/models/cardboard/field/integer.rb</a></li>
|
59
|
+
|
60
|
+
<li><a href="../files/app/models/cardboard/field/resource_link_rb.html">app/models/cardboard/field/resource_link.rb</a></li>
|
61
|
+
|
62
|
+
<li><a href="../files/app/models/cardboard/field/rich_text_rb.html">app/models/cardboard/field/rich_text.rb</a></li>
|
63
|
+
|
64
|
+
<li><a href="../files/app/models/cardboard/field/string_rb.html">app/models/cardboard/field/string.rb</a></li>
|
65
|
+
|
66
|
+
<li><a href="../files/app/models/cardboard/field_rb.html">app/models/cardboard/field.rb</a></li>
|
67
|
+
|
68
|
+
<li><a href="../files/app/models/cardboard/page_rb.html">app/models/cardboard/page.rb</a></li>
|
69
|
+
|
70
|
+
<li><a href="../files/app/models/cardboard/page_part_rb.html">app/models/cardboard/page_part.rb</a></li>
|
71
|
+
|
72
|
+
<li><a href="../files/app/models/cardboard/setting_rb.html">app/models/cardboard/setting.rb</a></li>
|
73
|
+
|
74
|
+
</ul>
|
75
|
+
</div>
|
76
|
+
<div id="bodyContent">
|
77
|
+
<div id="content">
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
<!-- Namespace -->
|
90
|
+
<div class="sectiontitle">Namespace</div>
|
91
|
+
<ul>
|
92
|
+
|
93
|
+
<li>
|
94
|
+
<span class="type">MODULE</span>
|
95
|
+
<a href="Cardboard/AdminHelper.html">Cardboard::AdminHelper</a>
|
96
|
+
</li>
|
97
|
+
|
98
|
+
<li>
|
99
|
+
<span class="type">MODULE</span>
|
100
|
+
<a href="Cardboard/ApplicationHelper.html">Cardboard::ApplicationHelper</a>
|
101
|
+
</li>
|
102
|
+
|
103
|
+
<li>
|
104
|
+
<span class="type">MODULE</span>
|
105
|
+
<a href="Cardboard/PublicHelper.html">Cardboard::PublicHelper</a>
|
106
|
+
</li>
|
107
|
+
|
108
|
+
<li>
|
109
|
+
<span class="type">CLASS</span>
|
110
|
+
<a href="Cardboard/AdminController.html">Cardboard::AdminController</a>
|
111
|
+
</li>
|
112
|
+
|
113
|
+
<li>
|
114
|
+
<span class="type">CLASS</span>
|
115
|
+
<a href="Cardboard/ApplicationController.html">Cardboard::ApplicationController</a>
|
116
|
+
</li>
|
117
|
+
|
118
|
+
<li>
|
119
|
+
<span class="type">CLASS</span>
|
120
|
+
<a href="Cardboard/DashboardController.html">Cardboard::DashboardController</a>
|
121
|
+
</li>
|
122
|
+
|
123
|
+
<li>
|
124
|
+
<span class="type">CLASS</span>
|
125
|
+
<a href="Cardboard/Field.html">Cardboard::Field</a>
|
126
|
+
</li>
|
127
|
+
|
128
|
+
<li>
|
129
|
+
<span class="type">CLASS</span>
|
130
|
+
<a href="Cardboard/Page.html">Cardboard::Page</a>
|
131
|
+
</li>
|
132
|
+
|
133
|
+
<li>
|
134
|
+
<span class="type">CLASS</span>
|
135
|
+
<a href="Cardboard/PagePart.html">Cardboard::PagePart</a>
|
136
|
+
</li>
|
137
|
+
|
138
|
+
<li>
|
139
|
+
<span class="type">CLASS</span>
|
140
|
+
<a href="Cardboard/PagesController.html">Cardboard::PagesController</a>
|
141
|
+
</li>
|
142
|
+
|
143
|
+
<li>
|
144
|
+
<span class="type">CLASS</span>
|
145
|
+
<a href="Cardboard/Setting.html">Cardboard::Setting</a>
|
146
|
+
</li>
|
147
|
+
|
148
|
+
<li>
|
149
|
+
<span class="type">CLASS</span>
|
150
|
+
<a href="Cardboard/SettingsController.html">Cardboard::SettingsController</a>
|
151
|
+
</li>
|
152
|
+
|
153
|
+
<li>
|
154
|
+
<span class="type">CLASS</span>
|
155
|
+
<a href="Cardboard/SuperUserController.html">Cardboard::SuperUserController</a>
|
156
|
+
</li>
|
157
|
+
|
158
|
+
<li>
|
159
|
+
<span class="type">CLASS</span>
|
160
|
+
<a href="Cardboard/UsersController.html">Cardboard::UsersController</a>
|
161
|
+
</li>
|
162
|
+
|
163
|
+
</ul>
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
<!-- Methods -->
|
186
|
+
</div>
|
187
|
+
|
188
|
+
</div>
|
189
|
+
</body>
|
190
|
+
</html>
|
@@ -0,0 +1,134 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<title>Cardboard::AdminController</title>
|
7
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
8
|
+
<link rel="stylesheet" href="../../css/reset.css" type="text/css" media="screen" />
|
9
|
+
<link rel="stylesheet" href="../../css/main.css" type="text/css" media="screen" />
|
10
|
+
<link rel="stylesheet" href="../../css/github.css" type="text/css" media="screen" />
|
11
|
+
<script src="../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
|
12
|
+
<script src="../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
<script src="../../js/main.js" type="text/javascript" charset="utf-8"></script>
|
14
|
+
<script src="../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>
|
15
|
+
|
16
|
+
</head>
|
17
|
+
|
18
|
+
<body>
|
19
|
+
<div class="banner">
|
20
|
+
|
21
|
+
<h1>
|
22
|
+
<span class="type">Class</span>
|
23
|
+
Cardboard::AdminController
|
24
|
+
|
25
|
+
<span class="parent"><
|
26
|
+
|
27
|
+
<a href="ApplicationController.html">Cardboard::ApplicationController</a>
|
28
|
+
|
29
|
+
</span>
|
30
|
+
|
31
|
+
</h1>
|
32
|
+
<ul class="files">
|
33
|
+
|
34
|
+
<li><a href="../../files/app/controllers/cardboard/admin_controller_rb.html">app/controllers/cardboard/admin_controller.rb</a></li>
|
35
|
+
|
36
|
+
</ul>
|
37
|
+
</div>
|
38
|
+
<div id="bodyContent">
|
39
|
+
<div id="content">
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
<!-- Method ref -->
|
55
|
+
<div class="sectiontitle">Methods</div>
|
56
|
+
<dl class="methods">
|
57
|
+
|
58
|
+
<dt>C</dt>
|
59
|
+
<dd>
|
60
|
+
<ul>
|
61
|
+
|
62
|
+
|
63
|
+
<li>
|
64
|
+
<a href="#method-i-collection">collection</a>
|
65
|
+
</li>
|
66
|
+
|
67
|
+
</ul>
|
68
|
+
</dd>
|
69
|
+
|
70
|
+
</dl>
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
<!-- Methods -->
|
90
|
+
|
91
|
+
<div class="sectiontitle">Instance Public methods</div>
|
92
|
+
|
93
|
+
<div class="method">
|
94
|
+
<div class="title method-title" id="method-i-collection">
|
95
|
+
|
96
|
+
<b>collection</b>()
|
97
|
+
|
98
|
+
<a href="../../classes/Cardboard/AdminController.html#method-i-collection" name="method-i-collection" class="permalink">Link</a>
|
99
|
+
</div>
|
100
|
+
|
101
|
+
|
102
|
+
<div class="description">
|
103
|
+
|
104
|
+
</div>
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
<div class="sourcecode">
|
112
|
+
|
113
|
+
<p class="source-link">
|
114
|
+
Source:
|
115
|
+
<a href="javascript:toggleSource('method-i-collection_source')" id="l_method-i-collection_source">show</a>
|
116
|
+
|
117
|
+
</p>
|
118
|
+
<div id="method-i-collection_source" class="dyn-source">
|
119
|
+
<pre><span class="ruby-comment"># File app/controllers/cardboard/admin_controller.rb, line 10</span>
|
120
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">collection</span>
|
121
|
+
<span class="ruby-ivar">@q</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">end_of_association_chain</span>.<span class="ruby-identifier">search</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:q</span>])
|
122
|
+
<span class="ruby-identifier">get_collection_ivar</span> <span class="ruby-operator">||</span> <span class="ruby-keyword">begin</span>
|
123
|
+
<span class="ruby-identifier">set_collection_ivar</span>((<span class="ruby-ivar">@q</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:scoped</span>) <span class="ruby-operator">?</span> <span class="ruby-ivar">@q</span>.<span class="ruby-identifier">scoped</span>.<span class="ruby-identifier">result</span>(<span class="ruby-value">:distinct</span> =<span class="ruby-operator">></span> <span class="ruby-keyword">true</span>) <span class="ruby-operator">:</span> <span class="ruby-ivar">@q</span>.<span class="ruby-identifier">result</span>(<span class="ruby-value">:distinct</span> =<span class="ruby-operator">></span> <span class="ruby-keyword">true</span>)).<span class="ruby-identifier">page</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:page</span>]))
|
124
|
+
<span class="ruby-keyword">end</span>
|
125
|
+
<span class="ruby-keyword">end</span></pre>
|
126
|
+
</div>
|
127
|
+
</div>
|
128
|
+
|
129
|
+
</div>
|
130
|
+
</div>
|
131
|
+
|
132
|
+
</div>
|
133
|
+
</body>
|
134
|
+
</html>
|
@@ -0,0 +1,307 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<title>Cardboard::AdminHelper</title>
|
7
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
8
|
+
<link rel="stylesheet" href="../../css/reset.css" type="text/css" media="screen" />
|
9
|
+
<link rel="stylesheet" href="../../css/main.css" type="text/css" media="screen" />
|
10
|
+
<link rel="stylesheet" href="../../css/github.css" type="text/css" media="screen" />
|
11
|
+
<script src="../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
|
12
|
+
<script src="../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
<script src="../../js/main.js" type="text/javascript" charset="utf-8"></script>
|
14
|
+
<script src="../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>
|
15
|
+
|
16
|
+
</head>
|
17
|
+
|
18
|
+
<body>
|
19
|
+
<div class="banner">
|
20
|
+
|
21
|
+
<h1>
|
22
|
+
<span class="type">Module</span>
|
23
|
+
Cardboard::AdminHelper
|
24
|
+
|
25
|
+
</h1>
|
26
|
+
<ul class="files">
|
27
|
+
|
28
|
+
<li><a href="../../files/app/helpers/cardboard/admin_helper_rb.html">app/helpers/cardboard/admin_helper.rb</a></li>
|
29
|
+
|
30
|
+
</ul>
|
31
|
+
</div>
|
32
|
+
<div id="bodyContent">
|
33
|
+
<div id="content">
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
<!-- Method ref -->
|
49
|
+
<div class="sectiontitle">Methods</div>
|
50
|
+
<dl class="methods">
|
51
|
+
|
52
|
+
<dt>C</dt>
|
53
|
+
<dd>
|
54
|
+
<ul>
|
55
|
+
|
56
|
+
|
57
|
+
<li>
|
58
|
+
<a href="#method-i-cardboard_filters">cardboard_filters</a>
|
59
|
+
</li>
|
60
|
+
|
61
|
+
</ul>
|
62
|
+
</dd>
|
63
|
+
|
64
|
+
<dt>L</dt>
|
65
|
+
<dd>
|
66
|
+
<ul>
|
67
|
+
|
68
|
+
|
69
|
+
<li>
|
70
|
+
<a href="#method-i-l">l</a>
|
71
|
+
</li>
|
72
|
+
|
73
|
+
</ul>
|
74
|
+
</dd>
|
75
|
+
|
76
|
+
<dt>M</dt>
|
77
|
+
<dd>
|
78
|
+
<ul>
|
79
|
+
|
80
|
+
|
81
|
+
<li>
|
82
|
+
<a href="#method-i-main_sidebar_nav_link">main_sidebar_nav_link</a>
|
83
|
+
</li>
|
84
|
+
|
85
|
+
</ul>
|
86
|
+
</dd>
|
87
|
+
|
88
|
+
<dt>R</dt>
|
89
|
+
<dd>
|
90
|
+
<ul>
|
91
|
+
|
92
|
+
|
93
|
+
<li>
|
94
|
+
<a href="#method-i-ransack_options">ransack_options</a>
|
95
|
+
</li>
|
96
|
+
|
97
|
+
</ul>
|
98
|
+
</dd>
|
99
|
+
|
100
|
+
</dl>
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
<!-- Methods -->
|
120
|
+
|
121
|
+
<div class="sectiontitle">Instance Public methods</div>
|
122
|
+
|
123
|
+
<div class="method">
|
124
|
+
<div class="title method-title" id="method-i-cardboard_filters">
|
125
|
+
|
126
|
+
<b>cardboard_filters</b>(model, main_element, options={})
|
127
|
+
|
128
|
+
<a href="../../classes/Cardboard/AdminHelper.html#method-i-cardboard_filters" name="method-i-cardboard_filters" class="permalink">Link</a>
|
129
|
+
</div>
|
130
|
+
|
131
|
+
|
132
|
+
<div class="description">
|
133
|
+
<pre class="ruby"><span class="ruby-string">"q"</span>=<span class="ruby-operator">></span>
|
134
|
+
</pre>
|
135
|
+
|
136
|
+
<p>{“id_lt”=>“1”,</p>
|
137
|
+
|
138
|
+
<pre class="ruby"><span class="ruby-string">"id_gteq"</span>=<span class="ruby-operator">></span><span class="ruby-string">"1"</span>,
|
139
|
+
<span class="ruby-string">"color_cont"</span>=<span class="ruby-operator">></span><span class="ruby-string">"1"</span>,
|
140
|
+
<span class="ruby-string">"flavor_cont"</span>=<span class="ruby-operator">></span><span class="ruby-string">""</span>,
|
141
|
+
<span class="ruby-string">"size_lt"</span>=<span class="ruby-operator">></span><span class="ruby-string">""</span>,
|
142
|
+
<span class="ruby-string">"size_gteq"</span>=<span class="ruby-operator">></span><span class="ruby-string">""</span>,
|
143
|
+
<span class="ruby-string">"created_at_lt"</span>=<span class="ruby-operator">></span><span class="ruby-string">""</span>,
|
144
|
+
<span class="ruby-string">"created_at_gteq"</span>=<span class="ruby-operator">></span><span class="ruby-string">""</span>,
|
145
|
+
<span class="ruby-string">"updated_at_lt"</span>=<span class="ruby-operator">></span><span class="ruby-string">""</span>,
|
146
|
+
<span class="ruby-string">"updated_at_gteq"</span>=<span class="ruby-operator">></span><span class="ruby-string">""</span>},
|
147
|
+
</pre>
|
148
|
+
</div>
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
<div class="sourcecode">
|
156
|
+
|
157
|
+
<p class="source-link">
|
158
|
+
Source:
|
159
|
+
<a href="javascript:toggleSource('method-i-cardboard_filters_source')" id="l_method-i-cardboard_filters_source">show</a>
|
160
|
+
|
161
|
+
</p>
|
162
|
+
<div id="method-i-cardboard_filters_source" class="dyn-source">
|
163
|
+
<pre><span class="ruby-comment"># File app/helpers/cardboard/admin_helper.rb, line 43</span>
|
164
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">cardboard_filters</span>(<span class="ruby-identifier">model</span>, <span class="ruby-identifier">main_element</span>, <span class="ruby-identifier">options</span>={})
|
165
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-string">"First argument needs to be a class"</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">model</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Class</span>
|
166
|
+
|
167
|
+
<span class="ruby-identifier">elements</span> = <span class="ruby-identifier">model</span>.<span class="ruby-identifier">columns</span>.<span class="ruby-identifier">inject</span>([]) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">a</span>, <span class="ruby-identifier">column</span><span class="ruby-operator">|</span>
|
168
|
+
<span class="ruby-identifier">name</span> = <span class="ruby-identifier">column</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_sym</span>
|
169
|
+
<span class="ruby-identifier">type</span> = <span class="ruby-identifier">column</span>.<span class="ruby-identifier">type</span>.<span class="ruby-identifier">to_sym</span>
|
170
|
+
<span class="ruby-identifier">a</span> <span class="ruby-operator"><<</span> [<span class="ruby-identifier">name</span>, <span class="ruby-identifier">type</span>] <span class="ruby-keyword">if</span> (<span class="ruby-identifier">options</span>[<span class="ruby-value">:fields</span>].<span class="ruby-identifier">blank?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:fields</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">name</span>)) <span class="ruby-comment">#&& name != main_element.to_sym</span>
|
171
|
+
<span class="ruby-identifier">a</span>
|
172
|
+
<span class="ruby-keyword">end</span>
|
173
|
+
|
174
|
+
<span class="ruby-identifier">elements</span> <span class="ruby-operator">|=</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:associated_fields</span>] <span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:associated_fields</span>].<span class="ruby-identifier">present?</span>
|
175
|
+
|
176
|
+
<span class="ruby-identifier">render</span> <span class="ruby-string">"cardboard/resources/search_helper"</span>, <span class="ruby-identifier">model</span><span class="ruby-operator">:</span> <span class="ruby-identifier">model</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">demodulize</span>.<span class="ruby-identifier">underscore</span>, <span class="ruby-identifier">elements</span><span class="ruby-operator">:</span> <span class="ruby-identifier">elements</span>, <span class="ruby-identifier">options</span><span class="ruby-operator">:</span> <span class="ruby-identifier">options</span>, <span class="ruby-identifier">main_element</span><span class="ruby-operator">:</span> <span class="ruby-identifier">main_element</span>
|
177
|
+
<span class="ruby-keyword">end</span></pre>
|
178
|
+
</div>
|
179
|
+
</div>
|
180
|
+
|
181
|
+
</div>
|
182
|
+
|
183
|
+
<div class="method">
|
184
|
+
<div class="title method-title" id="method-i-l">
|
185
|
+
|
186
|
+
<b>l</b>(val, options = {})
|
187
|
+
|
188
|
+
<a href="../../classes/Cardboard/AdminHelper.html#method-i-l" name="method-i-l" class="permalink">Link</a>
|
189
|
+
</div>
|
190
|
+
|
191
|
+
|
192
|
+
<div class="description">
|
193
|
+
|
194
|
+
</div>
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
<div class="sourcecode">
|
202
|
+
|
203
|
+
<p class="source-link">
|
204
|
+
Source:
|
205
|
+
<a href="javascript:toggleSource('method-i-l_source')" id="l_method-i-l_source">show</a>
|
206
|
+
|
207
|
+
</p>
|
208
|
+
<div id="method-i-l_source" class="dyn-source">
|
209
|
+
<pre><span class="ruby-comment"># File app/helpers/cardboard/admin_helper.rb, line 4</span>
|
210
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">l</span>(<span class="ruby-identifier">val</span>, <span class="ruby-identifier">options</span> = {})
|
211
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">val</span>.<span class="ruby-identifier">blank?</span>
|
212
|
+
<span class="ruby-identifier">val</span> = <span class="ruby-identifier">val</span>.<span class="ruby-identifier">to_date</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">val</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">String</span>
|
213
|
+
<span class="ruby-keyword">super</span>(<span class="ruby-identifier">val</span>, <span class="ruby-identifier">options</span>)
|
214
|
+
<span class="ruby-keyword">end</span></pre>
|
215
|
+
</div>
|
216
|
+
</div>
|
217
|
+
|
218
|
+
</div>
|
219
|
+
|
220
|
+
<div class="method">
|
221
|
+
<div class="title method-title" id="method-i-main_sidebar_nav_link">
|
222
|
+
|
223
|
+
<b>main_sidebar_nav_link</b>(text, link, options={})
|
224
|
+
|
225
|
+
<a href="../../classes/Cardboard/AdminHelper.html#method-i-main_sidebar_nav_link" name="method-i-main_sidebar_nav_link" class="permalink">Link</a>
|
226
|
+
</div>
|
227
|
+
|
228
|
+
|
229
|
+
<div class="description">
|
230
|
+
<p>.item</p>
|
231
|
+
|
232
|
+
<pre>= link_to dashboard_path, id:"nav_dashboard_link" do
|
233
|
+
i.icon-dashboard
|
234
|
+
span Dashboard</pre>
|
235
|
+
</div>
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
<div class="sourcecode">
|
243
|
+
|
244
|
+
<p class="source-link">
|
245
|
+
Source:
|
246
|
+
<a href="javascript:toggleSource('method-i-main_sidebar_nav_link_source')" id="l_method-i-main_sidebar_nav_link_source">show</a>
|
247
|
+
|
248
|
+
</p>
|
249
|
+
<div id="method-i-main_sidebar_nav_link_source" class="dyn-source">
|
250
|
+
<pre><span class="ruby-comment"># File app/helpers/cardboard/admin_helper.rb, line 22</span>
|
251
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">main_sidebar_nav_link</span>(<span class="ruby-identifier">text</span>, <span class="ruby-identifier">link</span>, <span class="ruby-identifier">options</span>={})
|
252
|
+
<span class="ruby-identifier">icon</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:icon</span>)
|
253
|
+
<span class="ruby-identifier">options</span>[<span class="ruby-value">:class</span>] = <span class="ruby-node">"#{options[:class]} active"</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">path</span>[<span class="ruby-node">"#{link}/"</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">path</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">link</span>
|
254
|
+
<span class="ruby-identifier">out</span> = <span class="ruby-identifier">content_tag</span>(<span class="ruby-value">:div</span>, <span class="ruby-identifier">class</span><span class="ruby-value">:"item"</span>) <span class="ruby-keyword">do</span>
|
255
|
+
<span class="ruby-identifier">link_to</span>(<span class="ruby-node">"<i class='#{icon}'></i><span>#{text}</span>"</span>.<span class="ruby-identifier">html_safe</span>, <span class="ruby-identifier">link</span>, <span class="ruby-identifier">options</span>)
|
256
|
+
<span class="ruby-keyword">end</span>
|
257
|
+
<span class="ruby-identifier">out</span>.<span class="ruby-identifier">html_safe</span>
|
258
|
+
<span class="ruby-keyword">end</span></pre>
|
259
|
+
</div>
|
260
|
+
</div>
|
261
|
+
|
262
|
+
</div>
|
263
|
+
|
264
|
+
<div class="method">
|
265
|
+
<div class="title method-title" id="method-i-ransack_options">
|
266
|
+
|
267
|
+
<b>ransack_options</b>()
|
268
|
+
|
269
|
+
<a href="../../classes/Cardboard/AdminHelper.html#method-i-ransack_options" name="method-i-ransack_options" class="permalink">Link</a>
|
270
|
+
</div>
|
271
|
+
|
272
|
+
|
273
|
+
<div class="description">
|
274
|
+
|
275
|
+
</div>
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
<div class="sourcecode">
|
283
|
+
|
284
|
+
<p class="source-link">
|
285
|
+
Source:
|
286
|
+
<a href="javascript:toggleSource('method-i-ransack_options_source')" id="l_method-i-ransack_options_source">show</a>
|
287
|
+
|
288
|
+
</p>
|
289
|
+
<div id="method-i-ransack_options_source" class="dyn-source">
|
290
|
+
<pre><span class="ruby-comment"># File app/helpers/cardboard/admin_helper.rb, line 59</span>
|
291
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">ransack_options</span>
|
292
|
+
{
|
293
|
+
<span class="ruby-identifier">string</span><span class="ruby-operator">:</span> [[<span class="ruby-string">"Contains"</span>,<span class="ruby-string">"cont"</span>],[<span class="ruby-string">"Does not contain"</span>,<span class="ruby-string">"not_cont"</span>], [<span class="ruby-string">"Starts with"</span>,<span class="ruby-string">"start"</span>], [<span class="ruby-string">"Ends with"</span>,<span class="ruby-string">"end"</span>]],
|
294
|
+
<span class="ruby-identifier">datetime</span><span class="ruby-operator">:</span> [[<span class="ruby-string">"On"</span>,<span class="ruby-string">"eq"</span>],[<span class="ruby-string">"Before"</span>,<span class="ruby-string">"lt"</span>],[<span class="ruby-string">"After"</span>,<span class="ruby-string">"gt"</span>]],
|
295
|
+
<span class="ruby-identifier">integer</span><span class="ruby-operator">:</span> [[<span class="ruby-string">"Greater than"</span>,<span class="ruby-string">"gt"</span>],[<span class="ruby-string">"Equals"</span>,<span class="ruby-string">"eq"</span>],[<span class="ruby-string">"Less than"</span>,<span class="ruby-string">"lt"</span>]],
|
296
|
+
<span class="ruby-identifier">boolean</span><span class="ruby-operator">:</span> [[<span class="ruby-string">"is False"</span>,<span class="ruby-string">"blank"</span>],[<span class="ruby-string">"is True"</span>,<span class="ruby-string">"true"</span>]]
|
297
|
+
}
|
298
|
+
<span class="ruby-keyword">end</span></pre>
|
299
|
+
</div>
|
300
|
+
</div>
|
301
|
+
|
302
|
+
</div>
|
303
|
+
</div>
|
304
|
+
|
305
|
+
</div>
|
306
|
+
</body>
|
307
|
+
</html>
|