atrium 0.0.1.alpha
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +13 -0
- data/.gitmodules +3 -0
- data/.rvmrc +32 -0
- data/GETTING_STARTED.textile +109 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +320 -0
- data/Guardfile +10 -0
- data/README.mkd +56 -0
- data/Rakefile +6 -0
- 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/atrium/atrium.js +281 -0
- data/app/assets/javascripts/chosen.jquery.js +899 -0
- data/app/assets/javascripts/ckeditor.warning.js +65 -0
- data/app/assets/javascripts/ckeditor/config.js.coffee +6 -0
- data/app/assets/javascripts/ckeditor/jquery.generateId.js +13 -0
- data/app/assets/javascripts/ckeditor/jquery.jeditable.ckeditor.js +59 -0
- data/app/assets/javascripts/ckeditor/plugins/linkItem/application_link.png +0 -0
- data/app/assets/javascripts/ckeditor/plugins/linkItem/dialogs/linkItem.js +1470 -0
- data/app/assets/javascripts/ckeditor/plugins/linkItem/plugin.js +16 -0
- data/app/assets/javascripts/ckeditor/plugins/linkItem/ui_toolbar_pencil.png +0 -0
- data/app/assets/javascripts/jquery.colorbox.js +864 -0
- data/app/assets/javascripts/jquery.jeditable.js +543 -0
- data/app/assets/stylesheets/atrium/atrium.css +216 -0
- data/app/assets/stylesheets/atrium/chosen-sprite.png +0 -0
- data/app/assets/stylesheets/atrium/chosen.css +367 -0
- data/app/assets/stylesheets/colorbox.css +42 -0
- data/app/assets/stylesheets/controls.png +0 -0
- data/app/assets/stylesheets/loading.gif +0 -0
- data/app/controllers/atrium/base_controller.rb +25 -0
- data/app/controllers/atrium/collection_exhibit_order_controller.rb +21 -0
- data/app/controllers/atrium/collections_controller.rb +165 -0
- data/app/controllers/atrium/customization_controller.rb +41 -0
- data/app/controllers/atrium/descriptions_controller.rb +177 -0
- data/app/controllers/atrium/exhibit_facet_order_controller.rb +19 -0
- data/app/controllers/atrium/exhibits_controller.rb +108 -0
- data/app/controllers/atrium/showcases_controller.rb +193 -0
- data/app/helpers/atrium/base_helper.rb +6 -0
- data/app/models/ability.rb +14 -0
- data/app/models/atrium/browse_level.rb +41 -0
- data/app/models/atrium/collection.rb +121 -0
- data/app/models/atrium/description.rb +128 -0
- data/app/models/atrium/essay.rb +21 -0
- data/app/models/atrium/exhibit.rb +58 -0
- data/app/models/atrium/search/facet.rb +29 -0
- data/app/models/atrium/search/facet_selection.rb +17 -0
- data/app/models/atrium/showcase.rb +173 -0
- data/app/models/atrium/showcase/facet_selection.rb +21 -0
- data/app/models/atrium/showcase/item.rb +19 -0
- data/app/models/role_mapper.rb +23 -0
- data/app/views/_user_util_links.html.erb +25 -0
- data/app/views/atrium/collections/_bookmark_control.html.erb +25 -0
- data/app/views/atrium/collections/_browse_index.html.erb +20 -0
- data/app/views/atrium/collections/_collection_items_index.html.erb +10 -0
- data/app/views/atrium/collections/_document.html.erb +24 -0
- data/app/views/atrium/collections/_document_list.html.erb +6 -0
- data/app/views/atrium/collections/_edit_navigation.html.erb +20 -0
- data/app/views/atrium/collections/_folder_control.html.erb +12 -0
- data/app/views/atrium/collections/_form.html.erb +93 -0
- data/app/views/atrium/collections/_listing.html.erb +18 -0
- data/app/views/atrium/collections/_navigation.html.erb +45 -0
- data/app/views/atrium/collections/_results_pagination.html.erb +9 -0
- data/app/views/atrium/collections/_sort_and_per_page.html.erb +23 -0
- data/app/views/atrium/collections/edit.html.erb +5 -0
- data/app/views/atrium/collections/new.html.erb +6 -0
- data/app/views/atrium/collections/show.html.erb +22 -0
- data/app/views/atrium/descriptions/_form.html.erb +64 -0
- data/app/views/atrium/descriptions/edit.html.erb +4 -0
- data/app/views/atrium/descriptions/index.html.erb +4 -0
- data/app/views/atrium/descriptions/new.html.erb +2 -0
- data/app/views/atrium/descriptions/show.html.erb +20 -0
- data/app/views/atrium/exhibits/_bookmark_control.html.erb +25 -0
- data/app/views/atrium/exhibits/_folder_control.html.erb +12 -0
- data/app/views/atrium/exhibits/_form.html.erb +108 -0
- data/app/views/atrium/exhibits/edit.html.erb +9 -0
- data/app/views/atrium/exhibits/new.html.erb +6 -0
- data/app/views/atrium/exhibits/show.html.erb +26 -0
- data/app/views/atrium/showcases/_showcase_navigation.html.erb +23 -0
- data/app/views/atrium/showcases/show.html.erb +1 -0
- data/app/views/catalog/_collection_home_text.html.erb +6 -0
- data/app/views/catalog/_constraints.html.erb +9 -0
- data/app/views/catalog/_default_collection_text.html.erb +18 -0
- data/app/views/catalog/_default_home_text.html.erb +6 -0
- data/app/views/catalog/_home_text.html.erb +6 -0
- data/app/views/catalog/_index_partials/_description.html.erb +8 -0
- data/app/views/catalog/_search_form.html.erb +66 -0
- data/app/views/catalog/_show_partials/_description.html.erb +15 -0
- data/app/views/catalog/browse_show.html.erb +18 -0
- data/app/views/catalog/index.html.erb +35 -0
- data/app/views/catalog/list_description.html.erb +24 -0
- data/app/views/catalog/list_item.html.erb +3 -0
- data/app/views/layouts/atrium.html.erb +86 -0
- data/app/views/layouts/atrium_themes/default.html.erb +4 -0
- data/app/views/layouts/item_listing.html.erb +36 -0
- data/app/views/listing/_document.html.erb +27 -0
- data/app/views/listing/_document_list.html.erb +3 -0
- data/app/views/listing/_item_search.html.erb +27 -0
- data/app/views/shared/_banner.html.erb +5 -0
- data/app/views/shared/_collection_complete_list.html.erb +33 -0
- data/app/views/shared/_collection_search_form.html.erb +12 -0
- data/app/views/shared/_collection_title_header.html.erb +3 -0
- data/app/views/shared/_featured_sources.html.erb +20 -0
- data/app/views/shared/_list_descriptions.html.erb +38 -0
- data/app/views/shared/_navigation_browse_levels.html.erb +34 -0
- data/app/views/shared/_showcase_configure_menu.html.erb +22 -0
- data/app/views/shared/_top_navigation.html.erb +9 -0
- data/atrium.gemspec +76 -0
- data/config/routes.rb +12 -0
- data/init.rb +3 -0
- data/lib/application_controller.rb +24 -0
- data/lib/atrium.rb +42 -0
- data/lib/atrium/application_helper.rb +24 -0
- data/lib/atrium/atrium_helper_behavior.rb +162 -0
- data/lib/atrium/catalog.rb +203 -0
- data/lib/atrium/collections_helper.rb +139 -0
- data/lib/atrium/controller.rb +10 -0
- data/lib/atrium/descriptions_helper.rb +23 -0
- data/lib/atrium/engine.rb +12 -0
- data/lib/atrium/layout_helper.rb +13 -0
- data/lib/atrium/routes.rb +99 -0
- data/lib/atrium/solr_helper.rb +440 -0
- data/lib/atrium/version.rb +3 -0
- data/lib/generators/atrium/assets_generator.rb +44 -0
- data/lib/generators/atrium/atrium_generator.rb +149 -0
- data/lib/generators/atrium/cucumber_support_generator.rb +29 -0
- data/lib/generators/atrium/templates/config/role_map_cucumber.yml +2 -0
- data/lib/generators/atrium/templates/config/role_map_development.yml +2 -0
- data/lib/generators/atrium/templates/config/role_map_production.yml +2 -0
- data/lib/generators/atrium/templates/config/role_map_test.yml +2 -0
- data/lib/generators/atrium/templates/config/solr.yml +10 -0
- data/lib/generators/atrium/templates/db/seeds.rb +87 -0
- data/lib/generators/atrium/templates/migrations/create_atrium_browse_levels.rb +18 -0
- data/lib/generators/atrium/templates/migrations/create_atrium_collections.rb +20 -0
- data/lib/generators/atrium/templates/migrations/create_atrium_descriptions.rb +16 -0
- data/lib/generators/atrium/templates/migrations/create_atrium_essays.rb +15 -0
- data/lib/generators/atrium/templates/migrations/create_atrium_exhibits.rb +16 -0
- data/lib/generators/atrium/templates/migrations/create_atrium_search_facets.rb +14 -0
- data/lib/generators/atrium/templates/migrations/create_atrium_showcase_facet_selections.rb +15 -0
- data/lib/generators/atrium/templates/migrations/create_atrium_showcase_items.rb +17 -0
- data/lib/generators/atrium/templates/migrations/create_atrium_showcases.rb +16 -0
- data/lib/generators/atrium/templates/themes/example.html.erb +21 -0
- data/lib/railties/all_tests.rake +23 -0
- data/lib/railties/atrium_cucumber.rake +121 -0
- data/lib/railties/index.rake +37 -0
- data/tasks/atrium.rake +268 -0
- data/tasks/atrium_rspec.rake +91 -0
- data/test_support/etc/Gemfile +33 -0
- data/test_support/etc/bundle_config +3 -0
- data/test_support/etc/rvmrc +32 -0
- data/test_support/features/atrium_collections.feature +162 -0
- data/test_support/features/atrium_exhibits.feature +164 -0
- data/test_support/features/step_definitions/atrium_collection_steps.rb +102 -0
- data/test_support/features/step_definitions/atrium_exhibit_steps.rb +53 -0
- data/test_support/features/step_definitions/bookmarks_steps.rb +6 -0
- data/test_support/features/step_definitions/error_steps.rb +5 -0
- data/test_support/features/step_definitions/folder_steps.rb +27 -0
- data/test_support/features/step_definitions/general_steps.rb +50 -0
- data/test_support/features/step_definitions/record_view_steps.rb +12 -0
- data/test_support/features/step_definitions/saved_searches_steps.rb +22 -0
- data/test_support/features/step_definitions/search_facets_steps.rb +29 -0
- data/test_support/features/step_definitions/search_history_steps.rb +9 -0
- data/test_support/features/step_definitions/search_result_steps.rb +114 -0
- data/test_support/features/step_definitions/search_steps.rb +103 -0
- data/test_support/features/step_definitions/user_steps.rb +5 -0
- data/test_support/features/step_definitions/web_steps.rb +213 -0
- data/test_support/features/support/env.rb +67 -0
- data/test_support/features/support/paths.rb +76 -0
- data/test_support/features/support/selectors.rb +40 -0
- data/test_support/fixtures/atrium_exhibits.yml +3 -0
- data/test_support/spec/controllers/atrium/base_controller_spec.rb +13 -0
- data/test_support/spec/controllers/atrium/collection_exhibit_order_controller_spec.rb +29 -0
- data/test_support/spec/controllers/atrium/collections_controller_spec.rb +185 -0
- data/test_support/spec/controllers/atrium/customization_controller_spec.rb +38 -0
- data/test_support/spec/controllers/atrium/descriptions_controller_spec.rb +150 -0
- data/test_support/spec/controllers/atrium/exhibit_facet_order_controller_spec.rb +36 -0
- data/test_support/spec/controllers/atrium/exhibits_controller_spec.rb +192 -0
- data/test_support/spec/controllers/atrium/showcases_controller_spec.rb +185 -0
- data/test_support/spec/helpers/atrium_collections_helper_spec.rb +147 -0
- data/test_support/spec/helpers/atrium_description_helper_spec.rb +47 -0
- data/test_support/spec/helpers/atrium_solr_helper_spec.rb +512 -0
- data/test_support/spec/models/atrium/browse_level_spec.rb +31 -0
- data/test_support/spec/models/atrium/collection_spec.rb +30 -0
- data/test_support/spec/models/atrium/description_spec.rb +67 -0
- data/test_support/spec/models/atrium/essay_spec.rb +12 -0
- data/test_support/spec/models/atrium/exhibit_spec.rb +76 -0
- data/test_support/spec/models/atrium/search/facet_selection_spec.rb +24 -0
- data/test_support/spec/models/atrium/search/facet_spec.rb +11 -0
- data/test_support/spec/models/atrium/search_facet_spec.rb +54 -0
- data/test_support/spec/models/atrium/showcase/facet_selection_spec.rb +15 -0
- data/test_support/spec/models/atrium/showcase/item_spec.rb +12 -0
- data/test_support/spec/models/atrium/showcase_facet_selection_spec.rb +65 -0
- data/test_support/spec/models/atrium/showcase_spec.rb +134 -0
- data/test_support/spec/rcov.opts +3 -0
- data/test_support/spec/routing/atrium/collections_routing_spec.rb +33 -0
- data/test_support/spec/spec.opts +4 -0
- data/test_support/spec/spec_helper.rb +47 -0
- data/test_support/spec/support/be_accessible_matcher.rb +8 -0
- data/test_support/spec/support/be_routed_mixin.rb +7 -0
- data/test_support/tmp/step_definitions/catalog_index_steps.rb +14 -0
- data/test_support/tmp/step_definitions/edit_document_steps.rb +67 -0
- data/test_support/tmp/step_definitions/hydra_metadata_steps.rb +3 -0
- data/test_support/tmp/step_definitions/hydra_steps.rb +8 -0
- data/test_support/tmp/step_definitions/search_steps.rb +86 -0
- data/test_support/tmp/step_definitions/searching_steps.rb +22 -0
- data/test_support/tmp/step_definitions/select_steps.rb +8 -0
- data/test_support/tmp/step_definitions/show_document_steps.rb +73 -0
- data/test_support/tmp/step_definitions/user_steps.rb +15 -0
- data/test_support/tmp/step_definitions/web_steps.rb +273 -0
- data/test_support/tmp/support/env.rb +54 -0
- data/test_support/tmp/support/paths.rb +57 -0
- metadata +1047 -0
@@ -0,0 +1,19 @@
|
|
1
|
+
class Atrium::Showcase::Item < ActiveRecord::Base
|
2
|
+
self.table_name = 'atrium_showcase_items'
|
3
|
+
|
4
|
+
belongs_to(
|
5
|
+
:showcase,
|
6
|
+
:class_name => 'Atrium::Showcase',
|
7
|
+
:foreign_key => 'atrium_showcase_id'
|
8
|
+
)
|
9
|
+
|
10
|
+
validates_presence_of(
|
11
|
+
:solr_doc_id,
|
12
|
+
:atrium_showcase_id
|
13
|
+
)
|
14
|
+
|
15
|
+
attr_accessible(
|
16
|
+
:solr_doc_id,
|
17
|
+
:type
|
18
|
+
)
|
19
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
class RoleMapper
|
3
|
+
@@map = YAML.load(File.open(File.join(Rails.root, "config/role_map_#{Rails.env}.yml")))
|
4
|
+
m = Hash.new{|h,k| h[k]=[]}
|
5
|
+
@@byname = @@map.inject(m) do|memo, k|
|
6
|
+
k.last.each { |x| memo[x]<<k.first}
|
7
|
+
memo
|
8
|
+
end
|
9
|
+
class << self
|
10
|
+
def role_names
|
11
|
+
@@map.keys
|
12
|
+
end
|
13
|
+
def roles(username)
|
14
|
+
|
15
|
+
@@byname[username]||[]
|
16
|
+
end
|
17
|
+
|
18
|
+
def whois(r)
|
19
|
+
@@map[r]||[]
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<ul>
|
2
|
+
<% if has_user_authentication_provider? %>
|
3
|
+
<% if current_user %>
|
4
|
+
<li>
|
5
|
+
<%= link_to "Log Out", destroy_user_session_path %> [<%= link_to current_user, edit_user_registration_path %>]
|
6
|
+
</li>
|
7
|
+
<li>
|
8
|
+
<%= link_to 'Your Bookmarks', bookmarks_path %>
|
9
|
+
</li>
|
10
|
+
<li>
|
11
|
+
<%= link_to "Saved Searches", saved_searches_path %>
|
12
|
+
</li>
|
13
|
+
<% else %>
|
14
|
+
<li>
|
15
|
+
<%= link_to 'Login', new_user_session_path %>
|
16
|
+
</li>
|
17
|
+
<% end %>
|
18
|
+
<% end %>
|
19
|
+
<li>
|
20
|
+
<%= link_to "Selected Items", folder_index_path %> (<span id="folder_number"><%= "#{session[:folder_document_ids] ? session[:folder_document_ids].length : 0}" %></span>)
|
21
|
+
</li>
|
22
|
+
<li>
|
23
|
+
<%= link_to "Search History", search_history_path %>
|
24
|
+
</li>
|
25
|
+
</ul>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<% if current_user %>
|
2
|
+
<%- existing_bookmark = current_user.existing_bookmark_for(document[:id]) -%>
|
3
|
+
<%-
|
4
|
+
# Note these two forms are pretty similar but for different :methods, classes, and labels.
|
5
|
+
# but it was simpler to leave them seperate instead of DRYing them, got confusing trying that.
|
6
|
+
# the data-doc-id attribute is used by our JS that converts to a checkbox/label.
|
7
|
+
-%>
|
8
|
+
<% unless existing_bookmark %>
|
9
|
+
|
10
|
+
<%= form_tag( bookmark_path( document[:id]), :method => :put, :class => "bookmark_toggle", "data-doc-id" => document[:id], :title=> document[document_show_link_field] ) do %>
|
11
|
+
<%= hidden_field(:bookmark, :title, :value => document[document_show_link_field] ) %>
|
12
|
+
<%= submit_tag("Bookmark", :id => "bookmark_toggle_#{document[:id]}", :class => "bookmark_add") %>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<% else %>
|
16
|
+
|
17
|
+
<%= form_tag( bookmark_path( document[:id]), :method => :delete, :class => "bookmark_toggle", "data-doc-id" => document[:id], :title=> document[document_show_link_field]) do %>
|
18
|
+
<%= hidden_field(:bookmark, :title, :value => document[document_show_link_field] ) %>
|
19
|
+
<%= submit_tag("Remove bookmark", :id => "bookmark_toggle_#{document[:id]}", :class => "bookmark_remove") %>
|
20
|
+
<% end %>
|
21
|
+
|
22
|
+
<% end %>
|
23
|
+
<% else %>
|
24
|
+
|
25
|
+
<% end %>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
|
2
|
+
<%- if @browse_response.nil? -%>
|
3
|
+
<h3><em>0 items found</em></h3>
|
4
|
+
<%- else -%>
|
5
|
+
|
6
|
+
<div class="pageEntriesInfo">
|
7
|
+
<%# render_pagination_info @browse_response, :entry_name=>'item' %>
|
8
|
+
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<%= render 'atrium/collections/sort_and_per_page', :locals => {:response=>@browse_response} if @browse_response.response['numFound'] > 10%>
|
12
|
+
|
13
|
+
<%= render 'atrium/collections/results_pagination' %>
|
14
|
+
|
15
|
+
<%= render :partial => 'atrium/collections/document_list', :locals => {:document_list=>@browse_document_list, :response=>@browse_response}%>
|
16
|
+
|
17
|
+
<%= render 'atrium/collections/results_pagination' %>
|
18
|
+
|
19
|
+
<% end %>
|
20
|
+
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<%= render :partial=>'atrium/collections/sort_and_per_page', :locals => {:response=>@collection_items_response} if @collection_items_response.response['numFound'] > 10%>
|
2
|
+
|
3
|
+
<%= render :partial=>'atrium/collections/results_pagination',:locals => {:response=>@collection_items_response} %>
|
4
|
+
|
5
|
+
<%= render :partial => 'atrium/collections/document_list', :locals => {:document_list=>@collection_items_documents, :response=>@collection_items_response}%>
|
6
|
+
|
7
|
+
<%= render :partial=>'atrium/collections/results_pagination',:locals => {:response=>@collection_items_response} %>
|
8
|
+
|
9
|
+
|
10
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<% # container for a single doc -%>
|
2
|
+
<%- response = @browse_response if response.nil?%>
|
3
|
+
|
4
|
+
<% # container for a single doc -%>
|
5
|
+
<div class="document <%= render_document_class document %>">
|
6
|
+
|
7
|
+
<% # header bar for doc items in index view -%>
|
8
|
+
<div class="documentHeader">
|
9
|
+
|
10
|
+
<% # bookmark/folder functions for items/docs are hidden in collection and exhibit view-%>
|
11
|
+
<%# render_index_doc_actions document %>
|
12
|
+
|
13
|
+
<% # main title container for doc partial view -%>
|
14
|
+
<div class="yui-u">
|
15
|
+
<h3 class="index_title">
|
16
|
+
<%= document_counter + 1 + @response.params[:start].to_i %>. <%= link_to_document document, :label=>document_show_link_field, :counter => (document_counter + 1 + @response.params[:start].to_i) %>
|
17
|
+
</h3>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
|
21
|
+
<% # main container for doc partial view -%>
|
22
|
+
<%= render_document_partial document, :index %>
|
23
|
+
|
24
|
+
</div>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<% # container for all documents in index view -%>
|
2
|
+
<div id="documents">
|
3
|
+
<% document_list = @browse_document_list if document_list.nil?%>
|
4
|
+
<% response = @browse_response if response.nil?%>
|
5
|
+
<%= render :partial => 'atrium/collections/document', :collection => document_list, :as => :document , :locals=>{:response=>response}%>
|
6
|
+
</div>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<div class="facet-list">
|
2
|
+
<h2 class="collection-title"><%= @atrium_collection.pretty_title %></h2>
|
3
|
+
<ul class="collection-controls">
|
4
|
+
<li><%= link_to 'View Collection', @atrium_collection %></li>
|
5
|
+
<li><%= link_to 'Configure Collection', edit_atrium_collection_path(@atrium_collection.id) %></li>
|
6
|
+
<li><%= link_to 'Customize Collection Home Page', new_atrium_collection_showcases_path(@atrium_collection)%></li>
|
7
|
+
</ul>
|
8
|
+
<%- unless @exhibit_navigation_data.nil? || @exhibit_navigation_data.empty? -%>
|
9
|
+
<%- @exhibit_navigation_data.each do |exhibit| -%>
|
10
|
+
<h3 class="exhibit-title"><%= exhibit.pretty_title%></h3>
|
11
|
+
<ul class="exhibit-controls">
|
12
|
+
<li><%= link_to 'Configure Exhibit', edit_atrium_exhibit_path(exhibit) %></li>
|
13
|
+
<li><%= link_to 'Customize Exhibit Home Page', new_atrium_exhibit_showcases_path(exhibit)%></li>
|
14
|
+
</ul>
|
15
|
+
<%- end -%>
|
16
|
+
<%- end -%>
|
17
|
+
</div>
|
18
|
+
|
19
|
+
<hr />
|
20
|
+
<%= link_to "Delete this Collection", atrium_collection_path(@atrium_collection[:id]), :method => :delete, :remote => true, :confirm => "Are you really sure?" %>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<%-
|
2
|
+
# pass in local :document with a SolrDocument
|
3
|
+
method = (item_in_folder?(document[:id]) ? "delete" : "put")
|
4
|
+
label = (item_in_folder?(document[:id]) ? "Unselect" : "Select")
|
5
|
+
cssClass = (item_in_folder?(document[:id]) ? "deleteFolder" : "addFolder")
|
6
|
+
-%>
|
7
|
+
|
8
|
+
<%= form_tag( folder_path(document[:id]), :method => method, :class=> "folder_toggle #{cssClass}", "data-doc-id" => document[:id], :title=>h(document[document_show_link_field])) do -%>
|
9
|
+
<%= hidden_field(:bookmark, :title, :value => document[document_show_link_field]) %>
|
10
|
+
<%= submit_tag(label, :class=>"folder_submit", :id => "folder_submit_#{document[:id]}") %>
|
11
|
+
<% end %>
|
12
|
+
|
@@ -0,0 +1,93 @@
|
|
1
|
+
<%= form_for(@atrium_collection, :html => {:class => "atrium"}) do |f| %>
|
2
|
+
<fieldset>
|
3
|
+
<legend>Basic Configuration</legend>
|
4
|
+
<% if @atrium_collection.errors.any? %>
|
5
|
+
<ul class="errors">
|
6
|
+
<% @atrium_collection.errors.full_messages.each do |msg| %>
|
7
|
+
<li><%= msg %></li>
|
8
|
+
<% end %>
|
9
|
+
</ul>
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<ol>
|
13
|
+
<li>
|
14
|
+
<%= f.label :title, 'Title:' %>
|
15
|
+
<%= f.text_field :title %>
|
16
|
+
</li>
|
17
|
+
<li>
|
18
|
+
<%= f.label :title_markup, 'Title Markup:' %>
|
19
|
+
<%= f.text_area :title_markup, :class => 'jquery-ckeditor' %>
|
20
|
+
</li>
|
21
|
+
<li>
|
22
|
+
<%= f.label :url_slug, 'URL slug:' %>
|
23
|
+
<%= f.text_field :url_slug %>
|
24
|
+
</li>
|
25
|
+
<li>
|
26
|
+
<%= f.label :search_facet_names, 'Collection Search Facets:' %>
|
27
|
+
<%= 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' %>
|
28
|
+
<li/>
|
29
|
+
<li>
|
30
|
+
<%= f.label :collection_description, 'Collection Browse Page About Text:' %>
|
31
|
+
<%= f.text_area :collection_description, :rows=> '20', :cols => '120', :class => 'jquery-ckeditor' %>
|
32
|
+
</li>
|
33
|
+
<li>
|
34
|
+
<%= f.label :search_instructions, 'Collection Search Page About Text:' %>
|
35
|
+
<%= f.text_area :search_instructions, :rows=> '20', :cols => '120', :class => 'jquery-ckeditor' %>
|
36
|
+
</li>
|
37
|
+
<li>
|
38
|
+
<%= f.label :theme, 'Collection Theme:' %>
|
39
|
+
<%= f.collection_select :theme, Atrium::Collection.available_themes, :to_s, :titleize %>
|
40
|
+
</li>
|
41
|
+
</ol>
|
42
|
+
<%= f.submit 'Update Collection Configuration', :class => 'button' %>
|
43
|
+
</fieldset>
|
44
|
+
<% end %>
|
45
|
+
|
46
|
+
<h3>Collection Scope</h3>
|
47
|
+
<p>
|
48
|
+
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.
|
49
|
+
</p>
|
50
|
+
<fieldset>
|
51
|
+
<legend>Current Scope</legend>
|
52
|
+
<%-if @atrium_collection.filter_query_params %>
|
53
|
+
<ul>
|
54
|
+
<%- @atrium_collection.filter_query_params.each do |key,value| %>
|
55
|
+
<li><label><%= key %>: </label><%= value %></li>
|
56
|
+
<%- end %>
|
57
|
+
</ul>
|
58
|
+
<%- end %>
|
59
|
+
</fieldset>
|
60
|
+
<%- query_params = {:collection_id=>@atrium_collection[:id],:edit_collection_filter=>true} -%>
|
61
|
+
<%- query_params.merge!(@atrium_collection.filter_query_params) if @atrium_collection.filter_query_params -%>
|
62
|
+
<%- query_params.delete(:controller) %>
|
63
|
+
<%- query_params.delete(:action) %>
|
64
|
+
<%- query_params.delete(:solr_doc_ids) %>
|
65
|
+
<p class="exhibit-scope-controls">
|
66
|
+
<%= link_to("Set Collection Scope", atrium_set_collection_scope_path(query_params), :class => 'button').html_safe %>
|
67
|
+
<%= link_to("Remove Collection Scope", atrium_unset_collection_scope_path(@atrium_collection[:id]), :class => 'button').html_safe %>
|
68
|
+
</p>
|
69
|
+
|
70
|
+
<h3>Exhibits</h3>
|
71
|
+
<% if @atrium_collection.exhibits.any? %>
|
72
|
+
<ol data-resource="<%= update_atrium_collection_exhibit_order_path %>" class="exhibit-listing sortable">
|
73
|
+
<% @atrium_collection.exhibits.each do |exhibit| %>
|
74
|
+
<li data-id="<%= exhibit[:id] %>" data-order="<%= exhibit.set_number %>" class="ui-state-default">
|
75
|
+
<span class="ui-icon ui-icon-arrowthick-2-n-s"></span>
|
76
|
+
<%= exhibit.pretty_title %>
|
77
|
+
<span class="controls">
|
78
|
+
<%= link_to 'Configure', edit_atrium_exhibit_path(exhibit) %>
|
79
|
+
</span>
|
80
|
+
</li>
|
81
|
+
<% end %>
|
82
|
+
</ol>
|
83
|
+
<% else %>
|
84
|
+
<em>There are no exhibits in this collection.</em>
|
85
|
+
<% end %>
|
86
|
+
|
87
|
+
<%= form_for(@atrium_exhibit) do |exhibit| %>
|
88
|
+
<%- @atrium_exhibit.set_number = @atrium_collection.exhibits.size + 1 -%>
|
89
|
+
<%- @atrium_exhibit.atrium_collection_id = @atrium_collection[:id] -%>
|
90
|
+
<%= exhibit.hidden_field :set_number %>
|
91
|
+
<%= exhibit.hidden_field :atrium_collection_id %>
|
92
|
+
<%= exhibit.submit 'Add a Exhibit to this Collection', :class => 'button' %>
|
93
|
+
<% end %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<%- collections = get_collections_list -%>
|
2
|
+
<%- if collections.any? -%>
|
3
|
+
<h2>Collections</h2>
|
4
|
+
<ul class="collection-list">
|
5
|
+
<%- collections.each do |collection| -%>
|
6
|
+
<li>
|
7
|
+
<h3><%=link_to collection.pretty_title, atrium_collection_path(collection) %></h3>
|
8
|
+
</li>
|
9
|
+
<%- end -%>
|
10
|
+
</ul>
|
11
|
+
<%- end -%>
|
12
|
+
|
13
|
+
<%- if (current_user) && (can? :create, Atrium::Collection) -%>
|
14
|
+
<%- @atrium_collection = Atrium::Collection.new-%>
|
15
|
+
<%= form_for (@atrium_collection) do |f| %>
|
16
|
+
<%= f.submit 'Create New Collection', :class => 'button' %>
|
17
|
+
<%- end -%>
|
18
|
+
<%- end -%>
|
@@ -0,0 +1,45 @@
|
|
1
|
+
<% if can? :create, Atrium::Collection %>
|
2
|
+
<p>
|
3
|
+
<%= link_to "Configure Collection #{@atrium_exhbit}" , edit_atrium_collection_path(@atrium_collection[:id]), :class => "customize"%>
|
4
|
+
</p>
|
5
|
+
<% end %>
|
6
|
+
<%= link_to 'View Collection', @atrium_collection %>
|
7
|
+
|
8
|
+
<div id="browse-navigation" class="facet-list">
|
9
|
+
<% if @exhibit_navigation_data.nil? || @exhibit_navigation_data.empty? %>
|
10
|
+
<ul>
|
11
|
+
<% @atrium_collection.exhibits.each do |exhibit| %>
|
12
|
+
<li>
|
13
|
+
<%= link_to "View #{exhibit.pretty_title}", exhibit %>
|
14
|
+
</li>
|
15
|
+
<% if can? :edit, Atrium::Exhibit %>
|
16
|
+
<li>
|
17
|
+
<%= link_to "Customize #{exhibit.pretty_title}", new_atrium_exhibit_showcases_path(exhibit, :facet_selection => params[:f]), :class => "customize" %>
|
18
|
+
</li>
|
19
|
+
<% end %>
|
20
|
+
<% end %>
|
21
|
+
</ul>
|
22
|
+
<% else %>
|
23
|
+
<%# Recursively render the browse sets. %>
|
24
|
+
<% @exhibit_navigation_data.each do |exhibit| %>
|
25
|
+
<h3 class="facet-heading <%= exhibit.pretty_title%>">
|
26
|
+
<%= link_to exhibit.pretty_title, exhibit %>
|
27
|
+
</h3>
|
28
|
+
<% unless exhibit.browse_levels.nil? || exhibit.browse_levels.empty? %>
|
29
|
+
<%= render :partial => 'shared/navigation_browse_levels',
|
30
|
+
:locals=>{
|
31
|
+
:exhibit_number => exhibit.set_number,
|
32
|
+
:browse_levels => exhibit.browse_levels,
|
33
|
+
:browse_facets => exhibit.browse_facet_names,
|
34
|
+
:exhibit_id => exhibit[:id]
|
35
|
+
}%>
|
36
|
+
<% end %>
|
37
|
+
<% end %>
|
38
|
+
<% end %>
|
39
|
+
|
40
|
+
<% if can? :edit, Atrium::Showcase %>
|
41
|
+
<% if !session[:edit_showcase] && !params[:atrium_collection_browse] && !params[:atrium_exhibit_browse] %>
|
42
|
+
<%= link_to "Customize this page", get_customize_page_path, :class => "customize"%>
|
43
|
+
<% end %>
|
44
|
+
<% end %>
|
45
|
+
</div>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
|
2
|
+
<%- response = @browse_response if response.nil?%>
|
3
|
+
|
4
|
+
<%- if paginate_params(response).num_pages > 1 %>
|
5
|
+
<div class="pagination">
|
6
|
+
<h2>Results navigation</h2>
|
7
|
+
<%= paginate_rsolr_response response, :outer_window => 2, :theme => 'blacklight' %>
|
8
|
+
</div>
|
9
|
+
<% end %>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<%- response = @browse_response if response.nil? -%>
|
2
|
+
<div id="sortAndPerPage">
|
3
|
+
<% unless response.response['numFound'] < 2 %>
|
4
|
+
<%-# kind of hacky way to get this to work on catalog and folder controllers. May be able to simple do {:action=>"index"} but I'm not sure -%>
|
5
|
+
<%-# NOTE: This form is not working reliably. However, the previous approach to paths wasn't sufficiently flexible. -%>
|
6
|
+
<%= form_tag url_for(params), :class=>'per_page' do %>
|
7
|
+
<%= label_tag(:per_page) do %>
|
8
|
+
Show <%= select_tag(:per_page, options_for_select(['10', '20', '50', '100'], h(params[:per_page])), :title => "Number of results to display per page") %> per page
|
9
|
+
<% end %>
|
10
|
+
<%= search_as_hidden_fields(:omit_keys => [:page, :per_page]) %>
|
11
|
+
<%= submit_tag 'update' %>
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
<%-# kind of hacky way to get this to work on catalog and folder controllers. May be able to simple do {:action=>"index"} but I'm not sure -%>
|
15
|
+
<%-# NOTE: This form is not working reliably. However, the previous approach to paths wasn't sufficiently flexible. -%>
|
16
|
+
<%= form_tag url_for(params), :class=>'sort', :id => "sort_form" do %>
|
17
|
+
<%= label_tag(:sort, "Sort by ") %>
|
18
|
+
<%= select_tag(:sort, options_for_select(sort_fields, h(params[:sort]))) %>
|
19
|
+
<%= search_as_hidden_fields(:omit_keys => [:page, :sort]) %>
|
20
|
+
<%= submit_tag 'sort results' %>
|
21
|
+
<% end %>
|
22
|
+
<% end %>
|
23
|
+
</div>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<%= render :partial=>'shared/collection_title_header'%>
|
2
|
+
|
3
|
+
<div id="show-description">
|
4
|
+
<%- if @atrium_showcase && @atrium_showcase.descriptions.any? -%>
|
5
|
+
<%= render :partial=>'shared/list_descriptions', :locals=>{:descriptions=>@atrium_showcase.descriptions} %>
|
6
|
+
<%- end -%>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<div id="show-selected">
|
10
|
+
<%- if !@featured_documents.blank? && @featured_documents.any? -%>
|
11
|
+
<%= render :partial=>'shared/featured_sources' %>
|
12
|
+
<%- end -%>
|
13
|
+
</div>
|
14
|
+
|
15
|
+
<h3 class="list-heading">Complete Sources</h3>
|
16
|
+
<div id="complete-sources">
|
17
|
+
<%- if !@collection_items_documents.blank? -%>
|
18
|
+
<%= render :partial=>'collection_items_index' %>
|
19
|
+
<%- else -%>
|
20
|
+
<%= render :partial=>'browse_index'%>
|
21
|
+
<%- end -%>
|
22
|
+
</div>
|
@@ -0,0 +1,64 @@
|
|
1
|
+
<h1>Author a Description</h1>
|
2
|
+
<p>
|
3
|
+
Descriptions are blocks of text present at the top of the page when viewing
|
4
|
+
a showcase. They can be added from within Atrium or they can be ingested
|
5
|
+
into Solr through any process you like.
|
6
|
+
</p>
|
7
|
+
<p>
|
8
|
+
To associate a description that is already present in the Solr index with
|
9
|
+
this showcase find the item you are interested in and click the
|
10
|
+
“Select” checkbox. You can limit the items listed by keyword
|
11
|
+
search and or facet selection.
|
12
|
+
</p>
|
13
|
+
<p>
|
14
|
+
To save your work use the “Save” button below. If you wish to
|
15
|
+
close <strong>without</strong> saving close the modal window.
|
16
|
+
</p>
|
17
|
+
|
18
|
+
<%= form_for(@atrium_description, :html => { :class => 'atrium' }) do |f| %>
|
19
|
+
<fieldset>
|
20
|
+
<legend>Description</legend>
|
21
|
+
<% if @atrium_description.errors.any? %>
|
22
|
+
<ul class="errors">
|
23
|
+
<% @atrium_description.errors.full_messages.each do |msg| %>
|
24
|
+
<li><%= msg %></li>
|
25
|
+
<% end %>
|
26
|
+
</ul>
|
27
|
+
<% end %>
|
28
|
+
<% @atrium_description.atrium_showcase_id = params[:showcase_id] if (params[:showcase_id]) %>
|
29
|
+
<%= f.hidden_field :atrium_showcase_id %>
|
30
|
+
<ol>
|
31
|
+
<li>
|
32
|
+
<%= f.label :title, 'Title:' %>
|
33
|
+
<%= f.text_field :title %>
|
34
|
+
</li>
|
35
|
+
<li class="inline">
|
36
|
+
<%= f.radio_button :page_display, 'samepage', :checked => true %>
|
37
|
+
<%= label :page_display_samepage, 'Include the full text of the description on the showcase page' %>
|
38
|
+
</li>
|
39
|
+
<li class="inline">
|
40
|
+
<%= f.radio_button :page_display, 'newpage' %>
|
41
|
+
<%= label :page_display_newpage, 'Include the summary on the showcase page and open the full text in a new page' %>
|
42
|
+
</li>
|
43
|
+
<%= f.fields_for :essay, @atrium_description.essay do |essay_fields| %>
|
44
|
+
<% @atrium_description.essay.content_type = "essay" %>
|
45
|
+
<li>
|
46
|
+
<%= essay_fields.label :content, 'Full Text:' %>
|
47
|
+
<%= essay_fields.text_area :content, :rows=> '20', :cols => '120', :class =>'jquery-ckeditor' %>
|
48
|
+
<%= essay_fields.hidden_field :atrium_description_id %>
|
49
|
+
<%= essay_fields.hidden_field :content_type %>
|
50
|
+
</li>
|
51
|
+
<% end %>
|
52
|
+
<%= f.fields_for :summary, @atrium_description.summary do |summary_fields| %>
|
53
|
+
<% @atrium_description.summary.content_type = "summary" %>
|
54
|
+
<li>
|
55
|
+
<%= summary_fields.label :content, 'Summary:' %>
|
56
|
+
<%= summary_fields.text_area :content, :rows=> '20', :cols => '120', :class =>'jquery-ckeditor' %>
|
57
|
+
<%= summary_fields.hidden_field :atrium_description_id %>
|
58
|
+
<%= summary_fields.hidden_field :content_type %>
|
59
|
+
</li>
|
60
|
+
<% end %>
|
61
|
+
</ol>
|
62
|
+
<%= f.submit 'Save', :class => 'button' %>
|
63
|
+
</fieldset>
|
64
|
+
<% end %>
|