atrium 0.0.1 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +9 -1
- data/.rspec +2 -0
- data/.rvmrc +1 -1
- data/CONTRIBUTING.md +73 -0
- data/Gemfile +27 -2
- data/Gemfile.lock +122 -246
- data/Guardfile +40 -10
- data/LICENSE +14 -0
- data/README.mkd +23 -39
- data/ROADMAP.mkd +41 -9
- data/Rakefile +39 -4
- data/app/assets/images/atrium/remove.png +0 -0
- data/app/assets/images/atrium/white-arrow.png +0 -0
- data/app/assets/javascripts/{atrium/atrium.js → atrium.js} +8 -153
- data/app/assets/stylesheets/{atrium/atrium.css → atrium.css} +110 -37
- data/app/assets/stylesheets/atrium/collections.css +4 -0
- data/app/assets/stylesheets/atrium/descriptions.css +4 -0
- data/app/assets/stylesheets/atrium/exhibits.css +4 -0
- data/app/assets/stylesheets/atrium/reset.css +69 -0
- data/app/assets/stylesheets/atrium/showcases.css +4 -0
- data/app/assets/stylesheets/atrium/theme.css +248 -0
- data/app/controllers/atrium/application_controller.rb +12 -0
- data/app/controllers/atrium/browse_levels_controller.rb +22 -0
- data/app/controllers/atrium/collections_controller.rb +42 -138
- data/app/controllers/atrium/descriptions_controller.rb +27 -146
- data/app/controllers/atrium/exhibits_controller.rb +51 -77
- data/app/controllers/atrium/order_controller.rb +74 -0
- data/app/controllers/atrium/showcases_controller.rb +96 -117
- data/app/helpers/atrium/application_helper.rb +8 -0
- data/app/helpers/atrium/collections_helper.rb +44 -0
- data/app/helpers/atrium/descriptions_helper.rb +4 -0
- data/app/helpers/atrium/exhibits_helper.rb +4 -0
- data/app/helpers/atrium/showcases_helper.rb +34 -0
- data/app/models/atrium/browse_level.rb +21 -11
- data/app/models/atrium/collection.rb +70 -36
- data/app/models/atrium/configuration.rb +66 -0
- data/app/models/atrium/description.rb +39 -88
- data/app/models/atrium/essay.rb +4 -5
- data/app/models/atrium/exhibit.rb +28 -19
- data/app/models/atrium/is_showcased_mixin.rb +34 -0
- data/app/models/atrium/query_param_mixin.rb +105 -0
- data/app/models/atrium/search/facet.rb +14 -25
- data/app/models/atrium/search/facet_selection.rb +10 -12
- data/app/models/atrium/showcase.rb +105 -95
- data/app/models/atrium/showcase/facet_selection.rb +18 -18
- data/app/models/atrium/showcase/featured_selection.rb +15 -0
- data/app/services/browse_level_evaluation_service.rb +131 -0
- data/app/services/current_filter_query_params_extraction_service.rb +91 -0
- data/app/services/navigation_tree.rb +13 -0
- data/app/services/params_adaptor_for_filter.rb +18 -0
- data/app/views/atrium/collections/_form.html.erb +149 -72
- data/app/views/atrium/collections/_head.html.erb +3 -0
- data/app/views/atrium/collections/edit.html.erb +1 -4
- data/app/views/atrium/collections/index.html.erb +14 -0
- data/app/views/atrium/collections/new.html.erb +2 -5
- data/app/views/atrium/collections/show.html.erb +11 -29
- data/app/views/atrium/descriptions/_form.html.erb +47 -49
- data/app/views/atrium/descriptions/edit.html.erb +1 -2
- data/app/views/atrium/descriptions/index.html.erb +2 -8
- data/app/views/atrium/descriptions/new.html.erb +2 -1
- data/app/views/atrium/descriptions/show.html.erb +2 -20
- data/app/views/atrium/exhibits/_exhibit.html.erb +1 -0
- data/app/views/atrium/exhibits/_form.html.erb +143 -96
- data/app/views/atrium/exhibits/edit.html.erb +1 -8
- data/app/views/atrium/exhibits/index.html.erb +2 -0
- data/app/views/atrium/exhibits/new.html.erb +0 -5
- data/app/views/atrium/exhibits/show.html.erb +2 -34
- data/app/views/atrium/showcases/_configure_menu.html.erb +55 -0
- data/app/views/atrium/showcases/_form.html.erb +40 -0
- data/app/views/atrium/showcases/edit.html.erb +3 -0
- data/app/views/atrium/showcases/index.html.erb +32 -0
- data/app/views/atrium/showcases/new.html.erb +3 -0
- data/app/views/atrium/showcases/show.html.erb +2 -1
- data/app/views/layouts/atrium.html.erb +16 -24
- data/app/views/layouts/atrium/application.html.erb +49 -0
- data/app/views/layouts/atrium/themes/default.html.erb +15 -0
- data/app/views/shared/_list_searchs.html.erb +4 -0
- data/app/views/shared/_navigation.html.erb +19 -0
- data/atrium.gemspec +31 -64
- data/config/routes.rb +40 -10
- data/{lib/generators/atrium/templates/migrations/create_atrium_collections.rb → db/migrate/20120730170406_create_atrium_collections.rb} +2 -1
- data/{lib/generators/atrium/templates/migrations/create_atrium_showcases.rb → db/migrate/20120731134846_create_atrium_showcases.rb} +3 -4
- data/{lib/generators/atrium/templates/migrations/create_atrium_exhibits.rb → db/migrate/20120731134856_create_atrium_exhibits.rb} +2 -1
- data/{lib/generators/atrium/templates/migrations/create_atrium_descriptions.rb → db/migrate/20120731134904_create_atrium_descriptions.rb} +2 -1
- data/{lib/generators/atrium/templates/migrations/create_atrium_essays.rb → db/migrate/20120731135534_create_atrium_essays.rb} +3 -2
- data/{lib/generators/atrium/templates/migrations/create_atrium_search_facets.rb → db/migrate/20120731135721_create_atrium_search_facets.rb} +1 -1
- data/{lib/generators/atrium/templates/migrations/create_atrium_showcase_facet_selections.rb → db/migrate/20120731140621_create_atrium_showcase_facet_selections.rb} +6 -2
- data/{lib/generators/atrium/templates/migrations/create_atrium_browse_levels.rb → db/migrate/20120801145241_create_atrium_browse_levels.rb} +1 -1
- data/db/migrate/20120820183808_create_selected_items.rb +16 -0
- data/db/migrate/20120823135716_update_atrium_collection_indices.rb +13 -0
- data/db/migrate/20120823143315_add_lookup_indices_as_required.rb +11 -0
- data/lib/atrium.rb +40 -36
- data/lib/atrium/engine.rb +4 -8
- data/lib/atrium/exceptions.rb +10 -0
- data/lib/atrium/version.rb +2 -2
- data/lib/generators/atrium/install/USAGE +8 -0
- data/lib/generators/atrium/install/install_generator.rb +86 -0
- data/lib/generators/atrium/install/templates/atrium_initializer.rb +21 -0
- data/lib/generators/atrium/install/templates/controllers/atrium_base_controller.rb +18 -0
- data/lib/generators/atrium/install/templates/controllers/collections_controller.rb +40 -0
- data/lib/generators/atrium/install/templates/controllers/descriptions_controller.rb +36 -0
- data/lib/generators/atrium/install/templates/controllers/exhibits_controller.rb +47 -0
- data/lib/generators/atrium/install/templates/controllers/selected_items_controller.rb +26 -0
- data/lib/generators/atrium/install/templates/helpers/application_helper.rb +42 -0
- data/lib/generators/atrium/install/templates/helpers/collections_helper.rb +15 -0
- data/lib/generators/atrium/install/templates/helpers/navigation_helper.rb +62 -0
- data/lib/generators/atrium/install/templates/helpers/solr_helper.rb +138 -0
- data/lib/generators/atrium/install/templates/models/selected_item.rb +7 -0
- data/lib/generators/atrium/install/templates/views/collections/_document.html.erb +19 -0
- data/lib/generators/atrium/install/templates/views/collections/_exhibits.html.erb +3 -0
- data/lib/generators/atrium/install/templates/views/collections/_pagination.html.erb +6 -0
- data/lib/generators/atrium/install/templates/views/collections/browse.html.erb +16 -0
- data/lib/generators/atrium/install/templates/views/collections/show.html.erb +19 -0
- data/lib/generators/atrium/install/templates/views/descriptions/show.html.erb +8 -0
- data/lib/generators/atrium/install/templates/views/exhibits/_document.html.erb +19 -0
- data/lib/generators/atrium/install/templates/views/exhibits/_pagination.html.erb +6 -0
- data/lib/generators/atrium/install/templates/views/exhibits/show.html.erb +28 -0
- data/lib/generators/atrium/install/templates/views/folder/_selected_items_form.html.erb +8 -0
- data/lib/generators/atrium/install/templates/views/folder/index.html.erb +45 -0
- data/lib/generators/atrium/install/templates/views/shared/_document_list.html.erb +14 -0
- data/lib/generators/atrium/install/templates/views/shared/_featured_sources.html.erb +19 -0
- data/lib/generators/atrium/install/templates/views/shared/_list_descriptions.html.erb +25 -0
- data/lib/generators/atrium/install/templates/views/shared/_masthead.html.erb +19 -0
- data/lib/generators/atrium/install/templates/views/shared/_navigation_browse_level.html.erb +34 -0
- data/lib/generators/atrium/install/templates/views/shared/_showcases.html.erb +12 -0
- data/lib/generators/atrium/install/templates/views/shared/_side_bar_navigation.html.erb +20 -0
- data/lib/generators/atrium/service/USAGE +9 -0
- data/lib/generators/atrium/service/service_generator.rb +16 -0
- data/lib/generators/atrium/service/templates/service.rb.erb +2 -0
- data/lib/generators/atrium/service/templates/service_spec.rb.erb +4 -0
- data/lib/generators/atrium/theme/USAGE +8 -0
- data/lib/generators/atrium/theme/templates/theme.html.erb +14 -0
- data/lib/generators/atrium/theme/theme_generator.rb +11 -0
- data/lib/tasks/atrium_tasks.rake +4 -0
- data/script/rails +10 -0
- data/spec/atrium_spec.rb +10 -0
- data/spec/controllers/atrium/application_controller_spec.rb +7 -0
- data/spec/controllers/atrium/collections_controller_spec.rb +125 -0
- data/spec/controllers/atrium/descriptions_controller_spec.rb +142 -0
- data/spec/controllers/atrium/exhibits_controller_spec.rb +102 -0
- data/spec/controllers/atrium/order_controller_spec.rb +100 -0
- data/spec/controllers/atrium/showcases_controller_spec.rb +217 -0
- data/spec/dummy/README.rdoc +261 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +15 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/mailers/.gitkeep +0 -0
- data/spec/dummy/app/models/.gitkeep +0 -0
- data/spec/dummy/app/models/collection.rb +3 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +59 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +67 -0
- data/spec/dummy/config/environments/test.rb +37 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +4 -0
- data/spec/dummy/db/schema.rb +124 -0
- data/spec/dummy/lib/assets/.gitkeep +0 -0
- data/spec/dummy/log/.gitkeep +0 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/dummy/test/fixtures/collections.yml +11 -0
- data/spec/dummy/test/unit/collection_test.rb +7 -0
- data/spec/factories/atrium_collections.rb +8 -0
- data/spec/factories/atrium_exhibits.rb +9 -0
- data/spec/factories/atrium_search_facets.rb +8 -0
- data/spec/factories/atrium_showcases.rb +25 -0
- data/spec/helpers/atrium/collections_helper_spec.rb +57 -0
- data/spec/helpers/atrium/showcases_helper_spec.rb +56 -0
- data/spec/models/atrium/browse_level_spec.rb +56 -0
- data/spec/models/atrium/collection_spec.rb +76 -0
- data/spec/models/atrium/configuration_spec.rb +114 -0
- data/spec/models/atrium/description_spec.rb +56 -0
- data/spec/models/atrium/essay_spec.rb +16 -0
- data/spec/models/atrium/exhibit_spec.rb +90 -0
- data/spec/models/atrium/search/facet_selection_spec.rb +23 -0
- data/{test_support/spec → spec}/models/atrium/search/facet_spec.rb +2 -4
- data/{test_support/spec → spec}/models/atrium/showcase/facet_selection_spec.rb +5 -5
- data/spec/models/atrium/showcase/featured_selection_spec.rb +18 -0
- data/spec/models/atrium/showcase_spec.rb +97 -0
- data/spec/services/browse_level_evaluation_service_spec.rb +33 -0
- data/spec/services/current_filter_query_params_extraction_service_spec.rb +34 -0
- data/spec/services/navigation_tree_spec.rb +18 -0
- data/spec/services/params_adaptor_for_filter_spec.rb +8 -0
- data/spec/spec_helper.rb +39 -0
- data/spec/support/accept_nested_attributes_for.rb +39 -0
- data/{test_support/spec → spec}/support/be_accessible_matcher.rb +0 -0
- data/{test_support/spec → spec}/support/be_routed_mixin.rb +0 -0
- data/spec/support/controller_hacks.rb +35 -0
- data/spec/support/routes.rb +5 -0
- data/spec/support/shared_examples/is_showcased_mixin.rb +20 -0
- data/spec/support/shared_examples/query_param_mixin.rb +179 -0
- data/{app/assets/stylesheets/atrium → vendor/assets/images}/chosen-sprite.png +0 -0
- data/{app → vendor}/assets/javascripts/chosen.jquery.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor.warning.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/config.js.coffee +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/jquery.generateId.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/jquery.jeditable.ckeditor.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/linkItem/application_link.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/linkItem/dialogs/linkItem.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/linkItem/plugin.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/linkItem/ui_toolbar_pencil.png +0 -0
- data/vendor/assets/javascripts/jquery-ui-1.8.23.custom.min.js +41 -0
- data/vendor/assets/javascripts/jquery-ui-build.txt +8 -0
- data/{app → vendor}/assets/javascripts/jquery.jeditable.js +0 -0
- data/{app/assets/stylesheets/atrium → vendor/assets/stylesheets}/chosen.css +4 -4
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/jquery-ui-1.8.23.custom.css +334 -0
- metadata +431 -949
- data/GETTING_STARTED.textile +0 -102
- data/app/assets/images/atrium/ajax-loader.gif +0 -0
- data/app/assets/images/atrium/lightbox-ico-loading.gif +0 -0
- data/app/assets/images/atrium/logo.png +0 -0
- data/app/assets/javascripts/jquery.colorbox.js +0 -864
- data/app/assets/stylesheets/colorbox.css +0 -42
- data/app/assets/stylesheets/controls.png +0 -0
- data/app/assets/stylesheets/loading.gif +0 -0
- data/app/controllers/atrium/base_controller.rb +0 -25
- data/app/controllers/atrium/collection_exhibit_order_controller.rb +0 -21
- data/app/controllers/atrium/customization_controller.rb +0 -41
- data/app/controllers/atrium/exhibit_facet_order_controller.rb +0 -19
- data/app/helpers/atrium/base_helper.rb +0 -6
- data/app/models/ability.rb +0 -14
- data/app/models/atrium/showcase/item.rb +0 -19
- data/app/models/role_mapper.rb +0 -23
- data/app/views/_user_util_links.html.erb +0 -25
- data/app/views/atrium/collections/_bookmark_control.html.erb +0 -25
- data/app/views/atrium/collections/_browse_index.html.erb +0 -20
- data/app/views/atrium/collections/_collection_items_index.html.erb +0 -10
- data/app/views/atrium/collections/_document.html.erb +0 -24
- data/app/views/atrium/collections/_document_list.html.erb +0 -6
- data/app/views/atrium/collections/_edit_navigation.html.erb +0 -20
- data/app/views/atrium/collections/_folder_control.html.erb +0 -12
- data/app/views/atrium/collections/_listing.html.erb +0 -18
- data/app/views/atrium/collections/_navigation.html.erb +0 -50
- data/app/views/atrium/collections/_results_pagination.html.erb +0 -9
- data/app/views/atrium/collections/_sort_and_per_page.html.erb +0 -23
- data/app/views/atrium/exhibits/_bookmark_control.html.erb +0 -25
- data/app/views/atrium/exhibits/_folder_control.html.erb +0 -12
- data/app/views/atrium/exhibits/_navigation.html.erb +0 -30
- data/app/views/atrium/showcases/_showcase_navigation.html.erb +0 -23
- data/app/views/catalog/_collection_home_text.html.erb +0 -6
- data/app/views/catalog/_constraints.html.erb +0 -9
- data/app/views/catalog/_default_collection_text.html.erb +0 -18
- data/app/views/catalog/_default_home_text.html.erb +0 -6
- data/app/views/catalog/_home_text.html.erb +0 -6
- data/app/views/catalog/_index_partials/_description.html.erb +0 -8
- data/app/views/catalog/_search_form.html.erb +0 -66
- data/app/views/catalog/_show_partials/_description.html.erb +0 -15
- data/app/views/catalog/browse_show.html.erb +0 -18
- data/app/views/catalog/index.html.erb +0 -41
- data/app/views/catalog/list_description.html.erb +0 -24
- data/app/views/catalog/list_item.html.erb +0 -3
- data/app/views/layouts/atrium_themes/default.html.erb +0 -4
- data/app/views/layouts/item_listing.html.erb +0 -36
- data/app/views/listing/_document.html.erb +0 -27
- data/app/views/listing/_document_list.html.erb +0 -3
- data/app/views/listing/_item_search.html.erb +0 -27
- data/app/views/shared/_banner.html.erb +0 -5
- data/app/views/shared/_collection_complete_list.html.erb +0 -33
- data/app/views/shared/_collection_search_form.html.erb +0 -12
- data/app/views/shared/_collection_title_header.html.erb +0 -3
- data/app/views/shared/_featured_sources.html.erb +0 -23
- data/app/views/shared/_list_descriptions.html.erb +0 -39
- data/app/views/shared/_navigation_browse_levels.html.erb +0 -34
- data/app/views/shared/_showcase_configure_menu.html.erb +0 -22
- data/app/views/shared/_top_navigation.html.erb +0 -9
- data/init.rb +0 -3
- data/lib/application_controller.rb +0 -24
- data/lib/atrium/application_helper.rb +0 -24
- data/lib/atrium/atrium_helper_behavior.rb +0 -159
- data/lib/atrium/catalog.rb +0 -203
- data/lib/atrium/collections_helper.rb +0 -172
- data/lib/atrium/controller.rb +0 -10
- data/lib/atrium/descriptions_helper.rb +0 -27
- data/lib/atrium/layout_helper.rb +0 -13
- data/lib/atrium/routes.rb +0 -100
- data/lib/atrium/solr_helper.rb +0 -440
- data/lib/generators/atrium/assets_generator.rb +0 -44
- data/lib/generators/atrium/atrium_generator.rb +0 -149
- data/lib/generators/atrium/cucumber_support_generator.rb +0 -29
- data/lib/generators/atrium/templates/config/role_map_cucumber.yml +0 -2
- data/lib/generators/atrium/templates/config/role_map_development.yml +0 -2
- data/lib/generators/atrium/templates/config/role_map_production.yml +0 -2
- data/lib/generators/atrium/templates/config/role_map_test.yml +0 -2
- data/lib/generators/atrium/templates/config/solr.yml +0 -10
- data/lib/generators/atrium/templates/db/seeds.rb +0 -87
- data/lib/generators/atrium/templates/migrations/create_atrium_showcase_items.rb +0 -17
- data/lib/generators/atrium/templates/themes/example.html.erb +0 -21
- data/lib/railties/all_tests.rake +0 -23
- data/lib/railties/atrium_cucumber.rake +0 -121
- data/lib/railties/index.rake +0 -37
- data/tasks/atrium.rake +0 -268
- data/tasks/atrium_rspec.rake +0 -91
- data/test_support/etc/Gemfile +0 -33
- data/test_support/etc/bundle_config +0 -3
- data/test_support/etc/rvmrc +0 -32
- data/test_support/features/atrium_collections.feature +0 -162
- data/test_support/features/atrium_exhibits.feature +0 -164
- data/test_support/features/step_definitions/atrium_collection_steps.rb +0 -102
- data/test_support/features/step_definitions/atrium_exhibit_steps.rb +0 -53
- data/test_support/features/step_definitions/bookmarks_steps.rb +0 -6
- data/test_support/features/step_definitions/error_steps.rb +0 -5
- data/test_support/features/step_definitions/folder_steps.rb +0 -27
- data/test_support/features/step_definitions/general_steps.rb +0 -50
- data/test_support/features/step_definitions/record_view_steps.rb +0 -12
- data/test_support/features/step_definitions/saved_searches_steps.rb +0 -22
- data/test_support/features/step_definitions/search_facets_steps.rb +0 -29
- data/test_support/features/step_definitions/search_history_steps.rb +0 -9
- data/test_support/features/step_definitions/search_result_steps.rb +0 -114
- data/test_support/features/step_definitions/search_steps.rb +0 -103
- data/test_support/features/step_definitions/user_steps.rb +0 -5
- data/test_support/features/step_definitions/web_steps.rb +0 -213
- data/test_support/features/support/env.rb +0 -67
- data/test_support/features/support/paths.rb +0 -76
- data/test_support/features/support/selectors.rb +0 -40
- data/test_support/fixtures/atrium_exhibits.yml +0 -3
- data/test_support/spec/controllers/atrium/base_controller_spec.rb +0 -13
- data/test_support/spec/controllers/atrium/collection_exhibit_order_controller_spec.rb +0 -29
- data/test_support/spec/controllers/atrium/collections_controller_spec.rb +0 -185
- data/test_support/spec/controllers/atrium/customization_controller_spec.rb +0 -38
- data/test_support/spec/controllers/atrium/descriptions_controller_spec.rb +0 -150
- data/test_support/spec/controllers/atrium/exhibit_facet_order_controller_spec.rb +0 -36
- data/test_support/spec/controllers/atrium/exhibits_controller_spec.rb +0 -192
- data/test_support/spec/controllers/atrium/showcases_controller_spec.rb +0 -219
- data/test_support/spec/helpers/atrium_collections_helper_spec.rb +0 -147
- data/test_support/spec/helpers/atrium_description_helper_spec.rb +0 -47
- data/test_support/spec/helpers/atrium_solr_helper_spec.rb +0 -522
- data/test_support/spec/models/atrium/browse_level_spec.rb +0 -31
- data/test_support/spec/models/atrium/collection_spec.rb +0 -30
- data/test_support/spec/models/atrium/description_spec.rb +0 -67
- data/test_support/spec/models/atrium/essay_spec.rb +0 -12
- data/test_support/spec/models/atrium/exhibit_spec.rb +0 -76
- data/test_support/spec/models/atrium/search/facet_selection_spec.rb +0 -24
- data/test_support/spec/models/atrium/search_facet_spec.rb +0 -54
- data/test_support/spec/models/atrium/showcase/item_spec.rb +0 -12
- data/test_support/spec/models/atrium/showcase_facet_selection_spec.rb +0 -65
- data/test_support/spec/models/atrium/showcase_spec.rb +0 -134
- data/test_support/spec/rcov.opts +0 -3
- data/test_support/spec/routing/atrium/collections_routing_spec.rb +0 -33
- data/test_support/spec/spec.opts +0 -4
- data/test_support/spec/spec_helper.rb +0 -47
- data/test_support/tmp/step_definitions/catalog_index_steps.rb +0 -14
- data/test_support/tmp/step_definitions/edit_document_steps.rb +0 -67
- data/test_support/tmp/step_definitions/hydra_metadata_steps.rb +0 -3
- data/test_support/tmp/step_definitions/hydra_steps.rb +0 -8
- data/test_support/tmp/step_definitions/search_steps.rb +0 -86
- data/test_support/tmp/step_definitions/searching_steps.rb +0 -22
- data/test_support/tmp/step_definitions/select_steps.rb +0 -8
- data/test_support/tmp/step_definitions/show_document_steps.rb +0 -73
- data/test_support/tmp/step_definitions/user_steps.rb +0 -15
- data/test_support/tmp/step_definitions/web_steps.rb +0 -273
- data/test_support/tmp/support/env.rb +0 -54
- data/test_support/tmp/support/paths.rb +0 -57
@@ -1,27 +0,0 @@
|
|
1
|
-
|
2
|
-
<% @page_title = application_name + " Search Results" %>
|
3
|
-
|
4
|
-
<% extra_head_content << render_opensearch_response_metadata.html_safe %>
|
5
|
-
|
6
|
-
<%= render :partial => 'search_form' %>
|
7
|
-
|
8
|
-
<%= render :partial => 'did_you_mean' %>
|
9
|
-
|
10
|
-
<%= render 'constraints', :localized_params=>params %>
|
11
|
-
|
12
|
-
<div class="pageEntriesInfo">
|
13
|
-
<%= render_pagination_info @response, :entry_name=>'item' %>
|
14
|
-
<%=link_to "start over", catalog_index_path, :id=>"startOverLink" %>
|
15
|
-
</div>
|
16
|
-
|
17
|
-
<%= render 'sort_and_per_page' %>
|
18
|
-
|
19
|
-
<%= render 'results_pagination' %>
|
20
|
-
|
21
|
-
<%= render :partial => 'listing/document_list' %>
|
22
|
-
|
23
|
-
<% sidebar_items << capture do %>
|
24
|
-
<%= render :partial=>'facets' %>
|
25
|
-
<% end %>
|
26
|
-
|
27
|
-
<%= render 'results_pagination' %>
|
@@ -1,33 +0,0 @@
|
|
1
|
-
<% # container for all documents in index view -%>
|
2
|
-
<div id="documents" class="collection-listing">
|
3
|
-
<% # loop thru each doc -%>
|
4
|
-
<% document_list = @document_list if document_list.nil?%>
|
5
|
-
<% response = @response if response.nil?%>
|
6
|
-
<% document_list.each_with_index do |document,counter| %>
|
7
|
-
<div class="document<%= thumbnail_class( document ) %>">
|
8
|
-
<% # header bar for doc items in index view -%>
|
9
|
-
<div class="documentHeader yui-g">
|
10
|
-
<% # main title container for doc partial view -%>
|
11
|
-
<div class="yui-u">
|
12
|
-
<%- af_model = get_af_model(document) -%>
|
13
|
-
<%- if af_model == "Collection" && document[Collection.title_solr_field_name] && !document[Collection.title_solr_field_name].empty?-%>
|
14
|
-
<%- title = document[Collection.title_solr_field_name].first -%>
|
15
|
-
<%- elsif af_model == "Component" && document["component_type_t"] && !document["component_type_t"].empty? && document[Component.title_solr_field_name] && !document[Component.title_solr_field_name].empty?-%>
|
16
|
-
<%- title = document[Component.title_solr_field_name].first -%>
|
17
|
-
<%- elsif af_model == "Page" && document["name_t"] && !document["name_t"].empty? -%>
|
18
|
-
<%- title = document["name_t"].first -%>
|
19
|
-
<%- else-%>
|
20
|
-
<%- title = document[:id] %>
|
21
|
-
<%- end %>
|
22
|
-
<!--<h2 class="index_title"><span class="title_count"><%# response.params[:start].to_i.eql?(0) ? counter + 1 + response.params[:start].to_i+new_counter : counter + 1 + response.params[:start].to_i-new_counter%>. </span> <%# link_to_document document, :label=>title.blank? ? document_show_link_field : title , :counter => (counter + 1 + response.params[:start].to_i) %></h2>-->
|
23
|
-
<h2 class="index_title"><span class="title_count"><%= counter + 1 + response.params[:start].to_i %>. </span> <%= link_to_document document, :label=>title.blank? ? document_show_link_field : title , :counter => (counter + 1 + response.params[:start].to_i) %></h2>
|
24
|
-
</div>
|
25
|
-
</div>
|
26
|
-
|
27
|
-
<% # main container for doc partial view -%>
|
28
|
-
<%= render_document_index_partial document, document[:id], counter, :index %>
|
29
|
-
|
30
|
-
</div>
|
31
|
-
|
32
|
-
<% end %>
|
33
|
-
</div>
|
@@ -1,12 +0,0 @@
|
|
1
|
-
<div id="collection-search" class="search">
|
2
|
-
<%- @atrium_collection ? collection_id = @atrium_collection[:id] : collection_id = params[:id]%>
|
3
|
-
<%= form_tag catalog_index_path, :method => :get do %>
|
4
|
-
<fieldset>
|
5
|
-
<h3 class="search"><label for="q"><%= link_to("Search Complete Collection", atrium_collection_home_path(collection_id)) %></label></h3>
|
6
|
-
<%= text_field_tag :q, params[:q], :class => "q" %>
|
7
|
-
<%= hidden_field_tag :collection_id, collection_id%>
|
8
|
-
<%= search_as_hidden_fields(:omit_keys => [:q, :f, :search_field, :qt, :action, :id, :controller, :class, :atrium_exhibit_browse, :atrium_collection_browse]).html_safe %>
|
9
|
-
<%= submit_tag 'Search', :class=>'submit' %>
|
10
|
-
</fieldset>
|
11
|
-
<% end %>
|
12
|
-
</div>
|
@@ -1,23 +0,0 @@
|
|
1
|
-
|
2
|
-
<h1>Featured Sources</h1>
|
3
|
-
|
4
|
-
<div id="documents">
|
5
|
-
<%- if @featured_documents-%>
|
6
|
-
<% @featured_documents.each_with_index do |document, i| %>
|
7
|
-
<% # container for a single doc -%>
|
8
|
-
<div class="document <%= render_document_class document %>">
|
9
|
-
<% # header bar for doc items in index view -%>
|
10
|
-
<div class="documentHeader">
|
11
|
-
<% # main title container for doc partial view -%>
|
12
|
-
<div class="yui-u">
|
13
|
-
<h3 class="index_title"><%= i + 1 + @featured_response.params[:start].to_i%>. <%= link_to_document document, :label => document_show_link_field, :results_view => false %></h3>
|
14
|
-
</div>
|
15
|
-
</div>
|
16
|
-
<%= render_document_partial document, :index %>
|
17
|
-
<% if is_editing? && (can? :create, Atrium::Showcase)%>
|
18
|
-
<a class="remove_featured button" href=# action="<%= atrium_showcase_remove_featured_path(showcase_id, :solr_doc_id=>document[:id])%>" title="Remove this featured item">Remove this item</a>
|
19
|
-
<% end %>
|
20
|
-
</div>
|
21
|
-
<% end %>
|
22
|
-
<%- end -%>
|
23
|
-
</div>
|
@@ -1,39 +0,0 @@
|
|
1
|
-
<% descriptions.each do |desc| %>
|
2
|
-
<%- title= desc.pretty_title %>
|
3
|
-
<% if !desc.nil? && !is_editing?%>
|
4
|
-
<% path = params[:controller] == "atrium_exhibits" ? atrium_description_path(desc[:id], :f=>params[:f], :exhibit_id=>params[:id]) : atrium_description_path(desc[:id], :collection_id=>params[:id]) %>
|
5
|
-
<% if desc.show_on_this_page? %>
|
6
|
-
<h3>
|
7
|
-
<%= link_to title, path, :label=>("Essay: \"#{title}\"") %>
|
8
|
-
</h3>
|
9
|
-
<blockquote>
|
10
|
-
<%= desc.get_summary.html_safe %>
|
11
|
-
</blockquote>
|
12
|
-
<%= link_to "Read the complete essay", path%>
|
13
|
-
<% else %>
|
14
|
-
<h3><%=title%></h3>
|
15
|
-
<%- content= desc.description_solr_id.blank? ? desc.get_essay : get_essay_from_description(@description_hash,desc.description_solr_id)%>
|
16
|
-
<%if content %>
|
17
|
-
<blockquote class="intro"><%= truncate( content, :length =>550, :ommision => "....").html_safe%></blockquote>
|
18
|
-
<% if content.length>50 %>
|
19
|
-
<a class="heading" href="#">[Read the complete essay]</a>
|
20
|
-
<div style="display: none"class="content" id="<%= desc[:id] %>">
|
21
|
-
<%= content.html_safe %>
|
22
|
-
</div>
|
23
|
-
<% end %>
|
24
|
-
<% end %>
|
25
|
-
<% end %>
|
26
|
-
<% elsif is_editing?%>
|
27
|
-
<%# need to add dl tag for animated JS to work %>
|
28
|
-
<dl>
|
29
|
-
<h3><%= "Essay: #{title}"%></h3>
|
30
|
-
<h4>Summary: </h4> <blockquote> <%= desc.get_summary.html_safe %></blockquote>
|
31
|
-
<h4>Essay: </h4><blockquote> <%= desc.get_summary.html_safe %> </blockquote>
|
32
|
-
<h4>From Solr:</h4> <%= desc.description_solr_id.blank? ? "" : get_essay_from_description(@description_hash,desc.description_solr_id).html_safe%>
|
33
|
-
<% if (can? :create, Atrium::Description)%>
|
34
|
-
<%= link_to 'Edit Description', edit_atrium_description_path(desc[:id]), :class => 'description_colorbox button', :action=> atrium_descriptions_path(:showcase_id=>desc.atrium_showcase_id, :id=>desc[:id], :no_layout=>true) if desc.description_solr_id.blank? %>
|
35
|
-
<a class="destroy_description button" href=# action="<%= atrium_description_path(desc[:id])%>" title="Remove Description"> Delete this description</a>
|
36
|
-
<% end %>
|
37
|
-
</dl>
|
38
|
-
<% end %>
|
39
|
-
<% end %>
|
@@ -1,34 +0,0 @@
|
|
1
|
-
<%# This partial recursively calls itself as necessary to render the navigation browse level data. %>
|
2
|
-
<% unless browse_levels.nil? || browse_facets.nil? || exhibit_number.nil?%>
|
3
|
-
<% browse_level = browse_levels.first %>
|
4
|
-
<% unless browse_level.values.empty? %>
|
5
|
-
<% solr_facet_name = browse_level.solr_facet_name %>
|
6
|
-
<% browse_level.label = facet_field_labels[solr_facet_name] if browse_level.label.blank? %>
|
7
|
-
<h3 class="facet-heading"><%= browse_level.label %></h3>
|
8
|
-
<ul class="browse-facets">
|
9
|
-
<% browse_level.values.each do |value| %>
|
10
|
-
<li class="<%= value.downcase.gsub(/\W/, '-') %>">
|
11
|
-
<% @exhibit ? exhibit_set_from_params = @exhibit.set_number : exhibit_set_from_params = get_exhibit_set_number(exhibit_id) %>
|
12
|
-
<% if !browse_level.selected.nil? && browse_level.selected == value && exhibit_number.to_i == exhibit_set_from_params.to_i%>
|
13
|
-
<% selected_path = get_selected_browse_facet_path(solr_facet_name, value, browse_facets, exhibit_number, exhibit_id) %>
|
14
|
-
<span class="selected browse-facet">
|
15
|
-
<%= value %>
|
16
|
-
</span>
|
17
|
-
<%= link_to("[remove]", selected_path, :class=>"remove") %>
|
18
|
-
<% if browse_levels.size > 1 && !browse_levels.second.values.empty? %>
|
19
|
-
<%= render :partial => 'shared/navigation_browse_levels',
|
20
|
-
:locals => {
|
21
|
-
:browse_levels => browse_levels.slice(1, browse_levels.length - 1),
|
22
|
-
:browse_facets => browse_facets.slice(1, browse_facets.length - 1),
|
23
|
-
:exhibit_number => exhibit_number,
|
24
|
-
:exhibit_id => exhibit_id
|
25
|
-
} %>
|
26
|
-
<% end %>
|
27
|
-
<% else %>
|
28
|
-
<%= link_to(value, get_browse_facet_path(solr_facet_name, value, browse_facets, exhibit_number, exhibit_id)) %>
|
29
|
-
<% end %>
|
30
|
-
</li>
|
31
|
-
<% end %>
|
32
|
-
</ul>
|
33
|
-
<% end %>
|
34
|
-
<% end %>
|
@@ -1,22 +0,0 @@
|
|
1
|
-
<strong>Browse view configuration</strong>
|
2
|
-
<%- params[:controller] == "atrium_collections" ? collection_id = params[:id] : collection_id = params[:collection_id] -%>
|
3
|
-
|
4
|
-
<ul class="controls">
|
5
|
-
<li>
|
6
|
-
<%= link_to 'Select Featured Items',
|
7
|
-
atrium_showcase_featured_path(:id => @atrium_showcase[:id], :collection_id => collection_id, :f => params[:f]),
|
8
|
-
:class => 'select_colorbox button',
|
9
|
-
:action => atrium_showcase_path(:id => @atrium_showcase[:id], :no_layout=>true)
|
10
|
-
%>
|
11
|
-
</li>
|
12
|
-
<li>
|
13
|
-
<%= link_to 'Add New Description', new_atrium_description_path(:showcase_id=>@atrium_showcase[:id]), :class => 'description_colorbox button', :action=> atrium_descriptions_path(:showcase_id=>@atrium_showcase[:id], :no_layout=>true) %>
|
14
|
-
</li>
|
15
|
-
<li>
|
16
|
-
<%= link_to 'Add Description From Solr', atrium_descriptions_add_path(:showcase_id=>@atrium_showcase[:id]), :class => 'description_colorbox button', :action=> atrium_descriptions_link_path(:showcase_id=>@atrium_showcase[:id], :no_layout=>true) %>
|
17
|
-
</li>
|
18
|
-
<li class="last">
|
19
|
-
<%= link_to "Stop Editing", stop_atrium_customization_path(@atrium_showcase.for_exhibit? ? {:type => 'exhibit', :id => @exhibit[:id], :f => params[:f]} : {:type => 'collection', :id => @atrium_collection[:id], :f => params[:f]}), :class => 'button close' %>
|
20
|
-
</li>
|
21
|
-
</ul>
|
22
|
-
|
data/init.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
module Atrium
|
2
|
-
## Define ControllerMethods
|
3
|
-
module Controller
|
4
|
-
## this one manages the usual self.included, klass_eval stuff
|
5
|
-
extend ActiveSupport::Concern
|
6
|
-
require 'cancan'
|
7
|
-
|
8
|
-
included do
|
9
|
-
before_filter :method_for_before_filtering
|
10
|
-
end
|
11
|
-
|
12
|
-
module InstanceMethods
|
13
|
-
def method_for_before_filtering
|
14
|
-
#puts "Filtering before"
|
15
|
-
end
|
16
|
-
|
17
|
-
def method_not_a_filter
|
18
|
-
puts "not used as a filter"
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
::ActionController::Base.send :include, Atrium::Controller
|
@@ -1,24 +0,0 @@
|
|
1
|
-
module Atrium::ApplicationHelper
|
2
|
-
def thumbnail_class( document )
|
3
|
-
display_thumnail( document ) ? ' with-thumbnail' : ''
|
4
|
-
end
|
5
|
-
|
6
|
-
def top_level_showcase(exhibit_id)
|
7
|
-
showcases = Atrium::Showcase.find_by_atrium_exhibit_id(exhibit_id)
|
8
|
-
showcase = showcases.first unless showcases.empty?
|
9
|
-
end
|
10
|
-
|
11
|
-
def is_editing?
|
12
|
-
session[:edit_showcase].blank? ? false : true
|
13
|
-
end
|
14
|
-
|
15
|
-
def get_essay_from_description(desc_hash, desc_id)
|
16
|
-
if !desc_hash.nil?
|
17
|
-
return desc_hash[desc_id]
|
18
|
-
else
|
19
|
-
logger.error("hash is blank for some reason. Please check")
|
20
|
-
return ""
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
end
|
@@ -1,159 +0,0 @@
|
|
1
|
-
require "blacklight_helper"
|
2
|
-
require "facets_helper"
|
3
|
-
module Atrium::AtriumHelperBehavior
|
4
|
-
include BlacklightHelper
|
5
|
-
include FacetsHelper
|
6
|
-
|
7
|
-
def application_name
|
8
|
-
'Atrium Application'
|
9
|
-
end
|
10
|
-
|
11
|
-
# An array of strings to be added to HTML HEAD section of view.
|
12
|
-
def extra_head_content
|
13
|
-
@extra_head_content ||= []
|
14
|
-
end
|
15
|
-
|
16
|
-
|
17
|
-
# Array, where each element is an array of arguments to
|
18
|
-
# Rails stylesheet_link_tag helper. See
|
19
|
-
# ApplicationHelper#render_head_content for details.
|
20
|
-
def stylesheet_links
|
21
|
-
@stylesheet_links ||= []
|
22
|
-
end
|
23
|
-
|
24
|
-
# Array, where each element is an array of arguments to
|
25
|
-
# Rails javascript_include_tag helper. See
|
26
|
-
# ApplicationHelper#render_head_content for details.
|
27
|
-
def javascript_includes
|
28
|
-
@javascript_includes ||= []
|
29
|
-
end
|
30
|
-
|
31
|
-
# used in the catalog/_facets partial
|
32
|
-
#def facet_field_names
|
33
|
-
# if params[:collection_id] && params[:controller] == 'catalog' && params[:action] = 'index'
|
34
|
-
# logger.debug("Into get facets")
|
35
|
-
# collection = @atrium_collection? @atrium_collection : Atrium::Collection.find(params[:collection_id])
|
36
|
-
# if collection
|
37
|
-
# collection.search_facets.collect {|f| f.name}
|
38
|
-
# end
|
39
|
-
# else
|
40
|
-
# super
|
41
|
-
# end
|
42
|
-
#end
|
43
|
-
|
44
|
-
def render_facet_limit(display_facet, options = {})
|
45
|
-
if params[:edit_exhibit_filter] || params[:edit_collection_filter] || params[:edit_browse_level_filter] || params[:add_featured] || params[:exclude_browse_level_filter]
|
46
|
-
if display_facet.is_a? String or display_facet.is_a? Symbol
|
47
|
-
$stderr.puts "............... DEPRECATION WARNING: Blacklight::FacetsHelper#render_facet_limit: use #render_facet_partials to render facets by field name"
|
48
|
-
return render_facet_partials([display_facet])
|
49
|
-
end
|
50
|
-
options = options.dup
|
51
|
-
options[:partial] ||= facet_partial_name(display_facet)
|
52
|
-
options[:layout] ||= "facet_layout" unless options.has_key?(:layout)
|
53
|
-
options[:locals] ||= {}
|
54
|
-
options[:locals][:solr_field] ||= display_facet.name
|
55
|
-
options[:locals][:solr_fname] ||= display_facet.name # DEPRECATED
|
56
|
-
options[:locals][:facet_field] ||= facet_configuration_for_field(display_facet.name)
|
57
|
-
options[:locals][:display_facet] ||= display_facet
|
58
|
-
render(options)
|
59
|
-
else
|
60
|
-
super
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
# link_to_document(doc, :label=>'VIEW', :counter => 3)
|
65
|
-
# Use the catalog_path RESTful route to create a link to the show page for a specific item.
|
66
|
-
# catalog_path accepts a HashWithIndifferentAccess object. The solr query params are stored in the session,
|
67
|
-
# so we only need the +counter+ param here. We also need to know if we are viewing to document as part of search results.
|
68
|
-
def link_to_document(doc, opts={:label=>blacklight_config.index.show_link.to_sym, :counter => nil, :results_view => true})
|
69
|
-
collection_id = params[:controller] == "atrium/collections" ? params[:id] : params[:collection_id]
|
70
|
-
exhibit_id = params[:controller] == "atrium/exhibits" ? params[:id] : params[:exhibit_id]
|
71
|
-
label = render_document_index_label doc, opts
|
72
|
-
args = {}
|
73
|
-
args.merge!(:f=>params[:f]) if params[:f]
|
74
|
-
#&& params[:controller] != "catalog"
|
75
|
-
#try to retrieve collection id if not set
|
76
|
-
if exhibit_id && !collection_id
|
77
|
-
begin
|
78
|
-
exhibit = Atrium::Exhibit.find(exhibit_id)
|
79
|
-
collection_id = exhibit.collection.id if exhibit && exhibit.collection
|
80
|
-
rescue
|
81
|
-
end
|
82
|
-
end
|
83
|
-
args.merge!(:'data-counter' => opts[:counter])
|
84
|
-
if exhibit_id && collection_id
|
85
|
-
#link_to_with_data(label, atrium_collection_exhibit_browse_path(collection_id, exhibit_id, doc.id, args), {:method => :put, :class => label.parameterize, :data => opts}).html_safe
|
86
|
-
label = render_document_index_label doc, opts
|
87
|
-
link_to label, atrium_collection_exhibit_browse_path(collection_id, exhibit_id, doc.id, args)
|
88
|
-
#elsif exhibit_id
|
89
|
-
# link_to_with_data(label, atrium_exhibit_browse_path(exhibit_id, doc.id, args), {:method => :put, :class => label.parameterize, :data => opts}).html_safe
|
90
|
-
elsif collection_id
|
91
|
-
params[:controller] == "catalog" ? current_path = atrium_collection_catalog_path(collection_id, doc.id, args) : current_path = atrium_collection_browse_path(collection_id, doc.id, args)
|
92
|
-
label = render_document_index_label doc, opts
|
93
|
-
link_to label, current_path, :'data-counter' => opts[:counter]
|
94
|
-
#link_to_with_data(label, current_path, {:method => :put, :class => label.parameterize, :data => opts}).html_safe
|
95
|
-
else
|
96
|
-
super
|
97
|
-
end
|
98
|
-
|
99
|
-
end
|
100
|
-
|
101
|
-
# If collection is defined and in an collection browse view
|
102
|
-
# then do not set limit on facet values displayed.
|
103
|
-
# Otherwise use code lifted from catalog controller in blacklight plugin
|
104
|
-
def facet_limit_for(facet_field)
|
105
|
-
|
106
|
-
#if (params[:collection_id] && !params[:render_search].blank?)
|
107
|
-
if params[:controller] == "catalog"
|
108
|
-
super
|
109
|
-
else
|
110
|
-
nil
|
111
|
-
end
|
112
|
-
end
|
113
|
-
|
114
|
-
# Overriding so that it will not show facet constraints if selecting
|
115
|
-
# featured items because we should not be able to remove facet selections
|
116
|
-
# that are setting proper search scope for a browse page
|
117
|
-
def render_constraints(localized_params = params)
|
118
|
-
if params[:add_featured]
|
119
|
-
(render_constraints_query(localized_params)).html_safe
|
120
|
-
else
|
121
|
-
(render_constraints_query(localized_params) + render_constraints_filters(localized_params)).html_safe
|
122
|
-
end
|
123
|
-
end
|
124
|
-
|
125
|
-
# Override this from BlacklightHelper so we can have a link back to browsing a collection
|
126
|
-
# Create a link back to the index screen, keeping the user's facet, query and paging choices intact by using session.
|
127
|
-
def link_back_to_catalog(opts={:label=>'Back to Search'})
|
128
|
-
if params[:atrium_collection_browse]
|
129
|
-
params[:controller] == "atrium_collections" ? collection_id = params[:id] : collection_id = params[:collection_id]
|
130
|
-
link_to "Back to Browse Collection", atrium_collection_path(collection_id)
|
131
|
-
elsif params[:atrium_exhibit_browse]
|
132
|
-
params[:controller] == "atrium_exhibits" ? exhibit_id = params[:id] : exhibit_id = params[:exhibit_id]
|
133
|
-
link_to "Back to Browse Exhibit", atrium_exhibit_path(exhibit_id,:f=>params[:f])
|
134
|
-
else
|
135
|
-
super
|
136
|
-
end
|
137
|
-
end
|
138
|
-
|
139
|
-
def save_collection_id_in_session(collection_id)
|
140
|
-
session[:collection_id] = collection_id
|
141
|
-
end
|
142
|
-
|
143
|
-
def save_exhibit_id_in_session(exhibit_id)
|
144
|
-
session[:exhibit_id] = exhibit_id
|
145
|
-
end
|
146
|
-
|
147
|
-
def set_edit_showcase_in_session
|
148
|
-
session[:edit_showcase] = true
|
149
|
-
end
|
150
|
-
|
151
|
-
def get_start_over_path
|
152
|
-
if (params[:collection_id])
|
153
|
-
atrium_collection_home_path(params[:collection_id])
|
154
|
-
else
|
155
|
-
catalog_index_path
|
156
|
-
end
|
157
|
-
end
|
158
|
-
|
159
|
-
end
|
data/lib/atrium/catalog.rb
DELETED
@@ -1,203 +0,0 @@
|
|
1
|
-
require 'blacklight/catalog'
|
2
|
-
require 'atrium/layout_helper'
|
3
|
-
|
4
|
-
# Include this module into any of your Blacklight Catalog classes (ie. CatalogController) to add Atrium functionality
|
5
|
-
#
|
6
|
-
# This module will only work if you also include Blacklight::Catalog in the Controller you're extending.
|
7
|
-
# The atrium rails generator will create the CatalogController for you in app/controllers/catalog_controller.rb
|
8
|
-
# @example
|
9
|
-
# require 'blacklight/catalog'
|
10
|
-
# require 'atrium/catalog'
|
11
|
-
# class CustomCatalogController < ApplicationController
|
12
|
-
# include Blacklight::Catalog
|
13
|
-
# include Atrium::Catalog
|
14
|
-
# end
|
15
|
-
module Atrium::Catalog
|
16
|
-
extend ActiveSupport::Concern
|
17
|
-
include Blacklight::Catalog
|
18
|
-
include Atrium::SolrHelper
|
19
|
-
include Atrium::LayoutHelper
|
20
|
-
include BlacklightHelper
|
21
|
-
|
22
|
-
def self.included(klass)
|
23
|
-
klass.before_filter :initialize_collection
|
24
|
-
klass.layout :collection_theme_if_present
|
25
|
-
end
|
26
|
-
|
27
|
-
def show
|
28
|
-
super
|
29
|
-
if params[:atrium_collection_browse] || params[:atrium_exhibit_browse]
|
30
|
-
@exhibit_navigation_data = get_exhibit_navigation_data
|
31
|
-
logger.debug("render browse_show")
|
32
|
-
#render "browse_show"
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
def browse_show
|
37
|
-
end
|
38
|
-
|
39
|
-
def index
|
40
|
-
#put in atrium index code here
|
41
|
-
if params[:save_collection_filter_button]
|
42
|
-
#logger.debug("pressed save collection filter button")
|
43
|
-
if @atrium_collection
|
44
|
-
if !session[:folder_document_ids].blank?
|
45
|
-
@atrium_collection.collection_items ||= Hash.new
|
46
|
-
selected_document_ids = session[:folder_document_ids]
|
47
|
-
collection_items={}
|
48
|
-
collection_items[:solr_doc_ids]=selected_document_ids.join(',')
|
49
|
-
#@atrium_collection.update_attributes(:collection_items=>collection_items)
|
50
|
-
@atrium_collection.update_attributes(:filter_query_params=>collection_items)
|
51
|
-
session[:folder_document_ids] = session[:copy_folder_document_ids]
|
52
|
-
session[:copy_folder_document_ids]=nil
|
53
|
-
#logger.debug("@@atrium_collection: #{@atrium_collection.inspect},Selected Items: #{@atrium_collection.filter_query_params.inspect}, folders_selected: #{session[:folder_document_ids].inspect}")
|
54
|
-
else
|
55
|
-
filter_query_params = search_session.clone
|
56
|
-
filter_query_params.delete(:save_collection_filter_button)
|
57
|
-
filter_query_params.delete(:collection_id)
|
58
|
-
filter_query_params.delete :action
|
59
|
-
filter_query_params.delete :id
|
60
|
-
filter_query_params.delete :controller
|
61
|
-
filter_query_params.delete :utf8
|
62
|
-
@atrium_collection.update_attributes(:filter_query_params=>filter_query_params)
|
63
|
-
end
|
64
|
-
redirect_to edit_atrium_collection_path(@atrium_collection.id)
|
65
|
-
else
|
66
|
-
redirect_to new_atrium_collection_path
|
67
|
-
end
|
68
|
-
elsif params[:save_exhibit_filter_button]
|
69
|
-
params[:exhibit_id] ? exhibit_id = params[:exhibit_id] : exhibit_id = params[:edit_exhibit_filter]
|
70
|
-
@exhibit = Atrium::Exhibit.find(exhibit_id) if exhibit_id
|
71
|
-
#logger.debug("pressed save exhibit filter button")
|
72
|
-
if @exhibit
|
73
|
-
if !session[:folder_document_ids].blank?
|
74
|
-
selected_document_ids = session[:folder_document_ids]
|
75
|
-
exhibit_items={}
|
76
|
-
exhibit_items[:solr_doc_ids]=selected_document_ids.join(',')
|
77
|
-
@exhibit.update_attributes(:filter_query_params=>exhibit_items)
|
78
|
-
session[:folder_document_ids] = session[:copy_folder_document_ids]
|
79
|
-
session[:copy_folder_document_ids]=nil
|
80
|
-
#logger.debug("exhibit: #{@exhibit.inspect},Selected Items: #{@exhibit.filter_query_params.inspect}, folders_selected: #{session[:folder_document_ids].inspect}")
|
81
|
-
else
|
82
|
-
filter_query_params = search_session.clone
|
83
|
-
filter_query_params.delete(:save_exhibit_filter_button)
|
84
|
-
filter_query_params.delete(:collection_id)
|
85
|
-
filter_query_params.delete(:exhibit_id)
|
86
|
-
filter_query_params.delete :action
|
87
|
-
filter_query_params.delete :id
|
88
|
-
filter_query_params.delete :controller
|
89
|
-
filter_query_params.delete :utf8
|
90
|
-
@exhibit.update_attributes(:filter_query_params=>filter_query_params)
|
91
|
-
end
|
92
|
-
redirect_to edit_atrium_exhibit_path(@exhibit.id)
|
93
|
-
else
|
94
|
-
redirect_to new_atrium_exhibit_path
|
95
|
-
end
|
96
|
-
elsif params[:save_browse_level_filter_button]
|
97
|
-
params[:browse_level_id] ? browse_level_id = params[:browse_level_id] : browse_level_id = params[:edit_browse_level_filter]
|
98
|
-
@browse_level = Atrium::BrowseLevel.find(browse_level_id) if browse_level_id
|
99
|
-
#logger.debug("pressed save browse level filter button")
|
100
|
-
if @browse_level
|
101
|
-
filter_query_params = search_session.clone
|
102
|
-
filter_query_params.delete(:save_browse_level_filter_button)
|
103
|
-
filter_query_params.delete(:collection_id)
|
104
|
-
filter_query_params.delete(:browse_level_id)
|
105
|
-
@browse_level.update_attributes(:filter_query_params=>filter_query_params)
|
106
|
-
redirect_to edit_atrium_exhibit_path(@browse_level.atrium_exhibit_id)
|
107
|
-
else
|
108
|
-
redirect_to new_atrium_exhibit_path
|
109
|
-
end
|
110
|
-
elsif params[:save_browse_level_exclude_button]
|
111
|
-
params[:browse_level_id] ? browse_level_id = params[:browse_level_id] : browse_level_id = params[:edit_browse_level_filter]
|
112
|
-
@browse_level = Atrium::BrowseLevel.find(browse_level_id) if browse_level_id
|
113
|
-
#logger.debug("pressed save browse level filter button")
|
114
|
-
if @browse_level
|
115
|
-
filter_query_params = search_session.clone
|
116
|
-
filter_query_params[:exclude] = filter_query_params[:f]
|
117
|
-
filter_query_params.delete(:f)
|
118
|
-
filter_query_params.delete(:save_browse_level_exclude_button)
|
119
|
-
filter_query_params.delete(:collection_id)
|
120
|
-
filter_query_params.delete(:browse_level_id)
|
121
|
-
@browse_level.update_attributes(:exclude_query_params=>filter_query_params)
|
122
|
-
redirect_to edit_atrium_exhibit_path(@browse_level.atrium_exhibit_id)
|
123
|
-
else
|
124
|
-
redirect_to new_atrium_exhibit_path
|
125
|
-
end
|
126
|
-
else
|
127
|
-
delete_or_assign_search_session_params if !params[:add_description]
|
128
|
-
|
129
|
-
extra_head_content << view_context.auto_discovery_link_tag(:rss, url_for(params.merge(:format => 'rss')), :title => "RSS for results")
|
130
|
-
extra_head_content << view_context.auto_discovery_link_tag(:atom, url_for(params.merge(:format => 'atom')), :title => "Atom for results")
|
131
|
-
|
132
|
-
@extra_controller_params ||= {}
|
133
|
-
if params[:exhibit_id]
|
134
|
-
@exhibit = Atrium::Exhibit.find(params[:exhibit_id])
|
135
|
-
@atrium_collection = @exhibit.collection if @exhibit
|
136
|
-
end
|
137
|
-
|
138
|
-
if params[:browse_level_id]
|
139
|
-
@browse_level = Atrium::BrowseLevel.find(params[:browse_level_id])
|
140
|
-
@exhibit = @browse_level.exhibit if @browse_level
|
141
|
-
@atrium_collection = @exhibit.collection if @exhibit
|
142
|
-
end
|
143
|
-
|
144
|
-
#do not mixin whatever level I am on if I am editing the settings
|
145
|
-
collection = @atrium_collection unless params[:edit_collection_filter]
|
146
|
-
exhibit = @exhibit unless params[:edit_exhibit_filter] || params[:edit_collection_filter]
|
147
|
-
browse_level = @browse_level unless params[:edit_exhibit_filter] || params[:edit_collection_filter] || params[:edit_browse_level_filter]
|
148
|
-
#logger.debug("collection is: #{collection.inspect}")
|
149
|
-
#logger.debug("exhibit is: #{exhibit.inspect}")
|
150
|
-
#logger.debug("browse level is: #{browse_level.inspect}")
|
151
|
-
#logger.debug("params before search are: #{params.inspect}")
|
152
|
-
if params[:add_description] || params[:edit_exhibit_filter] || params[:edit_collection_filter] || params[:edit_browse_level_filter] || params[:CKEditor]
|
153
|
-
@extra_controller_params={}
|
154
|
-
else
|
155
|
-
@extra_controller_params = prepare_extra_controller_params_for_collection_query(collection,exhibit,browse_level,params,@extra_controller_params) if collection || exhibit || browse_level
|
156
|
-
end
|
157
|
-
|
158
|
-
logger.debug("extra params before search are: #{@extra_controller_params.inspect}")
|
159
|
-
(@response, @document_list) = get_search_results(params,@extra_controller_params)
|
160
|
-
@images = get_all_children(@document_list, "is_part_of_s")
|
161
|
-
#@members = get_all_children(@document_list, "is_member_of_s")
|
162
|
-
|
163
|
-
#reset to settings before was merged with user params
|
164
|
-
@extra_controller_params = reset_extra_controller_params_after_collection_query(collection,exhibit,browse_level,@extra_controller_params) if collection || exhibit || browse_level
|
165
|
-
@filters = params[:f] || []
|
166
|
-
search_session[:total] = @response.total unless @response.nil?
|
167
|
-
|
168
|
-
if params[:CKEditor] || params[:edit_exhibit_filter] || params[:edit_collection_filter] || params[:edit_browse_level_filter] || params[:add_featured]
|
169
|
-
render "list_item", :layout=> "item_listing"
|
170
|
-
elsif params[:add_description]
|
171
|
-
render "list_description", :layout=> "item_listing"
|
172
|
-
end
|
173
|
-
|
174
|
-
respond_to do |format|
|
175
|
-
format.html { save_current_search_params unless params[:edit_exhibit_filter] || params[:edit_collection_filter] || params[:edit_browse_level_filter]}
|
176
|
-
format.rss { render :layout => false }
|
177
|
-
format.atom { render :layout => false }
|
178
|
-
end
|
179
|
-
end
|
180
|
-
end
|
181
|
-
|
182
|
-
def initialize_collection
|
183
|
-
if collection_id = determine_collection_id
|
184
|
-
return __initialize_collection( collection_id )
|
185
|
-
else
|
186
|
-
return false
|
187
|
-
end
|
188
|
-
end
|
189
|
-
|
190
|
-
#protected :initialize_collection
|
191
|
-
|
192
|
-
private
|
193
|
-
|
194
|
-
def determine_collection_id
|
195
|
-
if params.has_key? :collection_id
|
196
|
-
return params[:collection_id]
|
197
|
-
elsif params.has_key? :collection_number
|
198
|
-
return params[:collection_number]
|
199
|
-
end
|
200
|
-
end
|
201
|
-
|
202
|
-
end
|
203
|
-
|