curation_concerns 1.0.0.beta4 → 1.0.0.beta5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -3
- data/app/assets/stylesheets/curation_concerns/modules/forms.scss +16 -2
- data/app/controllers/concerns/curation_concerns/catalog_controller.rb +0 -5
- data/app/controllers/concerns/curation_concerns/curation_concern_controller.rb +0 -5
- data/app/helpers/curation_concerns/main_app_helpers.rb +1 -0
- data/app/helpers/curation_concerns/permissions_helper.rb +2 -4
- data/app/helpers/curation_concerns/rights_helper.rb +9 -0
- data/app/inputs/multi_value_select_input.rb +45 -0
- data/app/models/concerns/curation_concerns/collection.rb +0 -1
- data/app/presenters/curation_concerns/file_set_presenter.rb +4 -4
- data/app/presenters/curation_concerns/presents_attributes.rb +28 -2
- data/app/presenters/curation_concerns/work_show_presenter.rb +1 -8
- data/app/renderers/curation_concerns/renderers/attribute_renderer.rb +2 -33
- data/app/renderers/curation_concerns/renderers/faceted_attribute_renderer.rb +19 -0
- data/app/renderers/curation_concerns/renderers/linked_attribute_renderer.rb +20 -0
- data/app/renderers/curation_concerns/renderers/rights_attribute_renderer.rb +27 -0
- data/app/services/curation_concerns/actors/actor_factory.rb +1 -2
- data/app/services/rights_service.rb +11 -1
- data/app/views/curation_concerns/base/_attribute_rows.html.erb +3 -3
- data/app/views/curation_concerns/base/_attributes.html.erb +1 -1
- data/app/views/curation_concerns/base/_form_permission.html.erb +1 -1
- data/app/views/curation_concerns/base/_form_rights.html.erb +4 -2
- data/app/views/records/edit_fields/_default.html.erb +1 -1
- data/config/locales/curation_concerns.en.yml +2 -0
- data/curation_concerns.gemspec +1 -1
- data/lib/curation_concerns/configuration.rb +0 -1
- data/lib/curation_concerns/version.rb +1 -1
- data/lib/generators/curation_concerns/install_generator.rb +6 -3
- data/lib/generators/curation_concerns/templates/config/initializers/simple_form.rb +170 -0
- data/lib/generators/curation_concerns/templates/config/initializers/simple_form_bootstrap.rb +150 -0
- data/spec/inputs/multi_value_with_help_input_spec.rb +0 -15
- data/spec/presenters/curation_concerns/file_set_presenter_spec.rb +15 -1
- data/spec/presenters/curation_concerns/work_show_presenter_spec.rb +0 -11
- data/spec/renderers/curation_concerns/renderers/faceted_attribute_renderer_spec.rb +21 -0
- data/spec/renderers/curation_concerns/renderers/linked_attribute_renderer_spec.rb +21 -0
- data/spec/renderers/curation_concerns/renderers/rights_attribute_renderer_spec.rb +21 -0
- data/spec/services/rights_service_spec.rb +9 -3
- data/spec/views/curation_concerns/base/_form_rights_spec.rb +41 -0
- data/spec/views/curation_concerns/base/file_manager.html.erb_spec.rb +1 -1
- metadata +19 -20
- data/app/actors/concerns/curation_concerns/manages_embargoes_actor.rb +0 -28
- data/app/actors/curation_concerns/actors/assign_identifier_actor.rb +0 -9
- data/app/actors/curation_concerns/actors/work_actor_behavior.rb +0 -12
- data/app/inputs/multi_value_with_help_input.rb +0 -8
- data/app/inputs/select_with_help_input.rb +0 -3
- data/app/inputs/select_with_modal_help_input.rb +0 -36
- data/app/inputs/with_help_icon.rb +0 -34
- data/app/search_builders/curation_concerns/search_builder.rb +0 -10
- data/spec/helpers/curation_concerns/permissions_helper_spec.rb +0 -12
- data/spec/inputs/select_with_help_input_spec.rb +0 -43
- data/spec/inputs/select_with_modal_help_input_spec.rb +0 -21
- data/spec/search_builders/curation_concerns/search_builder_spec.rb +0 -53
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3516c66d4ff6b39953a066d649baa15417442b33
|
4
|
+
data.tar.gz: 540d110fcf876cdaf08346246317fc7d4ae109ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec704704bbb9085b8e42d3d8b53d6e87a68fd6f51d24ab80639dc59edc6b2fce718b188194eb8c4c2fe1dbbd3a3a66f9b97226fa609b40f38e20a2a4d3e3ca81
|
7
|
+
data.tar.gz: 6c545fae4b20c118a42ba34cb4e9cd1e73401c3d3936e1adc7028c41af7aaf7db604e8554307b0d0898ec7db95f3f6e27a6c28b1a835344b67160e0291381091
|
data/README.md
CHANGED
@@ -2,12 +2,11 @@
|
|
2
2
|
|
3
3
|
[![Version](https://badge.fury.io/rb/curation_concerns.png)](http://badge.fury.io/rb/curation_concerns)
|
4
4
|
[![Build Status](https://travis-ci.org/projecthydra/curation_concerns.svg?branch=master)](https://travis-ci.org/projecthydra/curation_concerns)
|
5
|
-
[![Coverage Status](https://coveralls.io/repos/projecthydra
|
6
|
-
[![Code Climate](https://codeclimate.com/github/projecthydra
|
5
|
+
[![Coverage Status](https://coveralls.io/repos/projecthydra/curation_concerns/badge.svg?branch=master)](https://coveralls.io/r/projecthydra/curation_concerns?branch=master)
|
6
|
+
[![Code Climate](https://codeclimate.com/github/projecthydra/curation_concerns/badges/gpa.svg)](https://codeclimate.com/github/projecthydra/curation_concerns)
|
7
7
|
[![Apache 2.0 License](http://img.shields.io/badge/APACHE2-license-blue.svg)](./LICENSE.txt)
|
8
8
|
[![Contribution Guidelines](http://img.shields.io/badge/CONTRIBUTING-Guidelines-blue.svg)](./CONTRIBUTING.md)
|
9
9
|
[![API Docs](http://img.shields.io/badge/API-docs-blue.svg)](http://rubydoc.info/gems/curation_concerns)
|
10
|
-
[![Stories in Ready](https://badge.waffle.io/projecthydra-labs/sufia-core.png?source=projecthydra-labs%2Fcuration_concerns&label=ready&title=Ready)](https://waffle.io/projecthydra-labs/sufia-core?source=projecthydra-labs%2Fcuration_concerns)
|
11
10
|
|
12
11
|
A Hydra-based Rails Engine that extends an application, adding the ability to Create, Read, Update and Destroy (CRUD) objects (based on [Hydra::Works](http://github.com/projecthydra/hydra-works)) and providing a generator for defining object types with custom workflows, views, access controls, etc.
|
13
12
|
|
@@ -25,6 +25,8 @@ legend small {
|
|
25
25
|
padding-left:1.2em;
|
26
26
|
}
|
27
27
|
|
28
|
+
.form-group { margin-bottom: 2em; }
|
29
|
+
|
28
30
|
.form-group.has-error input,
|
29
31
|
.form-group.has-error option,
|
30
32
|
.form-group.has-error textarea {
|
@@ -35,8 +37,16 @@ legend small {
|
|
35
37
|
margin-top: 1em;
|
36
38
|
}
|
37
39
|
|
38
|
-
form
|
39
|
-
|
40
|
+
form {
|
41
|
+
label { font-weight: bold; }
|
42
|
+
|
43
|
+
label { margin-bottom: 7px; }
|
44
|
+
|
45
|
+
.help-block {
|
46
|
+
margin-top: 0;
|
47
|
+
margin-bottom: 10px;
|
48
|
+
}
|
49
|
+
}
|
40
50
|
|
41
51
|
.set-access-controls {
|
42
52
|
label { font-weight: normal; }
|
@@ -68,3 +78,7 @@ form label.required { font-weight: bold; }
|
|
68
78
|
form.button-to {
|
69
79
|
margin:0 .3em;
|
70
80
|
}
|
81
|
+
|
82
|
+
.required-tag {
|
83
|
+
vertical-align: super;
|
84
|
+
}
|
@@ -22,10 +22,5 @@ module CurationConcerns::CatalogController
|
|
22
22
|
def modified_field
|
23
23
|
solr_name('date_modified', :stored_sortable, type: :date)
|
24
24
|
end
|
25
|
-
|
26
|
-
def search_config
|
27
|
-
ActiveSupport::Deprecation.warn("#{self.class}.search_config is deprecated and will be removed in CurationConcerns 1.0")
|
28
|
-
{ 'qf' => %w(title_tesim name_tesim), 'qt' => 'search', 'rows' => 10 }
|
29
|
-
end
|
30
25
|
end
|
31
26
|
end
|
@@ -16,11 +16,6 @@ module CurationConcerns::CurationConcernController
|
|
16
16
|
end
|
17
17
|
|
18
18
|
module ClassMethods
|
19
|
-
def set_curation_concern_type(curation_concern_type)
|
20
|
-
Deprecation.warn self, "set_curation_concern_type is deprecated and will be removed in curation_concerns 1.0. Use self.curation_concern_type = #{curation_concern_type} instead."
|
21
|
-
self.curation_concern_type = curation_concern_type
|
22
|
-
end
|
23
|
-
|
24
19
|
def curation_concern_type=(curation_concern_type)
|
25
20
|
load_and_authorize_resource class: curation_concern_type, instance_name: :curation_concern, except: [:show, :file_manager]
|
26
21
|
self._curation_concern_type = curation_concern_type
|
@@ -1,9 +1,7 @@
|
|
1
1
|
module CurationConcerns
|
2
2
|
module PermissionsHelper
|
3
|
-
def
|
4
|
-
|
5
|
-
data: { toggle: 'popover', content: capture_content(file), 'original-title' => title },
|
6
|
-
'aria-label' => aria_label
|
3
|
+
def help_text(file)
|
4
|
+
capture_content(file)
|
7
5
|
end
|
8
6
|
|
9
7
|
private
|
@@ -0,0 +1,9 @@
|
|
1
|
+
module CurationConcerns::RightsHelper
|
2
|
+
def include_current_value(value, _index, render_options, html_options)
|
3
|
+
unless value.blank? || RightsService.active?(value)
|
4
|
+
html_options[:class] << ' force-select'
|
5
|
+
render_options += [[RightsService.label(value), value]]
|
6
|
+
end
|
7
|
+
[render_options, html_options]
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
class MultiValueSelectInput < MultiValueInput
|
2
|
+
def input_type
|
3
|
+
'multi_value'.freeze
|
4
|
+
end
|
5
|
+
|
6
|
+
private
|
7
|
+
|
8
|
+
def select_options
|
9
|
+
@select_options ||= begin
|
10
|
+
collection = options.delete(:collection) || self.class.boolean_collection
|
11
|
+
collection.respond_to?(:call) ? collection.call : collection.to_a
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def build_field_options(value)
|
16
|
+
field_options = input_html_options.dup
|
17
|
+
|
18
|
+
field_options[:value] = value
|
19
|
+
if @rendered_first_element
|
20
|
+
field_options[:id] = nil
|
21
|
+
field_options[:required] = nil
|
22
|
+
else
|
23
|
+
field_options[:id] ||= input_dom_id
|
24
|
+
end
|
25
|
+
field_options[:class] ||= []
|
26
|
+
field_options[:class] += ["#{input_dom_id} form-control multi-text-field"]
|
27
|
+
field_options[:'aria-labelledby'] = label_id
|
28
|
+
field_options.delete(:multiple)
|
29
|
+
field_options.delete(:item_helper)
|
30
|
+
field_options.merge!(options.slice(:include_blank))
|
31
|
+
|
32
|
+
@rendered_first_element = true
|
33
|
+
|
34
|
+
field_options
|
35
|
+
end
|
36
|
+
|
37
|
+
def build_field(value, index)
|
38
|
+
render_options = select_options
|
39
|
+
html_options = build_field_options(value)
|
40
|
+
if options[:item_helper]
|
41
|
+
(render_options, html_options) = options[:item_helper].call(value, index, render_options, html_options)
|
42
|
+
end
|
43
|
+
template.select_tag(attribute_name, template.options_for_select(render_options, value), html_options)
|
44
|
+
end
|
45
|
+
end
|
@@ -21,17 +21,17 @@ module CurationConcerns
|
|
21
21
|
delegate :has?, :first, :fetch, to: :solr_document
|
22
22
|
|
23
23
|
# Metadata Methods
|
24
|
-
delegate :title, :description, :creator, :contributor, :subject,
|
25
|
-
:language, :date_uploaded, :rights,
|
24
|
+
delegate :title, :label, :description, :creator, :contributor, :subject,
|
25
|
+
:publisher, :language, :date_uploaded, :rights,
|
26
26
|
:embargo_release_date, :lease_expiration_date,
|
27
27
|
:depositor, :keyword, :title_or_label, to: :solr_document
|
28
28
|
|
29
29
|
def page_title
|
30
|
-
|
30
|
+
label
|
31
31
|
end
|
32
32
|
|
33
33
|
def link_name
|
34
|
-
current_ability.can?(:read, id) ?
|
34
|
+
current_ability.can?(:read, id) ? label : 'File'
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
@@ -4,17 +4,20 @@ module CurationConcerns
|
|
4
4
|
# Present the attribute as an HTML table row.
|
5
5
|
#
|
6
6
|
# @param [Hash] options
|
7
|
-
# @option options [
|
7
|
+
# @option options [Symbol] :render_as use an alternate renderer
|
8
|
+
# (e.g., :linked or :linked_attribute to use LinkedAttributeRenderer)
|
8
9
|
# @option options [String] :search_field If the method_name of the attribute is different than
|
9
10
|
# how the attribute name should appear on the search URL,
|
10
11
|
# you can explicitly set the URL's search field name
|
11
12
|
# @option options [String] :label The default label for the field if no translation is found
|
13
|
+
# @option options [TrueClass, FalseClass] :include_empty should we display a row if there are no values?
|
12
14
|
def attribute_to_html(field, options = {})
|
13
15
|
unless respond_to?(field)
|
14
16
|
Rails.logger.warn("#{self.class} attempted to render #{field}, but no method exists with that name.")
|
15
17
|
return
|
16
18
|
end
|
17
|
-
|
19
|
+
|
20
|
+
renderer_for(field, options).new(field, send(field), options).render
|
18
21
|
end
|
19
22
|
|
20
23
|
def permission_badge
|
@@ -37,6 +40,29 @@ module CurationConcerns
|
|
37
40
|
|
38
41
|
private
|
39
42
|
|
43
|
+
def find_renderer_class(name)
|
44
|
+
renderer = nil
|
45
|
+
['Renderer', 'AttributeRenderer'].each do |suffix|
|
46
|
+
const_name = "#{name.to_s.camelize}#{suffix}".to_sym
|
47
|
+
renderer = begin
|
48
|
+
Renderers.const_get(const_name)
|
49
|
+
rescue NameError
|
50
|
+
nil
|
51
|
+
end
|
52
|
+
break unless renderer.nil?
|
53
|
+
end
|
54
|
+
raise NameError, "unknown renderer type `#{name}`" if renderer.nil?
|
55
|
+
renderer
|
56
|
+
end
|
57
|
+
|
58
|
+
def renderer_for(_field, options)
|
59
|
+
if options[:render_as]
|
60
|
+
find_renderer_class(options[:render_as])
|
61
|
+
else
|
62
|
+
Renderers::AttributeRenderer
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
40
66
|
def microdata_type_key
|
41
67
|
"curation_concerns.schema_org.resource_type.#{human_readable_type}"
|
42
68
|
end
|
@@ -25,7 +25,7 @@ module CurationConcerns
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def page_title
|
28
|
-
|
28
|
+
title.first
|
29
29
|
end
|
30
30
|
|
31
31
|
# CurationConcern methods
|
@@ -53,13 +53,6 @@ module CurationConcerns
|
|
53
53
|
@work_presenters ||= member_presenters(ordered_ids - file_set_ids, work_presenter_class)
|
54
54
|
end
|
55
55
|
|
56
|
-
# @deprecated
|
57
|
-
# @return [Array<FileSetPresenter>] presenters for the orderd_members that are FileSets
|
58
|
-
def file_presenters
|
59
|
-
Deprecation.warn WorkShowPresenter, "file_presenters is deprecated and will be removed in CurationConcerns 1.0. Use file_set_presenters or member_presenters instead."
|
60
|
-
member_presenters
|
61
|
-
end
|
62
|
-
|
63
56
|
# @param [Array<String>] ids a list of ids to build presenters for
|
64
57
|
# @param [Class] presenter_class the type of presenter to build
|
65
58
|
# @return [Array<presenter_class>] presenters for the ordered_members (not filtered by class)
|
@@ -45,9 +45,7 @@ module CurationConcerns
|
|
45
45
|
private
|
46
46
|
|
47
47
|
def attribute_value_to_html(value)
|
48
|
-
if field
|
49
|
-
rights_attribute_to_html(value)
|
50
|
-
elsif microdata_value_attributes(field).present?
|
48
|
+
if microdata_value_attributes(field).present?
|
51
49
|
"<span#{html_attributes(microdata_value_attributes(field))}>#{li_value(value)}</span>"
|
52
50
|
else
|
53
51
|
li_value(value)
|
@@ -63,37 +61,8 @@ module CurationConcerns
|
|
63
61
|
buffer
|
64
62
|
end
|
65
63
|
|
66
|
-
def search_field
|
67
|
-
options.fetch(:search_field, field)
|
68
|
-
end
|
69
|
-
|
70
64
|
def li_value(value)
|
71
|
-
|
72
|
-
link_to(ERB::Util.h(value), search_path(value))
|
73
|
-
else
|
74
|
-
auto_link(ERB::Util.h(value))
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
def search_path(value)
|
79
|
-
Rails.application.routes.url_helpers.search_catalog_path(
|
80
|
-
search_field: search_field, q: ERB::Util.h(value))
|
81
|
-
end
|
82
|
-
|
83
|
-
##
|
84
|
-
# Special treatment for license/rights. A URL from the Sufia gem's config/sufia.rb is stored in the descMetadata of the
|
85
|
-
# curation_concern. If that URL is valid in form, then it is used as a link. If it is not valid, it is used as plain text.
|
86
|
-
def rights_attribute_to_html(value)
|
87
|
-
begin
|
88
|
-
parsed_uri = URI.parse(value)
|
89
|
-
rescue
|
90
|
-
nil
|
91
|
-
end
|
92
|
-
if parsed_uri.nil?
|
93
|
-
ERB::Util.h(value)
|
94
|
-
else
|
95
|
-
%(<a href=#{ERB::Util.h(value)} target="_blank">#{RightsService.label(value)}</a>)
|
96
|
-
end
|
65
|
+
auto_link(ERB::Util.h(value))
|
97
66
|
end
|
98
67
|
end
|
99
68
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module CurationConcerns
|
2
|
+
module Renderers
|
3
|
+
class FacetedAttributeRenderer < AttributeRenderer
|
4
|
+
private
|
5
|
+
|
6
|
+
def li_value(value)
|
7
|
+
link_to(ERB::Util.h(value), search_path(value))
|
8
|
+
end
|
9
|
+
|
10
|
+
def search_path(value)
|
11
|
+
Rails.application.routes.url_helpers.search_catalog_path(:"f[#{search_field}][]" => ERB::Util.h(value))
|
12
|
+
end
|
13
|
+
|
14
|
+
def search_field
|
15
|
+
ERB::Util.h(Solrizer.solr_name(options.fetch(:search_field, field), :facetable, type: :string))
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module CurationConcerns
|
2
|
+
module Renderers
|
3
|
+
class LinkedAttributeRenderer < AttributeRenderer
|
4
|
+
private
|
5
|
+
|
6
|
+
def li_value(value)
|
7
|
+
link_to(ERB::Util.h(value), search_path(value))
|
8
|
+
end
|
9
|
+
|
10
|
+
def search_path(value)
|
11
|
+
Rails.application.routes.url_helpers.search_catalog_path(
|
12
|
+
search_field: search_field, q: ERB::Util.h(value))
|
13
|
+
end
|
14
|
+
|
15
|
+
def search_field
|
16
|
+
options.fetch(:search_field, field)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module CurationConcerns
|
2
|
+
module Renderers
|
3
|
+
class RightsAttributeRenderer < AttributeRenderer
|
4
|
+
private
|
5
|
+
|
6
|
+
def attribute_value_to_html(value)
|
7
|
+
rights_attribute_to_html(value)
|
8
|
+
end
|
9
|
+
|
10
|
+
##
|
11
|
+
# Special treatment for license/rights. A URL from the Sufia gem's config/sufia.rb is stored in the descMetadata of the
|
12
|
+
# curation_concern. If that URL is valid in form, then it is used as a link. If it is not valid, it is used as plain text.
|
13
|
+
def rights_attribute_to_html(value)
|
14
|
+
begin
|
15
|
+
parsed_uri = URI.parse(value)
|
16
|
+
rescue
|
17
|
+
nil
|
18
|
+
end
|
19
|
+
if parsed_uri.nil?
|
20
|
+
ERB::Util.h(value)
|
21
|
+
else
|
22
|
+
%(<a href=#{ERB::Util.h(value)} target="_blank">#{RightsService.label(value)}</a>)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -2,10 +2,20 @@ module RightsService
|
|
2
2
|
mattr_accessor :authority
|
3
3
|
self.authority = Qa::Authorities::Local.subauthority_for('rights')
|
4
4
|
|
5
|
-
def self.
|
5
|
+
def self.select_all_options
|
6
|
+
authority.all.map do |element|
|
7
|
+
[element[:label], element[:id]]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.select_active_options
|
6
12
|
active_elements.map { |e| [e[:label], e[:id]] }
|
7
13
|
end
|
8
14
|
|
15
|
+
def self.active?(id)
|
16
|
+
authority.find(id).fetch('active')
|
17
|
+
end
|
18
|
+
|
9
19
|
def self.label(id)
|
10
20
|
authority.find(id).fetch('term')
|
11
21
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<%= presenter.attribute_to_html(:description) %>
|
2
|
-
<%= presenter.attribute_to_html(:creator,
|
3
|
-
<%= presenter.attribute_to_html(:contributor, label: 'Contributors',
|
4
|
-
<%= presenter.attribute_to_html(:subject,
|
2
|
+
<%= presenter.attribute_to_html(:creator, render_as: :linked) %>
|
3
|
+
<%= presenter.attribute_to_html(:contributor, label: 'Contributors', render_as: :linked) %>
|
4
|
+
<%= presenter.attribute_to_html(:subject, render_as: :linked) %>
|
5
5
|
<%= presenter.attribute_to_html(:publisher) %>
|
6
6
|
<%= presenter.attribute_to_html(:language) %>
|
7
7
|
|
@@ -8,6 +8,6 @@
|
|
8
8
|
<%= presenter.attribute_to_html(:permission_badge, label: 'Visibility') %>
|
9
9
|
<%= presenter.attribute_to_html(:embargo_release_date) %>
|
10
10
|
<%= presenter.attribute_to_html(:lease_expiration_date) %>
|
11
|
-
<%= presenter.attribute_to_html(:rights) %>
|
11
|
+
<%= presenter.attribute_to_html(:rights, render_as: :rights) %>
|
12
12
|
</tbody>
|
13
13
|
</table>
|
@@ -9,7 +9,7 @@
|
|
9
9
|
Visibility
|
10
10
|
<small>Who should be able to view or download this content?</small>
|
11
11
|
<span id="visibility_tooltip" class="h5">
|
12
|
-
<%=
|
12
|
+
<%= help_text 'visibility' %>
|
13
13
|
</span>
|
14
14
|
</legend>
|
15
15
|
|
@@ -9,8 +9,10 @@
|
|
9
9
|
<a href="http://creativecommons.org/licenses/" target="_blank">Here's some help</a> if you don't know which license to choose.
|
10
10
|
</p>
|
11
11
|
|
12
|
-
<%= f.input :rights, as: :
|
13
|
-
collection: RightsService.
|
12
|
+
<%= f.input :rights, as: :multi_value_select,
|
13
|
+
collection: RightsService.select_active_options,
|
14
|
+
include_blank: true,
|
15
|
+
item_helper: method(:include_current_value),
|
14
16
|
input_html: { class: 'form-control' } %>
|
15
17
|
</fieldset>
|
16
18
|
</div>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<% if f.object.class.multiple? key %>
|
2
|
-
<%= f.input key, as: :
|
2
|
+
<%= f.input key, as: :multi_value, input_html: { class: 'form-control' }, required: f.object.required?(key) %>
|
3
3
|
<% else %>
|
4
4
|
<%= f.input key, required: f.object.required?(key) %>
|
5
5
|
<% end %>
|
data/curation_concerns.gemspec
CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.add_dependency 'sprockets-es6'
|
30
30
|
spec.add_dependency 'kaminari_route_prefix', '~> 0.0.1'
|
31
31
|
spec.add_dependency 'active_attr'
|
32
|
-
spec.add_dependency 'hydra-works', '>= 0.
|
32
|
+
spec.add_dependency 'hydra-works', '>= 0.12.0'
|
33
33
|
spec.add_dependency 'active_fedora-noid', '~> 1.0'
|
34
34
|
spec.add_dependency 'qa', '~> 0.5'
|
35
35
|
spec.add_dependency 'redlock', '~> 0.1.2'
|
@@ -17,7 +17,7 @@ module CurationConcerns
|
|
17
17
|
7. Adds CurationConcerns::SolrDocumentBehavior to app/models/solr_document.rb
|
18
18
|
8. Adds config/authorities/rights.yml to the application
|
19
19
|
9. Adds config/authorities/resource_types.yml to the application
|
20
|
-
10.
|
20
|
+
10. Copies modified simple_form initializers
|
21
21
|
'
|
22
22
|
|
23
23
|
def run_required_generators
|
@@ -101,8 +101,11 @@ module CurationConcerns
|
|
101
101
|
copy_file "config/authorities/resource_types.yml", "config/authorities/resource_types.yml"
|
102
102
|
end
|
103
103
|
|
104
|
-
def
|
105
|
-
|
104
|
+
def simple_form_initializers
|
105
|
+
copy_file 'config/initializers/simple_form.rb',
|
106
|
+
'config/initializers/simple_form.rb'
|
107
|
+
copy_file 'config/initializers/simple_form_bootstrap.rb',
|
108
|
+
'config/initializers/simple_form_bootstrap.rb'
|
106
109
|
end
|
107
110
|
end
|
108
111
|
end
|