atrium 0.0.1 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (382) hide show
  1. data/.gitignore +9 -1
  2. data/.rspec +2 -0
  3. data/.rvmrc +1 -1
  4. data/CONTRIBUTING.md +73 -0
  5. data/Gemfile +27 -2
  6. data/Gemfile.lock +122 -246
  7. data/Guardfile +40 -10
  8. data/LICENSE +14 -0
  9. data/README.mkd +23 -39
  10. data/ROADMAP.mkd +41 -9
  11. data/Rakefile +39 -4
  12. data/app/assets/images/atrium/remove.png +0 -0
  13. data/app/assets/images/atrium/white-arrow.png +0 -0
  14. data/app/assets/javascripts/{atrium/atrium.js → atrium.js} +8 -153
  15. data/app/assets/stylesheets/{atrium/atrium.css → atrium.css} +110 -37
  16. data/app/assets/stylesheets/atrium/collections.css +4 -0
  17. data/app/assets/stylesheets/atrium/descriptions.css +4 -0
  18. data/app/assets/stylesheets/atrium/exhibits.css +4 -0
  19. data/app/assets/stylesheets/atrium/reset.css +69 -0
  20. data/app/assets/stylesheets/atrium/showcases.css +4 -0
  21. data/app/assets/stylesheets/atrium/theme.css +248 -0
  22. data/app/controllers/atrium/application_controller.rb +12 -0
  23. data/app/controllers/atrium/browse_levels_controller.rb +22 -0
  24. data/app/controllers/atrium/collections_controller.rb +42 -138
  25. data/app/controllers/atrium/descriptions_controller.rb +27 -146
  26. data/app/controllers/atrium/exhibits_controller.rb +51 -77
  27. data/app/controllers/atrium/order_controller.rb +74 -0
  28. data/app/controllers/atrium/showcases_controller.rb +96 -117
  29. data/app/helpers/atrium/application_helper.rb +8 -0
  30. data/app/helpers/atrium/collections_helper.rb +44 -0
  31. data/app/helpers/atrium/descriptions_helper.rb +4 -0
  32. data/app/helpers/atrium/exhibits_helper.rb +4 -0
  33. data/app/helpers/atrium/showcases_helper.rb +34 -0
  34. data/app/models/atrium/browse_level.rb +21 -11
  35. data/app/models/atrium/collection.rb +70 -36
  36. data/app/models/atrium/configuration.rb +66 -0
  37. data/app/models/atrium/description.rb +39 -88
  38. data/app/models/atrium/essay.rb +4 -5
  39. data/app/models/atrium/exhibit.rb +28 -19
  40. data/app/models/atrium/is_showcased_mixin.rb +34 -0
  41. data/app/models/atrium/query_param_mixin.rb +105 -0
  42. data/app/models/atrium/search/facet.rb +14 -25
  43. data/app/models/atrium/search/facet_selection.rb +10 -12
  44. data/app/models/atrium/showcase.rb +105 -95
  45. data/app/models/atrium/showcase/facet_selection.rb +18 -18
  46. data/app/models/atrium/showcase/featured_selection.rb +15 -0
  47. data/app/services/browse_level_evaluation_service.rb +131 -0
  48. data/app/services/current_filter_query_params_extraction_service.rb +91 -0
  49. data/app/services/navigation_tree.rb +13 -0
  50. data/app/services/params_adaptor_for_filter.rb +18 -0
  51. data/app/views/atrium/collections/_form.html.erb +149 -72
  52. data/app/views/atrium/collections/_head.html.erb +3 -0
  53. data/app/views/atrium/collections/edit.html.erb +1 -4
  54. data/app/views/atrium/collections/index.html.erb +14 -0
  55. data/app/views/atrium/collections/new.html.erb +2 -5
  56. data/app/views/atrium/collections/show.html.erb +11 -29
  57. data/app/views/atrium/descriptions/_form.html.erb +47 -49
  58. data/app/views/atrium/descriptions/edit.html.erb +1 -2
  59. data/app/views/atrium/descriptions/index.html.erb +2 -8
  60. data/app/views/atrium/descriptions/new.html.erb +2 -1
  61. data/app/views/atrium/descriptions/show.html.erb +2 -20
  62. data/app/views/atrium/exhibits/_exhibit.html.erb +1 -0
  63. data/app/views/atrium/exhibits/_form.html.erb +143 -96
  64. data/app/views/atrium/exhibits/edit.html.erb +1 -8
  65. data/app/views/atrium/exhibits/index.html.erb +2 -0
  66. data/app/views/atrium/exhibits/new.html.erb +0 -5
  67. data/app/views/atrium/exhibits/show.html.erb +2 -34
  68. data/app/views/atrium/showcases/_configure_menu.html.erb +55 -0
  69. data/app/views/atrium/showcases/_form.html.erb +40 -0
  70. data/app/views/atrium/showcases/edit.html.erb +3 -0
  71. data/app/views/atrium/showcases/index.html.erb +32 -0
  72. data/app/views/atrium/showcases/new.html.erb +3 -0
  73. data/app/views/atrium/showcases/show.html.erb +2 -1
  74. data/app/views/layouts/atrium.html.erb +16 -24
  75. data/app/views/layouts/atrium/application.html.erb +49 -0
  76. data/app/views/layouts/atrium/themes/default.html.erb +15 -0
  77. data/app/views/shared/_list_searchs.html.erb +4 -0
  78. data/app/views/shared/_navigation.html.erb +19 -0
  79. data/atrium.gemspec +31 -64
  80. data/config/routes.rb +40 -10
  81. data/{lib/generators/atrium/templates/migrations/create_atrium_collections.rb → db/migrate/20120730170406_create_atrium_collections.rb} +2 -1
  82. data/{lib/generators/atrium/templates/migrations/create_atrium_showcases.rb → db/migrate/20120731134846_create_atrium_showcases.rb} +3 -4
  83. data/{lib/generators/atrium/templates/migrations/create_atrium_exhibits.rb → db/migrate/20120731134856_create_atrium_exhibits.rb} +2 -1
  84. data/{lib/generators/atrium/templates/migrations/create_atrium_descriptions.rb → db/migrate/20120731134904_create_atrium_descriptions.rb} +2 -1
  85. data/{lib/generators/atrium/templates/migrations/create_atrium_essays.rb → db/migrate/20120731135534_create_atrium_essays.rb} +3 -2
  86. data/{lib/generators/atrium/templates/migrations/create_atrium_search_facets.rb → db/migrate/20120731135721_create_atrium_search_facets.rb} +1 -1
  87. data/{lib/generators/atrium/templates/migrations/create_atrium_showcase_facet_selections.rb → db/migrate/20120731140621_create_atrium_showcase_facet_selections.rb} +6 -2
  88. data/{lib/generators/atrium/templates/migrations/create_atrium_browse_levels.rb → db/migrate/20120801145241_create_atrium_browse_levels.rb} +1 -1
  89. data/db/migrate/20120820183808_create_selected_items.rb +16 -0
  90. data/db/migrate/20120823135716_update_atrium_collection_indices.rb +13 -0
  91. data/db/migrate/20120823143315_add_lookup_indices_as_required.rb +11 -0
  92. data/lib/atrium.rb +40 -36
  93. data/lib/atrium/engine.rb +4 -8
  94. data/lib/atrium/exceptions.rb +10 -0
  95. data/lib/atrium/version.rb +2 -2
  96. data/lib/generators/atrium/install/USAGE +8 -0
  97. data/lib/generators/atrium/install/install_generator.rb +86 -0
  98. data/lib/generators/atrium/install/templates/atrium_initializer.rb +21 -0
  99. data/lib/generators/atrium/install/templates/controllers/atrium_base_controller.rb +18 -0
  100. data/lib/generators/atrium/install/templates/controllers/collections_controller.rb +40 -0
  101. data/lib/generators/atrium/install/templates/controllers/descriptions_controller.rb +36 -0
  102. data/lib/generators/atrium/install/templates/controllers/exhibits_controller.rb +47 -0
  103. data/lib/generators/atrium/install/templates/controllers/selected_items_controller.rb +26 -0
  104. data/lib/generators/atrium/install/templates/helpers/application_helper.rb +42 -0
  105. data/lib/generators/atrium/install/templates/helpers/collections_helper.rb +15 -0
  106. data/lib/generators/atrium/install/templates/helpers/navigation_helper.rb +62 -0
  107. data/lib/generators/atrium/install/templates/helpers/solr_helper.rb +138 -0
  108. data/lib/generators/atrium/install/templates/models/selected_item.rb +7 -0
  109. data/lib/generators/atrium/install/templates/views/collections/_document.html.erb +19 -0
  110. data/lib/generators/atrium/install/templates/views/collections/_exhibits.html.erb +3 -0
  111. data/lib/generators/atrium/install/templates/views/collections/_pagination.html.erb +6 -0
  112. data/lib/generators/atrium/install/templates/views/collections/browse.html.erb +16 -0
  113. data/lib/generators/atrium/install/templates/views/collections/show.html.erb +19 -0
  114. data/lib/generators/atrium/install/templates/views/descriptions/show.html.erb +8 -0
  115. data/lib/generators/atrium/install/templates/views/exhibits/_document.html.erb +19 -0
  116. data/lib/generators/atrium/install/templates/views/exhibits/_pagination.html.erb +6 -0
  117. data/lib/generators/atrium/install/templates/views/exhibits/show.html.erb +28 -0
  118. data/lib/generators/atrium/install/templates/views/folder/_selected_items_form.html.erb +8 -0
  119. data/lib/generators/atrium/install/templates/views/folder/index.html.erb +45 -0
  120. data/lib/generators/atrium/install/templates/views/shared/_document_list.html.erb +14 -0
  121. data/lib/generators/atrium/install/templates/views/shared/_featured_sources.html.erb +19 -0
  122. data/lib/generators/atrium/install/templates/views/shared/_list_descriptions.html.erb +25 -0
  123. data/lib/generators/atrium/install/templates/views/shared/_masthead.html.erb +19 -0
  124. data/lib/generators/atrium/install/templates/views/shared/_navigation_browse_level.html.erb +34 -0
  125. data/lib/generators/atrium/install/templates/views/shared/_showcases.html.erb +12 -0
  126. data/lib/generators/atrium/install/templates/views/shared/_side_bar_navigation.html.erb +20 -0
  127. data/lib/generators/atrium/service/USAGE +9 -0
  128. data/lib/generators/atrium/service/service_generator.rb +16 -0
  129. data/lib/generators/atrium/service/templates/service.rb.erb +2 -0
  130. data/lib/generators/atrium/service/templates/service_spec.rb.erb +4 -0
  131. data/lib/generators/atrium/theme/USAGE +8 -0
  132. data/lib/generators/atrium/theme/templates/theme.html.erb +14 -0
  133. data/lib/generators/atrium/theme/theme_generator.rb +11 -0
  134. data/lib/tasks/atrium_tasks.rake +4 -0
  135. data/script/rails +10 -0
  136. data/spec/atrium_spec.rb +10 -0
  137. data/spec/controllers/atrium/application_controller_spec.rb +7 -0
  138. data/spec/controllers/atrium/collections_controller_spec.rb +125 -0
  139. data/spec/controllers/atrium/descriptions_controller_spec.rb +142 -0
  140. data/spec/controllers/atrium/exhibits_controller_spec.rb +102 -0
  141. data/spec/controllers/atrium/order_controller_spec.rb +100 -0
  142. data/spec/controllers/atrium/showcases_controller_spec.rb +217 -0
  143. data/spec/dummy/README.rdoc +261 -0
  144. data/spec/dummy/Rakefile +7 -0
  145. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  146. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  147. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  148. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  149. data/spec/dummy/app/mailers/.gitkeep +0 -0
  150. data/spec/dummy/app/models/.gitkeep +0 -0
  151. data/spec/dummy/app/models/collection.rb +3 -0
  152. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  153. data/spec/dummy/config.ru +4 -0
  154. data/spec/dummy/config/application.rb +59 -0
  155. data/spec/dummy/config/boot.rb +10 -0
  156. data/spec/dummy/config/database.yml +25 -0
  157. data/spec/dummy/config/environment.rb +5 -0
  158. data/spec/dummy/config/environments/development.rb +37 -0
  159. data/spec/dummy/config/environments/production.rb +67 -0
  160. data/spec/dummy/config/environments/test.rb +37 -0
  161. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  162. data/spec/dummy/config/initializers/inflections.rb +15 -0
  163. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  164. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  165. data/spec/dummy/config/initializers/session_store.rb +8 -0
  166. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  167. data/spec/dummy/config/locales/en.yml +5 -0
  168. data/spec/dummy/config/routes.rb +4 -0
  169. data/spec/dummy/db/schema.rb +124 -0
  170. data/spec/dummy/lib/assets/.gitkeep +0 -0
  171. data/spec/dummy/log/.gitkeep +0 -0
  172. data/spec/dummy/public/404.html +26 -0
  173. data/spec/dummy/public/422.html +26 -0
  174. data/spec/dummy/public/500.html +25 -0
  175. data/spec/dummy/public/favicon.ico +0 -0
  176. data/spec/dummy/script/rails +6 -0
  177. data/spec/dummy/test/fixtures/collections.yml +11 -0
  178. data/spec/dummy/test/unit/collection_test.rb +7 -0
  179. data/spec/factories/atrium_collections.rb +8 -0
  180. data/spec/factories/atrium_exhibits.rb +9 -0
  181. data/spec/factories/atrium_search_facets.rb +8 -0
  182. data/spec/factories/atrium_showcases.rb +25 -0
  183. data/spec/helpers/atrium/collections_helper_spec.rb +57 -0
  184. data/spec/helpers/atrium/showcases_helper_spec.rb +56 -0
  185. data/spec/models/atrium/browse_level_spec.rb +56 -0
  186. data/spec/models/atrium/collection_spec.rb +76 -0
  187. data/spec/models/atrium/configuration_spec.rb +114 -0
  188. data/spec/models/atrium/description_spec.rb +56 -0
  189. data/spec/models/atrium/essay_spec.rb +16 -0
  190. data/spec/models/atrium/exhibit_spec.rb +90 -0
  191. data/spec/models/atrium/search/facet_selection_spec.rb +23 -0
  192. data/{test_support/spec → spec}/models/atrium/search/facet_spec.rb +2 -4
  193. data/{test_support/spec → spec}/models/atrium/showcase/facet_selection_spec.rb +5 -5
  194. data/spec/models/atrium/showcase/featured_selection_spec.rb +18 -0
  195. data/spec/models/atrium/showcase_spec.rb +97 -0
  196. data/spec/services/browse_level_evaluation_service_spec.rb +33 -0
  197. data/spec/services/current_filter_query_params_extraction_service_spec.rb +34 -0
  198. data/spec/services/navigation_tree_spec.rb +18 -0
  199. data/spec/services/params_adaptor_for_filter_spec.rb +8 -0
  200. data/spec/spec_helper.rb +39 -0
  201. data/spec/support/accept_nested_attributes_for.rb +39 -0
  202. data/{test_support/spec → spec}/support/be_accessible_matcher.rb +0 -0
  203. data/{test_support/spec → spec}/support/be_routed_mixin.rb +0 -0
  204. data/spec/support/controller_hacks.rb +35 -0
  205. data/spec/support/routes.rb +5 -0
  206. data/spec/support/shared_examples/is_showcased_mixin.rb +20 -0
  207. data/spec/support/shared_examples/query_param_mixin.rb +179 -0
  208. data/{app/assets/stylesheets/atrium → vendor/assets/images}/chosen-sprite.png +0 -0
  209. data/{app → vendor}/assets/javascripts/chosen.jquery.js +0 -0
  210. data/{app → vendor}/assets/javascripts/ckeditor.warning.js +0 -0
  211. data/{app → vendor}/assets/javascripts/ckeditor/config.js.coffee +0 -0
  212. data/{app → vendor}/assets/javascripts/ckeditor/jquery.generateId.js +0 -0
  213. data/{app → vendor}/assets/javascripts/ckeditor/jquery.jeditable.ckeditor.js +0 -0
  214. data/{app → vendor}/assets/javascripts/ckeditor/plugins/linkItem/application_link.png +0 -0
  215. data/{app → vendor}/assets/javascripts/ckeditor/plugins/linkItem/dialogs/linkItem.js +0 -0
  216. data/{app → vendor}/assets/javascripts/ckeditor/plugins/linkItem/plugin.js +0 -0
  217. data/{app → vendor}/assets/javascripts/ckeditor/plugins/linkItem/ui_toolbar_pencil.png +0 -0
  218. data/vendor/assets/javascripts/jquery-ui-1.8.23.custom.min.js +41 -0
  219. data/vendor/assets/javascripts/jquery-ui-build.txt +8 -0
  220. data/{app → vendor}/assets/javascripts/jquery.jeditable.js +0 -0
  221. data/{app/assets/stylesheets/atrium → vendor/assets/stylesheets}/chosen.css +4 -4
  222. data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  223. data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  224. data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  225. data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  226. data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  227. data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  228. data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  229. data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  230. data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  231. data/vendor/assets/stylesheets/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  232. data/vendor/assets/stylesheets/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  233. data/vendor/assets/stylesheets/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  234. data/vendor/assets/stylesheets/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  235. data/vendor/assets/stylesheets/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  236. data/vendor/assets/stylesheets/ui-lightness/jquery-ui-1.8.23.custom.css +334 -0
  237. metadata +431 -949
  238. data/GETTING_STARTED.textile +0 -102
  239. data/app/assets/images/atrium/ajax-loader.gif +0 -0
  240. data/app/assets/images/atrium/lightbox-ico-loading.gif +0 -0
  241. data/app/assets/images/atrium/logo.png +0 -0
  242. data/app/assets/javascripts/jquery.colorbox.js +0 -864
  243. data/app/assets/stylesheets/colorbox.css +0 -42
  244. data/app/assets/stylesheets/controls.png +0 -0
  245. data/app/assets/stylesheets/loading.gif +0 -0
  246. data/app/controllers/atrium/base_controller.rb +0 -25
  247. data/app/controllers/atrium/collection_exhibit_order_controller.rb +0 -21
  248. data/app/controllers/atrium/customization_controller.rb +0 -41
  249. data/app/controllers/atrium/exhibit_facet_order_controller.rb +0 -19
  250. data/app/helpers/atrium/base_helper.rb +0 -6
  251. data/app/models/ability.rb +0 -14
  252. data/app/models/atrium/showcase/item.rb +0 -19
  253. data/app/models/role_mapper.rb +0 -23
  254. data/app/views/_user_util_links.html.erb +0 -25
  255. data/app/views/atrium/collections/_bookmark_control.html.erb +0 -25
  256. data/app/views/atrium/collections/_browse_index.html.erb +0 -20
  257. data/app/views/atrium/collections/_collection_items_index.html.erb +0 -10
  258. data/app/views/atrium/collections/_document.html.erb +0 -24
  259. data/app/views/atrium/collections/_document_list.html.erb +0 -6
  260. data/app/views/atrium/collections/_edit_navigation.html.erb +0 -20
  261. data/app/views/atrium/collections/_folder_control.html.erb +0 -12
  262. data/app/views/atrium/collections/_listing.html.erb +0 -18
  263. data/app/views/atrium/collections/_navigation.html.erb +0 -50
  264. data/app/views/atrium/collections/_results_pagination.html.erb +0 -9
  265. data/app/views/atrium/collections/_sort_and_per_page.html.erb +0 -23
  266. data/app/views/atrium/exhibits/_bookmark_control.html.erb +0 -25
  267. data/app/views/atrium/exhibits/_folder_control.html.erb +0 -12
  268. data/app/views/atrium/exhibits/_navigation.html.erb +0 -30
  269. data/app/views/atrium/showcases/_showcase_navigation.html.erb +0 -23
  270. data/app/views/catalog/_collection_home_text.html.erb +0 -6
  271. data/app/views/catalog/_constraints.html.erb +0 -9
  272. data/app/views/catalog/_default_collection_text.html.erb +0 -18
  273. data/app/views/catalog/_default_home_text.html.erb +0 -6
  274. data/app/views/catalog/_home_text.html.erb +0 -6
  275. data/app/views/catalog/_index_partials/_description.html.erb +0 -8
  276. data/app/views/catalog/_search_form.html.erb +0 -66
  277. data/app/views/catalog/_show_partials/_description.html.erb +0 -15
  278. data/app/views/catalog/browse_show.html.erb +0 -18
  279. data/app/views/catalog/index.html.erb +0 -41
  280. data/app/views/catalog/list_description.html.erb +0 -24
  281. data/app/views/catalog/list_item.html.erb +0 -3
  282. data/app/views/layouts/atrium_themes/default.html.erb +0 -4
  283. data/app/views/layouts/item_listing.html.erb +0 -36
  284. data/app/views/listing/_document.html.erb +0 -27
  285. data/app/views/listing/_document_list.html.erb +0 -3
  286. data/app/views/listing/_item_search.html.erb +0 -27
  287. data/app/views/shared/_banner.html.erb +0 -5
  288. data/app/views/shared/_collection_complete_list.html.erb +0 -33
  289. data/app/views/shared/_collection_search_form.html.erb +0 -12
  290. data/app/views/shared/_collection_title_header.html.erb +0 -3
  291. data/app/views/shared/_featured_sources.html.erb +0 -23
  292. data/app/views/shared/_list_descriptions.html.erb +0 -39
  293. data/app/views/shared/_navigation_browse_levels.html.erb +0 -34
  294. data/app/views/shared/_showcase_configure_menu.html.erb +0 -22
  295. data/app/views/shared/_top_navigation.html.erb +0 -9
  296. data/init.rb +0 -3
  297. data/lib/application_controller.rb +0 -24
  298. data/lib/atrium/application_helper.rb +0 -24
  299. data/lib/atrium/atrium_helper_behavior.rb +0 -159
  300. data/lib/atrium/catalog.rb +0 -203
  301. data/lib/atrium/collections_helper.rb +0 -172
  302. data/lib/atrium/controller.rb +0 -10
  303. data/lib/atrium/descriptions_helper.rb +0 -27
  304. data/lib/atrium/layout_helper.rb +0 -13
  305. data/lib/atrium/routes.rb +0 -100
  306. data/lib/atrium/solr_helper.rb +0 -440
  307. data/lib/generators/atrium/assets_generator.rb +0 -44
  308. data/lib/generators/atrium/atrium_generator.rb +0 -149
  309. data/lib/generators/atrium/cucumber_support_generator.rb +0 -29
  310. data/lib/generators/atrium/templates/config/role_map_cucumber.yml +0 -2
  311. data/lib/generators/atrium/templates/config/role_map_development.yml +0 -2
  312. data/lib/generators/atrium/templates/config/role_map_production.yml +0 -2
  313. data/lib/generators/atrium/templates/config/role_map_test.yml +0 -2
  314. data/lib/generators/atrium/templates/config/solr.yml +0 -10
  315. data/lib/generators/atrium/templates/db/seeds.rb +0 -87
  316. data/lib/generators/atrium/templates/migrations/create_atrium_showcase_items.rb +0 -17
  317. data/lib/generators/atrium/templates/themes/example.html.erb +0 -21
  318. data/lib/railties/all_tests.rake +0 -23
  319. data/lib/railties/atrium_cucumber.rake +0 -121
  320. data/lib/railties/index.rake +0 -37
  321. data/tasks/atrium.rake +0 -268
  322. data/tasks/atrium_rspec.rake +0 -91
  323. data/test_support/etc/Gemfile +0 -33
  324. data/test_support/etc/bundle_config +0 -3
  325. data/test_support/etc/rvmrc +0 -32
  326. data/test_support/features/atrium_collections.feature +0 -162
  327. data/test_support/features/atrium_exhibits.feature +0 -164
  328. data/test_support/features/step_definitions/atrium_collection_steps.rb +0 -102
  329. data/test_support/features/step_definitions/atrium_exhibit_steps.rb +0 -53
  330. data/test_support/features/step_definitions/bookmarks_steps.rb +0 -6
  331. data/test_support/features/step_definitions/error_steps.rb +0 -5
  332. data/test_support/features/step_definitions/folder_steps.rb +0 -27
  333. data/test_support/features/step_definitions/general_steps.rb +0 -50
  334. data/test_support/features/step_definitions/record_view_steps.rb +0 -12
  335. data/test_support/features/step_definitions/saved_searches_steps.rb +0 -22
  336. data/test_support/features/step_definitions/search_facets_steps.rb +0 -29
  337. data/test_support/features/step_definitions/search_history_steps.rb +0 -9
  338. data/test_support/features/step_definitions/search_result_steps.rb +0 -114
  339. data/test_support/features/step_definitions/search_steps.rb +0 -103
  340. data/test_support/features/step_definitions/user_steps.rb +0 -5
  341. data/test_support/features/step_definitions/web_steps.rb +0 -213
  342. data/test_support/features/support/env.rb +0 -67
  343. data/test_support/features/support/paths.rb +0 -76
  344. data/test_support/features/support/selectors.rb +0 -40
  345. data/test_support/fixtures/atrium_exhibits.yml +0 -3
  346. data/test_support/spec/controllers/atrium/base_controller_spec.rb +0 -13
  347. data/test_support/spec/controllers/atrium/collection_exhibit_order_controller_spec.rb +0 -29
  348. data/test_support/spec/controllers/atrium/collections_controller_spec.rb +0 -185
  349. data/test_support/spec/controllers/atrium/customization_controller_spec.rb +0 -38
  350. data/test_support/spec/controllers/atrium/descriptions_controller_spec.rb +0 -150
  351. data/test_support/spec/controllers/atrium/exhibit_facet_order_controller_spec.rb +0 -36
  352. data/test_support/spec/controllers/atrium/exhibits_controller_spec.rb +0 -192
  353. data/test_support/spec/controllers/atrium/showcases_controller_spec.rb +0 -219
  354. data/test_support/spec/helpers/atrium_collections_helper_spec.rb +0 -147
  355. data/test_support/spec/helpers/atrium_description_helper_spec.rb +0 -47
  356. data/test_support/spec/helpers/atrium_solr_helper_spec.rb +0 -522
  357. data/test_support/spec/models/atrium/browse_level_spec.rb +0 -31
  358. data/test_support/spec/models/atrium/collection_spec.rb +0 -30
  359. data/test_support/spec/models/atrium/description_spec.rb +0 -67
  360. data/test_support/spec/models/atrium/essay_spec.rb +0 -12
  361. data/test_support/spec/models/atrium/exhibit_spec.rb +0 -76
  362. data/test_support/spec/models/atrium/search/facet_selection_spec.rb +0 -24
  363. data/test_support/spec/models/atrium/search_facet_spec.rb +0 -54
  364. data/test_support/spec/models/atrium/showcase/item_spec.rb +0 -12
  365. data/test_support/spec/models/atrium/showcase_facet_selection_spec.rb +0 -65
  366. data/test_support/spec/models/atrium/showcase_spec.rb +0 -134
  367. data/test_support/spec/rcov.opts +0 -3
  368. data/test_support/spec/routing/atrium/collections_routing_spec.rb +0 -33
  369. data/test_support/spec/spec.opts +0 -4
  370. data/test_support/spec/spec_helper.rb +0 -47
  371. data/test_support/tmp/step_definitions/catalog_index_steps.rb +0 -14
  372. data/test_support/tmp/step_definitions/edit_document_steps.rb +0 -67
  373. data/test_support/tmp/step_definitions/hydra_metadata_steps.rb +0 -3
  374. data/test_support/tmp/step_definitions/hydra_steps.rb +0 -8
  375. data/test_support/tmp/step_definitions/search_steps.rb +0 -86
  376. data/test_support/tmp/step_definitions/searching_steps.rb +0 -22
  377. data/test_support/tmp/step_definitions/select_steps.rb +0 -8
  378. data/test_support/tmp/step_definitions/show_document_steps.rb +0 -73
  379. data/test_support/tmp/step_definitions/user_steps.rb +0 -15
  380. data/test_support/tmp/step_definitions/web_steps.rb +0 -273
  381. data/test_support/tmp/support/env.rb +0 -54
  382. data/test_support/tmp/support/paths.rb +0 -57
@@ -1,21 +1,21 @@
1
- class Atrium::Showcase::FacetSelection < ActiveRecord::Base
2
- self.table_name = 'atrium_showcase_facet_selections'
1
+ module Atrium
2
+ class Showcase::FacetSelection < ActiveRecord::Base
3
+ belongs_to(
4
+ :showcase,
5
+ class_name: 'Atrium::Showcase',
6
+ foreign_key: 'atrium_showcase_id'
7
+ )
3
8
 
4
- belongs_to(
5
- :showcase,
6
- :class_name => 'Atrium::Showcase',
7
- :foreign_key => 'atrium_showcase_id'
8
- )
9
+ validates_presence_of(
10
+ :atrium_showcase_id,
11
+ :value,
12
+ :solr_facet_name
13
+ )
9
14
 
10
- validates_presence_of(
11
- :atrium_showcase_id,
12
- :value,
13
- :solr_facet_name
14
- )
15
-
16
- attr_accessible(
17
- :atrium_showcase_id,
18
- :solr_facet_name,
19
- :value
20
- )
15
+ attr_accessible(
16
+ :atrium_showcase_id,
17
+ :solr_facet_name,
18
+ :value
19
+ )
20
+ end
21
21
  end
@@ -0,0 +1,15 @@
1
+ module Atrium
2
+ class Showcase::FeaturedSelection
3
+ include Atrium::ApplicationHelper
4
+
5
+ attr_reader :solr_id, :title
6
+
7
+ def initialize(selected_item_hash)
8
+ @solr_id = selected_item_hash[:id]
9
+ @title = selected_item_hash[:title]
10
+ end
11
+
12
+
13
+ end
14
+ end
15
+
@@ -0,0 +1,131 @@
1
+ # Purpose: To walk the browse levels until we reach the current browse level.
2
+ # While walking the browse levels, determine which FacetItems to attach at each
3
+ # level.
4
+ #
5
+ # That is to say, each browse level's "values" are lazily evaluated.
6
+ #
7
+ # There is a complicated negotation of the Exhibit, Collection, BrowseLevel, and
8
+ # query params.
9
+ #
10
+ # TODO: Should this class be implemented as a delegate of the
11
+ # ApplicationController class. I am passing in three anonymous functions that
12
+ # could instead be deferred to the calling context.
13
+ class BrowseLevelEvaluationService
14
+ attr_reader(
15
+ :exhibit,
16
+ :extra_controller_params,
17
+ :params,
18
+ :solr_search_params_callable,
19
+ :get_search_results_callable
20
+ )
21
+
22
+ def initialize(
23
+ solr_search_params_callable,
24
+ get_search_results_callable,
25
+ facet_in_params_callable,
26
+ collection,
27
+ exhibit,
28
+ params
29
+ )
30
+ @solr_search_params_callable = solr_search_params_callable
31
+ @get_search_results_callable = get_search_results_callable
32
+ @facet_in_params_callable = facet_in_params_callable
33
+ @collection = collection
34
+ @exhibit = exhibit
35
+ @params = ParamsAdaptorForFilter.new(params)
36
+ end
37
+
38
+ def extract(browse_levels)
39
+ recursive_extract(browse_levels,true)
40
+ end
41
+
42
+ protected
43
+ def recursive_extract(browse_levels, top_level)
44
+ return [] if browse_levels.nil? || browse_levels.empty?
45
+ updated_browse_levels = []
46
+ browse_level = browse_levels.first
47
+ browse_facet_name = browse_level.solr_facet_name
48
+ updated_browse_levels << browse_level
49
+ deep_cloned_params = Marshal.load(Marshal.dump(params))
50
+
51
+ remove_f_params_for!(
52
+ deep_cloned_params,
53
+ browse_facet_name,
54
+ browse_levels,
55
+ top_level
56
+ )
57
+
58
+ response_without_f_param = extract_response_from(
59
+ deep_cloned_params,
60
+ browse_level
61
+ )
62
+
63
+ display_facet = response_without_f_param.facets.detect {|f|
64
+ f.name == browse_facet_name
65
+ }
66
+
67
+ unless display_facet.nil?
68
+ level_has_selected_facet = false
69
+ browse_level_subset = browse_levels.slice(1,browse_levels.length-1)
70
+
71
+ display_facet.items.each do |item|
72
+ browse_level.values << item.value
73
+ if @facet_in_params_callable.call(display_facet.name, item.value )
74
+ level_has_selected_facet = true
75
+ browse_level.selected = item.value
76
+ if browse_levels.length > 1
77
+ extracted_levels = recursive_extract(browse_level_subset, false)
78
+ updated_browse_levels << extracted_levels
79
+ updated_browse_levels.flatten!(1)
80
+ end
81
+ end
82
+ end
83
+
84
+ unless level_has_selected_facet
85
+ updated_browse_levels << browse_level_subset
86
+ updated_browse_levels.flatten!(1)
87
+ end
88
+ end
89
+ updated_browse_levels
90
+ end
91
+
92
+ protected
93
+
94
+ def remove_f_params_for!(fetchable, facet_name, browse_levels, top_level)
95
+ begin
96
+ f_hash = fetchable.fetch(:f)
97
+ rescue NoMethodError, KeyError
98
+ return fetchable
99
+ end
100
+
101
+ facet_entry =
102
+ begin
103
+ f_hash[facet_name] || f_hash[facet_name.to_s]
104
+ rescue TypeError
105
+ nil
106
+ end
107
+
108
+ if !top_level || facet_entry
109
+ browse_levels.each do |browse_level|
110
+ fetchable[:f].delete(browse_level.solr_facet_name)
111
+ end
112
+ else
113
+ fetchable[:f] = {}
114
+ end
115
+ end
116
+
117
+
118
+ def extract_response_from(modified_params, browse_level)
119
+ prepared_params = CurrentFilterQueryParamsExtractionService.new(
120
+ @solr_search_params_callable,
121
+ [exhibit.collection, exhibit, browse_level, modified_params],
122
+ [:filter_query_params,:exclude_query_params]
123
+ ).filter_query_params
124
+
125
+ (response_document, document_list) =
126
+ @get_search_results_callable.call(params,prepared_params)
127
+
128
+ response_document
129
+ end
130
+
131
+ end
@@ -0,0 +1,91 @@
1
+ # The purpose of this class is to consolodate the :q and :fq params for querying
2
+ # SOLR.
3
+ class CurrentFilterQueryParamsExtractionService
4
+ # @param [lambda] the function that will convert :f params to :fq
5
+ # @param [Array] an array of receiver objects that will interact with that may
6
+ # have methods which return a hash with keys :f and :q
7
+ # @param [Array] an array of symbols representing messages to send to each of
8
+ # the receiver objects; These messages should return a hash
9
+ def initialize(
10
+ solr_fq_extractor,
11
+ objects_to_merge_solr_params = [],
12
+ method_names_with_query_params = []
13
+ )
14
+
15
+ raise(
16
+ RuntimeError,
17
+ "Expected :solr_fq_extractor for #{self.class} to respond to #call"
18
+ ) unless solr_fq_extractor.respond_to?(:call)
19
+
20
+ raise(
21
+ RuntimeError,
22
+ "Expected :objects_to_merge_solr_params for #{self.class}" <<
23
+ " to respond to #each"
24
+ ) unless objects_to_merge_solr_params.respond_to?(:each)
25
+
26
+ raise(
27
+ RuntimeError,
28
+ "Expected :method_names_with_query_params for #{self.class}" <<
29
+ " to respond to #each"
30
+ ) unless method_names_with_query_params.respond_to?(:each)
31
+
32
+ @solr_fq_extractor = solr_fq_extractor
33
+ @objects_to_merge_solr_params = objects_to_merge_solr_params
34
+ @method_names_with_query_params = method_names_with_query_params
35
+ end
36
+
37
+ def filter_query_params
38
+ f_queries = []
39
+ queries = []
40
+
41
+ @objects_to_merge_solr_params.each do |object|
42
+ @method_names_with_query_params.each do |method_name|
43
+ collect_solr_params_from(object, method_name) do |q,fq|
44
+ queries << q if q
45
+ f_queries << fq if fq
46
+ end
47
+ end
48
+ end
49
+
50
+ {
51
+ fq: f_queries.uniq.flatten,
52
+ q: queries.uniq.flatten.join(" AND ")
53
+ }
54
+ end
55
+
56
+ protected
57
+
58
+ def collect_solr_params_from(object, method_name)
59
+ begin
60
+ return false unless object.public_send(method_name).present?
61
+ rescue NoMethodError
62
+ # Either an undefined method; or we are trying to call a private method
63
+ return false
64
+ end
65
+
66
+ query_params = object.public_send(method_name)
67
+
68
+ return false unless query_params.respond_to?(:fetch)
69
+
70
+ solrized_hash = @solr_fq_extractor.call(query_params)
71
+
72
+ q_value = nil
73
+ begin
74
+ q_value = solrized_hash.fetch(:q)
75
+ rescue NoMethodError, KeyError
76
+ end
77
+
78
+ fq_value = nil
79
+ begin
80
+ fq_value = solrized_hash.fetch(:fq)
81
+ rescue NoMethodError, KeyError
82
+ end
83
+
84
+ if q_value || fq_value
85
+ yield(q_value, fq_value)
86
+ return q_value, fq_value
87
+ else
88
+ return nil
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,13 @@
1
+ class NavigationTree
2
+ def initialize(browse_levels, facet_query_hash)
3
+ @browse_levels = browse_levels.clone
4
+ @facet_query_hash = facet_query_hash
5
+ end
6
+
7
+ def current_level
8
+ return nil unless @facet_query_hash.present?
9
+ @browse_levels.reverse.detect do |browse_level|
10
+ @facet_query_hash.has_key?(browse_level.solr_facet_name)
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,18 @@
1
+ class ParamsAdaptorForFilter < Delegator
2
+ def initialize(obj)
3
+ super
4
+ @_sd_obj = obj
5
+ end
6
+
7
+ def __getobj__
8
+ @_sd_obj
9
+ end
10
+
11
+ def __setobj__(obj)
12
+ @_sd_obj = obj
13
+ end
14
+
15
+ def filter_query_params
16
+ @_sd_obj
17
+ end
18
+ end
@@ -1,98 +1,175 @@
1
+ <%= form_for(@collection, :html => {:class => "atrium"}) do |f| %>
2
+ <% if @collection.errors.any? %>
3
+ <ul class="errors">
4
+ <% @collection.errors.full_messages.each do |msg| %>
5
+ <li><%= msg %></li>
6
+ <% end %>
7
+ </ul>
8
+ <% end %>
1
9
 
2
- <% content_for :atrium_side_bar do %>
3
- <%= render :partial => 'atrium/collections/edit_navigation' %>
4
- <% end %>
5
- <%= form_for(@atrium_collection, :html => {:class => "atrium"}) do |f| %>
6
10
  <fieldset>
7
- <legend>Basic Configuration</legend>
8
- <% if @atrium_collection.errors.any? %>
9
- <ul class="errors">
10
- <% @atrium_collection.errors.full_messages.each do |msg| %>
11
- <li><%= msg %></li>
12
- <% end %>
13
- </ul>
14
- <% end %>
15
-
11
+ <legend>Collection Attributes</legend>
16
12
  <ol>
17
13
  <li>
18
- <%= f.label :title, 'Title:' %>
14
+ <%= f.label :title, 'Title Text:' %>
19
15
  <%= f.text_field :title %>
20
16
  </li>
21
- <li>
22
- <%= f.label :title_markup, 'Title Markup:' %>
23
- <%= f.text_area :title_markup, :class => 'jquery-ckeditor' %>
24
- </li>
25
17
  <li>
26
18
  <%= f.label :url_slug, 'URL slug:' %>
27
19
  <%= f.text_field :url_slug %>
20
+ <small>
21
+ Enter the way you'd like this collection to be identified in the URL.<br />
22
+ It defaults to the numeric id of the collection.
23
+ </small>
28
24
  </li>
29
25
  <li>
30
- <%= f.label :search_facet_names, 'Collection Search Facets:' %>
31
- <%= f.collection_select :search_facet_names, blacklight_config.facet_fields.map {|key, facet| Atrium::Search::FacetSelection.new(:field_name => facet.field)}, :field_name, :label, {}, :multiple => true, :class => 'chosen', :'data-placeholder' => 'Select desired facets from the Collection' %>
32
- <li/>
26
+ <%= f.label :title_markup, 'HTML Title (optional):' %>
27
+ <%= f.text_area :title_markup, :class => 'jquery-ckeditor' %>
28
+ <small>
29
+ You can create an HTML title for use throughout this collection.<br />
30
+ For more dramatic view customization create a theme instead.
31
+ </small>
32
+ </li>
33
+ </ol>
34
+ </fieldset>
35
+
36
+ <fieldset>
37
+ <legend>Collection Scope</legend>
38
+ <p>
39
+ A collection is a subset of the total holdings.<br />
40
+ Save a search on the catalog page to use as the collection scope.
41
+ </p>
42
+ <p>
43
+ <% if f.object.filter_query_params.present? %>
44
+ Current Scope: <%= Atrium.query_param_beautifier(self,f.object.filter_query_params) %>
45
+ <%= f.check_box :remove_filter_query_params %>
46
+ <small>Use the checkbox to delete scope</small>
47
+ <% end %>
48
+ </p>
49
+ <ol>
33
50
  <li>
34
- <%= f.label :collection_description, 'Collection Browse Page About Text:' %>
35
- <%= f.text_area :collection_description, :rows=> '20', :cols => '120', :class => 'jquery-ckeditor' %>
51
+ <%= f.label :include_search_id, 'Set Collection Scope:' %>
52
+ <%= f.select(:include_search_id, saved_searches_for_select, { :include_blank => true }) %>
53
+ <small>Choose from one of your saved searches.</small>
36
54
  </li>
55
+ </ol>
56
+ </fieldset>
57
+
58
+ <fieldset>
59
+ <legend>Collection Options</legend>
60
+ <ol>
37
61
  <li>
38
- <%= f.label :search_instructions, 'Collection Search Page About Text:' %>
39
- <%= f.text_area :search_instructions, :rows=> '20', :cols => '120', :class => 'jquery-ckeditor' %>
62
+ <%= f.label :theme, 'Theme:' %>
63
+ <%= f.select :theme, @collection.class.available_themes %>
64
+ <small>Themes are created outside of the administrative interface.</small>
40
65
  </li>
41
66
  <li>
42
- <%= f.label :theme, 'Collection Theme:' %>
43
- <%= f.collection_select :theme, Atrium::Collection.available_themes, :to_s, :titleize %>
67
+ <%= f.label :search_facet_names, 'Collection Search Facets:' %>
68
+ <%= f.collection_select(
69
+ :search_facet_names,
70
+ Atrium.config.facet_fields.map {|key, facet| Atrium::Search::FacetSelection.new(:field_name => facet.field)},
71
+ :field_name,
72
+ :label,
73
+ {},
74
+ :multiple => true,
75
+ :class => 'chosen',
76
+ :'data-placeholder' => 'Select desired facets from the Collection'
77
+ )%>
78
+ </li>
79
+ </ol>
80
+ </fieldset>
81
+
82
+ <fieldset class="last">
83
+ <legend>Collection Description</legend>
84
+ <ol>
85
+ <li>
86
+ <%= f.label :collection_description, 'Collection Home Page About Text:' %>
87
+ <%= f.text_area :collection_description, :rows=> '20', :cols => '120', :class => 'jquery-ckeditor' %>
88
+ </li>
89
+ </ol>
44
90
  </li>
45
91
  </ol>
46
- <%= f.submit 'Update Collection Configuration', :class => 'button' %>
47
92
  </fieldset>
93
+ <p>
94
+ <% if @collection.new_record? %>
95
+ <%= f.submit 'Create Collection', :class => 'button' %>
96
+ <% else %>
97
+ <%= f.submit 'Update Collection', :class => 'button' %>
98
+ <% end %>
99
+ </p>
48
100
  <% end %>
101
+ <% unless @collection.new_record? %>
49
102
 
50
- <h3>Collection Scope</h3>
51
- <p>
52
- An collection is a subset of a collection. The scope of the collection can be set to any possible query made in the search interface.
53
- </p>
54
- <fieldset>
55
- <legend>Current Scope</legend>
56
- <%-if @atrium_collection.filter_query_params %>
57
- <ul>
58
- <%- @atrium_collection.filter_query_params.each do |key,value| %>
59
- <li><label><%= key %>: </label><%= value %></li>
60
- <%- end %>
61
- </ul>
62
- <%- end %>
63
- </fieldset>
64
- <%- query_params = {:collection_id=>@atrium_collection[:id],:edit_collection_filter=>true} -%>
65
- <%- query_params.merge!(@atrium_collection.filter_query_params) if @atrium_collection.filter_query_params -%>
66
- <%- query_params.delete(:controller) %>
67
- <%- query_params.delete(:action) %>
68
- <%- query_params.delete(:solr_doc_ids) %>
69
- <p class="exhibit-scope-controls">
70
- <%= link_to("Set Collection Scope", atrium_set_collection_scope_path(query_params), :class => 'button').html_safe %>
71
- <%= link_to("Remove Collection Scope", atrium_unset_collection_scope_path(@atrium_collection[:id]), :class => 'button').html_safe %>
72
- </p>
103
+ <hr />
73
104
 
74
105
  <h3>Exhibits</h3>
75
- <% if @atrium_collection.exhibits.any? %>
76
- <ol data-resource="<%= update_atrium_collection_exhibit_order_path %>" class="exhibit-listing sortable">
77
- <% @atrium_collection.exhibits.each do |exhibit| %>
78
- <li data-id="<%= exhibit[:id] %>" data-order="<%= exhibit.set_number %>" class="ui-state-default">
79
- <span class="ui-icon ui-icon-arrowthick-2-n-s"></span>
80
- <%= exhibit.pretty_title %>
81
- <span class="controls">
82
- <%= link_to 'Configure', edit_atrium_exhibit_path(exhibit) %>
106
+ <p>
107
+ An exhibit is a customizable view of a single topic (as defined by a facet),
108
+ further scoped by an optional Solr query. An exhibit defines it's own
109
+ hierarchical list of facets. It may also have a description and a list of
110
+ featured items.
111
+ </p>
112
+ <% if @collection.exhibits.any? %>
113
+ <ol data-resource="<%=update_collection_exhibit_order_path %>" class="exhibit-listing sortable">
114
+ <% @collection.exhibits.each do |exhibit| %>
115
+ <li data-id="<%= exhibit[:id] %>" data-order="<%= exhibit.set_number %>" class="ui-state-default">
116
+ <span class="ui-icon ui-icon-arrowthick-2-n-s"></span>
117
+ <%= exhibit.pretty_title %>
118
+ <span class="controls">
119
+ <%= link_to 'Configure', edit_collection_exhibit_path(exhibit.collection, exhibit) %>
120
+ <%= link_to(
121
+ 'Delete',
122
+ collection_exhibit_path(exhibit.collection, exhibit),
123
+ :method => :delete,
124
+ :class => :destroy,
125
+ :confirm => 'Do you really want to delete this exhibit?'
126
+ )%>
83
127
  </span>
84
- </li>
85
- <% end %>
86
- </ol>
87
- <% else %>
88
- <em>There are no exhibits in this collection.</em>
89
- <% end %>
90
- <% if can_add_view_exhibit? %>
91
- <%= form_for(@atrium_exhibit) do |exhibit| %>
92
- <%- @atrium_exhibit.set_number = @atrium_collection.exhibits.size + 1 -%>
93
- <%- @atrium_exhibit.atrium_collection_id = @atrium_collection[:id] -%>
94
- <%= exhibit.hidden_field :set_number %>
95
- <%= exhibit.hidden_field :atrium_collection_id %>
96
- <%= exhibit.submit 'Add a Exhibit to this Collection', :class => 'button' %>
128
+ </li>
129
+ <% end %>
130
+ </ol>
131
+ <% else %>
132
+ <p><em>There are no exhibits in this collection.</em></p>
133
+ <% end %>
134
+ <%= link_to 'Add a Exhibit to this Collection', new_collection_exhibit_path(@collection), :class => 'button' %>
135
+ <hr />
136
+
137
+ <h3>Showcases</h3>
138
+ <p>
139
+ A showcase is a container for storing featured items and descriptions. A
140
+ showcase can be attached to a collection, exhibit, or to specific
141
+ combinations of selected facets and facet values within an exhibit. There
142
+ can be multiple showcases in a collection.
143
+ </p>
144
+ <% if @collection.showcases.any? %>
145
+ <ol data-resource="<%=update_collection_showcase_order_path %>" class="exhibit-listing sortable">
146
+ <% @collection.showcases.each do |showcase| %>
147
+ <li data-id="<%= showcase.id%>" data-order="<%= showcase.sequence %>" class="ui-state-default">
148
+ <span class="ui-icon ui-icon-arrowthick-2-n-s"></span>
149
+ <%= showcase.pretty_title %>
150
+ <span class="controls">
151
+ <%= link_to 'Configure', get_showcase_parent_edit_path(showcase) %>
152
+ <%= link_to "Delete", get_showcase_parent_show_path(showcase), :method=>:delete, :class=>:destroy, :confirm=>"Do you really want to delete this showcase?"%>
153
+ </span>
154
+ </li>
155
+ <% end %>
156
+ </ol>
157
+ <% else %>
158
+ <p><em>There are no showcases in this collection.</em></p>
159
+ <% end %>
160
+ <%= link_to 'Add a Showcase to this Collection', new_collection_showcase_path(@collection), :class => 'button' %>
161
+
162
+ <hr />
163
+ <%= button_to(
164
+ 'Delete this Collection',
165
+ collection_path(@collection),
166
+ :method => :delete,
167
+ :form_class => 'collection-destroy-controls hazardous-action',
168
+ :confirm => 'Do you really want to delete this collection?',
169
+ :class => 'button'
170
+ )%>
171
+
172
+ <% content_for :atrium_side_bar do %>
173
+ <%= render :partial => 'shared/navigation' %>
97
174
  <% end %>
98
175
  <% end %>