curation_concerns 0.12.0.pre7 → 0.12.0.pre8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/views/collections/_search_form.html.erb +2 -5
- data/app/views/collections/show.html.erb +1 -2
- data/config/locales/curation_concerns.en.yml +0 -15
- data/lib/curation_concerns/engine.rb +0 -1
- data/lib/curation_concerns/version.rb +1 -1
- data/lib/curation_concerns.rb +0 -1
- metadata +2 -6
- data/lib/curation_concerns/messages.rb +0 -68
- data/lib/curation_concerns/models.rb +0 -42
- data/spec/lib/curation_concerns/messages_spec.rb +0 -69
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e81fd9998236bbf1d83f58c8260bd58792a2761
|
4
|
+
data.tar.gz: e5687797edb64acd557ecb35efe1cc98b0697434
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7612adacda225e98429b99365ff1893b4941140f94acf23a94d79583e4bc93e0403fb358712d36ff6a43356859773772c4f410d63cb807fab86fc804bde3502
|
7
|
+
data.tar.gz: 21c5c4454f410f260015a7457cc05babc47617452f776fede66c7697ca6d881c99f113b6414669eb9c38f5941d720d323ab7936b26611bef3042db38f961dd05
|
@@ -1,7 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
<label class="sr-only">Search Collection <%= @presenter.title %></label>
|
1
|
+
<%= form_for presenter, method: :get, class: "well form-search" do |f| %>
|
2
|
+
<label class="sr-only">Search Collection <%= presenter.title %></label>
|
5
3
|
<div class="input-group">
|
6
4
|
<%= text_field_tag :cq, params[:cq], class: "collection-query form-control", placeholder: "Search Collection", size: '30', type: "search", id: "collection_search" %>
|
7
5
|
<div class="input-group-btn">
|
@@ -11,4 +9,3 @@
|
|
11
9
|
<%= hidden_field_tag :sort, params[:sort], id: 'collection_sort' %>
|
12
10
|
<%= render_hash_as_hidden_fields(search_state.params_for_search.except(:cq, :sort, :qt, :page)) %>
|
13
11
|
<% end %>
|
14
|
-
</div>
|
@@ -16,7 +16,7 @@
|
|
16
16
|
<%= render 'attributes', presenter: @presenter %>
|
17
17
|
<% end %>
|
18
18
|
|
19
|
-
<%= render 'search_form' %>
|
19
|
+
<%= render 'search_form', presenter: @presenter %>
|
20
20
|
<%= render 'sort_and_per_page', collection: @presenter %>
|
21
21
|
|
22
22
|
<% if has_collection_search_parameters? %>
|
@@ -28,4 +28,3 @@
|
|
28
28
|
|
29
29
|
<%= render partial: 'paginate' %>
|
30
30
|
</div>
|
31
|
-
|
@@ -21,21 +21,6 @@ en:
|
|
21
21
|
placeholder: "Type keywords in here"
|
22
22
|
bread_crumb:
|
23
23
|
works_list: "the works browser"
|
24
|
-
messages:
|
25
|
-
success:
|
26
|
-
single: "has been saved."
|
27
|
-
multiple:
|
28
|
-
link: "These files"
|
29
|
-
tag: "have been saved."
|
30
|
-
title: "Files uploaded successfully"
|
31
|
-
subject: "Batch upload complete"
|
32
|
-
failure:
|
33
|
-
single: "could not be updated. You do not have sufficient privileges to edit it."
|
34
|
-
multiple:
|
35
|
-
link: "These files"
|
36
|
-
tag: "could not be updated. You do not have sufficient privileges to edit them."
|
37
|
-
title: "Files failed"
|
38
|
-
subject: "Batch upload permission denied"
|
39
24
|
api:
|
40
25
|
accepted:
|
41
26
|
default: "Your request has been accepted for processing, but processing is not complete. See job for more info."
|
data/lib/curation_concerns.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'curation_concerns/version'
|
2
2
|
require 'curation_concerns/engine'
|
3
3
|
require 'curation_concerns/configuration'
|
4
|
-
require 'curation_concerns/models'
|
5
4
|
require 'curation_concerns/collections'
|
6
5
|
require 'blacklight_advanced_search'
|
7
6
|
require 'kaminari_route_prefix'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: curation_concerns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.0.
|
4
|
+
version: 0.12.0.pre8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Zumwalt
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-04-
|
13
|
+
date: 2016-04-18 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: hydra-head
|
@@ -973,8 +973,6 @@ files:
|
|
973
973
|
- lib/curation_concerns/configuration.rb
|
974
974
|
- lib/curation_concerns/controller_resource.rb
|
975
975
|
- lib/curation_concerns/engine.rb
|
976
|
-
- lib/curation_concerns/messages.rb
|
977
|
-
- lib/curation_concerns/models.rb
|
978
976
|
- lib/curation_concerns/name.rb
|
979
977
|
- lib/curation_concerns/null_logger.rb
|
980
978
|
- lib/curation_concerns/rails/routes.rb
|
@@ -1118,7 +1116,6 @@ files:
|
|
1118
1116
|
- spec/lib/curation_concerns/callbacks/registry_spec.rb
|
1119
1117
|
- spec/lib/curation_concerns/callbacks_spec.rb
|
1120
1118
|
- spec/lib/curation_concerns/collections/search_service_spec.rb
|
1121
|
-
- spec/lib/curation_concerns/messages_spec.rb
|
1122
1119
|
- spec/lib/curation_concerns/name_spec.rb
|
1123
1120
|
- spec/lib/curation_concerns/null_logger_spec.rb
|
1124
1121
|
- spec/lib/curation_concerns/readable_permissions_spec.rb
|
@@ -1319,7 +1316,6 @@ test_files:
|
|
1319
1316
|
- spec/lib/curation_concerns/callbacks/registry_spec.rb
|
1320
1317
|
- spec/lib/curation_concerns/callbacks_spec.rb
|
1321
1318
|
- spec/lib/curation_concerns/collections/search_service_spec.rb
|
1322
|
-
- spec/lib/curation_concerns/messages_spec.rb
|
1323
1319
|
- spec/lib/curation_concerns/name_spec.rb
|
1324
1320
|
- spec/lib/curation_concerns/null_logger_spec.rb
|
1325
1321
|
- spec/lib/curation_concerns/readable_permissions_spec.rb
|
@@ -1,68 +0,0 @@
|
|
1
|
-
module CurationConcerns
|
2
|
-
module Messages
|
3
|
-
extend ActiveSupport::Concern
|
4
|
-
|
5
|
-
# Borrowed from AbstractController so we can render html content tags
|
6
|
-
attr_accessor :output_buffer
|
7
|
-
include ActionView::Helpers::TagHelper
|
8
|
-
include ActionView::Helpers::UrlHelper
|
9
|
-
|
10
|
-
def success_subject
|
11
|
-
I18n.t('curation_concerns.messages.success.subject')
|
12
|
-
end
|
13
|
-
|
14
|
-
def failure_subject
|
15
|
-
I18n.t('curation_concerns.messages.failure.subject')
|
16
|
-
end
|
17
|
-
|
18
|
-
def single_success(id, file)
|
19
|
-
content_tag :span, id: 'ss-' + id do
|
20
|
-
[link_to_file(file), I18n.t('curation_concerns.messages.success.single')].join(' ').html_safe
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
def multiple_success(id, files)
|
25
|
-
content_tag :span, id: 'ss-' + id do
|
26
|
-
[success_link(files), I18n.t('curation_concerns.messages.success.multiple.tag')].join(' ').html_safe
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
def single_failure(id, file)
|
31
|
-
content_tag :span, id: 'ss-' + id do
|
32
|
-
[link_to_file(file), I18n.t('curation_concerns.messages.failure.single')].join(' ').html_safe
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
def multiple_failure(id, files)
|
37
|
-
content_tag :span, id: 'ss-' + id do
|
38
|
-
[failure_link(files), I18n.t('curation_concerns.messages.failure.multiple.tag')].join(' ').html_safe
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
# Double-quotes are replaced with single ones so this list can be included in a data block. Ex:
|
43
|
-
# <a href="#" data-content="<a href='#'>embedded link</a>" data-toggle="popover">Click me</a>
|
44
|
-
def file_list(files)
|
45
|
-
files.map { |fs| link_to_file(fs) }.join(', ').tr("\"", "'")
|
46
|
-
end
|
47
|
-
|
48
|
-
def link_to_file(file)
|
49
|
-
link_to(file.to_s, Rails.application.class.routes.url_helpers.curation_concerns_file_set_path(file))
|
50
|
-
end
|
51
|
-
|
52
|
-
private
|
53
|
-
|
54
|
-
def success_link(files)
|
55
|
-
link_to I18n.t('curation_concerns.messages.success.multiple.link'), '#',
|
56
|
-
data: { toggle: 'popover',
|
57
|
-
content: file_list(files).html_safe,
|
58
|
-
title: I18n.t('curation_concerns.messages.success.title') }
|
59
|
-
end
|
60
|
-
|
61
|
-
def failure_link(files)
|
62
|
-
link_to I18n.t('curation_concerns.messages.failure.multiple.link'), '#',
|
63
|
-
data: { toggle: 'popover',
|
64
|
-
content: file_list(files).html_safe,
|
65
|
-
title: I18n.t('curation_concerns.messages.failure.title') }
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
@@ -1,42 +0,0 @@
|
|
1
|
-
require 'hydra/head'
|
2
|
-
|
3
|
-
module CurationConcerns
|
4
|
-
extend ActiveSupport::Autoload
|
5
|
-
|
6
|
-
module Models
|
7
|
-
module Utils
|
8
|
-
extend ActiveSupport::Concern
|
9
|
-
|
10
|
-
def retry_unless(number_of_tries, condition, &block)
|
11
|
-
self.class.retry_unless(number_of_tries, condition, &block)
|
12
|
-
end
|
13
|
-
|
14
|
-
module ClassMethods
|
15
|
-
def retry_unless(number_of_tries, condition, &_block)
|
16
|
-
fail ArgumentError, 'First argument must be an enumerator' unless number_of_tries.is_a? Enumerator
|
17
|
-
fail ArgumentError, 'Second argument must be a lambda' unless condition.respond_to? :call
|
18
|
-
fail ArgumentError, 'Must pass a block of code to retry' unless block_given?
|
19
|
-
number_of_tries.each do
|
20
|
-
result = yield
|
21
|
-
return result unless condition.call
|
22
|
-
end
|
23
|
-
fail 'retry_unless could not complete successfully. Try upping the # of tries?'
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
autoload :Permissions
|
30
|
-
autoload :Messages
|
31
|
-
autoload :NullLogger
|
32
|
-
eager_autoload do
|
33
|
-
autoload :Configuration
|
34
|
-
autoload :Name
|
35
|
-
end
|
36
|
-
|
37
|
-
attr_writer :queue
|
38
|
-
|
39
|
-
def self.queue
|
40
|
-
@queue ||= config.queue.new('curation_concerns')
|
41
|
-
end
|
42
|
-
end
|
@@ -1,69 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe CurationConcerns::Messages do
|
4
|
-
let(:message) do
|
5
|
-
TestClass.new
|
6
|
-
end
|
7
|
-
|
8
|
-
before do
|
9
|
-
class TestClass
|
10
|
-
include CurationConcerns::Messages
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
after do
|
15
|
-
Object.send(:remove_const, :TestClass)
|
16
|
-
end
|
17
|
-
|
18
|
-
let(:upload_set_id) { '1' }
|
19
|
-
let(:single) { double(to_param: '1', to_s: 'File 1') }
|
20
|
-
let(:multiple) { [double(to_param: '1', to_s: 'File 1'), double(to_param: '2', to_s: 'File 2'), double(to_param: '3', to_s: 'File 3')] }
|
21
|
-
let(:file_list) { "<a href='/concern/file_sets/1'>File 1</a>, <a href='/concern/file_sets/2'>File 2</a>, <a href='/concern/file_sets/3'>File 3</a>" }
|
22
|
-
|
23
|
-
describe 'message subjects' do
|
24
|
-
it 'provides a subject for a success message' do
|
25
|
-
expect(message.success_subject).to eq('Batch upload complete')
|
26
|
-
end
|
27
|
-
it 'provides a subject for a failure message' do
|
28
|
-
expect(message.failure_subject).to eq('Batch upload permission denied')
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
describe '#single_success' do
|
33
|
-
it 'renders a success message for a single file' do
|
34
|
-
node = Capybara::Node::Simple.new(message.single_success(upload_set_id, single))
|
35
|
-
expect(node).to have_selector("span[id=\"ss-1\"]", text: 'File 1 has been saved.')
|
36
|
-
expect(node).to have_selector("a[href=\"/concern/file_sets/1\"]")
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
describe '#multiple_success' do
|
41
|
-
it 'renders a success message for multiple files' do
|
42
|
-
node = Capybara::Node::Simple.new(message.multiple_success(upload_set_id, multiple))
|
43
|
-
expect(node).to have_selector("span[id=\"ss-1\"]", text: 'These files have been saved.')
|
44
|
-
expect(node).to have_selector("a[data-content=\"#{file_list}\"][data-toggle=\"popover\"][data-title=\"Files uploaded successfully\"]")
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
describe '#single_failure' do
|
49
|
-
it 'renders a failure message for a single file' do
|
50
|
-
node = Capybara::Node::Simple.new(message.single_failure(upload_set_id, single))
|
51
|
-
expect(node).to have_selector("span[id=\"ss-1\"]", text: 'File 1 could not be updated. You do not have sufficient privileges to edit it.')
|
52
|
-
expect(node).to have_selector("a[href=\"/concern/file_sets/1\"]")
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
describe '#multiple_failure' do
|
57
|
-
it 'renders a failure message for multiple files' do
|
58
|
-
node = Capybara::Node::Simple.new(message.multiple_failure(upload_set_id, multiple))
|
59
|
-
expect(node).to have_selector("span[id=\"ss-1\"]", text: 'These files could not be updated. You do not have sufficient privileges to edit them.')
|
60
|
-
expect(node).to have_selector("a[data-content=\"#{file_list}\"][data-toggle=\"popover\"][data-title=\"Files failed\"]")
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
describe '#file_list' do
|
65
|
-
it 'replaces double-quotes with single quotes' do
|
66
|
-
expect(message.file_list(multiple)).to eq(file_list)
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|