to_spotlight 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +28 -0
- data/Rakefile +36 -0
- data/app/assets/config/to_spotlight_manifest.js +2 -0
- data/app/assets/javascripts/to_spotlight/application.js +13 -0
- data/app/assets/stylesheets/to_spotlight/application.css +15 -0
- data/app/controllers/to_spotlight/application_controller.rb +5 -0
- data/app/controllers/to_spotlight/spotlight_transfer_controller.rb +101 -0
- data/app/helpers/to_spotlight/application_helper.rb +4 -0
- data/app/jobs/to_spotlight/application_job.rb +4 -0
- data/app/jobs/to_spotlight/spotlight_transfer_job.rb +114 -0
- data/app/mailers/to_spotlight/application_mailer.rb +6 -0
- data/app/models/to_spotlight/application_record.rb +5 -0
- data/app/models/to_spotlight/spotlight_transfer.rb +5 -0
- data/app/views/layouts/to_spotlight/application.html.erb +14 -0
- data/app/views/to_spotlight/spotlight_transfer/_default_group.html.erb +15 -0
- data/app/views/to_spotlight/spotlight_transfer/_list_transfers.html.erb +18 -0
- data/app/views/to_spotlight/spotlight_transfer/_select.html.erb +1 -0
- data/app/views/to_spotlight/spotlight_transfer/_tabs.html.erb +5 -0
- data/app/views/to_spotlight/spotlight_transfer/_transfers_list.html.erb +4 -0
- data/app/views/to_spotlight/spotlight_transfer/approve.html.erb +7 -0
- data/app/views/to_spotlight/spotlight_transfer/index.html.erb +23 -0
- data/app/views/to_spotlight/spotlight_transfer/receive.html.erb +5 -0
- data/config/application.rb +10 -0
- data/config/routes.rb +6 -0
- data/db/migrate/20200310153953_create_to_spotlight_spotlight_transfers.rb +13 -0
- data/lib/tasks/to_spotlight_tasks.rake +4 -0
- data/lib/to_spotlight.rb +5 -0
- data/lib/to_spotlight/engine.rb +5 -0
- data/lib/to_spotlight/version.rb +3 -0
- metadata +104 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 47d051e0fece7cf647d972aa63b7687195729275c7c0373712fa38e2dc264627
|
4
|
+
data.tar.gz: 7ac2551403387002cad146018d8097819e633b8934fe3df6022dd3f9fbf6acb6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7d3ccdc0a44140329d50a25aaa8c203e6813903def0fc8bc79400fde91a7a479daac1fcdd21c96406ee8ff010b6cb9b1d028041d6d076eb0970fce598d9d4350
|
7
|
+
data.tar.gz: b2bf28b53fc2fcbc3f3127ff44173247a17ed0d0b3a2efba3918dd192de7c1df3898c3c9ce76d213c179d6293eb04ecaffcd8d4a8f4f741e21a991f84a6d3d3a
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2020 sephirothkod
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# ToSpotlight
|
2
|
+
Short description and motivation.
|
3
|
+
|
4
|
+
## Usage
|
5
|
+
How to use my plugin.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
Add this line to your application's Gemfile:
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
gem 'to_spotlight'
|
12
|
+
```
|
13
|
+
|
14
|
+
And then execute:
|
15
|
+
```bash
|
16
|
+
$ bundle
|
17
|
+
```
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
```bash
|
21
|
+
$ gem install to_spotlight
|
22
|
+
```
|
23
|
+
|
24
|
+
## Contributing
|
25
|
+
Contribution directions go here.
|
26
|
+
|
27
|
+
## License
|
28
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'ToSpotlight'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.md')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
|
18
|
+
load 'rails/tasks/engine.rake'
|
19
|
+
|
20
|
+
|
21
|
+
load 'rails/tasks/statistics.rake'
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
require 'bundler/gem_tasks'
|
26
|
+
|
27
|
+
require 'rake/testtask'
|
28
|
+
|
29
|
+
Rake::TestTask.new(:test) do |t|
|
30
|
+
t.libs << 'test'
|
31
|
+
t.pattern = 'test/**/*_test.rb'
|
32
|
+
t.verbose = false
|
33
|
+
end
|
34
|
+
|
35
|
+
|
36
|
+
task default: :test
|
@@ -0,0 +1,13 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// compiled file. JavaScript code in this file should be added after the last require_* statement.
|
9
|
+
//
|
10
|
+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
|
+
//
|
13
|
+
//= require_tree .
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
+
* It is generally better to create a new file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
@@ -0,0 +1,101 @@
|
|
1
|
+
module ToSpotlight
|
2
|
+
class SpotlightTransferController < ActionController::Base
|
3
|
+
protect_from_forgery with: :exception
|
4
|
+
skip_before_action :verify_authenticity_token, only: :receive
|
5
|
+
require 'json'
|
6
|
+
require 'net/http'
|
7
|
+
|
8
|
+
def api
|
9
|
+
case params[:request_type]
|
10
|
+
when 'fields'
|
11
|
+
render plain: curated_fields
|
12
|
+
when 'works'
|
13
|
+
render partial: 'to_spotlight/spotlight_transfer/select', locals: { type_name: 'work', data: curated_works }
|
14
|
+
when 'admin_sets'
|
15
|
+
render partial: 'to_spotlight/spotlight_transfer/select', locals: { type_name: 'admin_set', data: admin_sets }
|
16
|
+
else
|
17
|
+
render plain: 'Invalid Request Type'
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
def receive
|
23
|
+
return unless params[:token]
|
24
|
+
mappings = params.permit!.to_h[:mappings]
|
25
|
+
user = params.permit!.to_h[:user]
|
26
|
+
admin_set_id = params.permit!.to_h[:admin_set_id]
|
27
|
+
exhibit_id = params.permit!.to_h[:exhibit_id]
|
28
|
+
@transfer = ToSpotlight::SpotlightTransfer.new user: user,
|
29
|
+
mappings: mappings,
|
30
|
+
admin_set_id: admin_set_id,
|
31
|
+
exhibit_id: exhibit_id
|
32
|
+
if @transfer.save
|
33
|
+
render plain: 'Transfer Request Received'
|
34
|
+
else
|
35
|
+
render plain: 'Transfer Request Failed'
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def index
|
40
|
+
@transfers = ToSpotlight::SpotlightTransfer.all
|
41
|
+
end
|
42
|
+
|
43
|
+
def approve
|
44
|
+
now = params[:commit].downcase.include?('now')
|
45
|
+
transfer = ToSpotlight::SpotlightTransfer.find params[:transfer_id]
|
46
|
+
works = ::AdminSet.find(transfer.admin_set_id).members
|
47
|
+
mappings = mapping_invert transfer.mappings
|
48
|
+
SpotlightTransferJob.perform_later(works, mappings)
|
49
|
+
@res = ::Net::HTTP.post URI('http://localhost:3000/from_hyrax/receive'),
|
50
|
+
{ transfer: transfer.attributes,
|
51
|
+
now: now,
|
52
|
+
token: 'secret_token' }.to_json,
|
53
|
+
'Content-Type' => 'application/json'
|
54
|
+
|
55
|
+
end
|
56
|
+
|
57
|
+
private
|
58
|
+
|
59
|
+
def mapping_invert hash
|
60
|
+
result = []
|
61
|
+
test = hash.map { |h| { h['hyrax'] => h['spotlight'].values } }
|
62
|
+
test.reduce({}, :merge).map { |k, v| v.map { |val| [val, k] } }.each { |a| a.each { |a2| result<<a2 } }
|
63
|
+
Hash[result]
|
64
|
+
end
|
65
|
+
|
66
|
+
def curated_works
|
67
|
+
%w[GenericWork IaffWork]
|
68
|
+
end
|
69
|
+
|
70
|
+
def admin_sets
|
71
|
+
%w[DefaultSet SecondSet]
|
72
|
+
end
|
73
|
+
|
74
|
+
def curated_fields
|
75
|
+
genericwork_fields - excluded_fields
|
76
|
+
end
|
77
|
+
|
78
|
+
def genericwork_fields # GenericWork.new.attributes.keys
|
79
|
+
%w[id head tail depositor title date_uploaded date_modified state
|
80
|
+
proxy_depositor on_behalf_of arkivo_checksum owner alternative_title
|
81
|
+
edition geographic_coverage coordinates chronological_coverage extent
|
82
|
+
additional_physical_characteristics has_format physical_repository
|
83
|
+
collection provenance provider sponsor genre format
|
84
|
+
archival_item_identifier fonds_title fonds_creator fonds_description
|
85
|
+
fonds_identifier is_referenced_by date_digitized transcript
|
86
|
+
technical_note year label relative_path import_url creator part_of
|
87
|
+
resource_type contributor description keyword license rights_statement
|
88
|
+
publisher date_created subject language identifier based_near
|
89
|
+
related_url bibliographic_citation source access_control_id
|
90
|
+
representative_id thumbnail_id rendering_ids admin_set_id
|
91
|
+
embargo_id lease_id]
|
92
|
+
end
|
93
|
+
|
94
|
+
def excluded_fields
|
95
|
+
%w[id head tail state proxy_depositor on_behalf_of arkivo_checksum label
|
96
|
+
relative_path import_url part_of resource_type access_control_id
|
97
|
+
representative_id thumbnail_id rendering_ids admin_set_id embargo_id
|
98
|
+
lease_id]
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
@@ -0,0 +1,114 @@
|
|
1
|
+
module ToSpotlight
|
2
|
+
class SpotlightTransferJob < ActiveJob::Base
|
3
|
+
queue_as :default
|
4
|
+
|
5
|
+
def perform(works, mappings)
|
6
|
+
base_url = ::Account.where(tenant: Apartment::Tenant.current).first.cname
|
7
|
+
csv_headers = %w[url full_title_tesim] + mappings.keys + %w[children]
|
8
|
+
csv_array = csv_headers
|
9
|
+
#items = []
|
10
|
+
works.each do |wk|
|
11
|
+
#if comp
|
12
|
+
# items << wk.id if wk.file_set_ids.length>1
|
13
|
+
# next unless wk.file_set_ids.length>1
|
14
|
+
#else
|
15
|
+
# items << wk.id unless wk.file_set_ids.length>1
|
16
|
+
# next if wk.file_set_ids.length>1
|
17
|
+
#end
|
18
|
+
#index += 1
|
19
|
+
comp = wk.file_set_ids.any?
|
20
|
+
children = []
|
21
|
+
if comp
|
22
|
+
index = wk.ordered_file_set_ids.length * -1
|
23
|
+
wk.ordered_file_set_ids.each do |f_id|
|
24
|
+
csv_array << empty_fs_line(f_id, csv_headers.length-1)
|
25
|
+
children << index
|
26
|
+
index += 1
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
doc = ::SolrDocument.find wk.id
|
31
|
+
|
32
|
+
line_hash = {}
|
33
|
+
line_hash << "http://#{base_url}/downloads/#{wk.file_sets.first.id}?locale=en" #url
|
34
|
+
line_hash << (doc.title.length > 1 ? doc.title.join('; ') : doc.title.first) #full_title_tesim
|
35
|
+
|
36
|
+
mappings.each do |skey, field|
|
37
|
+
line_hash[skey] = create_cell doc, field
|
38
|
+
end
|
39
|
+
|
40
|
+
line_hash << children.join("|")
|
41
|
+
|
42
|
+
csv_array << line_hash.values_at(*csv_headers).map { |cell| cell = "" if cell.nil?; "\"#{cell.gsub("\"","\"\"")}\"" }.join(',')
|
43
|
+
|
44
|
+
end
|
45
|
+
|
46
|
+
dir = Rails.root.join('public', 'uploads', 'csvs')
|
47
|
+
Dir.mkdir(dir) unless Dir.exist?(dir)
|
48
|
+
time = DateTime.now.strftime('%s')
|
49
|
+
filename = "spotlight_export-#{time}.csv"
|
50
|
+
File.open(dir.join(filename), 'wb') do |file|
|
51
|
+
file.write(csv_array.join("\n"))
|
52
|
+
end
|
53
|
+
items
|
54
|
+
end
|
55
|
+
|
56
|
+
def base_url
|
57
|
+
@base_url ||= ::Account.where(tenant: Apartment::Tenant.current).first.cname
|
58
|
+
end
|
59
|
+
|
60
|
+
def empty_fs_line fs_id, commas
|
61
|
+
"http://#{base_url}downloads/#{fs_id}?locale=en" + ("," * commas)
|
62
|
+
end
|
63
|
+
|
64
|
+
def create_cell w, field
|
65
|
+
if w.respond_to?((field + "_label").to_sym)
|
66
|
+
w.send(field + "_label").join(';')
|
67
|
+
else
|
68
|
+
if w.send(field).is_a?(Array)
|
69
|
+
w.send(field).join(';')
|
70
|
+
else
|
71
|
+
w.send(field)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
def get_location list
|
77
|
+
output = []
|
78
|
+
list.each do |loc|
|
79
|
+
output += loc.rdf_label || []
|
80
|
+
end
|
81
|
+
output.join('; ')
|
82
|
+
end
|
83
|
+
|
84
|
+
def get_resource list
|
85
|
+
output = []
|
86
|
+
list.each do |url|
|
87
|
+
if url.include? "http"
|
88
|
+
output << Hyrax::ResourceTypesService.label(url)
|
89
|
+
else
|
90
|
+
output << url
|
91
|
+
end
|
92
|
+
end
|
93
|
+
output.join('; ')
|
94
|
+
end
|
95
|
+
|
96
|
+
def get_rights list
|
97
|
+
output = []
|
98
|
+
list.each do |url|
|
99
|
+
if url.include? "http"
|
100
|
+
output << ::VaultRightsStatementsService.label(url)
|
101
|
+
else
|
102
|
+
output << url
|
103
|
+
end
|
104
|
+
end
|
105
|
+
#output = list.map { |url| url.include? "http" ? IaffRightsStatementService.label(url) : url }
|
106
|
+
output.join('; ')
|
107
|
+
end
|
108
|
+
|
109
|
+
#def csv_headers
|
110
|
+
# "url,full_title_tesim,spotlight_upload_dc_description_tesim,spotlight_upload_dc_Subject_tesim,spotlight_upload_dc_Subjects_tesim,spotlight_upload_dc_Subjects_ftesim,spotlight_upload_Creator_tesim,spotlight_upload_Publisher_tesim,spotlight_upload_Contributors_tesim,spotlight_upload_dc_Date_tesi,spotlight_upload_dc_Date-Created_Searchable_ftesi,spotlight_upload_dc_Date-Created_Searchable_tesi,spotlight_upload_dc_Type_Genre_tesim,spotlight_upload_dc_Type_Genre_ftesim,spotlight_upload_Format_tesim,spotlight_upload_Identifier_tesim,spotlight_upload_Source_tesim,spotlight_upload_Language_tesim,spotlight_upload_Language_ftesim,spotlight_upload_Relation_tesim,spotlight_upload_Coverage_tesim,spotlight_upload_Rights_tesim,spotlight_upload_Provenance_tesim,spotlight_upload_dc_Title_Alternative_tesim,spotlight_upload_Description-Table-Of-Contents_tesim,spotlight_upload_Description-Abstract_tesim,spotlight_upload_Format-Extent_tesim,spotlight_upload_Format-Medium_tesim,spotlight_upload_Identifier-Bibliographic-Citation_tesim,spotlight_upload_dc_Relation_IsPartOf_Collection_tesim,spotlight_upload_dc_Relation_IsPartOf_Collection_ftesim,spotlight_upload_dc_Coverage-Spatial_Location_tesim,spotlight_upload_dc_Coverage-Spatial_Location_ftesim,spotlight_upload_Coverage-Temporal_tesim,spotlight_upload_Date-Digitized_tesi,spotlight_upload_dc_Description_Transcript_tesim,spotlight_upload_dc_Subject_People_tesim,spotlight_upload_dc_Subject_People_ftesim,spotlight_upload_Sketchfab-uid_tesim,spotlight_annotation_x_dbsm,spotlight_annotation_y_dbsm,spotlight_annotation_width_dbsm,spotlight_annotation_height_dbsm,spotlight_annotation_title_tesim,spotlight_annotation_author_tesim,spotlight_annotation_description_tesim,spotlight_annotation_date_tesim,spotlight_annotation_publisher_tesim,spotlight_annotation_publisher-place_tesim,spotlight_annotation_publisher-date_tesim,spotlight_annotation_people_tesim,spotlight_annotation_locations_tesim,spotlight_annotation_transcript_tesim,spotlight_annotation_genre_tesim,spotlight_annotation_public_isim,spotlight_upload_parent_tesim,spotlight_upload_Commentary_tesim,spotlight_upload_UserDefined_tesim,children"
|
111
|
+
#end
|
112
|
+
|
113
|
+
end
|
114
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>To spotlight</title>
|
5
|
+
<%= stylesheet_link_tag "to_spotlight/application", media: "all" %>
|
6
|
+
<%= javascript_include_tag "to_spotlight/application" %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
<%= yield %>
|
12
|
+
|
13
|
+
</body>
|
14
|
+
</html>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<table class="table table-striped works-list">
|
2
|
+
<thead>
|
3
|
+
<tr>
|
4
|
+
<th><%= "Uploaded" %></th>
|
5
|
+
<th><%= "User" %></th>
|
6
|
+
<th><%= "Admin Set" %></th>
|
7
|
+
<th><%= "Actions" %></th>
|
8
|
+
</tr>
|
9
|
+
</thead>
|
10
|
+
<tbody>
|
11
|
+
<% transfers.each do |transfer| %>
|
12
|
+
<%= render 'list_transfers', transfer: transfer %>
|
13
|
+
<% end %>
|
14
|
+
</tbody>
|
15
|
+
</table>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<tr id="transfer_<%= transfer.id %>">
|
2
|
+
|
3
|
+
<td class="date"><%= transfer.created_at %></td>
|
4
|
+
|
5
|
+
<td><%= transfer.user %></td>
|
6
|
+
|
7
|
+
<td><%= transfer.admin_set_id %></td>
|
8
|
+
|
9
|
+
<td>
|
10
|
+
<%= form_tag to_spotlight.approve_path, method: :post, class: "form-inline" do %>
|
11
|
+
<%= hidden_field_tag 'transfer_id', transfer.id %>
|
12
|
+
<%= submit_tag "Run Tonight", class: 'btn btn-primary' %>
|
13
|
+
<% end %><%= form_tag to_spotlight.approve_path, method: :post, class: "form-inline" do %>
|
14
|
+
<%= hidden_field_tag 'transfer_id', transfer.id %>
|
15
|
+
<%= submit_tag "Run Now", class: 'btn btn-primary' %>
|
16
|
+
<% end %>
|
17
|
+
</td>
|
18
|
+
</tr>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= select_tag type_name, options_for_select(data), {include_blank: true, onchange: 'get_next(this)'} %>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<style>
|
2
|
+
.form-inline {
|
3
|
+
float: left;
|
4
|
+
padding: 5px;
|
5
|
+
}
|
6
|
+
</style>
|
7
|
+
|
8
|
+
<% provide :page_title, "Transfers" %>
|
9
|
+
|
10
|
+
|
11
|
+
<% provide :page_header do %>
|
12
|
+
<h1><span class="fa fa-database" aria-hidden="true"></span> <%= "Transfers" %></h1>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<div class="row">
|
16
|
+
<div class="col-md-12">
|
17
|
+
<div class="panel-body">
|
18
|
+
<%= render 'transfers_list' %>
|
19
|
+
|
20
|
+
<%#= render 'results_pagination' %>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
</div>
|
data/config/routes.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
class CreateToSpotlightSpotlightTransfers < ActiveRecord::Migration[5.0]
|
2
|
+
def change
|
3
|
+
create_table :to_spotlight_spotlight_transfers do |t|
|
4
|
+
t.string :user
|
5
|
+
t.text :mappings
|
6
|
+
t.boolean :approved, default: false
|
7
|
+
t.string :admin_set_id
|
8
|
+
t.string :exhibit_id
|
9
|
+
|
10
|
+
t.timestamps
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/lib/to_spotlight.rb
ADDED
metadata
ADDED
@@ -0,0 +1,104 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: to_spotlight
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- sephirothkod
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-04-21 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '5.1'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '5.1'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: pg
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: Hyrax plugin gem to send data to Spotlight, must use in conjuction with
|
42
|
+
from_hyrax gem
|
43
|
+
email:
|
44
|
+
- bjustice@uvic.ca
|
45
|
+
executables: []
|
46
|
+
extensions: []
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- MIT-LICENSE
|
50
|
+
- README.md
|
51
|
+
- Rakefile
|
52
|
+
- app/assets/config/to_spotlight_manifest.js
|
53
|
+
- app/assets/javascripts/to_spotlight/application.js
|
54
|
+
- app/assets/stylesheets/to_spotlight/application.css
|
55
|
+
- app/controllers/to_spotlight/application_controller.rb
|
56
|
+
- app/controllers/to_spotlight/spotlight_transfer_controller.rb
|
57
|
+
- app/helpers/to_spotlight/application_helper.rb
|
58
|
+
- app/jobs/to_spotlight/application_job.rb
|
59
|
+
- app/jobs/to_spotlight/spotlight_transfer_job.rb
|
60
|
+
- app/mailers/to_spotlight/application_mailer.rb
|
61
|
+
- app/models/to_spotlight/application_record.rb
|
62
|
+
- app/models/to_spotlight/spotlight_transfer.rb
|
63
|
+
- app/views/layouts/to_spotlight/application.html.erb
|
64
|
+
- app/views/to_spotlight/spotlight_transfer/_default_group.html.erb
|
65
|
+
- app/views/to_spotlight/spotlight_transfer/_list_transfers.html.erb
|
66
|
+
- app/views/to_spotlight/spotlight_transfer/_select.html.erb
|
67
|
+
- app/views/to_spotlight/spotlight_transfer/_tabs.html.erb
|
68
|
+
- app/views/to_spotlight/spotlight_transfer/_transfers_list.html.erb
|
69
|
+
- app/views/to_spotlight/spotlight_transfer/approve.html.erb
|
70
|
+
- app/views/to_spotlight/spotlight_transfer/index.html.erb
|
71
|
+
- app/views/to_spotlight/spotlight_transfer/receive.html.erb
|
72
|
+
- config/application.rb
|
73
|
+
- config/routes.rb
|
74
|
+
- db/migrate/20200310153953_create_to_spotlight_spotlight_transfers.rb
|
75
|
+
- lib/tasks/to_spotlight_tasks.rake
|
76
|
+
- lib/to_spotlight.rb
|
77
|
+
- lib/to_spotlight/engine.rb
|
78
|
+
- lib/to_spotlight/version.rb
|
79
|
+
homepage: https://github.com/sephirothkod/to_spotlight
|
80
|
+
licenses:
|
81
|
+
- MIT
|
82
|
+
metadata: {}
|
83
|
+
post_install_message:
|
84
|
+
rdoc_options: []
|
85
|
+
require_paths:
|
86
|
+
- lib
|
87
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0'
|
92
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
requirements: []
|
98
|
+
rubyforge_project:
|
99
|
+
rubygems_version: 2.7.7
|
100
|
+
signing_key:
|
101
|
+
specification_version: 4
|
102
|
+
summary: Hyrax plugin gem to send data to Spotlight, must use in conjuction with from_hyrax
|
103
|
+
gem
|
104
|
+
test_files: []
|