sufia 6.0.0.rc4 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/Gemfile +1 -1
- data/History.md +280 -0
- data/README.md +180 -98
- data/SUFIA_VERSION +1 -1
- data/app/assets/images/site_images/collection-icon.svg +168 -0
- data/app/assets/javascripts/sufia/uploader.js +7 -4
- data/app/assets/stylesheets/sufia.css.scss +1 -1
- data/app/assets/stylesheets/sufia/_collections.scss +33 -13
- data/app/assets/stylesheets/sufia/_file-show.scss +24 -0
- data/app/assets/stylesheets/sufia/_settings.scss +4 -0
- data/app/controllers/concerns/sufia/catalog.rb +1 -11
- data/app/controllers/concerns/sufia/collections_controller_behavior.rb +13 -15
- data/app/controllers/concerns/sufia/dashboard_controller_behavior.rb +3 -1
- data/app/controllers/concerns/sufia/files_controller/browse_everything.rb +2 -1
- data/app/controllers/concerns/sufia/files_controller/local_ingest_behavior.rb +1 -0
- data/app/controllers/concerns/sufia/files_controller_behavior.rb +4 -1
- data/app/controllers/concerns/sufia/homepage_controller.rb +4 -11
- data/app/controllers/concerns/sufia/my_controller_behavior.rb +3 -21
- data/app/controllers/concerns/sufia/transfers_controller_behavior.rb +6 -6
- data/app/controllers/concerns/sufia/users_controller_behavior.rb +7 -7
- data/app/controllers/my/collections_controller.rb +1 -8
- data/app/controllers/my/files_controller.rb +1 -1
- data/app/controllers/my/highlights_controller.rb +1 -9
- data/app/controllers/my/shares_controller.rb +1 -8
- data/app/helpers/generic_file_helper.rb +4 -0
- data/app/helpers/sufia/sufia_helper_behavior.rb +3 -3
- data/app/helpers/sufia_url_helper.rb +9 -0
- data/app/jobs/content_depositor_change_event_job.rb +5 -5
- data/app/search_builders/sufia/search_builder.rb +50 -0
- data/app/views/_user_util_links.html.erb +6 -4
- data/app/views/batch_edits/_check_all.html.erb +1 -1
- data/app/views/catalog/index.html.erb +3 -30
- data/app/views/collections/_media_display.html.erb +1 -1
- data/app/views/collections/_show_descriptions.html.erb +1 -1
- data/app/views/collections/_show_document_list_row.html.erb +2 -2
- data/app/views/dashboard/_index_partials/_heading_actions.html.erb +16 -12
- data/app/views/generic_files/_browse_everything.html.erb +3 -1
- data/app/views/generic_files/_local_file_import.html.erb +0 -1
- data/app/views/generic_files/_multiple_upload.html.erb +0 -1
- data/app/views/generic_files/_show_descriptions.html.erb +6 -11
- data/app/views/generic_files/_show_details.html.erb +41 -65
- data/app/views/generic_files/new.html.erb +1 -0
- data/app/views/generic_files/show.html.erb +2 -1
- data/app/views/generic_files/upload/_alerts.html.erb +5 -13
- data/app/views/homepage/_home_header.html.erb +6 -7
- data/app/views/my/_index_partials/_list_collections.html.erb +1 -1
- data/app/views/my/index.html.erb +2 -2
- data/app/views/records/edit_fields/_resource_type.html.erb +1 -1
- data/config/initializers/sufia_events.rb +2 -3
- data/config/locales/sufia.en.yml +11 -2
- data/lib/generators/sufia/install_generator.rb +5 -1
- data/lib/generators/sufia/templates/catalog_controller.rb +3 -5
- data/lib/generators/sufia/upgrade600_generator.rb +26 -0
- data/lib/sufia/version.rb +1 -1
- data/spec/actors/generic_file/actor_spec.rb +14 -0
- data/spec/controllers/collections_controller_spec.rb +19 -2
- data/spec/controllers/dashboard_controller_spec.rb +43 -12
- data/spec/controllers/generic_files_controller_spec.rb +24 -1
- data/spec/controllers/transfers_controller_spec.rb +4 -4
- data/spec/controllers/users_controller_spec.rb +18 -4
- data/spec/fixtures/spoken-text.m4a +0 -0
- data/spec/helpers/dashboard_helper_spec.rb +1 -1
- data/spec/helpers/sufia_url_helper_spec.rb +15 -0
- data/spec/inputs/select_with_help_input_spec.rb +15 -0
- data/spec/jobs/{active_fedora_pid_based_job_spec.rb → active_fedora_id_based_job_spec.rb} +2 -2
- data/spec/jobs/audit_job_spec.rb +2 -2
- data/spec/lib/sufia/id_service_spec.rb +8 -8
- data/spec/lib/sufia/user_stat_importer_spec.rb +9 -1
- data/spec/models/ability_spec.rb +7 -4
- data/spec/models/checksum_audit_log_spec.rb +10 -10
- data/spec/models/collection_spec.rb +8 -13
- data/spec/models/fits_datastream_spec.rb +17 -0
- data/spec/models/generic_file_spec.rb +9 -1
- data/spec/models/proxy_deposit_request_spec.rb +15 -3
- data/spec/services/generic_file_audit_service_spec.rb +1 -1
- data/spec/support/features.rb +1 -0
- data/spec/support/rake_output.rb +20 -0
- data/spec/tasks/rake_spec.rb +58 -0
- data/spec/test_app_templates/Gemfile.extra +3 -1
- data/spec/views/batch/edit.html.erb_spec.rb +6 -2
- data/spec/views/catalog/index.html.erb_spec.rb +1 -1
- data/spec/views/catalog/sort_and_per_page.html.erb_spec.rb +6 -2
- data/spec/views/dashboard/index_spec.rb +49 -1
- data/spec/views/generic_file/_browse_everything.html.erb_spec.rb +9 -0
- data/spec/views/generic_file/show.html.erb_spec.rb +13 -8
- data/spec/views/homepage/_home_header.html.erb_spec.rb +26 -0
- data/spec/views/users/_user_util_links.html.erb_spec.rb +20 -0
- data/spec/views/users/show.html.erb_spec.rb +1 -1
- data/sufia-models/app/actors/sufia/generic_file/actor.rb +1 -1
- data/sufia-models/app/jobs/active_fedora_id_based_job.rb +22 -0
- data/sufia-models/app/jobs/active_fedora_pid_based_job.rb +5 -20
- data/sufia-models/app/jobs/audit_job.rb +5 -6
- data/sufia-models/app/jobs/characterize_job.rb +1 -1
- data/sufia-models/app/jobs/create_derivatives_job.rb +1 -1
- data/sufia-models/app/jobs/import_url_job.rb +2 -2
- data/sufia-models/app/models/batch.rb +18 -4
- data/sufia-models/app/models/checksum_audit_log.rb +2 -2
- data/sufia-models/app/models/concerns/sufia/ability.rb +7 -1
- data/sufia-models/app/models/concerns/sufia/collection_behavior.rb +1 -1
- data/sufia-models/app/models/concerns/sufia/generic_file/full_text_indexing.rb +23 -14
- data/sufia-models/app/models/concerns/sufia/generic_file/proxy_deposit.rb +1 -1
- data/sufia-models/app/models/datastreams/fits_datastream.rb +1 -36
- data/sufia-models/app/models/proxy_deposit_request.rb +6 -6
- data/sufia-models/app/services/sufia/generic_file_audit_service.rb +1 -1
- data/sufia-models/app/services/sufia/generic_file_indexing_service.rb +0 -1
- data/sufia-models/app/services/sufia/id_service.rb +2 -3
- data/sufia-models/app/services/sufia/noid.rb +1 -1
- data/sufia-models/lib/generators/sufia/models/templates/config/sufia.rb +1 -1
- data/sufia-models/lib/generators/sufia/models/templates/migrations/change_audit_log_pid_to_generic_file_id.rb +5 -0
- data/sufia-models/lib/generators/sufia/models/templates/migrations/change_proxy_deposit_request_pid_to_generic_file_id.rb +5 -0
- data/sufia-models/lib/generators/sufia/models/upgrade600_generator.rb +21 -0
- data/sufia-models/lib/sufia/models/stats/user_stat_importer.rb +20 -1
- data/sufia-models/lib/sufia/models/version.rb +1 -1
- data/sufia-models/lib/tasks/batch_cleanup.rake +19 -0
- data/sufia-models/lib/tasks/migrate.rake +21 -0
- data/sufia-models/lib/tasks/sufia-models_tasks.rake +55 -38
- data/sufia-models/sufia-models.gemspec +1 -1
- data/sufia.gemspec +2 -2
- metadata +44 -38
- data/app/assets/images/site_images/bg_body.png +0 -0
- data/app/assets/images/site_images/bg_breadcrumbs.png +0 -0
- data/app/assets/images/site_images/bg_button1.png +0 -0
- data/app/assets/images/site_images/bg_button2.png +0 -0
- data/app/assets/images/site_images/bg_button3.png +0 -0
- data/app/assets/images/site_images/bg_content.png +0 -0
- data/app/assets/images/site_images/bg_content2.png +0 -0
- data/app/assets/images/site_images/bg_footer.png +0 -0
- data/app/assets/images/site_images/bg_masthead.png +0 -0
- data/app/assets/images/site_images/bg_search_field.png +0 -0
- data/app/assets/images/site_images/bg_search_header.png +0 -0
- data/app/assets/images/site_images/bg_signin.png +0 -0
- data/app/assets/images/site_images/carrot_blue.png +0 -0
- data/app/assets/images/site_images/carrot_yellow.png +0 -0
- data/app/assets/images/site_images/icon_arrow2_up.png +0 -0
- data/app/assets/images/site_images/icon_arrow3_down.png +0 -0
- data/app/assets/images/site_images/icon_arrow3_right.png +0 -0
- data/app/assets/images/site_images/icon_arrow_down.png +0 -0
- data/app/assets/images/site_images/icons_sprite.png +0 -0
- data/app/assets/images/site_images/logo_psuss_footer.png +0 -0
- data/app/views/catalog/_edit_partials/_default.html.erb +0 -55
- data/spec/support/fedora_conf/fedora.fcfg +0 -953
@@ -1,16 +1,20 @@
|
|
1
1
|
<div class="col-xs-12 heading-row">
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
2
|
+
<% if can?(:create, GenericFile) %>
|
3
|
+
<div class="col-xs-6 col-sm-3 heading-tile">
|
4
|
+
<%= link_to sufia.new_generic_file_path do %>
|
5
|
+
<span class="glyphicon glyphicon-upload"></span>
|
6
|
+
<%= t("sufia.dashboard.upload") %>
|
7
|
+
<% end %>
|
8
|
+
</div>
|
9
|
+
<% end %>
|
10
|
+
<% if can?(:create, Collection) %>
|
11
|
+
<div class="col-xs-6 col-sm-3 heading-tile">
|
12
|
+
<%= link_to collections.new_collection_path, id: "hydra-collection-add" do %>
|
13
|
+
<span class="glyphicon glyphicon-plus"></span>
|
14
|
+
<%= t("sufia.dashboard.create_collection") %>
|
15
|
+
<% end %>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
14
18
|
<div class="col-xs-6 col-sm-3 heading-tile">
|
15
19
|
<%= link_to sufia.dashboard_collections_path, id: "hydra-collection-view" do %>
|
16
20
|
<span class="glyphicon glyphicon-th"></span>
|
@@ -1,5 +1,7 @@
|
|
1
1
|
<%= render partial: 'generic_files/upload/agreement' %>
|
2
|
-
|
2
|
+
<div class="alert alert-success">
|
3
|
+
<%= t("sufia.upload.cloud_timeout_message", contact_href: link_to(t("sufia.upload.alert.contact_href_text"), sufia.contact_form_index_path)) %>
|
4
|
+
</div>
|
3
5
|
<div class="well">
|
4
6
|
<%= form_tag(sufia.generic_files_path, id: 'browse_everything_form', method: 'post') do %>
|
5
7
|
<%= render partial: 'generic_files/upload/tos_checkbox' %>
|
@@ -1,12 +1,7 @@
|
|
1
|
-
|
2
|
-
<
|
3
|
-
|
4
|
-
<
|
5
|
-
|
6
|
-
<tr>
|
7
|
-
<th><%= r.label(term) %></th>
|
8
|
-
<td><%= r.value(term) %></td>
|
9
|
-
</tr>
|
1
|
+
<h2>Descriptions</h2>
|
2
|
+
<dl class="dl-horizontal file-show-term file-show-descriptions">
|
3
|
+
<% present_terms(@presenter,@presenter.terms - [:title, :description]) do |r, term| %>
|
4
|
+
<dt><%= r.label(term) %></dt>
|
5
|
+
<dd><%= r.value(term) %></dd>
|
10
6
|
<% end %>
|
11
|
-
|
12
|
-
</table> <!-- /verticalheadings -->
|
7
|
+
</dl>
|
@@ -1,69 +1,45 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
<%
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
<% end %>
|
33
|
-
</dt></dl>
|
34
|
-
</div>
|
35
|
-
</td>
|
36
|
-
</tr>
|
37
|
-
<% end %>
|
38
|
-
<tr>
|
39
|
-
<th>Characterization</th>
|
40
|
-
<td>
|
41
|
-
<%= "not yet characterized" if @generic_file.characterization_terms.values.flatten.map(&:empty?).reduce(true) { |sum, value| sum && value } %>
|
42
|
-
<% @generic_file.characterization_terms.each_pair do |term, values| %>
|
43
|
-
<div>
|
44
|
-
<% label = term.to_s %>
|
45
|
-
<% if label == "format_label" %>
|
46
|
-
<% label = "File Format" %>
|
47
|
-
<% values = @generic_file.file_format %>
|
48
|
-
<% end %>
|
49
|
-
<% label = label.humanize %>
|
50
|
-
<% if values.is_a? Array %>
|
51
|
-
<% length = values.length %>
|
52
|
-
<% length = Sufia.config.fits_message_length-1 if term == :status_message && values.length > Sufia.config.fits_message_length-1 %>
|
53
|
-
<% values[0..length].each_with_index do |value, idx| %>
|
1
|
+
<h2>File Details</h2>
|
2
|
+
<dl class="dl-horizontal file-show-term file-show-details">
|
3
|
+
<dt>Depositor</dt>
|
4
|
+
<dd itemprop="accountablePerson" itemscope itemtype="http://schema.org/Person"><span itemprop="name"><%= link_to_profile @generic_file.depositor %></span></dd>
|
5
|
+
<dt>Date Uploaded</dt>
|
6
|
+
<dd itemprop="datePublished"><%= @generic_file.date_uploaded %></dd>
|
7
|
+
<dt>Date Modified</dt>
|
8
|
+
<dd itemprop="dateModified"><%= @generic_file.date_modified %></dd>
|
9
|
+
<dt>Audit Status</dt>
|
10
|
+
<dd><%= @audit_status %></dd>
|
11
|
+
<% unless @generic_file.related_files.empty? %>
|
12
|
+
<dt>Related Files</dt>
|
13
|
+
<% @generic_file.related_files.each do |f| %>
|
14
|
+
<dd><%= link_to(f.label, sufia.generic_file_url(f)) %></dd>
|
15
|
+
<% end %>
|
16
|
+
<% end %>
|
17
|
+
<dt>Characterization</dt>
|
18
|
+
<dd>
|
19
|
+
<%= "not yet characterized" if @generic_file.characterization_terms.values.flatten.map(&:empty?).reduce(true) { |sum, value| sum && value } %>
|
20
|
+
<% @generic_file.characterization_terms.each_pair do |term, values| %>
|
21
|
+
<div>
|
22
|
+
<% label = term.to_s %>
|
23
|
+
<% if label == "format_label" %>
|
24
|
+
<% label = "File Format" %>
|
25
|
+
<% values = @generic_file.file_format %>
|
26
|
+
<% end %>
|
27
|
+
<% label = label.humanize %>
|
28
|
+
<% if values.is_a? Array %>
|
29
|
+
<% length = values.length %>
|
30
|
+
<% length = Sufia.config.fits_message_length-1 if term == :status_message && values.length > Sufia.config.fits_message_length-1 %>
|
31
|
+
<% values[0..length].each_with_index do |value, idx| %>
|
54
32
|
<% next if value.empty? %>
|
55
33
|
<%= "#{label}: #{value.truncate(250)}" %>
|
56
34
|
<%= "<br />".html_safe unless idx == length %>
|
57
|
-
<% end %>
|
58
|
-
<% if length != values.length %>
|
59
|
-
<%= render partial: "generic_files/extra_fields_modal", locals: {name: term, values: values, start: Sufia.config.fits_message_length}%>
|
60
|
-
<% end %>
|
61
|
-
<% else %>
|
62
|
-
<%= "#{label}: #{values.truncate(250)}" %><br />
|
63
35
|
<% end %>
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
36
|
+
<% if length != values.length %>
|
37
|
+
<%= render partial: "generic_files/extra_fields_modal", locals: {name: term, values: values, start: Sufia.config.fits_message_length}%>
|
38
|
+
<% end %>
|
39
|
+
<% else %>
|
40
|
+
<%= "#{label}: #{values.truncate(250)}" %><br />
|
41
|
+
<% end %>
|
42
|
+
</div>
|
43
|
+
<% end %>
|
44
|
+
</dd>
|
45
|
+
</dl>
|
@@ -1,4 +1,5 @@
|
|
1
1
|
<h2>Upload</h2>
|
2
|
+
<%= render partial: 'generic_files/upload/alerts' %>
|
2
3
|
<%# using partials rather than inlining, so implementers can add or change stuff on this page without much duplication %>
|
3
4
|
<ul class="nav nav-tabs" role="tablist" title="Data Source Selectors" id="upload_tabs">
|
4
5
|
<li class="active" id="computer_tab" title="<%= t('sufia.upload.my_computer.sr_tab_label')+' '+ t('sufia.upload.my_computer.tab_label') %>"><a role="tab" href="#local" data-toggle="tab"><i class="glyphicon glyphicon-folder-open" aria-hidden="true"></i> <%= t('sufia.upload.my_computer.tab_label')%></a></li>
|
@@ -47,7 +47,8 @@
|
|
47
47
|
<%= render 'show_collections' %>
|
48
48
|
</div>
|
49
49
|
<div itemscope itemtype="<%= @presenter.itemtype %>" class="col-xs-12 col-sm-8">
|
50
|
-
<h1 class="visibility"><%= @presenter.title
|
50
|
+
<h1 class="visibility"><%= display_multiple @presenter.title %> <%= render_visibility_badge %></h1>
|
51
|
+
<p class="genericfile_description"><%= display_multiple @presenter.description %></p>
|
51
52
|
<%= render 'show_descriptions' %>
|
52
53
|
<%= render 'show_details' %>
|
53
54
|
<%= render 'users/activity_log', events: @events %>
|
@@ -1,17 +1,9 @@
|
|
1
|
-
<div class="alert alert-
|
2
|
-
|
3
|
-
<p>
|
4
|
-
<%= link_to 'Add Descriptions', GenericFilesController.upload_complete_path(@batch_id), class: 'btn' %>
|
5
|
-
</p>
|
1
|
+
<div class="alert alert-warning" id="fail">
|
2
|
+
<%= t("sufia.upload.alert.fail_html", reload_href: link_to(t("sufia.upload.alert.fail_restart_href_text"), sufia.new_generic_file_path), contact_href: link_to(t("sufia.upload.alert.contact_href_text"), sufia.contact_form_index_path)) %>
|
6
3
|
</div>
|
7
4
|
|
8
|
-
<div class="alert
|
9
|
-
|
5
|
+
<div class="alert alert-warning" id="partial_fail">
|
6
|
+
<%= t("sufia.upload.alert.partial_fail_html", metadata_href: link_to(t("sufia.upload.alert.partial_fail_metadata_href_text"), GenericFilesController.upload_complete_path(@batch_id), class: 'btn'), contact_href: link_to(t("sufia.upload.alert.contact_href_text"), sufia.contact_form_index_path)) %>
|
10
7
|
</div>
|
11
8
|
|
12
|
-
<div class="alert
|
13
|
-
One or more files did not upload successfully. To continue using the files uploaded use one of the links below.<br />
|
14
|
-
<%= link_to 'Add Descriptions', GenericFilesController.upload_complete_path(@batch_id), class: 'btn' %>
|
15
|
-
</div>
|
16
|
-
|
17
|
-
<div class="alert hide" id="errmsg"> </div>
|
9
|
+
<div class="alert alert-warning" id="errmsg"> </div>
|
@@ -1,12 +1,11 @@
|
|
1
1
|
<div class="home_call_action col-xs-12 col-sm-4 pull-right">
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
<% if can?(:view_share_work, GenericFile) %>
|
3
|
+
<div class="home_share_work">
|
4
|
+
<%= link_to "<i class=\"glyphicon glyphicon-upload\"></i> #{t('sufia.share_button')}".html_safe, sufia.new_generic_file_path, class: "btn btn-primary btn-lg btn-block", id: "contribute_link" %>
|
5
|
+
<p class="text-center"><a href="/terms/">Terms of Use</a></p>
|
6
|
+
</div><!-- /.home_share_work -->
|
7
|
+
<% end %>
|
6
8
|
</div><!-- /.col-xs-3 -->
|
7
9
|
<div class="col-xs-12 col-sm-8">
|
8
10
|
<%= render partial: "marketing" %>
|
9
11
|
</div>
|
10
|
-
|
11
|
-
|
12
|
-
|
@@ -5,7 +5,7 @@
|
|
5
5
|
<td width="41%">
|
6
6
|
<div class="media">
|
7
7
|
<%= link_to [collections, document], class: "pull-left", "aria-hidden" => true do %>
|
8
|
-
|
8
|
+
<%= image_tag "site_images/collection-icon.svg", class: "collection-icon-small" %>
|
9
9
|
<% end %>
|
10
10
|
<div class="media-body">
|
11
11
|
<div class="media-heading">
|
data/app/views/my/index.html.erb
CHANGED
@@ -33,8 +33,8 @@
|
|
33
33
|
<%= render partial: 'document_list' %>
|
34
34
|
|
35
35
|
<% content_for :sidebar do %>
|
36
|
-
<%= link_to t(
|
37
|
-
<%= link_to t(
|
36
|
+
<%= link_to t('sufia.dashboard.upload_html'), sufia.new_generic_file_path, class: "btn btn-primary" %>
|
37
|
+
<%= link_to t('sufia.dashboard.create_collection_html'), collections.new_collection_path, id: "hydra-collection-add", class: "btn btn-primary" %>
|
38
38
|
<%= render partial: 'facets', locals: {current_tab: current_tab} %>
|
39
39
|
<% end %>
|
40
40
|
|
@@ -1,2 +1,2 @@
|
|
1
1
|
<%= f.input :resource_type, as: :select_with_help, collection: Sufia.config.resource_types,
|
2
|
-
input_html: { class: 'form-control', multiple: true
|
2
|
+
input_html: { class: 'form-control', multiple: true } %>
|
@@ -14,7 +14,6 @@ Sufia.config.after_update_metadata = lambda { |generic_file, user|
|
|
14
14
|
Sufia.queue.push(ContentUpdateEventJob.new(generic_file.id, user.user_key))
|
15
15
|
}
|
16
16
|
|
17
|
-
Sufia.config.after_destroy = lambda { |
|
18
|
-
Sufia.queue.push(ContentDeleteEventJob.new(
|
17
|
+
Sufia.config.after_destroy = lambda { |id, user|
|
18
|
+
Sufia.queue.push(ContentDeleteEventJob.new(id, user.user_key))
|
19
19
|
}
|
20
|
-
|
data/config/locales/sufia.en.yml
CHANGED
@@ -47,6 +47,13 @@ en:
|
|
47
47
|
local_ingest:
|
48
48
|
tab_label: "Network/Server Location"
|
49
49
|
processing: "File is being processed; you may edit when processing has completed"
|
50
|
+
alert:
|
51
|
+
fail_html: "There was a problem during upload, none of your files uploaded correctly. Please %{reload_href}. Use the %{contact_href} to report the error if it persists."
|
52
|
+
fail_restart_href_text: "start over"
|
53
|
+
contact_href_text: "contact form"
|
54
|
+
partial_fail_html: "One or more files did not upload successfully. To continue using the files that uploaded %{metadata_href}. <br /> Use the %{contact_href} to report the error if it persists."
|
55
|
+
partial_fail_metadata_href_text: "edit their metadata"
|
56
|
+
cloud_timeout_message: "Please note that if you upload a large number of files within a short period of time, the cloud provider may not be able to accommodate your request. If you experience any errors uploading from the cloud, let us know via the %{contact_href}."
|
50
57
|
homepage:
|
51
58
|
featured_works:
|
52
59
|
tab_label: 'Featured Works'
|
@@ -59,8 +66,8 @@ en:
|
|
59
66
|
dashboard:
|
60
67
|
title: "My Dashboard"
|
61
68
|
greeting: "Hello, "
|
62
|
-
|
63
|
-
|
69
|
+
upload_html: '<span class="glyphicon glyphicon-upload"></span> Upload'
|
70
|
+
create_collection_html: '<span class="glyphicon glyphicon-plus"></span> Create Collection'
|
64
71
|
view_collections: "View Collections"
|
65
72
|
view_files: "View Files"
|
66
73
|
user_activity: "User Activity"
|
@@ -121,6 +128,8 @@ en:
|
|
121
128
|
visibility:
|
122
129
|
open: "Open Access"
|
123
130
|
private: "Private"
|
131
|
+
open_title_attr: "Change the visibility of this resource"
|
132
|
+
private_title_attr: "Change the visibility of this resource"
|
124
133
|
user_profile:
|
125
134
|
no_followers: "No one is following you."
|
126
135
|
no_following: "You are not following anyone."
|
@@ -77,7 +77,7 @@ module Sufia
|
|
77
77
|
|
78
78
|
# The engine routes have to come after the devise routes so that /users/sign_in will work
|
79
79
|
def inject_routes
|
80
|
-
gsub_file 'config/routes.rb',
|
80
|
+
gsub_file 'config/routes.rb', /root (:to =>|to:) "catalog#index"/, ''
|
81
81
|
|
82
82
|
routing_code = "\n Hydra::BatchEdit.add_routes(self)\n" +
|
83
83
|
" # This must be the very last route in the file because it has a catch-all route for 404 errors.
|
@@ -101,6 +101,10 @@ module Sufia
|
|
101
101
|
end
|
102
102
|
end
|
103
103
|
|
104
|
+
def install_sufia_600
|
105
|
+
generate "sufia:upgrade600"
|
106
|
+
end
|
107
|
+
|
104
108
|
def install_blacklight_gallery
|
105
109
|
generate "blacklight_gallery:install"
|
106
110
|
end
|
@@ -8,16 +8,14 @@ require 'parslet'
|
|
8
8
|
require 'parsing_nesting/tree'
|
9
9
|
|
10
10
|
class CatalogController < ApplicationController
|
11
|
-
include
|
12
|
-
# Extend Blacklight::Catalog with Hydra behaviors (primarily editing).
|
11
|
+
include Hydra::Catalog
|
13
12
|
include Hydra::Controller::ControllerBehavior
|
14
|
-
include BlacklightAdvancedSearch::ParseBasicQ
|
15
13
|
include Sufia::Catalog
|
16
14
|
|
17
15
|
# These before_filters apply the hydra access controls
|
18
16
|
before_filter :enforce_show_permissions, only: :show
|
19
17
|
# This applies appropriate access controls to all solr queries
|
20
|
-
CatalogController.
|
18
|
+
CatalogController.search_params_logic += [:add_access_controls_to_solr_params, :add_advanced_parse_q_to_solr]
|
21
19
|
|
22
20
|
skip_before_filter :default_html_head
|
23
21
|
|
@@ -304,7 +302,7 @@ class CatalogController < ApplicationController
|
|
304
302
|
# whether the sort is ascending or descending (it must be asc or desc
|
305
303
|
# except in the relevancy case).
|
306
304
|
# label is key, solr field is value
|
307
|
-
config.add_sort_field "score desc, #{uploaded_field} desc", label: "relevance
|
305
|
+
config.add_sort_field "score desc, #{uploaded_field} desc", label: "relevance"
|
308
306
|
config.add_sort_field "#{uploaded_field} desc", label: "date uploaded \u25BC"
|
309
307
|
config.add_sort_field "#{uploaded_field} asc", label: "date uploaded \u25B2"
|
310
308
|
config.add_sort_field "#{modified_field} desc", label: "date modified \u25BC"
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
require 'rails/generators'
|
3
|
+
|
4
|
+
class Sufia::Upgrade600Generator < Rails::Generators::Base
|
5
|
+
|
6
|
+
source_root File.expand_path('../templates', __FILE__)
|
7
|
+
|
8
|
+
desc """
|
9
|
+
This generator for upgrading sufia to 6.0 makes the following changes to your application:
|
10
|
+
1. Adds Sufia::SearchBuilder to SearchBuilder
|
11
|
+
"""
|
12
|
+
|
13
|
+
def insert_builder
|
14
|
+
insert_into_file 'app/models/search_builder.rb', after: /include Blacklight::Solr::SearchBuilderBehavior/ do
|
15
|
+
# First line should be generated by Hydra. projecthydra/hydra-head#255
|
16
|
+
"\n include Hydra::AccessControlsEnforcement" +
|
17
|
+
"\n include Sufia::SearchBuilder\n"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def migrations
|
22
|
+
generate "sufia:models:upgrade600"
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
data/lib/sufia/version.rb
CHANGED
@@ -20,6 +20,20 @@ describe Sufia::GenericFile::Actor do
|
|
20
20
|
actor.create_content(uploaded_file, 'world.png', 'content', 'image/png')
|
21
21
|
end
|
22
22
|
|
23
|
+
context "when generic_file.title is empty and generic_file.label is not" do
|
24
|
+
let(:file) { "world.png" }
|
25
|
+
let(:long_name) { "an absurdly long title that goes on way to long and messes up the display of the page which should not need to be this big in order to show this impossibly long, long, long, oh so long string" }
|
26
|
+
let(:short_name) { "Nice Short Name" }
|
27
|
+
let(:actor) { Sufia::GenericFile::Actor.new(generic_file, user) }
|
28
|
+
before do
|
29
|
+
allow(generic_file).to receive(:label).and_return(short_name)
|
30
|
+
allow(Sufia.queue).to receive(:push)
|
31
|
+
actor.create_content(fixture_file_upload(file), long_name, 'content', 'image/png')
|
32
|
+
end
|
33
|
+
subject { generic_file.title }
|
34
|
+
it { is_expected.to eql [short_name] }
|
35
|
+
end
|
36
|
+
|
23
37
|
context "with two existing versions from different users" do
|
24
38
|
|
25
39
|
let(:file1) { "world.png" }
|
@@ -30,6 +30,15 @@ describe CollectionsController do
|
|
30
30
|
}.to change{ Collection.count }.by(1)
|
31
31
|
end
|
32
32
|
|
33
|
+
it "should remove blank strings from params before creating Collection" do
|
34
|
+
expect {
|
35
|
+
post :create, collection: {
|
36
|
+
title: "My First Collection ", creator: [""] }
|
37
|
+
}.to change{ Collection.count }.by(1)
|
38
|
+
expect(assigns[:collection].title).to eq("My First Collection ")
|
39
|
+
expect(assigns[:collection].creator).to eq([])
|
40
|
+
end
|
41
|
+
|
33
42
|
it "should create a Collection with files I can access" do
|
34
43
|
@asset1 = GenericFile.new(title: ["First of the Assets"])
|
35
44
|
@asset1.apply_depositor_metadata(user.user_key)
|
@@ -48,12 +57,12 @@ describe CollectionsController do
|
|
48
57
|
expect(collection.members).to match_array [@asset1, @asset2]
|
49
58
|
end
|
50
59
|
|
51
|
-
it "should add docs to collection if batch
|
60
|
+
it "should add docs to the collection if a batch id is provided and add the collection id to the documents in the collection" do
|
52
61
|
@asset1 = GenericFile.new(title: ["First of the Assets"])
|
53
62
|
@asset1.apply_depositor_metadata(user.user_key)
|
54
63
|
@asset1.save
|
55
64
|
post :create, batch_document_ids: [@asset1.id],
|
56
|
-
collection: { title: "My
|
65
|
+
collection: { title: "My Second Collection ", description: "The Description\r\n\r\nand more" }
|
57
66
|
expect(assigns[:collection].members).to eq [@asset1]
|
58
67
|
asset_results = ActiveFedora::SolrService.instance.conn.get "select", params:{fq:["id:\"#{@asset1.id}\""],fl:['id',Solrizer.solr_name(:collection)]}
|
59
68
|
expect(asset_results["response"]["numFound"]).to eq 1
|
@@ -113,6 +122,14 @@ describe CollectionsController do
|
|
113
122
|
collection.reload
|
114
123
|
expect(collection.creator).to eq ['Emily']
|
115
124
|
end
|
125
|
+
|
126
|
+
it "should remove blank strings from params before updating Collection metadata" do
|
127
|
+
put :update, id: collection, collection: {
|
128
|
+
title: "My Next Collection ", creator: [""] }
|
129
|
+
expect(assigns[:collection].title).to eq("My Next Collection ")
|
130
|
+
expect(assigns[:collection].creator).to eq([])
|
131
|
+
end
|
132
|
+
|
116
133
|
end
|
117
134
|
end
|
118
135
|
|