curate 0.6.1 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +135 -51
- data/app/assets/images/curate/default.png +0 -0
- data/app/assets/stylesheets/layout/positioning.css.scss +4 -0
- data/app/assets/stylesheets/modules/search_results.css.scss +4 -0
- data/app/controllers/concerns/curate/fields_for_add_to_collection.rb +9 -0
- data/app/controllers/curation_concern/base_controller.rb +1 -0
- data/app/controllers/curation_concern/generic_files_controller.rb +1 -0
- data/app/models/concerns/curate/ability.rb +6 -2
- data/app/repository_models/curation_concern/model.rb +1 -1
- data/app/repository_models/generic_file.rb +4 -0
- data/app/views/application/_add_to_collection_gui.html.erb +19 -0
- data/app/views/catalog/_index_partials/_identifier_and_action.html.erb +19 -11
- data/app/views/collections/_collection.html.erb +2 -27
- data/app/views/curate/collections/_form_to_add_member.html.erb +12 -10
- data/app/views/curate/collections/add_member_form.html.erb +4 -2
- data/app/views/curation_concern/base/_collections.html.erb +0 -10
- data/app/views/curation_concern/base/_related_files.html.erb +1 -1
- data/app/views/curation_concern/base/_representative_media.html.erb +8 -0
- data/app/views/curation_concern/base/_thumbnail.html.erb +7 -5
- data/app/views/curation_concern/base/show.html.erb +14 -6
- data/app/views/curation_concern/documents/_document.html.erb +1 -1
- data/app/views/curation_concern/generic_files/_media_display.html.erb +11 -1
- data/app/views/curation_concern/generic_files/show.html.erb +1 -1
- data/app/views/curation_concern/people/_person.html.erb +2 -20
- data/app/views/profiles/_profile.html.erb +2 -27
- data/lib/curate/spec_support.rb +1 -2
- data/lib/curate/version.rb +1 -1
- data/spec/features/catalog_search_spec.rb +0 -30
- data/spec/features/generic_file_spec.rb +2 -1
- data/spec/features/generic_work_spec.rb +0 -10
- data/spec/features/thumbnail_display_spec.rb +5 -2
- data/spec/helpers/curate_helper_spec.rb +27 -0
- data/spec/internal/Gemfile.lock +6 -6
- data/spec/internal/config/initializers/devise.rb +2 -2
- data/spec/internal/config/initializers/secret_token.rb +1 -1
- data/spec/internal/db/development.sqlite3 +0 -0
- data/spec/internal/db/migrate/{20131203200422_devise_create_users.rb → 20131205204122_devise_create_users.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200427_add_devise_guests_to_users.rb → 20131205204126_add_devise_guests_to_users.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200428_create_searches.rb → 20131205204127_create_searches.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200429_create_bookmarks.rb → 20131205204128_create_bookmarks.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200430_remove_editable_fields_from_bookmarks.rb → 20131205204129_remove_editable_fields_from_bookmarks.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200431_add_user_types_to_bookmarks_searches.rb → 20131205204130_add_user_types_to_bookmarks_searches.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200432_acts_as_follower_migration.rb → 20131205204131_acts_as_follower_migration.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200433_add_social_to_users.rb → 20131205204132_add_social_to_users.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200434_create_single_use_links.rb → 20131205204133_create_single_use_links.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200435_add_ldap_attrs_to_user.rb → 20131205204134_add_ldap_attrs_to_user.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200436_add_avatars_to_users.rb → 20131205204135_add_avatars_to_users.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200437_create_checksum_audit_logs.rb → 20131205204136_create_checksum_audit_logs.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200438_create_version_committers.rb → 20131205204137_create_version_committers.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200439_add_groups_to_users.rb → 20131205204138_add_groups_to_users.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200440_create_local_authorities.rb → 20131205204139_create_local_authorities.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200441_create_trophies.rb → 20131205204140_create_trophies.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200450_create_mailboxer.mailboxer_engine.rb → 20131205204152_create_mailboxer.mailboxer_engine.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200451_add_notified_object.mailboxer_engine.rb → 20131205204153_add_notified_object.mailboxer_engine.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200452_add_notification_code.mailboxer_engine.rb → 20131205204154_add_notification_code.mailboxer_engine.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200453_add_attachments.mailboxer_engine.rb → 20131205204155_add_attachments.mailboxer_engine.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200454_rename_receipts_read.mailboxer_engine.rb → 20131205204156_rename_receipts_read.mailboxer_engine.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200455_add_global_notification_support.mailboxer_engine.rb → 20131205204157_add_global_notification_support.mailboxer_engine.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200459_add_terms_of_service_to_user.curate_engine.rb → 20131205204202_add_terms_of_service_to_user.curate_engine.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200460_add_user_force_update_profile.curate_engine.rb → 20131205204203_add_user_force_update_profile.curate_engine.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200461_create_help_requests.curate_engine.rb → 20131205204204_create_help_requests.curate_engine.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200462_add_repository_id_to_user.curate_engine.rb → 20131205204205_add_repository_id_to_user.curate_engine.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200463_create_curate_proxy_deposit_rights.curate_engine.rb → 20131205204206_create_curate_proxy_deposit_rights.curate_engine.rb} +0 -0
- data/spec/internal/db/migrate/{20131203200464_change_display_name_to_name.curate_engine.rb → 20131205204207_change_display_name_to_name.curate_engine.rb} +0 -0
- data/spec/internal/db/schema.rb +1 -1
- data/spec/internal/db/test.sqlite3 +0 -0
- data/spec/internal/log/development.log +203 -191
- data/spec/internal/log/test.log +84621 -104943
- data/spec/internal/spec/factories/spams_factory.rb +0 -1
- data/spec/internal/spec/fixtures/cassettes/remotely_identified_doi_mint_generic_work.yml +13 -14
- data/spec/internal/spec/fixtures/cassettes/remotely_identified_doi_mint_spam.yml +13 -14
- data/spec/internal/tmp/cache/assets/test/sass/2c6be7e0f6fa11a075d87959732f91fde3df1f13/search_results.css.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/953d624c1831fcea22a3be549290f4c654726e96/positioning.css.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/163665b72c8e98b0c88c19896f080bc4 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/1c1167e9384b80e15359a663448a3196 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/4132e961bdf0f2ffa2f96a4c7822e209 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/41dd5dbd03cfa3f49e2d7569ffd03f8d +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/611235bfd282813bdfbc998bcbe798e8 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/7d4fe23150294500a7bcd2630667e5c8 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{7078324d4486aa4ba7a6c21debbf3638 → 98ad78dc8c309689440b20bfa7372b3e} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/ada353bb8ffe3eb0f2dd479e6d869a70 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/b148a5e98ff09a12b6a2139af1e62e46 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{f0817826ed378d461b95e0e1ac870fcf → c14352828e1be2bbf3199771a34f9c57} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/d510daa6eb0cd4805bff7fd0990dfdb5 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/d610f39602b6149ca02638c1728778b5 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/e9c2a0f2fa471ace3f7ed3a1f1b9ffc5 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/ea0ece5befbce765051e27cf991cc805 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/spec/matchers.rb +24 -0
- data/spec/{support/matchers → matchers}/metadata_field_matchers.rb +0 -0
- data/spec/{support/matchers → matchers}/raise_rescue_response_type_matcher.rb +0 -0
- data/spec/repository_models/generic_file_spec.rb +11 -0
- data/spec/spec_helper.rb +3 -2
- data/spec/support/shared/shared_examples_with_related_works.rb +0 -1
- data/spec/views/application/_add_to_collection_gui.html.erb_spec.rb +60 -0
- data/spec/views/curate/collections/_form_to_add_member.html.erb_spec.rb +11 -11
- data/spec/views/curation_concern/base/_collection.html.erb_spec.rb +0 -2
- data/spec/views/curation_concern/base/_related_files.html.erb_spec.rb +16 -0
- data/spec/views/curation_concern/base/_representative_media.html.erb_spec.rb +15 -0
- data/spec/views/curation_concern/base/_thumbnail.html.erb_spec.rb +27 -0
- data/spec/views/curation_concern/generic_files/_media_display.html.erb_spec.rb +34 -0
- data/spec/views/curation_concern/generic_files/show.html.erb_spec.rb +12 -0
- metadata +87 -74
- data/app/views/catalog/_add_to_collection_gui.html.erb +0 -15
- data/app/views/curation_concern/base/_add_to_collection_gui.html.erb +0 -18
- data/app/views/curation_concern/base/_form_to_add_collection.html.erb +0 -9
- data/app/views/curation_concern/base/_representative_image.html.erb +0 -6
- data/spec/views/catalog/_add_to_collection_gui.html.erb_spec.rb +0 -48
- data/spec/views/curation_concern/base/_add_to_collection_gui.html.erb_spec.rb +0 -34
|
@@ -1,24 +1,26 @@
|
|
|
1
|
+
<% fieldset_class ||= '' %>
|
|
2
|
+
<% select_label_id ||= '' %>
|
|
3
|
+
|
|
1
4
|
<%= form_tag add_member_collections_path, method: :put do %>
|
|
2
5
|
<fieldset class="required <%= fieldset_class %>">
|
|
3
|
-
|
|
4
|
-
<%= hidden_field_tag :collectible_id, collectible.pid %>
|
|
5
|
-
<% end %>
|
|
6
|
+
<%= hidden_field_tag :collectible_id, collectible.pid %>
|
|
6
7
|
|
|
7
8
|
<div class="control-group collection_id">
|
|
8
9
|
<div class="controls">
|
|
9
|
-
<% options =
|
|
10
|
-
|
|
10
|
+
<% options = "" %>
|
|
11
|
+
<% collections = available_collections(collectible) %>
|
|
12
|
+
<% if collections.any? -%>
|
|
11
13
|
<% options << '<optgroup label="Your Collections">'.html_safe %>
|
|
12
|
-
<% options << options_from_collection_for_select(
|
|
14
|
+
<% options << options_from_collection_for_select(collections, "pid", "title") %>
|
|
13
15
|
<% options << '</optgroup>'.html_safe %>
|
|
14
|
-
|
|
16
|
+
<% end %>
|
|
15
17
|
<% options << options_from_collection_for_select(available_profiles, "pid", "title") %>
|
|
16
|
-
|
|
18
|
+
<% if current_users_profile_sections.any? %>
|
|
17
19
|
<% options << '<optgroup label="Profile Sections">'.html_safe %>
|
|
18
20
|
<% options << options_from_collection_for_select(current_users_profile_sections, "pid", "title") %>
|
|
19
21
|
<% options << '</optgroup>'.html_safe %>
|
|
20
|
-
|
|
21
|
-
<%= select_tag :profile_collection_id, options,
|
|
22
|
+
<% end %>
|
|
23
|
+
<%= select_tag :profile_collection_id, options, prompt: 'Make a Selection', class: 'input-xlarge', :'aria-labelledby' => select_label_id %>
|
|
22
24
|
</div>
|
|
23
25
|
</div>
|
|
24
26
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
<% content_for :page_header do %>
|
|
2
|
-
<h1>Add <%= @collectible %> to:</h1>
|
|
2
|
+
<h1 id="add-to-title">Add <%= @collectible %> to:</h1>
|
|
3
|
+
<% end %>
|
|
4
|
+
<% if can? :collect, @collectible %>
|
|
5
|
+
<%= render partial: 'form_to_add_member', locals: { collectible: @collectible, select_label_id: 'add-to-title', button_class: 'btn btn-primary' } %>
|
|
3
6
|
<% end %>
|
|
4
|
-
<%= render partial: 'form_to_add_member', locals: { collectible: @collectible, fieldset_class: '' } %>
|
|
@@ -19,13 +19,3 @@
|
|
|
19
19
|
</tbody>
|
|
20
20
|
</table>
|
|
21
21
|
<% end %>
|
|
22
|
-
|
|
23
|
-
<%- if current_user %>
|
|
24
|
-
<%- if has_any_collections? %>
|
|
25
|
-
<%= render 'add_to_collection_gui', collectible: curation_concern %>
|
|
26
|
-
<%- else %>
|
|
27
|
-
<div class="span12 main-header">
|
|
28
|
-
<p><em>You have no collections in which to add this <%= curation_concern.human_readable_type %>.</em></p>
|
|
29
|
-
</div>
|
|
30
|
-
<%- end -%>
|
|
31
|
-
<%- end -%>
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
<%- end -%>
|
|
49
49
|
<%- end -%>
|
|
50
50
|
<%- if can?(:read, generic_file) -%>
|
|
51
|
-
<%=
|
|
51
|
+
<%= link_to 'Download', download_path(generic_file.noid),{class: 'btn', title: "Download #{generic_file.to_s.inspect}", :target => "_blank"}%>
|
|
52
52
|
<%- end -%>
|
|
53
53
|
</td>
|
|
54
54
|
</tr>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<% if work.representative.present? && (gf = GenericFile.load_instance_from_solr(work.representative)) %>
|
|
2
|
+
<%= render partial: 'curation_concern/generic_files/media_display', locals: {generic_file: gf, dom_class_name: 'representative_image'} %>
|
|
3
|
+
<% elsif work.representative.present? %>
|
|
4
|
+
<%= image_tag download_path(work.representative, {:datastream_id => 'thumbnail'}), class: 'representative_image' %>
|
|
5
|
+
<% else %>
|
|
6
|
+
<%= image_tag 'curate/nope.png', class: "canonical-image" %>
|
|
7
|
+
<% end %>
|
|
8
|
+
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
<% width = 36 if width.blank? %>
|
|
2
|
+
<% if thumbnail.image? || thumbnail.pdf? || thumbnail.video? %>
|
|
3
|
+
<% path = download_path(thumbnail, {datastream_id: 'thumbnail'}) %>
|
|
4
|
+
<% else %>
|
|
5
|
+
<% path = "curate/default.png" %>
|
|
6
|
+
<% end %>
|
|
7
|
+
<%= link_to image_tag(path, width: width, class: 'thumbnail'), curation_concern_generic_file_path(thumbnail.noid), class: 'canonical-image' %>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<% content_for :page_header do %>
|
|
3
3
|
<h1><%= curation_concern %> <span class="human_readable_type">(<%= curation_concern.human_readable_type %>)</span></h1>
|
|
4
4
|
<% end %>
|
|
5
|
-
<%= render partial: '
|
|
5
|
+
<%= render partial: 'representative_media', locals: {work: curation_concern} %>
|
|
6
6
|
|
|
7
7
|
<%= render 'attributes', curation_concern: curation_concern %>
|
|
8
8
|
<%= render 'doi', curation_concern: curation_concern %>
|
|
@@ -12,12 +12,20 @@
|
|
|
12
12
|
<%= render 'related_works', curation_concern: curation_concern, with_actions: true %>
|
|
13
13
|
<%= render 'collections', curation_concern: curation_concern %>
|
|
14
14
|
|
|
15
|
-
<%
|
|
16
|
-
|
|
15
|
+
<% collector = can?(:collect, curation_concern) %>
|
|
16
|
+
<% editor = can?(:edit, curation_concern) %>
|
|
17
|
+
<% if collector || editor %>
|
|
18
|
+
<% content_for :second_row do %>
|
|
17
19
|
<div class="form-actions">
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
<% if editor %>
|
|
21
|
+
<%= link_to "Edit This #{curation_concern.human_readable_type}", edit_polymorphic_path([:curation_concern, curation_concern]), class: 'btn btn-primary' %>
|
|
22
|
+
<%= link_to "Attach a File", new_curation_concern_generic_file_path(curation_concern), class: 'btn btn-primary' %>
|
|
23
|
+
<%= link_to "Add an External Link", new_curation_concern_linked_resource_path(curation_concern), class: 'btn btn-primary' %>
|
|
24
|
+
<% end %>
|
|
25
|
+
<% if collector %>
|
|
26
|
+
<%= render 'add_to_collection_gui', collectible: curation_concern, button_class: 'btn btn-primary' %>
|
|
27
|
+
<% end %>
|
|
21
28
|
</div>
|
|
22
29
|
<% end %>
|
|
23
30
|
<% end %>
|
|
31
|
+
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<% solr_doc = document.inner_object.solr_doc %>
|
|
3
3
|
<li id="document_<%= document.noid %>" class="search-result">
|
|
4
4
|
|
|
5
|
-
<%= render :partial => 'catalog/_index_partials/identifier_and_action', locals: {document: document, counter: document_counter} %>
|
|
5
|
+
<%= render :partial => 'catalog/_index_partials/identifier_and_action', locals: {document: document, counter: document_counter, solr_doc: solr_doc} %>
|
|
6
6
|
|
|
7
7
|
<div class="row-fluid">
|
|
8
8
|
|
|
@@ -1 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
<%- if generic_file.image? -%>
|
|
2
|
+
<%= image_tag download_path(generic_file, datastream_id: 'thumbnail'), class: 'representative_image' %>
|
|
3
|
+
<% elsif generic_file.audio? %>
|
|
4
|
+
<audio controls="controls" class="video-js vjs-default-skin" data-setup="{}" preload="auto">
|
|
5
|
+
<source src="<%= download_path(generic_file, datastream_id: 'ogg') %>" type="audio/ogg" />
|
|
6
|
+
<source src="<%= download_path(generic_file, datastream_id: 'mp3') %>" type="audio/mpeg" />
|
|
7
|
+
Your browser does not support the audio tag.
|
|
8
|
+
</audio>
|
|
9
|
+
<%- else -%>
|
|
10
|
+
<%= image_tag 'curate/nope.png', class: "canonical-image" %>
|
|
11
|
+
<%- end -%>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<% content_for :page_header do %>
|
|
3
3
|
<h1>File Details</h1>
|
|
4
4
|
<% end %>
|
|
5
|
-
<%= render partial: '
|
|
5
|
+
<%= render partial: 'media_display', locals: {generic_file: curation_concern, dom_class_name: 'representative_image'} %>
|
|
6
6
|
<%= render "attributes", curation_concern: curation_concern %>
|
|
7
7
|
|
|
8
8
|
<div class="form-actions">
|
|
@@ -1,27 +1,9 @@
|
|
|
1
1
|
<%# This is a search result view %>
|
|
2
2
|
<% noid = person.noid %>
|
|
3
|
+
<% solr_doc = person.inner_object.solr_doc %>
|
|
3
4
|
<li id="document_<%= noid %>" class="search-result">
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<div class="span2 list-number">
|
|
8
|
-
<%= document_counter_with_offset( person_counter ) %>
|
|
9
|
-
<%= render :partial => 'catalog/_index_partials/type_display', locals: {document: person} %>
|
|
10
|
-
</div>
|
|
11
|
-
|
|
12
|
-
<div class="span6">
|
|
13
|
-
<% solr_doc = person.inner_object.solr_doc %>
|
|
14
|
-
<%# Minimize Fedora hits by using solr_doc rather than document %>
|
|
15
|
-
<%= link_to render_index_field_value(document: solr_doc, field: 'desc_metadata__name_tesim'), person, :id => "src_copy_link_#{noid}" %>
|
|
16
|
-
</div>
|
|
17
|
-
|
|
18
|
-
<div class="span4">
|
|
19
|
-
<% if current_user -%>
|
|
20
|
-
<%= render partial: 'add_to_collection_gui', locals: { document: person } %>
|
|
21
|
-
<% end -%>
|
|
22
|
-
</div>
|
|
23
|
-
|
|
24
|
-
</div>
|
|
6
|
+
<%= render :partial => 'catalog/_index_partials/identifier_and_action', locals: { document: person, counter: person_counter, title_link_target: person, title_link_text: person.name, edit_path: '' } %>
|
|
25
7
|
|
|
26
8
|
<div class="row-fluid">
|
|
27
9
|
|
|
@@ -1,34 +1,9 @@
|
|
|
1
1
|
<%# This is a search result view %>
|
|
2
2
|
<% noid = profile.noid %>
|
|
3
|
+
<% solr_doc = profile.inner_object.solr_doc %>
|
|
3
4
|
<li id="document_<%= noid %>" class="search-result">
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<div class="span2 list-number">
|
|
8
|
-
<%= document_counter_with_offset( profile_counter ) %>
|
|
9
|
-
<%= render :partial => 'catalog/_index_partials/type_display', locals: {document: profile} %>
|
|
10
|
-
</div>
|
|
11
|
-
|
|
12
|
-
<div class="span6">
|
|
13
|
-
<% solr_doc = profile.inner_object.solr_doc %>
|
|
14
|
-
<%# Minimize Fedora hits by using solr_doc rather than document %>
|
|
15
|
-
<%= link_to render_index_field_value(document: solr_doc, field: 'desc_metadata__title_tesim'), profile, :id => "src_copy_link_#{noid}" %>
|
|
16
|
-
</div>
|
|
17
|
-
|
|
18
|
-
<div class="span4">
|
|
19
|
-
<% if current_user %>
|
|
20
|
-
<%= render partial: 'add_to_collection_gui', locals: { document: profile } %>
|
|
21
|
-
|
|
22
|
-
<%= link_to(
|
|
23
|
-
raw('<i class="icon-pencil icon-large"></i>'),
|
|
24
|
-
edit_collection_path(profile),
|
|
25
|
-
:class=> 'itemicon itemedit btn pull-right',
|
|
26
|
-
:title => 'Edit Profile'
|
|
27
|
-
) if can? :edit, profile %>
|
|
28
|
-
<% end -%>
|
|
29
|
-
</div>
|
|
30
|
-
|
|
31
|
-
</div>
|
|
6
|
+
<%= render :partial => 'catalog/_index_partials/identifier_and_action', locals: { document: profile, counter: profile_counter, title_link_target: profile, edit_path: edit_profile_path(profile), solr_doc: solr_doc } %>
|
|
32
7
|
|
|
33
8
|
<div class="row-fluid">
|
|
34
9
|
|
data/lib/curate/spec_support.rb
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# Then we should expose those spec support files to that applications
|
|
4
4
|
spec_directory = File.expand_path('../../../spec', __FILE__)
|
|
5
5
|
require "rails/test_help"
|
|
6
|
-
require
|
|
7
|
-
require 'rspec-html-matchers'
|
|
6
|
+
require "rspec/rails"
|
|
8
7
|
require 'factory_girl'
|
|
9
8
|
require 'capybara/poltergeist'
|
|
10
9
|
Dir["#{spec_directory}/factories/**/*.rb"].each { |f| require f }
|
data/lib/curate/version.rb
CHANGED
|
@@ -65,25 +65,6 @@ describe "Search for a work" do
|
|
|
65
65
|
end
|
|
66
66
|
end
|
|
67
67
|
|
|
68
|
-
context "Facet - Cancel bar" do
|
|
69
|
-
let(:user) { FactoryGirl.create(:user) }
|
|
70
|
-
let!(:collection) { FactoryGirl.create(:public_collection, user: user, title: 'Collected Stuff') }
|
|
71
|
-
let!(:work1) { FactoryGirl.create(:generic_work, user: user, title: 'Work 1') }
|
|
72
|
-
let!(:work2) { FactoryGirl.create(:generic_work, user: user, title: 'Work 2') }
|
|
73
|
-
before do
|
|
74
|
-
login_as(user)
|
|
75
|
-
add_to_collection(work1)
|
|
76
|
-
add_to_collection(work2)
|
|
77
|
-
end
|
|
78
|
-
it "should display collection title and not PID" do
|
|
79
|
-
visit catalog_index_path
|
|
80
|
-
within "ul#facets" do
|
|
81
|
-
click_link "Collected Stuff"
|
|
82
|
-
end
|
|
83
|
-
page.should have_content("Collected Stuff X")
|
|
84
|
-
end
|
|
85
|
-
end
|
|
86
|
-
|
|
87
68
|
protected
|
|
88
69
|
def create_collection
|
|
89
70
|
visit('/')
|
|
@@ -109,15 +90,4 @@ describe "Search for a work" do
|
|
|
109
90
|
end
|
|
110
91
|
end
|
|
111
92
|
|
|
112
|
-
def add_to_collection(work)
|
|
113
|
-
visit catalog_index_path
|
|
114
|
-
within "#document_#{work.noid}" do
|
|
115
|
-
click_on 'Add to Collection'
|
|
116
|
-
end
|
|
117
|
-
within "#main form" do
|
|
118
|
-
select('Collected Stuff')
|
|
119
|
-
click_on 'Add'
|
|
120
|
-
end
|
|
121
|
-
end
|
|
122
|
-
|
|
123
93
|
end
|
|
@@ -74,7 +74,8 @@ describe 'Uploading Generic File' do
|
|
|
74
74
|
curation_concern.save!
|
|
75
75
|
login_as(user)
|
|
76
76
|
end
|
|
77
|
-
|
|
77
|
+
|
|
78
|
+
xit 'should change versions correctly', redundant: true do
|
|
78
79
|
visit new_curation_concern_generic_file_path(curation_concern)
|
|
79
80
|
|
|
80
81
|
within("form.new_generic_file") do
|
|
@@ -51,15 +51,6 @@ describe 'An existing generic work owned by the user' do
|
|
|
51
51
|
click_link 'Add an External Link'
|
|
52
52
|
page.should have_link('Cancel', href: catalog_index_path)
|
|
53
53
|
end
|
|
54
|
-
|
|
55
|
-
context 'when the user has no collections yet,' do
|
|
56
|
-
|
|
57
|
-
it 'displays a message instead of the widget to add a work to a collection' do
|
|
58
|
-
login_as(user)
|
|
59
|
-
visit curation_concern_generic_work_path(work)
|
|
60
|
-
expect(page).to have_content('You have no collections')
|
|
61
|
-
end
|
|
62
|
-
end
|
|
63
54
|
end
|
|
64
55
|
|
|
65
56
|
describe 'Viewing a generic work that is private' do
|
|
@@ -88,4 +79,3 @@ describe 'When I click on the link to create a work: ' do
|
|
|
88
79
|
end
|
|
89
80
|
end
|
|
90
81
|
|
|
91
|
-
|
|
@@ -10,6 +10,7 @@ describe 'display thumbnail' do
|
|
|
10
10
|
context 'Display thumbnail for associated iamges' do
|
|
11
11
|
before do
|
|
12
12
|
generic_file2.datastreams['thumbnail'].content = image_file
|
|
13
|
+
generic_file2.mime_type = 'image/png'
|
|
13
14
|
generic_file2.save!
|
|
14
15
|
curation_concern.generic_files << generic_file2
|
|
15
16
|
curation_concern.save!
|
|
@@ -25,8 +26,10 @@ describe 'display thumbnail' do
|
|
|
25
26
|
context 'File Representative:' do
|
|
26
27
|
before do
|
|
27
28
|
generic_file1.datastreams['thumbnail'].content = image_file
|
|
29
|
+
generic_file1.mime_type = 'image/png'
|
|
28
30
|
generic_file1.save!
|
|
29
31
|
generic_file2.datastreams['thumbnail'].content = image_file
|
|
32
|
+
generic_file2.mime_type = 'image/png'
|
|
30
33
|
generic_file2.save!
|
|
31
34
|
curation_concern.generic_files << generic_file1
|
|
32
35
|
curation_concern.generic_files << generic_file2
|
|
@@ -36,10 +39,10 @@ describe 'display thumbnail' do
|
|
|
36
39
|
it 'should show thumbnail when a representative is selected for the work' do
|
|
37
40
|
login_as(user)
|
|
38
41
|
visit curation_concern_image_path(curation_concern)
|
|
39
|
-
page.should have_css("img[src$='#{generic_file1.
|
|
42
|
+
page.should have_css("img[src$='#{generic_file1.to_param}?datastream_id=thumbnail'][class$='representative_image']")
|
|
40
43
|
page.should have_css("img[src$='#{generic_file1.to_param}?datastream_id=thumbnail'][class$='thumbnail']")
|
|
41
44
|
page.should have_css("img[src$='#{generic_file2.to_param}?datastream_id=thumbnail'][class$='thumbnail']")
|
|
42
|
-
page.should_not have_css("img[src$='#{generic_file2.
|
|
45
|
+
page.should_not have_css("img[src$='#{generic_file2.to_param}?datastream_id=thumbnail'][class$='representative_image']")
|
|
43
46
|
end
|
|
44
47
|
end
|
|
45
48
|
end
|
|
@@ -1,6 +1,33 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
3
|
describe ApplicationHelper do
|
|
4
|
+
|
|
5
|
+
context '#collection_title_from_pid' do
|
|
6
|
+
let(:value) { 'abc' }
|
|
7
|
+
let(:collection) { double(title: 'Title') }
|
|
8
|
+
it 'should load the value and return the title' do
|
|
9
|
+
Collection.should_receive(:load_instance_from_solr).with(value).and_return(collection)
|
|
10
|
+
expect(helper.collection_title_from_pid(value)).to eq(collection.title)
|
|
11
|
+
end
|
|
12
|
+
it 'should attempt to load the value, fail, and return the value' do
|
|
13
|
+
Collection.should_receive(:load_instance_from_solr).with(value).and_return(nil)
|
|
14
|
+
expect(helper.collection_title_from_pid(value)).to eq(value)
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
context '#creator_name_from_pid' do
|
|
19
|
+
let(:value) { 'abc' }
|
|
20
|
+
let(:collection) { double(name: 'Name') }
|
|
21
|
+
it 'should load the value and return the name' do
|
|
22
|
+
Person.should_receive(:load_instance_from_solr).with(value).and_return(collection)
|
|
23
|
+
expect(helper.creator_name_from_pid(value)).to eq(collection.name)
|
|
24
|
+
end
|
|
25
|
+
it 'should attempt to load the value, fail, and return the value' do
|
|
26
|
+
Person.should_receive(:load_instance_from_solr).with(value).and_return(nil)
|
|
27
|
+
expect(helper.creator_name_from_pid(value)).to eq(value)
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
4
31
|
it 'has #default_page_title' do
|
|
5
32
|
expect(helper.default_page_title).to(
|
|
6
33
|
eq("#{controller_name.titleize} // #{I18n.t('sufia.product_name')}")
|
data/spec/internal/Gemfile.lock
CHANGED
|
@@ -10,7 +10,7 @@ GIT
|
|
|
10
10
|
PATH
|
|
11
11
|
remote: ../../../curate
|
|
12
12
|
specs:
|
|
13
|
-
curate (0.6.
|
|
13
|
+
curate (0.6.1)
|
|
14
14
|
active_attr
|
|
15
15
|
active_fedora-registered_attributes (~> 0.2.0)
|
|
16
16
|
bootstrap-datepicker-rails
|
|
@@ -81,7 +81,7 @@ GEM
|
|
|
81
81
|
multi_json (~> 1.3)
|
|
82
82
|
thread_safe (~> 0.1)
|
|
83
83
|
tzinfo (~> 0.3.37)
|
|
84
|
-
acts_as_follower (0.2.
|
|
84
|
+
acts_as_follower (0.2.1)
|
|
85
85
|
addressable (2.3.5)
|
|
86
86
|
arel (4.0.1)
|
|
87
87
|
atomic (1.1.14)
|
|
@@ -216,10 +216,10 @@ GEM
|
|
|
216
216
|
hydra-access-controls (= 6.4.1)
|
|
217
217
|
hydra-core (= 6.4.1)
|
|
218
218
|
rails (>= 3.2.6)
|
|
219
|
-
hydra-remote_identifier (0.6.
|
|
219
|
+
hydra-remote_identifier (0.6.2)
|
|
220
220
|
activesupport (>= 3.2.13, < 5.0)
|
|
221
221
|
rest-client (~> 1.6.7)
|
|
222
|
-
i18n (0.6.
|
|
222
|
+
i18n (0.6.9)
|
|
223
223
|
ice_nine (0.10.0)
|
|
224
224
|
jbuilder (1.5.3)
|
|
225
225
|
activesupport (>= 3.0.0)
|
|
@@ -318,7 +318,7 @@ GEM
|
|
|
318
318
|
rdoc (3.12.2)
|
|
319
319
|
json (~> 1.4)
|
|
320
320
|
redis (3.0.6)
|
|
321
|
-
redis-namespace (1.
|
|
321
|
+
redis-namespace (1.4.1)
|
|
322
322
|
redis (~> 3.0.4)
|
|
323
323
|
resque (1.25.1)
|
|
324
324
|
mono_logger (~> 1.0)
|
|
@@ -431,7 +431,7 @@ GEM
|
|
|
431
431
|
polyglot
|
|
432
432
|
polyglot (>= 0.3.1)
|
|
433
433
|
trollop (1.16.2)
|
|
434
|
-
turbolinks (
|
|
434
|
+
turbolinks (2.0.0)
|
|
435
435
|
coffee-rails
|
|
436
436
|
tzinfo (0.3.38)
|
|
437
437
|
uglifier (2.3.2)
|
|
@@ -4,7 +4,7 @@ Devise.setup do |config|
|
|
|
4
4
|
# The secret key used by Devise. Devise uses this key to generate
|
|
5
5
|
# random tokens. Changing this key will render invalid all existing
|
|
6
6
|
# confirmation, reset password and unlock tokens in the database.
|
|
7
|
-
config.secret_key = '
|
|
7
|
+
config.secret_key = 'e1a71ebe9846b0adaa7f20e03dc5712b18f31fad02b361c617c236e783ea8874d37317b1d63ee251a39978b83d1023552715483df57292c80f22d9ddfdbd4c71'
|
|
8
8
|
|
|
9
9
|
# ==> Mailer Configuration
|
|
10
10
|
# Configure the e-mail address which will be shown in Devise::Mailer,
|
|
@@ -95,7 +95,7 @@ Devise.setup do |config|
|
|
|
95
95
|
config.stretches = Rails.env.test? ? 1 : 10
|
|
96
96
|
|
|
97
97
|
# Setup a pepper to generate the encrypted password.
|
|
98
|
-
# config.pepper = '
|
|
98
|
+
# config.pepper = '063037e779f5ef314ccf15ef0b462128474a92348d7971311526a93313355088b2b36c444bc7c32021e6f9e2413c681cabc5b65fbab154366890b2b1df8eff35'
|
|
99
99
|
|
|
100
100
|
# ==> Configuration for :confirmable
|
|
101
101
|
# A period that the user is allowed to access the website even without
|