bulkrax 5.0.0 → 5.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/bulkrax/entries_controller.rb +4 -2
  3. data/app/controllers/bulkrax/exporters_controller.rb +13 -9
  4. data/app/controllers/bulkrax/importers_controller.rb +10 -10
  5. data/app/helpers/bulkrax/application_helper.rb +1 -1
  6. data/app/helpers/bulkrax/importers_helper.rb +2 -2
  7. data/app/helpers/bulkrax/validation_helper.rb +4 -4
  8. data/app/jobs/bulkrax/create_relationships_job.rb +78 -59
  9. data/app/jobs/bulkrax/delete_job.rb +1 -1
  10. data/app/jobs/bulkrax/export_work_job.rb +2 -2
  11. data/app/jobs/bulkrax/import_file_set_job.rb +1 -1
  12. data/app/jobs/bulkrax/import_work_job.rb +20 -7
  13. data/app/jobs/bulkrax/importer_job.rb +2 -2
  14. data/app/jobs/bulkrax/schedule_relationships_job.rb +2 -1
  15. data/app/matchers/bulkrax/application_matcher.rb +1 -0
  16. data/app/models/bulkrax/csv_entry.rb +93 -24
  17. data/app/models/bulkrax/exporter.rb +18 -19
  18. data/app/models/bulkrax/importer.rb +5 -5
  19. data/app/models/bulkrax/importer_run.rb +6 -0
  20. data/app/models/bulkrax/oai_entry.rb +14 -2
  21. data/app/models/bulkrax/pending_relationship.rb +4 -0
  22. data/app/models/concerns/bulkrax/dynamic_record_lookup.rb +3 -1
  23. data/app/models/concerns/bulkrax/export_behavior.rb +6 -4
  24. data/app/models/concerns/bulkrax/has_matchers.rb +1 -0
  25. data/app/models/concerns/bulkrax/import_behavior.rb +6 -3
  26. data/app/models/concerns/bulkrax/importer_exporter_behavior.rb +9 -1
  27. data/app/models/concerns/bulkrax/status_info.rb +9 -4
  28. data/app/parsers/bulkrax/application_parser.rb +14 -16
  29. data/app/parsers/bulkrax/bagit_parser.rb +6 -17
  30. data/app/parsers/bulkrax/csv_parser.rb +43 -111
  31. data/app/parsers/bulkrax/oai_dc_parser.rb +2 -2
  32. data/app/parsers/bulkrax/parser_export_record_set.rb +281 -0
  33. data/app/parsers/bulkrax/xml_parser.rb +9 -5
  34. data/app/services/bulkrax/remove_relationships_for_importer.rb +4 -2
  35. data/app/views/bulkrax/entries/show.html.erb +1 -1
  36. data/app/views/bulkrax/exporters/_form.html.erb +60 -45
  37. data/app/views/bulkrax/exporters/edit.html.erb +1 -1
  38. data/app/views/bulkrax/exporters/index.html.erb +2 -2
  39. data/app/views/bulkrax/exporters/new.html.erb +1 -1
  40. data/app/views/bulkrax/exporters/show.html.erb +3 -3
  41. data/app/views/bulkrax/importers/_bagit_fields.html.erb +13 -12
  42. data/app/views/bulkrax/importers/_csv_fields.html.erb +13 -12
  43. data/app/views/bulkrax/importers/_form.html.erb +5 -5
  44. data/app/views/bulkrax/importers/_oai_fields.html.erb +12 -10
  45. data/app/views/bulkrax/importers/_xml_fields.html.erb +12 -11
  46. data/app/views/bulkrax/importers/show.html.erb +18 -16
  47. data/app/views/bulkrax/shared/_collection_entries_tab.html.erb +6 -6
  48. data/app/views/bulkrax/shared/_file_set_entries_tab.html.erb +6 -6
  49. data/app/views/bulkrax/shared/_work_entries_tab.html.erb +6 -6
  50. data/config/locales/bulkrax.en.yml +26 -0
  51. data/lib/bulkrax/entry_spec_helper.rb +190 -0
  52. data/lib/bulkrax/version.rb +1 -1
  53. data/lib/bulkrax.rb +124 -45
  54. data/lib/generators/bulkrax/templates/config/initializers/bulkrax.rb +1 -1
  55. data/lib/tasks/reset.rake +1 -1
  56. metadata +5 -3
@@ -11,7 +11,7 @@
11
11
  </div>
12
12
  <% end %>
13
13
 
14
- <%= form.input :name, label: t('bulkrax.exporter.labels.name') %>
14
+ <%= form.input :name, label: t('bulkrax.exporter.labels.name'), input_html: { class: 'form-control' } %>
15
15
 
16
16
  <%= form.hidden_field :user_id, value: current_user.id %>
17
17
 
@@ -19,20 +19,22 @@
19
19
  collection: form.object.export_type_list,
20
20
  label: t('bulkrax.exporter.labels.export_type'),
21
21
  required: true,
22
- prompt: 'Please select an export type' %>
22
+ prompt: 'Please select an export type',
23
+ input_html: { class: 'form-control' } %>
23
24
 
24
25
  <%= form.input :export_from,
25
26
  collection: form.object.export_from_list,
26
27
  label: t('bulkrax.exporter.labels.export_from'),
27
28
  required: true,
28
- prompt: 'Please select an export source' %>
29
+ prompt: 'Please select an export source',
30
+ input_html: { class: 'form-control' } %>
29
31
 
30
32
  <%= form.input :export_source_importer,
31
33
  label: t('bulkrax.exporter.labels.importer'),
32
34
  required: true,
33
35
  prompt: 'Select from the list',
34
36
  label_html: { class: 'importer export-source-option hidden' },
35
- input_html: { class: 'importer export-source-option hidden' },
37
+ input_html: { class: 'importer export-source-option hidden form-control' },
36
38
  collection: form.object.importers_list.sort %>
37
39
 
38
40
  <%= form.input :export_source_collection,
@@ -42,7 +44,7 @@
42
44
  placeholder: @collection&.title&.first,
43
45
  label_html: { class: 'collection export-source-option hidden' },
44
46
  input_html: {
45
- class: 'collection export-source-option hidden',
47
+ class: 'collection export-source-option hidden form-control',
46
48
  data: {
47
49
  'autocomplete-url' => '/authorities/search/collections',
48
50
  'autocomplete' => 'collection'
@@ -55,13 +57,14 @@
55
57
  required: true,
56
58
  prompt: 'Select from the list',
57
59
  label_html: { class: 'worktype export-source-option hidden' },
58
- input_html: { class: 'worktype export-source-option hidden' },
59
- collection: Hyrax.config.curation_concerns.map {|cc| [cc.to_s, cc.to_s] } %>
60
+ input_html: { class: 'worktype export-source-option hidden form-control' },
61
+ collection: Bulkrax.curation_concerns.map { |cc| [cc.to_s, cc.to_s] } %>
60
62
 
61
63
  <%= form.input :limit,
62
64
  as: :integer,
63
65
  hint: 'leave blank or 0 for all records',
64
- label: t('bulkrax.exporter.labels.limit') %>
66
+ label: t('bulkrax.exporter.labels.limit'),
67
+ input_html: { class: 'form-control' } %>
65
68
 
66
69
  <%= form.input :generated_metadata?,
67
70
  as: :boolean,
@@ -76,58 +79,70 @@
76
79
  <%= form.input :date_filter,
77
80
  as: :boolean,
78
81
  label: t('bulkrax.exporter.labels.filter_by_date') %>
82
+
79
83
  <div id="date_filter_picker" class="hidden">
80
84
  <%= form.input :start_date,
81
85
  as: :date,
82
- label: t('bulkrax.exporter.labels.start_date') %>
86
+ label: t('bulkrax.exporter.labels.start_date'),
87
+ input_html: { class: 'form-control' } %>
83
88
 
84
89
  <%= form.input :finish_date,
85
90
  as: :date,
86
- label: t('bulkrax.exporter.labels.finish_date') %>
91
+ label: t('bulkrax.exporter.labels.finish_date'),
92
+ input_html: { class: 'form-control' } %>
87
93
  </div>
88
- <%= form.input :work_visibility,
89
- collection: form.object.work_visibility_list,
90
- label: t('bulkrax.exporter.labels.visibility') %>
94
+ <% if defined?(::Hyrax) %>
95
+ <%= form.input :work_visibility,
96
+ collection: form.object.work_visibility_list,
97
+ label: t('bulkrax.exporter.labels.visibility'),
98
+ input_html: { class: 'form-control' } %>
99
+ <% end %>
91
100
 
92
- <%= form.input :workflow_status,
93
- collection: form.object.workflow_status_list,
94
- label: t('bulkrax.exporter.labels.status') %>
101
+ <% if defined?(::Hyrax) %>
102
+ <%= form.input :workflow_status,
103
+ collection: form.object.workflow_status_list,
104
+ label: t('bulkrax.exporter.labels.status'),
105
+ input_html: { class: 'form-control' } %>
106
+ <% end %>
95
107
 
96
108
  <%= form.input :parser_klass,
97
109
  collection: Bulkrax.parsers.map {|p| [p[:name], p[:class_name], {'data-partial' => p[:partial]}] if p[:class_name].constantize.export_supported? }.compact,
98
- label: t('bulkrax.exporter.labels.export_format') %>
110
+ label: t('bulkrax.exporter.labels.export_format'),
111
+ input_html: { class: 'form-control' } %>
99
112
  </div>
100
113
 
101
114
  <%# Find definitions for the functions called in this script in
102
115
  app/assets/javascripts/bulkrax/exporters.js %>
103
116
  <script>
104
- $(function() {
105
- // show the selected export_source option
106
- var selectedVal = $('.exporter_export_from option:selected').val();
107
- hideUnhide(selectedVal);
108
-
109
- // Select2 dropdowns don't like taking a value param. Thus,
110
- // if export_source_collection is present, we populate the input.
111
- var selectedCollectionId = "<%= @collection&.id %>"
112
- if (selectedCollectionId.length > 0) {
113
- $('#exporter_export_source_collection').val(selectedCollectionId)
114
- }
115
-
116
- // get the selected export_from option and show the corresponding export_source
117
- $('.exporter_export_from').change(function() {
118
- var selectedVal = $('.exporter_export_from option:selected').val();
119
- hideUnhide(selectedVal);
120
- });
121
-
122
- // get the date filter option and show the corresponding date selectors
123
- $('.exporter_date_filter').change(function() {
124
- if($('.exporter_date_filter').find(".boolean").is(":checked"))
125
- $('#date_filter_picker').removeClass('hidden');
126
- else
127
- $('#date_filter_picker').addClass('hidden');
117
+ document.addEventListener("DOMContentLoaded", function() {
118
+ $(function () {
119
+ // show the selected export_source option
120
+ var selectedVal = $('.exporter_export_from option:selected').val();
121
+ hideUnhide(selectedVal);
122
+
123
+ // Select2 dropdowns don't like taking a value param. Thus,
124
+ // if export_source_collection is present, we populate the input.
125
+ var selectedCollectionId = "<%= @collection&.id %>"
126
+ if (selectedCollectionId.length > 0) {
127
+ $('#exporter_export_source_collection').val(selectedCollectionId)
128
+ }
129
+
130
+ // get the selected export_from option and show the corresponding export_source
131
+ $('.exporter_export_from').change(function () {
132
+ var selectedVal = $('.exporter_export_from option:selected').val();
133
+ hideUnhide(selectedVal);
134
+ });
135
+
136
+ // get the date filter option and show the corresponding date selectors
137
+ $('.exporter_date_filter').change(function () {
138
+ if ($('.exporter_date_filter').find(".boolean").is(":checked"))
139
+ $('#date_filter_picker').removeClass('hidden');
140
+ else
141
+ $('#date_filter_picker').addClass('hidden');
142
+ });
143
+
144
+ if ($('.exporter_date_filter').find(".boolean").is(":checked"))
145
+ $('#date_filter_picker').removeClass('hidden');
146
+ });
128
147
  });
129
-
130
- if($('.exporter_date_filter').find(".boolean").is(":checked"))
131
- $('#date_filter_picker').removeClass('hidden');
132
- });
133
148
  </script>
@@ -4,7 +4,7 @@
4
4
 
5
5
  <div class="row">
6
6
  <div class="col-md-12">
7
- <div class="panel panel-default tabs">
7
+ <div class="panel panel-default tabs exporter-form">
8
8
  <%= simple_form_for @exporter do |form| %>
9
9
  <%= render 'form', exporter: @exporter, form: form %>
10
10
  <div class="panel-footer">
@@ -1,7 +1,7 @@
1
1
  <% provide :page_header do %>
2
2
  <h1><span class="fa fa-cloud-download" aria-hidden="true"></span> Exporters</h1>
3
3
  <div class="pull-right">
4
- <%= link_to new_exporter_path, class: 'btn btn-primary' do %>
4
+ <%= link_to new_exporter_path, class: 'btn btn-primary', data: { turbolinks: false } do %>
5
5
  <span class="fa fa-edit" aria-hidden="true"></span> <%= t(:'helpers.action.exporter.new') %>
6
6
  <% end %>
7
7
  </div>
@@ -42,7 +42,7 @@
42
42
  <% end%>
43
43
  </td>
44
44
  <td><%= link_to raw('<span class="glyphicon glyphicon-info-sign"></span>'), exporter_path(exporter) %></td>
45
- <td><%= link_to raw('<span class="glyphicon glyphicon-pencil"></span>'), edit_exporter_path(exporter) %></td>
45
+ <td><%= link_to raw('<span class="glyphicon glyphicon-pencil"></span>'), edit_exporter_path(exporter), data: { turbolinks: false } %></td>
46
46
  <td><%= link_to raw('<span class="glyphicon glyphicon-remove"></span>'), exporter, method: :delete, data: { confirm: 'Are you sure?' } %></td>
47
47
  </tr>
48
48
  <% end %>
@@ -4,7 +4,7 @@
4
4
 
5
5
  <div class="row">
6
6
  <div class="col-md-12">
7
- <div class="panel panel-default tabs">
7
+ <div class="panel panel-default tabs exporter-form">
8
8
  <%= simple_form_for @exporter do |form| %>
9
9
  <%= render 'form', exporter: @exporter, form: form %>
10
10
  <div class="panel-footer">
@@ -96,9 +96,9 @@
96
96
  <div class="bulkrax-nav-tab-bottom-margin">
97
97
  <!-- Nav tabs -->
98
98
  <ul class="bulkrax-nav-tab-top-margin tab-nav nav nav-tabs" role="tablist">
99
- <li role="presentation" class='active'><a href="#work-entries" aria-controls="work-entries" role="tab" data-toggle="tab">Work Entries</a></li>
100
- <li role="presentation"><a href="#collection-entries" aria-controls="collection-entries" role="tab" data-toggle="tab">Collection Entries</a></li>
101
- <li role="presentation"><a href="#file-set-entries" aria-controls="file-set-entries" role="tab" data-toggle="tab">File Set Entries</a></li>
99
+ <li role="presentation" class='active'><a href="#work-entries" aria-controls="work-entries" role="tab" data-toggle="tab"><%= t('bulkrax.exporter.labels.work_entries') %></a></li>
100
+ <li role="presentation"><a href="#collection-entries" aria-controls="collection-entries" role="tab" data-toggle="tab"><%= t('bulkrax.exporter.labels.collection_entries') %></a></li>
101
+ <li role="presentation"><a href="#file-set-entries" aria-controls="file-set-entries" role="tab" data-toggle="tab"><%= t('bulkrax.exporter.labels.file_set_entries') %></a></li>
102
102
  </ul>
103
103
  <!-- Tab panes -->
104
104
  <div class="tab-content outline">
@@ -24,17 +24,18 @@
24
24
  input_html: { class: 'form-control' }
25
25
  %>
26
26
 
27
- <% rights_statements = Hyrax.config.rights_statement_service_class.new %>
28
- <%= fi.input :rights_statement,
29
- collection: rights_statements.select_active_options,
30
- selected: importer.parser_fields['rights_statement'],
31
- include_blank: true,
32
- item_helper: rights_statements.method(:include_current_value),
33
- input_html: { class: 'form-control' } ,
34
- required: false
35
- %>
36
- <%= fi.input :override_rights_statement, as: :boolean, hint: 'If checked, always use the selected rights statment. If unchecked, use rights or rights_statement from the record and only use the provided value if dc:rights is blank.', input_html: { checked: (importer.parser_fields['override_rights_statement'] == "1") } %>
37
-
27
+ <% if defined?(::Hyrax) %>
28
+ <% rights_statements = Hyrax.config.rights_statement_service_class.new %>
29
+ <%= fi.input :rights_statement,
30
+ collection: rights_statements.select_active_options,
31
+ selected: importer.parser_fields['rights_statement'],
32
+ include_blank: true,
33
+ item_helper: rights_statements.method(:include_current_value),
34
+ input_html: { class: 'form-control' } ,
35
+ required: false
36
+ %>
37
+ <%= fi.input :override_rights_statement, as: :boolean, hint: 'If checked, always use the selected rights statment. If unchecked, use rights or rights_statement from the record and only use the provided value if dc:rights is blank.', input_html: { checked: (importer.parser_fields['override_rights_statement'] == "1") } %>
38
+ <% end %>
38
39
  <h4>Bag or Bags to Import:</h4>
39
40
  <p>File upload and Cloud File upload must be a Zip file containing a single BagIt Bag, or a folder containing multiple BagIt Bags.</p>
40
41
  <p>The Server Path can point to a BagIt Bag, a folder containing BagIt Bags, or a zip file containing either.</p>
@@ -47,7 +48,7 @@
47
48
  <%= fi.input :import_file_path, as: :string, input_html: { value: importer.parser_fields['import_file_path'] } %>
48
49
  </div>
49
50
  <div id='cloud'>
50
- <% if Hyrax.config.browse_everything? %>
51
+ <% if defined?(::Hyrax) && Hyrax.config.browse_everything? %>
51
52
  <%= render 'browse_everything', form: form %>
52
53
  <% end %>
53
54
  </div>
@@ -9,17 +9,18 @@
9
9
  input_html: { class: 'form-control' }
10
10
  %>
11
11
 
12
- <% rights_statements = Hyrax.config.rights_statement_service_class.new %>
13
- <%= fi.input :rights_statement,
14
- collection: rights_statements.select_active_options,
15
- selected: importer.parser_fields['rights_statement'],
16
- include_blank: true,
17
- item_helper: rights_statements.method(:include_current_value),
18
- input_html: { class: 'form-control' },
19
- required: false
20
- %>
21
- <%= fi.input :override_rights_statement, as: :boolean, hint: 'If checked, always use the selected rights statment. If unchecked, use rights or rights_statement from the record and only use the provided value if dc:rights is blank.', input_html: { checked: (importer.parser_fields['override_rights_statement'] == "1") } %>
22
-
12
+ <% if defined?(::Hyrax) %>
13
+ <% rights_statements = Hyrax.config.rights_statement_service_class.new %>
14
+ <%= fi.input :rights_statement,
15
+ collection: rights_statements.select_active_options,
16
+ selected: importer.parser_fields['rights_statement'],
17
+ include_blank: true,
18
+ item_helper: rights_statements.method(:include_current_value),
19
+ input_html: { class: 'form-control' },
20
+ required: false
21
+ %>
22
+ <%= fi.input :override_rights_statement, as: :boolean, hint: 'If checked, always use the selected rights statment. If unchecked, use rights or rights_statement from the record and only use the provided value if dc:rights is blank.', input_html: { checked: (importer.parser_fields['override_rights_statement'] == "1") } %>
23
+ <% end %>
23
24
  <h4>Add CSV File to Import:</h4>
24
25
  <%# accept a single file upload; data files and bags will need to be added another way %>
25
26
 
@@ -30,7 +31,7 @@
30
31
  <div id='file_path'>
31
32
  <%= fi.input :import_file_path, as: :string, input_html: { value: importer.parser_fields['import_file_path'] } %>
32
33
  </div>
33
- <% if Hyrax.config.browse_everything? %>
34
+ <% if defined?(::Hyrax) && Hyrax.config.browse_everything? %>
34
35
  <h4>Add Files to Import:</h4>
35
36
  <p>Choose files to upload. The filenames must be unique, and the filenames must be referenced in a column called 'file' in the accompanying CSV file.</p>
36
37
  <%= render 'browse_everything', form: form %>
@@ -11,17 +11,17 @@
11
11
  </div>
12
12
  <% end %>
13
13
 
14
- <%= form.input :name %>
14
+ <%= form.input :name, input_html: { class: 'form-control' } %>
15
15
 
16
- <%= form.input :admin_set_id, collection: available_admin_sets %>
16
+ <%= form.input :admin_set_id, collection: available_admin_sets if defined?(::Hyrax) %>
17
17
 
18
18
  <%= form.hidden_field :user_id, value: current_user.id %>
19
19
 
20
- <%= form.input :frequency, collection: form.object.class.frequency_enums %>
20
+ <%= form.input :frequency, collection: form.object.class.frequency_enums, input_html: { class: 'form-control' } %>
21
21
 
22
- <%= form.input :limit, as: :integer, hint: 'leave blank or 0 for all records' %>
22
+ <%= form.input :limit, as: :integer, hint: 'leave blank or 0 for all records', input_html: { class: 'form-control'} %>
23
23
 
24
- <%= form.input :parser_klass, collection: Bulkrax.parsers.map {|p| [p[:name], p[:class_name], {'data-partial' => p[:partial]}]}, label: "Parser" %>
24
+ <%= form.input :parser_klass, collection: Bulkrax.parsers.map {|p| [p[:name], p[:class_name], {'data-partial' => p[:partial]}]}, label: "Parser", input_html: { class: 'form-control' } %>
25
25
 
26
26
  <%= form.fields_for :parser_fields do |fi| %>
27
27
  <div class='parser_fields'>
@@ -15,16 +15,18 @@
15
15
  input_html: { class: 'form-control' }
16
16
  %>
17
17
 
18
- <% rights_statements = Hyrax.config.rights_statement_service_class.new %>
19
- <%= fi.input :rights_statement,
20
- collection: rights_statements.select_active_options,
21
- selected: importer.parser_fields['rights_statement'],
22
- include_blank: true,
23
- item_helper: rights_statements.method(:include_current_value),
24
- input_html: { class: 'form-control' },
25
- required: false
26
- %>
27
- <%= fi.input :override_rights_statement, as: :boolean, hint: 'If checked, always use the selected rights statment. If unchecked, use dc:rights from the record and only use the provided value if dc:rights is blank.', input_html: { checked: (importer.parser_fields['override_rights_statement'] == "1") } %>
18
+ <% if defined?(::Hyrax) %>
19
+ <% rights_statements = Hyrax.config.rights_statement_service_class.new %>
20
+ <%= fi.input :rights_statement,
21
+ collection: rights_statements.select_active_options,
22
+ selected: importer.parser_fields['rights_statement'],
23
+ include_blank: true,
24
+ item_helper: rights_statements.method(:include_current_value),
25
+ input_html: { class: 'form-control' },
26
+ required: false
27
+ %>
28
+ <%= fi.input :override_rights_statement, as: :boolean, hint: 'If checked, always use the selected rights statment. If unchecked, use dc:rights from the record and only use the provided value if dc:rights is blank.', input_html: { checked: (importer.parser_fields['override_rights_statement'] == "1") } %>
29
+ <% end %>
28
30
  <%= fi.input :thumbnail_url, required: false, as: :string, input_html: { value: importer.parser_fields['thumbnail_url'] } %>
29
31
  <div class="help-block well well-sm">
30
32
  <p>
@@ -31,16 +31,17 @@
31
31
  input_html: { class: 'form-control' }
32
32
  %>
33
33
 
34
- <% rights_statements = Hyrax.config.rights_statement_service_class.new %>
35
- <%= fi.input :rights_statement,
36
- collection: rights_statements.select_active_options,
37
- selected: importer.parser_fields['rights_statement'],
38
- include_blank: true,
39
- item_helper: rights_statements.method(:include_current_value),
40
- input_html: { class: 'form-control' },
41
- required: false %>
42
- <%= fi.input :override_rights_statement, as: :boolean, hint: 'If checked, always use the selected rights statment. If unchecked, use rights or rights_statement from the record and only use the provided value if dc:rights is blank.', input_html: { checked: (importer.parser_fields['override_rights_statement'] == "1") } %>
43
-
34
+ <% if defined?(::Hyrax) %>
35
+ <% rights_statements = Hyrax.config.rights_statement_service_class.new %>
36
+ <%= fi.input :rights_statement,
37
+ collection: rights_statements.select_active_options,
38
+ selected: importer.parser_fields['rights_statement'],
39
+ include_blank: true,
40
+ item_helper: rights_statements.method(:include_current_value),
41
+ input_html: { class: 'form-control' },
42
+ required: false %>
43
+ <%= fi.input :override_rights_statement, as: :boolean, hint: 'If checked, always use the selected rights statment. If unchecked, use rights or rights_statement from the record and only use the provided value if dc:rights is blank.', input_html: { checked: (importer.parser_fields['override_rights_statement'] == "1") } %>
44
+ <% end %>
44
45
  <h4>XML and files to Import:</h4>
45
46
  <p>File upload and Cloud File upload MUST be a either a single XML file (for metadata only import) OR a Zip file containing the XML files and data files, each in a separate folder.</p>
46
47
  <p>The Server Path can point to a folder containing XML files and data files to import, or direct to the XML file itself.</p>
@@ -53,7 +54,7 @@
53
54
  <%= fi.input :import_file_path, as: :string, input_html: { value: importer.parser_fields['import_file_path'] } %>
54
55
  </div>
55
56
  <div id='cloud'>
56
- <% if Hyrax.config.browse_everything? %>
57
+ <% if defined?(::Hyrax) && Hyrax.config.browse_everything? %>
57
58
  <%= render 'browse_everything', form: form %>
58
59
  <% end %>
59
60
  </div>
@@ -1,6 +1,6 @@
1
1
  <div class="col-xs-12 main-header">
2
2
  <h1><span class="fa fa-cloud-upload" aria-hidden="true"></span> Importer: <%= @importer.name %></h1>
3
- <% if @importer.parser_klass == 'Bulkrax::CsvParser' && @work_entries.map { |e| e.status == 'failed' }.any? %>
3
+ <% if @importer.parser_klass == 'Bulkrax::CsvParser' && @work_entries.map(&:failed?).any? %>
4
4
  <div class="pull-right">
5
5
  <%= link_to 'Export Errored Entries', importer_export_errors_path(@importer.id), class: 'btn btn-primary' %>
6
6
  <%= link_to 'Upload Corrected Entries', importer_upload_corrected_entries_path(@importer.id), class: 'btn btn-primary' %>
@@ -10,27 +10,29 @@
10
10
  <div class="panel panel-default bulkrax-align-text">
11
11
  <div class="panel-body">
12
12
  <p class="bulkrax-p-align">
13
- <strong>Name:</strong>
13
+ <strong><%= t('bulkrax.importer.labels.name') %>:</strong>
14
14
  <%= @importer.name %>
15
15
  </p>
16
+ <% if defined?(::Hyrax) %>
17
+ <p class="bulkrax-p-align">
18
+ <strong><%= t('bulkrax.importer.labels.admin_set') %>:</strong>
19
+ <%= @importer.admin_set_id %>
20
+ </p>
21
+ <% end %>
16
22
  <p class="bulkrax-p-align">
17
- <strong>Admin set:</strong>
18
- <%= @importer.admin_set_id %>
19
- </p>
20
- <p class="bulkrax-p-align">
21
- <strong>User:</strong>
23
+ <strong><%= t('bulkrax.importer.labels.user') %>:</strong>
22
24
  <%= @importer.user %>
23
25
  </p>
24
26
  <p class="bulkrax-p-align">
25
- <strong>Frequency:</strong>
27
+ <strong><%= t('bulkrax.importer.labels.frequency') %>:</strong>
26
28
  <%= @importer.frequency %>
27
29
  </p>
28
30
  <p class="bulkrax-p-align">
29
- <strong>Parser klass:</strong>
31
+ <strong><%= t('bulkrax.importer.labels.parser_klass') %>:</strong>
30
32
  <%= @importer.parser_klass %>
31
33
  </p>
32
34
  <p class="bulkrax-p-align">
33
- <strong>Limit:</strong>
35
+ <strong><%= t('bulkrax.importer.labels.limit') %>:</strong>
34
36
  <%= @importer.limit %>
35
37
  </p>
36
38
 
@@ -57,26 +59,26 @@
57
59
  <%= render partial: 'bulkrax/shared/bulkrax_field_mapping', locals: {item: @importer} %>
58
60
 
59
61
  <p class="bulkrax-p-align" title="<%= @importer.last_run&.processed_works %> processed, <%= @importer.last_run&.failed_works %> failed">
60
- <strong>Total Works:</strong>
62
+ <strong><%= t('bulkrax.importer.labels.total_work_entries') %>:</strong>
61
63
  <%= @importer.last_run&.total_work_entries %>
62
64
  </p>
63
65
 
64
66
  <p class="bulkrax-p-align" title="<%= @importer.last_run&.processed_collections %> processed, <%= @importer.last_run&.failed_collections %> failed">
65
- <strong>Total Collections:</strong>
67
+ <strong><%= t('bulkrax.importer.labels.total_collections') %>:</strong>
66
68
  <%= @importer.last_run&.total_collection_entries %>
67
69
  </p>
68
70
 
69
71
  <p class="bulkrax-p-align" title="<%= @importer.last_run&.processed_file_sets %> processed, <%= @importer.last_run&.failed_file_sets %> failed">
70
- <strong>Total File Sets:</strong>
72
+ <strong><%= t('bulkrax.importer.labels.total_file_sets') %>:</strong>
71
73
  <%= @importer.last_run&.total_file_set_entries %>
72
74
  </p>
73
75
 
74
76
  <div class="bulkrax-nav-tab-bottom-margin">
75
77
  <!-- Nav tabs -->
76
78
  <ul class="bulkrax-nav-tab-top-margin tab-nav nav nav-tabs" role="tablist">
77
- <li role="presentation" class='active'><a href="#work-entries" aria-controls="work-entries" role="tab" data-toggle="tab">Work Entries</a></li>
78
- <li role="presentation"><a href="#collection-entries" aria-controls="collection-entries" role="tab" data-toggle="tab">Collection Entries</a></li>
79
- <li role="presentation"><a href="#file-set-entries" aria-controls="file-set-entries" role="tab" data-toggle="tab">File Set Entries</a></li>
79
+ <li role="presentation" class='active'><a href="#work-entries" aria-controls="work-entries" role="tab" data-toggle="tab"><%= t('bulkrax.importer.labels.work_entries') %></a></li>
80
+ <li role="presentation"><a href="#collection-entries" aria-controls="collection-entries" role="tab" data-toggle="tab"><%= t('bulkrax.importer.labels.collection_entries') %></a></li>
81
+ <li role="presentation"><a href="#file-set-entries" aria-controls="file-set-entries" role="tab" data-toggle="tab"><%= t('bulkrax.importer.labels.file_set_entries') %></a></li>
80
82
  </ul>
81
83
  <!-- Tab panes -->
82
84
  <div class="tab-content outline">
@@ -2,12 +2,12 @@
2
2
  <table class='table table-striped'>
3
3
  <thead>
4
4
  <tr>
5
- <th>Identifier</th>
6
- <th>Entry ID</th>
7
- <th>Status</th>
8
- <th>Errors</th>
9
- <th>Status Set At</th>
10
- <th>Actions</th>
5
+ <th><%= t('bulkrax.table_header.labels.identifier') %></th>
6
+ <th><%= t('bulkrax.table_header.labels.entry_id') %></th>
7
+ <th><%= t('bulkrax.table_header.labels.status') %></th>
8
+ <th><%= t('bulkrax.table_header.labels.errors') %></th>
9
+ <th><%= t('bulkrax.table_header.labels.status_set_at') %></th>
10
+ <th><%= t('bulkrax.table_header.labels.actions') %></th>
11
11
  </tr>
12
12
  </thead>
13
13
  <tbody>
@@ -2,12 +2,12 @@
2
2
  <table class='table table-striped'>
3
3
  <thead>
4
4
  <tr>
5
- <th>Identifier</th>
6
- <th>Entry ID</th>
7
- <th>Status</th>
8
- <th>Errors</th>
9
- <th>Status Set At</th>
10
- <th>Actions</th>
5
+ <th><%= t('bulkrax.table_header.labels.identifier') %></th>
6
+ <th><%= t('bulkrax.table_header.labels.entry_id') %></th>
7
+ <th><%= t('bulkrax.table_header.labels.status') %></th>
8
+ <th><%= t('bulkrax.table_header.labels.errors') %></th>
9
+ <th><%= t('bulkrax.table_header.labels.status_set_at') %></th>
10
+ <th><%= t('bulkrax.table_header.labels.actions') %></th>
11
11
  </tr>
12
12
  </thead>
13
13
  <tbody>
@@ -2,12 +2,12 @@
2
2
  <table class='table table-striped'>
3
3
  <thead>
4
4
  <tr>
5
- <th>Identifier</th>
6
- <th>Entry ID</th>
7
- <th>Status</th>
8
- <th>Errors</th>
9
- <th>Status Set At</th>
10
- <th>Actions</th>
5
+ <th><%= t('bulkrax.table_header.labels.identifier') %></th>
6
+ <th><%= t('bulkrax.table_header.labels.entry_id') %></th>
7
+ <th><%= t('bulkrax.table_header.labels.status') %></th>
8
+ <th><%= t('bulkrax.table_header.labels.errors') %></th>
9
+ <th><%= t('bulkrax.table_header.labels.status_set_at') %></th>
10
+ <th><%= t('bulkrax.table_header.labels.actions') %></th>
11
11
  </tr>
12
12
  </thead>
13
13
  <tbody>
@@ -27,8 +27,12 @@ en:
27
27
  start_date: Start Date
28
28
  status: Status
29
29
  total_work_entries: Total Works
30
+ total_entries: Total Entries
30
31
  user: User
31
32
  worktype: Work Type
33
+ work_entries: Work Entries
34
+ collection_entries: Collection Entries
35
+ file_set_entries: File Set Entries
32
36
  workflow_status:
33
37
  approved: "Approved"
34
38
  deleted: "Deleted"
@@ -40,3 +44,25 @@ en:
40
44
  hints:
41
45
  include_thumbnails: "These exported fields currently cannot be imported."
42
46
  generated_metadata: "These exported fields currently cannot be imported."
47
+ importer:
48
+ labels:
49
+ name: Name
50
+ user: User
51
+ admin_set: Admin set
52
+ frequency: Frequency
53
+ parser_klass: Parser klass
54
+ limit: Limit
55
+ total_work_entries: Total Works
56
+ total_collections: Total Collections
57
+ total_file_sets: Total File Sets
58
+ work_entries: Work Entries
59
+ collection_entries: Collection Entries
60
+ file_set_entries: File Set Entries
61
+ table_header:
62
+ labels:
63
+ identifier: Identifier
64
+ entry_id: Entry ID
65
+ status: Status
66
+ errors: Errors
67
+ status_set_at: Status Set At
68
+ actions: Actions