curation_concerns 0.12.0.pre1 → 0.12.0.pre2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (212) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +24 -16
  3. data/Gemfile +0 -4
  4. data/README.md +14 -0
  5. data/RELEASING.md +2 -2
  6. data/Rakefile +2 -0
  7. data/app/actors/concerns/curation_concerns/manages_embargoes_actor.rb +28 -0
  8. data/app/actors/curation_concerns/abstract_actor.rb +28 -0
  9. data/app/actors/curation_concerns/add_to_collection_actor.rb +38 -0
  10. data/app/actors/curation_concerns/apply_order_actor.rb +24 -0
  11. data/app/actors/curation_concerns/assign_identifier_actor.rb +7 -0
  12. data/app/actors/curation_concerns/assign_representative_actor.rb +18 -0
  13. data/app/actors/curation_concerns/attach_files_actor.rb +39 -0
  14. data/app/actors/curation_concerns/base_actor.rb +71 -0
  15. data/app/actors/curation_concerns/embargo_actor.rb +19 -0
  16. data/app/actors/curation_concerns/file_actor.rb +79 -0
  17. data/app/actors/curation_concerns/file_set_actor.rb +146 -0
  18. data/app/actors/curation_concerns/interpret_visibility_actor.rb +123 -0
  19. data/app/actors/curation_concerns/lease_actor.rb +19 -0
  20. data/app/actors/curation_concerns/root_actor.rb +17 -0
  21. data/app/actors/curation_concerns/work_actor_behavior.rb +8 -0
  22. data/app/assets/javascripts/curation_concerns/batch_select.js +42 -0
  23. data/app/assets/javascripts/curation_concerns/collections.js +13 -0
  24. data/app/assets/javascripts/curation_concerns/curation_concerns.js +2 -0
  25. data/app/assets/stylesheets/curation_concerns/_curation_concerns.scss +0 -3
  26. data/app/assets/stylesheets/curation_concerns/_modules.scss +1 -1
  27. data/app/assets/stylesheets/curation_concerns/_positioning.scss +3 -6
  28. data/app/assets/stylesheets/curation_concerns/_theme.scss +0 -39
  29. data/app/assets/stylesheets/curation_concerns/_typography.scss +0 -69
  30. data/app/assets/stylesheets/curation_concerns/modules/classify_work.scss +0 -2
  31. data/app/assets/stylesheets/curation_concerns/modules/collections.scss +4 -0
  32. data/app/assets/stylesheets/curation_concerns/modules/forms.scss +0 -4
  33. data/app/assets/stylesheets/curation_concerns/modules/site_actions.scss +34 -29
  34. data/app/assets/stylesheets/curation_concerns/modules/site_search.scss +0 -46
  35. data/app/assets/stylesheets/curation_concerns.scss +4 -0
  36. data/app/controllers/concerns/curation_concerns/collections_controller_behavior.rb +166 -21
  37. data/app/controllers/concerns/curation_concerns/embargoes_controller_behavior.rb +1 -1
  38. data/app/controllers/concerns/curation_concerns/leases_controller_behavior.rb +1 -1
  39. data/app/controllers/concerns/curation_concerns/selects_collections.rb +65 -0
  40. data/app/forms/curation_concerns/forms/collection_edit_form.rb +0 -29
  41. data/app/forms/curation_concerns/forms/work_form.rb +2 -1
  42. data/app/helpers/batch_select_helper.rb +23 -0
  43. data/app/helpers/collections_helper.rb +4 -0
  44. data/app/helpers/curation_concerns/collections_helper.rb +2 -2
  45. data/app/helpers/curation_concerns/collections_helper_behavior.rb +56 -0
  46. data/app/helpers/curation_concerns/render_constraints_helper.rb +14 -35
  47. data/app/helpers/curation_concerns/title_helper.rb +4 -0
  48. data/app/indexers/curation_concerns/collection_indexer.rb +16 -0
  49. data/app/indexers/curation_concerns/file_set_indexer.rb +46 -0
  50. data/app/indexers/curation_concerns/work_indexer.rb +15 -0
  51. data/app/jobs/audit_job.rb +49 -0
  52. data/app/jobs/characterize_job.rb +11 -0
  53. data/app/jobs/create_derivatives_job.rb +21 -0
  54. data/app/jobs/import_url_job.rb +48 -0
  55. data/app/jobs/ingest_file_job.rb +30 -0
  56. data/app/jobs/ingest_local_file_job.rb +20 -0
  57. data/app/jobs/resolrize_job.rb +7 -0
  58. data/app/models/checksum_audit_log.rb +20 -0
  59. data/app/models/collection.rb +6 -0
  60. data/app/models/concerns/curation_concerns/ability.rb +49 -0
  61. data/app/models/concerns/curation_concerns/basic_metadata.rb +64 -0
  62. data/app/models/concerns/curation_concerns/collection.rb +16 -0
  63. data/app/models/concerns/curation_concerns/collection_behavior.rb +62 -0
  64. data/app/models/concerns/curation_concerns/file_set/belongs_to_works.rb +47 -0
  65. data/app/models/concerns/curation_concerns/file_set/derivatives.rb +65 -0
  66. data/app/models/concerns/curation_concerns/file_set/full_text_indexing.rb +11 -0
  67. data/app/models/concerns/curation_concerns/file_set/indexing.rb +14 -0
  68. data/app/models/concerns/curation_concerns/file_set/querying.rb +17 -0
  69. data/app/models/concerns/curation_concerns/file_set_behavior.rb +36 -0
  70. data/app/models/concerns/curation_concerns/has_representative.rb +13 -0
  71. data/app/models/concerns/curation_concerns/human_readable_type.rb +17 -0
  72. data/app/models/concerns/curation_concerns/naming.rb +17 -0
  73. data/app/models/concerns/curation_concerns/permissions/readable.rb +18 -0
  74. data/app/models/concerns/curation_concerns/permissions/writable.rb +34 -0
  75. data/app/models/concerns/curation_concerns/permissions.rb +7 -0
  76. data/app/models/concerns/curation_concerns/required_metadata.rb +30 -0
  77. data/app/models/concerns/curation_concerns/serializers.rb +13 -0
  78. data/app/models/concerns/curation_concerns/solr_document_behavior.rb +147 -0
  79. data/app/models/concerns/curation_concerns/user.rb +18 -0
  80. data/app/models/concerns/curation_concerns/with_file_sets.rb +37 -0
  81. data/app/models/concerns/curation_concerns/work_behavior.rb +45 -0
  82. data/app/models/curation_concerns/classify_concern.rb +49 -0
  83. data/app/models/curation_concerns/quick_classification_query.rb +38 -0
  84. data/app/models/single_use_link.rb +34 -0
  85. data/app/models/version_committer.rb +2 -0
  86. data/app/search_builders/curation_concerns/collection_member_search_builder.rb +1 -1
  87. data/app/search_builders/curation_concerns/collection_search_builder.rb +33 -0
  88. data/app/search_builders/curation_concerns/member_search_builder.rb +17 -0
  89. data/app/services/curation_concerns/derivative_path.rb +49 -0
  90. data/app/services/curation_concerns/file_set_audit_service.rb +105 -0
  91. data/app/services/curation_concerns/indexes_thumbnails.rb +30 -0
  92. data/app/services/curation_concerns/local_file_service.rb +10 -0
  93. data/app/services/curation_concerns/lock_manager.rb +39 -0
  94. data/app/services/curation_concerns/lockable.rb +16 -0
  95. data/app/services/curation_concerns/noid.rb +23 -0
  96. data/app/services/curation_concerns/persist_derivatives.rb +33 -0
  97. data/app/services/curation_concerns/persist_directly_contained_output_file_service.rb +26 -0
  98. data/app/services/curation_concerns/repository_audit_service.rb +7 -0
  99. data/app/services/curation_concerns/thumbnail_path_service.rb +46 -0
  100. data/app/services/curation_concerns/time_service.rb +7 -0
  101. data/app/services/curation_concerns/versioning_service.rb +26 -0
  102. data/app/validators/has_one_title_validator.rb +8 -0
  103. data/app/views/batch_select/_add_button.html.erb +3 -0
  104. data/app/views/batch_select/_check_all.html.erb +4 -0
  105. data/app/views/batch_select/_tools.html.erb +10 -0
  106. data/app/views/catalog/_action_menu_partials/_collection.html.erb +3 -3
  107. data/app/views/catalog/_action_menu_partials/_default.html.erb +1 -1
  108. data/app/views/catalog/_document_list.html.erb +1 -1
  109. data/app/views/collections/_bookmark_control.html.erb +2 -0
  110. data/app/views/collections/_button_create_collection.html.erb +2 -0
  111. data/app/views/collections/_button_for_creating_empty_collection.html.erb +1 -1
  112. data/app/views/collections/_button_for_delete_collection.html.erb +4 -0
  113. data/app/views/collections/_button_for_remove_selected_from_collection.html.erb +8 -0
  114. data/app/views/collections/_button_for_update_collection.html.erb +4 -0
  115. data/app/views/collections/_button_remove_from_collection.html.erb +4 -0
  116. data/app/views/collections/_document_header.html.erb +9 -0
  117. data/app/views/collections/_edit_actions.html.erb +1 -1
  118. data/app/views/collections/_edit_descriptions.html.erb +1 -1
  119. data/app/views/collections/_form.html.erb +2 -2
  120. data/app/views/collections/_form_for_select_destination_collection.html.erb +21 -0
  121. data/app/views/collections/_form_to_add_member.html.erb +1 -1
  122. data/app/views/collections/_index_default.html.erb +2 -0
  123. data/app/views/collections/_index_header_default.html.erb +2 -0
  124. data/app/views/collections/_media_display.html.erb +1 -1
  125. data/app/views/collections/_paginate.html.erb +1 -1
  126. data/app/views/collections/_paginate_compact.html.erb +1 -0
  127. data/app/views/collections/_results_pagination.html.erb +9 -0
  128. data/app/views/collections/_search_collection_dashboard_form.html.erb +1 -1
  129. data/app/views/collections/_search_form.html.erb +1 -1
  130. data/app/views/collections/_search_results.html.erb +23 -0
  131. data/app/views/collections/_show_actions.html.erb +1 -1
  132. data/app/views/collections/_sort_and_per_page.html.erb +1 -1
  133. data/app/views/collections/_view_type_group.html.erb +1 -1
  134. data/app/views/collections/index.html.erb +9 -0
  135. data/app/views/collections/new.html.erb +3 -0
  136. data/app/views/curation_concerns/base/_form_permission.html.erb +10 -11
  137. data/app/views/curation_concerns/base/_form_permission_embargo.html.erb +1 -1
  138. data/app/views/curation_concerns/base/_form_permission_lease.html.erb +1 -1
  139. data/app/views/curation_concerns/base/_legally_binding_text.html.erb +7 -7
  140. data/app/views/curation_concerns/base/_related_files.html.erb +1 -1
  141. data/app/views/curation_concerns/base/_visibility.html.erb +2 -2
  142. data/app/views/curation_concerns/file_sets/_actions.html.erb +1 -1
  143. data/app/views/embargoes/_list_expired_active_embargoes.html.erb +1 -1
  144. data/app/views/error/single_use_error.html.erb +1 -1
  145. data/app/views/shared/_add_content.html.erb +17 -15
  146. data/app/views/shared/_brand_bar.html.erb +19 -10
  147. data/app/views/shared/_header.html.erb +2 -6
  148. data/app/views/shared/_my_actions.html.erb +28 -27
  149. data/app/views/shared/_site_actions.html.erb +5 -1
  150. data/app/views/shared/_site_search.html.erb +3 -2
  151. data/app/views/shared/_title_bar.html.erb +7 -16
  152. data/app/views/welcome/index.html.erb +2 -2
  153. data/config/locales/curation_concerns.en.yml +25 -1
  154. data/curation_concerns.gemspec +21 -5
  155. data/lib/curation_concerns/collections/accepts_batches.rb +53 -0
  156. data/lib/curation_concerns/collections/search_service.rb +57 -0
  157. data/lib/curation_concerns/collections.rb +10 -0
  158. data/lib/curation_concerns/configuration.rb +167 -0
  159. data/lib/curation_concerns/engine.rb +22 -1
  160. data/lib/curation_concerns/messages.rb +68 -0
  161. data/lib/curation_concerns/models.rb +42 -0
  162. data/lib/curation_concerns/name.rb +20 -0
  163. data/lib/curation_concerns/null_logger.rb +10 -0
  164. data/lib/curation_concerns/rails/routes.rb +1 -3
  165. data/lib/curation_concerns/version.rb +1 -1
  166. data/lib/curation_concerns.rb +2 -0
  167. data/lib/generators/curation_concerns/abstract_migration_generator.rb +31 -0
  168. data/lib/generators/curation_concerns/clamav_generator.rb +19 -0
  169. data/lib/generators/curation_concerns/collection_generator.rb +15 -0
  170. data/lib/generators/curation_concerns/install_generator.rb +1 -2
  171. data/lib/generators/curation_concerns/models_generator.rb +62 -0
  172. data/lib/generators/curation_concerns/templates/app/models/collection.rb +6 -0
  173. data/lib/generators/curation_concerns/templates/app/models/file_set.rb +4 -0
  174. data/lib/generators/curation_concerns/templates/config/clamav.rb +1 -0
  175. data/lib/generators/curation_concerns/templates/config/curation_concerns.rb +61 -0
  176. data/lib/generators/curation_concerns/templates/config/mime_types.rb +6 -0
  177. data/lib/generators/curation_concerns/templates/config/redis.yml +9 -0
  178. data/lib/generators/curation_concerns/templates/config/redis_config.rb +29 -0
  179. data/lib/generators/curation_concerns/templates/config/resque-pool.yml +1 -0
  180. data/lib/generators/curation_concerns/templates/config/resque_config.rb +6 -0
  181. data/lib/generators/curation_concerns/templates/curation_concerns.scss +3 -2
  182. data/lib/generators/curation_concerns/templates/migrations/create_checksum_audit_logs.rb +19 -0
  183. data/lib/generators/curation_concerns/templates/migrations/create_single_use_links.rb +12 -0
  184. data/lib/generators/curation_concerns/templates/migrations/create_version_committers.rb +15 -0
  185. data/lib/tasks/migrate.rake +11 -0
  186. data/lib/tasks/resque.rake +14 -0
  187. data/lib/tasks/solr_reindex.rake +8 -0
  188. data/spec/actors/curation_concerns/file_set_actor_spec.rb +31 -0
  189. data/spec/controllers/accepts_batches_controller_spec.rb +65 -0
  190. data/spec/controllers/collections_controller_spec.rb +272 -0
  191. data/spec/controllers/curation_concerns/collections_controller_spec.rb +1 -2
  192. data/spec/controllers/selects_collections_controller_spec.rb +109 -0
  193. data/spec/features/create_work_spec.rb +1 -1
  194. data/spec/features/work_generator_spec.rb +1 -1
  195. data/spec/forms/collection_edit_form_spec.rb +2 -9
  196. data/spec/forms/work_form_spec.rb +5 -0
  197. data/spec/helpers/collections_helper_spec.rb +129 -0
  198. data/spec/helpers/curation_concerns/collections_helper_spec.rb +2 -2
  199. data/spec/helpers/render_constraints_helper_spec.rb +23 -1
  200. data/spec/lib/curation_concerns/collections/search_service_spec.rb +33 -0
  201. data/spec/models/collection_spec.rb +165 -0
  202. data/spec/tasks/rake_spec.rb +1 -1
  203. data/spec/test_app_templates/lib/generators/test_app_generator.rb +1 -1
  204. data/spec/views/curation_concerns/base/_form_permission.html.erb_spec.rb +4 -1
  205. data/spec/views/curation_concerns/file_sets/show.html.erb_spec.rb +1 -0
  206. data/spec/views/shared/_add_content.html.erb_spec.rb +3 -3
  207. metadata +341 -24
  208. data/VERSION +0 -1
  209. data/app/assets/stylesheets/curation_concerns/_global-variables.scss +0 -5
  210. data/app/assets/stylesheets/curation_concerns/modules/multi_value_fields.scss +0 -52
  211. data/app/views/collections/_form_required_information.html.erb +0 -11
  212. data/tasks/release.rake +0 -93
@@ -0,0 +1,23 @@
1
+ <h2 class="sr-only top-content-title"><%= t('blacklight.search.search_results_header') %></h2>
2
+
3
+ <% @page_title = t('blacklight.search.title', :application_name => application_name) %>
4
+
5
+
6
+ <% content_for(:head) do -%>
7
+ <%= render_opensearch_response_metadata %>
8
+ <% end -%>
9
+
10
+
11
+ <%= render 'search_header' %>
12
+
13
+ <h2 class="sr-only"><%= t('blacklight.search.search_results') %></h2>
14
+
15
+ <%- if @response.empty? %>
16
+ <%= render "zero_results" %>
17
+ <%- elsif render_grouped_response? %>
18
+ <%= render_grouped_document_index %>
19
+ <%- else %>
20
+ <%= render_document_index %>
21
+ <%- end %>
22
+
23
+ <%= render 'results_pagination' %>
@@ -1,7 +1,7 @@
1
1
  <% if can? :edit, @presenter.id %>
2
2
  <h2 class="non lower">Actions</h2>
3
3
  <p>
4
- <%= link_to "Edit", collections.edit_collection_path, class: 'btn btn-default' %> &nbsp;&nbsp;
4
+ <%= link_to "Edit", edit_collection_path, class: 'btn btn-default' %> &nbsp;&nbsp;
5
5
  <%= link_to "Add files from your dashboard", search_path_for_my_works, class: 'btn btn-default' %>
6
6
  </p>
7
7
  <%end %>
@@ -12,7 +12,7 @@
12
12
  <div class="sort-toggle">
13
13
  <%-# 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 -%>
14
14
  <% unless @response.response['numFound'] < 2 %>
15
- <%= form_tag collections.collection_path(collection), method: :get, class: 'per_page form-inline' do %>
15
+ <%= form_tag collection_path(collection), method: :get, class: 'per_page form-inline' do %>
16
16
  <%= label_tag :sort do %>
17
17
  <span>Sort By:</span>
18
18
  <% end %>
@@ -3,7 +3,7 @@
3
3
  <span class="sr-only"><%= t('blacklight.search.view_title') %></span>
4
4
  <div class="view-type-group btn-group">
5
5
  <% document_index_views.each do |view, config| %>
6
- <%= link_to collections.collection_path(params[:id], view: view), title: t("blacklight.search.view_title.#{view}", default: t("blacklight.search.view.#{view}", default: blacklight_config.view[view].title)), class: "btn btn-default view-type-#{ view.to_s.parameterize } #{"active" if document_index_view_type == view}" do %>
6
+ <%= link_to collection_path(params[:id], view: view), title: t("blacklight.search.view_title.#{view}", default: t("blacklight.search.view.#{view}", default: blacklight_config.view[view].title)), class: "btn btn-default view-type-#{ view.to_s.parameterize } #{"active" if document_index_view_type == view}" do %>
7
7
  <%= render_view_type_group_icon view %>
8
8
  <span class="caption"><%= t("blacklight.search.view.#{view}") %></span>
9
9
  <% end %>
@@ -0,0 +1,9 @@
1
+ <div id="sidebar" class="col-md-3 col-sm-4">
2
+ <%= render 'search_sidebar' %>
3
+ </div>
4
+
5
+ <div id="content" class="col-md-9 col-sm-8">
6
+ <h2>Collections</h2>
7
+ <%= render 'search_results' %>
8
+ </div>
9
+
@@ -0,0 +1,3 @@
1
+ <h1>Create New Collection</h1>
2
+
3
+ <%= render 'form' %>
@@ -17,26 +17,25 @@
17
17
 
18
18
  <div class="form-group">
19
19
  <label class="radio">
20
- <input type="radio" id="visibility_open" name="<%= f.object_name %>[visibility]" value="<%= Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC %>" <% if f.object.open_access? %> checked="true"<% end %>/>
21
- <span class="label label-success">Open Access</span> Visible to the world.
20
+ <%= f.radio_button :visibility, Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC %>
21
+ <%= t('curation_concerns.visibility.open.label_html') %>
22
22
  </label>
23
23
  <label class="radio">
24
- <input type="radio" id="visibility_registered" name="<%= f.object_name %>[visibility]" value="<%= Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED %>" <% if f.object.authenticated_only_access? %> checked="true"<% end %> />
25
- <span class="label label-info"><%=t('curation_concerns.institution.name') %></span> Visible to all <%=t('curation_concerns.institution.name') %> users.
24
+ <%= f.radio_button :visibility, Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED %>
25
+ <%= t('curation_concerns.visibility.authenticated.label_html', institution: t('curation_concerns.institution.name')) %>
26
26
  </label>
27
27
  <label class="radio">
28
- <input type="radio" id="visibility_embargo" name="<%= f.object_name %>[visibility]" value="<%= Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_EMBARGO %>" <% if f.object.open_access_with_embargo_release_date? %> checked="true"<% end %>/>
29
- <%= render "form_permission_embargo", f: f %>
28
+ <%= f.radio_button :visibility, Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_EMBARGO %>
29
+ <%= render "form_permission_embargo", f: f %>
30
30
  </label>
31
31
  <label class="radio">
32
- <input type="radio" id="visibility_lease" name="<%= f.object_name %>[visibility]" value="lease" <% if f.object.open_access_with_embargo_release_date? %> checked="true"<% end %>/>
33
- <%= render "form_permission_lease", f: f %>
32
+ <%= f.radio_button :visibility, Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_LEASE %>
33
+ <%= render "form_permission_lease", f: f %>
34
34
  </label>
35
35
  <label class="radio">
36
- <input type="radio" id="visibility_restricted" name="<%= f.object_name %>[visibility]" value="<%= Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE%>" <% if f.object.private_access? %> checked="true"<% end %>/>
37
- <span class="label label-danger">Private</span> Only visible to you and your delegates.
36
+ <%= f.radio_button :visibility, Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE %>
37
+ <%= t('curation_concerns.visibility.private.label_html') %>
38
38
  </label>
39
39
  </div>
40
-
41
40
  </fieldset>
42
41
  <% end %>
@@ -1,5 +1,5 @@
1
1
  <div class="form-inline">
2
- <span class="label label-warning">Embargo</span>
2
+ <%= t('curation_concerns.visibility.embargo.label_html') %>
3
3
  <%= f.input :visibility_during_embargo, wrapper: :inline, collection: visibility_options(:restrict), include_blank: false %>
4
4
  <%= f.input :embargo_release_date, wrapper: :inline, input_html: { value: f.object.embargo_release_date || Date.tomorrow, class: 'datepicker' } %>
5
5
  <%= f.input :visibility_after_embargo, wrapper: :inline, collection: visibility_options(:loosen), include_blank: false %>
@@ -1,5 +1,5 @@
1
1
  <div class="form-inline">
2
- <span class="label label-warning">Lease</span>
2
+ <%= t('curation_concerns.visibility.lease.label_html') %>
3
3
  <%= f.input :visibility_during_lease, wrapper: :inline, collection: visibility_options(:loosen), include_blank: false %>
4
4
  <%= f.input :lease_expiration_date, wrapper: :inline, input_html: { value: f.object.lease_expiration_date || Date.tomorrow, class: 'datepicker' } %>
5
5
  <%= f.input :visibility_after_lease, wrapper: :inline, collection: visibility_options(:restrict), include_blank: false %>
@@ -1,7 +1,7 @@
1
1
  <p>
2
- I am submitting my work for inclusion in the <%=I18n.t('curation_concerns.product_name')%> repository maintained by the University Libraries of the <%= I18n.t('curation_concerns.institution.name') %>.
2
+ I am submitting my work for inclusion in the <%=I18n.application_name%> repository maintained by the University Libraries of the <%= I18n.t('curation_concerns.institution.name') %>.
3
3
  I acknowledge that publication of the work may implicate my legal rights with respect to the work and its contents, including my ability to publish the work in other venues.
4
- I UNDERSTAND AND AGREE THAT BY SUBMITTING MY CONTENT FOR INCLUSION IN THE <%=I18n.t('curation_concerns.product_name').upcase%> REPOSITORY, I AGREE TO THE FOLLOWING TERMS:
4
+ I UNDERSTAND AND AGREE THAT BY SUBMITTING MY CONTENT FOR INCLUSION IN THE <%=I18n.application_name.upcase%> REPOSITORY, I AGREE TO THE FOLLOWING TERMS:
5
5
  </p>
6
6
 
7
7
  <p>
@@ -10,15 +10,15 @@
10
10
  I agree that the University can preserve the submission by migrating or translating it to a new format or medium as needed in the future.
11
11
  I also agree that the metadata attached to the item can be reviewed and altered by the University to aid in preservation and discovery.
12
12
  I understand that I may be allowed the opportunity to select the intended audience for the materials that I submit, and I agree that I am fully responsible for any claims and all responsibility for materials submitted.
13
- The <%=I18n.t('curation_concerns.product_name')%> service is offered as-is with no warranties, express or implied.
14
- The University may suspend or terminate <%=I18n.t('curation_concerns.product_name')%>, or remove any content within the system, at any time for any reason in the University&rsquo;s sole discretion.
13
+ The <%=I18n.application_name%> service is offered as-is with no warranties, express or implied.
14
+ The University may suspend or terminate <%=I18n.application_name%>, or remove any content within the system, at any time for any reason in the University&rsquo;s sole discretion.
15
15
  </p>
16
16
 
17
17
  <p>
18
18
  I warrant that the submitted material is original to me and that I have power to make this agreement.
19
19
  I also warrant that the submission does not, to the best of my knowledge, infringe upon anyone&rsquo;s copyright.
20
- I also warrant that if the work has been previously published elsewhere in whole or in part, that I have obtained the permission of the copyright owner to grant <%=I18n.t('curation_concerns.product_name')%> the rights required by this license.
21
- I also guarantee that I do not have any other publication agreements that involve this material or substantial parts of it that conflict with my submission of materials for dissemination in <%=I18n.t('curation_concerns.product_name')%>.
20
+ I also warrant that if the work has been previously published elsewhere in whole or in part, that I have obtained the permission of the copyright owner to grant <%=I18n.application_name%> the rights required by this license.
21
+ I also guarantee that I do not have any other publication agreements that involve this material or substantial parts of it that conflict with my submission of materials for dissemination in <%=I18n.application_name%>.
22
22
  </p>
23
23
 
24
24
  <p>
@@ -27,7 +27,7 @@
27
27
  </p>
28
28
 
29
29
  <p>
30
- I understand that I may request the University to remove my submitted materials from the <%=I18n.t('curation_concerns.product_name')%> repository; however, I acknowledge that the University cannot control or retract works that may have been accessed by third parties prior to my request for removal.
30
+ I understand that I may request the University to remove my submitted materials from the <%=I18n.application_name%> repository; however, I acknowledge that the University cannot control or retract works that may have been accessed by third parties prior to my request for removal.
31
31
  If the submission is removed I agree that the item can be replaced by a page with a statement declaring that the item was removed by my request.
32
32
  </p>
33
33
 
@@ -20,5 +20,5 @@
20
20
  </div>
21
21
  <% elsif can? :edit, presenter.id %>
22
22
  <h2>Files</h2>
23
- <p class="center"><em>This <%= presenter.human_readable_type %> has no files associated with it. You can add one using the "Attach a File" button below.</em></p>
23
+ <p class="text-center"><em>This <%= presenter.human_readable_type %> has no files associated with it. You can add one using the "Attach a File" button below.</em></p>
24
24
  <% end %>
@@ -2,13 +2,13 @@
2
2
  the visibility to <span class='label label-success'>Open Access</span> will allow your
3
3
  content to be discovered in Google and viewed by anyone. The visibility setting
4
4
  <span class='label label-info'><%=t('curation_concerns.institution_name') %></span> will only allow
5
- users who are logged into <%=t('curation_concerns.product_name') %> (via WebAccess) to view the content.
5
+ users who are logged into <%=application_name %> (via WebAccess) to view the content.
6
6
  Files that are marked <span class='label label-danger'>Private</span> are only able to be viewed
7
7
  by users and/or groups that have been given specific access in the &quot;Share With&quot; section.
8
8
  </p>
9
9
 
10
10
  <p>
11
- Permissions in <%=t('curation_concerns.product_name') %> are hierarchical. This means that you cannot set
11
+ Permissions in <%=application_name %> are hierarchical. This means that you cannot set
12
12
  the visibility of a file to <span class='label label-success'>Open Access</span> or
13
13
  <span class='label label-info'><%=t('curation_concerns.institution_name') %></span> and simultaneously
14
14
  try to restrict the access of a single user. However, you may mark the visibility of
@@ -7,7 +7,7 @@
7
7
  <% if can?(:destroy, file_set.id) %>
8
8
  <%= link_to( 'Delete', polymorphic_path([main_app, file_set]),
9
9
  class: 'btn btn-default', method: :delete, title: "Delete #{file_set}",
10
- data: {confirm: "Deleting #{file_set} from #{t('curation_concerns.product_name')} is permanent. Click OK to delete this from #{t('curation_concerns.product_name')}, or Cancel to cancel this operation"}
10
+ data: {confirm: "Deleting #{file_set} from #{application_name} is permanent. Click OK to delete this from #{application_name}, or Cancel to cancel this operation"}
11
11
  )%>
12
12
  <% end %>
13
13
  <% if can?(:read, file_set.id) %>
@@ -5,7 +5,7 @@
5
5
  <th>Type of Work</th><th>Title</th><th>Current Visibility</th><th>Embargo Release Date</th><th>Visibility will Change to</th>
6
6
  </tr>
7
7
  <tr>
8
- <td colspan="5" style='text-align:center'><p>There are no expired embargoes in effect at this time.</p> </td>
8
+ <td colspan="5" class="text-center"><p>There are no expired embargoes in effect at this time.</p> </td>
9
9
  </tr>
10
10
  </tbody>
11
11
  </table>
@@ -8,7 +8,7 @@
8
8
  <div class="column second">
9
9
  <h1>Single Use Link Expired or Not Found</h1>
10
10
  <p>
11
- <%= t('curation_concerns.product_name') %> could not locate the single use link.
11
+ <%= application_name %> could not locate the single use link.
12
12
  This link either expired or had been used previously. We apologize
13
13
  for the inconvenience. You might be interested in using
14
14
  <a href="/help/">the help page</a> for looking up
@@ -1,20 +1,22 @@
1
1
  <% include_works_link ||= can_ever_create_works? %>
2
2
  <% include_collections_link ||= can?(:create, ::Collection) %>
3
3
  <% if include_works_link || include_collections_link %>
4
- <div class="btn-group add-content">
5
- <%= link_to curation_concerns.new_classify_concern_path, id: "add-content", class: "btn btn-primary dropdown-toggle", data: { toggle: "dropdown"} do %>
6
- <span class="glyphicon glyphicon-plus"></span><span class="sr-only">Add</span>
7
- <% end %>
8
- <ul class="dropdown-menu quick-create">
9
- <% if include_works_link %>
10
- <li>
11
- <%= render 'shared/add_works' %>
12
- </li>
13
- <li class="divider"></li>
4
+ <ul class="nav navbar-nav">
5
+ <li class="dropdown">
6
+ <%= link_to curation_concerns.new_classify_concern_path, id: "add-content", class: "dropdown-toggle", data: { toggle: "dropdown"} do %>
7
+ <span class="glyphicon glyphicon-plus"></span><span class="sr-only">Add</span>
14
8
  <% end %>
15
- <% if include_collections_link %>
16
- <li><%= link_to 'Add a Collection', collections.new_collection_path, class: 'menu-heading new-collection', role: 'menuitem' %></li>
17
- <% end %>
18
- </ul>
19
- </div>
9
+ <ul class="dropdown-menu quick-create">
10
+ <% if include_works_link %>
11
+ <li>
12
+ <%= render 'shared/add_works' %>
13
+ </li>
14
+ <li class="divider"></li>
15
+ <% end %>
16
+ <% if include_collections_link %>
17
+ <li><%= link_to 'Add a Collection', main_app.new_collection_path, class: 'menu-heading new-collection', role: 'menuitem' %></li>
18
+ <% end %>
19
+ </ul>
20
+ </li>
21
+ </ul>
20
22
  <% end %>
@@ -1,10 +1,19 @@
1
- <div class="container">
2
- <div id="brand-bar" class="row">
3
- <div class="university col-md-6">
4
- <h3><a href="<%= t('curation_concerns.institution.homepage_url') %>" tabindex="-1"><%= t('curation_concerns.institution.name') %></a></h3>
5
- </div>
6
- <div class="division col-md-6">
7
- <h2><a href="<%= t('curation_concerns.division.homepage_url') %>" tabindex="-1"><%= t('curation_concerns.division.name') %></a></h2>
8
- </div>
9
- </div>
10
- </div>
1
+ <nav id="brand-bar" class="navbar navbar-default navbar-inverse navbar-static-top">
2
+ <div class="container-fluid">
3
+ <div class="navbar-header">
4
+ <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#brand-bar-nav" aria-expanded="false">
5
+ <span class="sr-only">Toggle navigation</span>
6
+ <span class="icon-bar"></span>
7
+ <span class="icon-bar"></span>
8
+ <span class="icon-bar"></span>
9
+ </button>
10
+ <%= link_to application_name, main_app.root_path, id: 'home-link', class: 'navbar-brand' %>
11
+ </div>
12
+
13
+ <div class="collapse navbar-collapse" id="brand-bar-nav">
14
+ <div class="navbar-right">
15
+ <%= render 'shared/site_actions' if show_site_actions? %>
16
+ </div>
17
+ </div>
18
+ </div>
19
+ </nav>
@@ -1,11 +1,7 @@
1
1
  <header id="banner" role="banner">
2
2
  <hgroup>
3
- <div id="brand-bar-wrapper">
4
- <%= render 'shared/brand_bar' %>
5
- </div>
6
- <div id="title-bar-wrapper">
7
- <%= render 'shared/title_bar' %>
8
- </div>
3
+ <%= render 'shared/brand_bar' %>
4
+ <%= render 'shared/title_bar' %>
9
5
  </hgroup>
10
6
  </header>
11
7
 
@@ -1,29 +1,30 @@
1
- <div class="btn-group my-actions">
2
- <a class="btn btn-primary dropdown-toggle user-display-name" data-toggle="dropdown" href="#">
3
- <%= current_user.user_key %>
4
- <span class="caret"></span>
5
- </a>
6
- <ul class="dropdown-menu">
7
- <% include_works_link ||= can_ever_create_works? %>
8
- <% include_collections_link ||= can?(:create, Collection) %>
9
- <% if include_works_link %>
10
- <li><%= link_to 'My Works', search_path_for_my_works, class: 'my-works', role: 'menuitem' %></li>
11
- <% end %>
12
- <% if include_collections_link %>
13
- <li><%= link_to 'My Collections', search_path_for_my_collections, class: 'my-collections', role: 'menuitem' %></li>
14
- <% end %>
1
+ <ul class="nav navbar-nav">
2
+ <li class="dropdown my-actions">
3
+ <a class="dropdown-toggle user-display-name" data-toggle="dropdown" href="#">
4
+ <%= current_user.user_key %>
5
+ <span class="caret"></span>
6
+ </a>
7
+ <ul class="dropdown-menu">
8
+ <% include_works_link ||= can_ever_create_works? %>
9
+ <% include_collections_link ||= can?(:create, Collection) %>
10
+ <% if include_works_link %>
11
+ <li><%= link_to 'My Works', search_path_for_my_works, class: 'my-works', role: 'menuitem' %></li>
12
+ <% end %>
13
+ <% if include_collections_link %>
14
+ <li><%= link_to 'My Collections', search_path_for_my_collections, class: 'my-collections', role: 'menuitem' %></li>
15
+ <% end %>
15
16
 
16
- <% if can? :discover, Hydra::AccessControls::Embargo %>
17
- <li><%= link_to 'Embargos', main_app.embargoes_path, role: 'menuitem' %></li>
18
- <% end %>
19
- <% if can? :discover, Hydra::AccessControls::Lease %>
20
- <li><%= link_to 'Leases', main_app.leases_path, role: 'menuitem' %></li>
21
- <% end %>
22
-
23
- <% if include_works_link || include_collections_link %>
24
- <li class="divider"></li>
25
- <% end %>
26
- <li><%= link_to 'Log Out', main_app.destroy_user_session_path, class: 'log-out', role: 'menuitem' %></li>
27
- </ul>
28
- </div>
17
+ <% if can? :discover, Hydra::AccessControls::Embargo %>
18
+ <li><%= link_to 'Embargos', main_app.embargoes_path, role: 'menuitem' %></li>
19
+ <% end %>
20
+ <% if can? :discover, Hydra::AccessControls::Lease %>
21
+ <li><%= link_to 'Leases', main_app.leases_path, role: 'menuitem' %></li>
22
+ <% end %>
29
23
 
24
+ <% if include_works_link || include_collections_link %>
25
+ <li class="divider"></li>
26
+ <% end %>
27
+ <li><%= link_to 'Log Out', main_app.destroy_user_session_path, class: 'log-out', role: 'menuitem' %></li>
28
+ </ul>
29
+ </li>
30
+ </ul>
@@ -2,6 +2,10 @@
2
2
  <%= render 'shared/add_content' %>
3
3
  <%= render 'shared/my_actions' %>
4
4
  <% else %>
5
- <%= link_to 'Log In', main_app.new_user_session_path, class: 'btn btn-primary login', role: 'menuitem' %>
5
+ <ul class="nav navbar-nav">
6
+ <li>
7
+ <%= link_to 'Log In', main_app.new_user_session_path, class: 'login', role: 'menuitem' %>
8
+ </li>
9
+ </ul>
6
10
  <% end %>
7
11
 
@@ -1,6 +1,6 @@
1
- <%= form_tag main_app.search_catalog_path, method: :get, class: "search-form" do %>
1
+ <%= form_tag main_app.search_catalog_path, method: :get, class: "search-form navbar-form" do %>
2
2
  <fieldset>
3
- <legend class="sr-only">Search <%= t('curation_concerns.product_name') %></legend>
3
+ <legend class="sr-only">Search <%= application_name %></legend>
4
4
  <%= label_tag :catalog_search, t('curation_concerns.search.form.q.label'), class: "sr-only" %>
5
5
  <%= render_hash_as_hidden_fields(search_state.params_for_search.except(:q, :search_field, :qt, :page, :utf8)) %>
6
6
 
@@ -8,6 +8,7 @@
8
8
  <div class="input-group">
9
9
  <%= text_field_tag(:q, params[:q], class: "q search-query form-control", id: "catalog_search",
10
10
  placeholder: t('curation_concerns.search.form.q.placeholder'), tabindex: "1", type: "search") %>
11
+
11
12
  <div class="input-group-btn">
12
13
  <button type="submit" class="search-submit btn btn-primary" id="keyword-search-submit" tabindex="2">
13
14
  <i class="glyphicon glyphicon-search"></i><span class="sr-only">Search</span>
@@ -1,16 +1,7 @@
1
- <div class="container">
2
- <div id="title-bar" class="row">
3
- <div id="site-search" class="col-md-4">
4
- <%= render 'shared/site_search' if show_site_search? %>
5
- </div>
6
-
7
- <div id="site-title" class="col-md-4">
8
- <h1><%= link_to t('curation_concerns.product_name'), main_app.root_path, id: 'home-link' %></h1>
9
- </div>
10
-
11
- <nav id="site-actions" class="col-md-4" role="menu">
12
- <%= render 'shared/site_actions' if show_site_actions? %>
13
- </nav>
14
- </div>
15
- </div>
16
-
1
+ <nav id="title-bar" class="navbar navbar-default navbar-static-top">
2
+ <div class="container-fluid">
3
+ <div class="navbar-right">
4
+ <%= render 'shared/site_search' if show_site_search? %>
5
+ </div>
6
+ </div>
7
+ </nav>
@@ -1,9 +1,9 @@
1
1
  <br />
2
2
  <p>
3
- <%=t('curation_concerns.product_name') %> is a secure repository service enabling the
3
+ <%=application_name %> is a secure repository service enabling the
4
4
  <%=t('curation_concerns.institution.name') %> community to share its research and scholarly
5
5
  work with a worldwide audience. Faculty, staff, and students can use
6
- <%=t('curation_concerns.product_name') %> to collect their work in one location and create a
6
+ <%=application_name %> to collect their work in one location and create a
7
7
  durable and citeable record of their papers, presentations, publications, data
8
8
  sets, or other scholarly creations.
9
9
  </p>
@@ -1,5 +1,7 @@
1
1
  en:
2
2
  curation_concerns:
3
+ product_name: "Repository"
4
+ institution_name: &INSTITUTION_NAME "Institution Name"
3
5
  catalog:
4
6
  index:
5
7
  type_tabs:
@@ -12,7 +14,6 @@ en:
12
14
  institution:
13
15
  name: "Your Institution"
14
16
  homepage_url: "#"
15
- product_name: "Repository"
16
17
  search:
17
18
  form:
18
19
  q:
@@ -101,6 +102,29 @@ en:
101
102
  property: keywords
102
103
  title:
103
104
  property: name
105
+
106
+ visibility:
107
+ open:
108
+ text: "Open Access"
109
+ class: "label-success"
110
+ label_html: <span class="label label-success">Open Access</span> Visible to the world.
111
+ authenticated:
112
+ text: *INSTITUTION_NAME
113
+ class: "label-info"
114
+ label_html: "<span class=\"label label-info\">%{institution}</span> Visible to all %{institution} users."
115
+ embargo:
116
+ text: "Embargo"
117
+ class: "label-warning"
118
+ label_html: <span class="label label-warning">Embargo</span>
119
+ lease:
120
+ text: "Lease"
121
+ class: "label-warning"
122
+ label_html: <span class="label label-warning">Lease</span>
123
+ private:
124
+ label_html: <span class="label label-danger">Private</span> Only visible to you and your delegates.
125
+ restricted:
126
+ text: "Private"
127
+ class: "label-danger"
104
128
  blacklight:
105
129
  search:
106
130
  fields:
@@ -1,9 +1,11 @@
1
1
  # coding: utf-8
2
- version = File.read(File.expand_path("../VERSION",__FILE__)).strip
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'curation_concerns/version'
3
5
 
4
6
  Gem::Specification.new do |spec|
5
7
  spec.name = "curation_concerns"
6
- spec.version = version
8
+ spec.version = CurationConcerns::VERSION
7
9
  spec.authors = ["Matt Zumwalt", "Justin Coyne", "Jeremy Friesen"]
8
10
  spec.email = ["justin@curationexperts.com"]
9
11
  spec.summary = %q{A Rails Engine that allows an application to CRUD CurationConcern objects (a.k.a. "Works") }
@@ -11,22 +13,33 @@ Gem::Specification.new do |spec|
11
13
  spec.homepage = ""
12
14
  spec.license = "APACHE2"
13
15
 
14
- spec.files = `git ls-files | grep -v ^curation_concerns-models | grep -v ^spec/fixtures`.split($\)
16
+ spec.files = `git ls-files | grep -v ^spec/fixtures`.split($\)
15
17
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
16
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
17
19
  spec.require_paths = ["lib"]
18
20
 
19
21
  spec.add_dependency 'hydra-head', '~> 9.9'
20
- spec.add_dependency 'blacklight', '~> 6.0'
22
+ spec.add_dependency 'blacklight', '~> 6.1'
21
23
  spec.add_dependency "breadcrumbs_on_rails", "~> 2.3"
22
24
  spec.add_dependency "jquery-ui-rails"
23
25
  spec.add_dependency "simple_form", '~> 3.1'
24
- spec.add_dependency 'curation_concerns-models', version
25
26
  spec.add_dependency 'hydra-editor', '~> 1.1'
26
27
  spec.add_dependency 'blacklight_advanced_search', '~> 6.0'
27
28
  spec.add_dependency 'rails_autolink'
28
29
  spec.add_dependency 'sprockets-es6'
29
30
  spec.add_dependency 'kaminari_route_prefix', '~> 0.0.1'
31
+ spec.add_dependency 'active_attr'
32
+ spec.add_dependency 'hydra-works', '~> 0.8', '>= 0.8.1'
33
+ spec.add_dependency 'active_fedora-noid', '~> 1.0'
34
+ spec.add_dependency 'resque', '~> 1.23'
35
+ spec.add_dependency 'resque-pool', '~> 0.3'
36
+ spec.add_dependency 'qa', '~> 0.5'
37
+ spec.add_dependency 'redlock', '~> 0.1.2'
38
+ spec.add_dependency 'solrizer', '~> 3.4'
39
+ spec.add_dependency 'active-fedora', '~> 9.9'
40
+ spec.add_dependency 'deprecation', '~> 0.1'
41
+ spec.add_dependency 'rdf', '~> 1.99'
42
+ spec.add_dependency 'rdf-vocab', '~> 0'
30
43
 
31
44
  spec.add_development_dependency 'solr_wrapper', '~> 0.4'
32
45
  spec.add_development_dependency 'fcrepo_wrapper', '~> 0.1'
@@ -45,4 +58,7 @@ Gem::Specification.new do |spec|
45
58
  spec.add_development_dependency "database_cleaner", "< 1.1.0"
46
59
  spec.add_development_dependency 'mida', '~> 0.3.4'
47
60
  spec.add_development_dependency 'jasmine'
61
+ spec.add_development_dependency 'rubocop', '~> 0.39'
62
+ spec.add_development_dependency 'rubocop-rspec', '~> 1.4.1'
63
+
48
64
  end
@@ -0,0 +1,53 @@
1
+ module CurationConcerns
2
+ module Collections
3
+ module AcceptsBatches
4
+ def batch
5
+ @batch ||= batch_ids_from_params
6
+ end
7
+
8
+ def batch=(val)
9
+ @batch = val
10
+ end
11
+
12
+ # Callback to be used in before_filter
13
+ def check_for_empty_batch?
14
+ batch.empty?
15
+ end
16
+
17
+ protected
18
+
19
+ def batch_ids_from_params
20
+ if params['batch_document_ids'].blank?
21
+ []
22
+ elsif params['batch_document_ids'] == 'all'
23
+ CurationConcerns::Collections::SearchService.new(session, current_user.user_key).last_search_documents.map(&:id)
24
+ else
25
+ params['batch_document_ids']
26
+ end
27
+ end
28
+
29
+ def filter_docs_with_read_access!
30
+ filter_docs_with_access!(:read)
31
+ end
32
+
33
+ def filter_docs_with_edit_access!
34
+ filter_docs_with_access!(:edit)
35
+ end
36
+
37
+ def filter_docs_with_access!(access_type = :edit)
38
+ no_permissions = []
39
+ if batch.empty?
40
+ flash[:notice] = 'Select something first'
41
+ else
42
+ batch.dup.each do |doc_id|
43
+ unless can?(access_type, doc_id)
44
+ batch.delete(doc_id)
45
+ no_permissions << doc_id
46
+ end
47
+ end
48
+ flash[:notice] = "You do not have permission to edit the documents: #{no_permissions.join(', ')}" unless no_permissions.empty?
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end