curation_concerns 1.7.8 → 2.0.0.rc1
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 -6
- data/CONTRIBUTING.md +20 -68
- data/app/actors/curation_concerns/actors/add_as_member_of_collections_actor.rb +23 -0
- data/app/actors/curation_concerns/actors/add_to_work_actor.rb +4 -16
- data/app/actors/curation_concerns/actors/apply_order_actor.rb +5 -16
- data/app/assets/javascripts/curation_concerns/file_manager/sorting.es6 +7 -17
- data/app/controllers/concerns/curation_concerns/collections_controller_behavior.rb +6 -2
- data/app/controllers/concerns/curation_concerns/curation_concern_controller.rb +2 -11
- data/app/controllers/concerns/curation_concerns/download_behavior.rb +0 -6
- data/app/forms/curation_concerns/forms/work_form.rb +10 -10
- data/app/indexers/curation_concerns/collection_indexer.rb +5 -0
- data/app/indexers/curation_concerns/work_indexer.rb +2 -0
- data/app/jobs/characterize_job.rb +5 -12
- data/app/jobs/create_derivatives_job.rb +5 -10
- data/app/jobs/ingest_file_job.rb +9 -13
- data/app/models/concerns/curation_concerns/ability.rb +0 -1
- data/app/models/concerns/curation_concerns/collection.rb +14 -0
- data/app/models/concerns/curation_concerns/required_metadata.rb +4 -0
- data/app/models/concerns/curation_concerns/solr_document_behavior.rb +4 -0
- data/app/models/concerns/curation_concerns/work_behavior.rb +0 -6
- data/app/presenters/curation_concerns/admin/workflow_role_presenter.rb +0 -4
- data/app/presenters/curation_concerns/collection_presenter.rb +4 -0
- data/app/presenters/curation_concerns/work_show_presenter.rb +52 -19
- data/app/search_builders/curation_concerns/collection_member_search_builder.rb +15 -1
- data/app/services/curation_concerns/actors/actor_factory.rb +1 -2
- data/app/services/curation_concerns/workflow/grant_edit_to_depositor.rb +1 -1
- data/app/services/curation_concerns/workflow/permission_query.rb +1 -4
- data/app/services/curation_concerns/workflow/workflow_factory.rb +1 -1
- data/app/services/curation_concerns/workflow/workflow_importer.rb +0 -1
- data/app/services/curation_concerns/workflow/workflow_schema.rb +0 -1
- data/app/views/catalog/_action_menu_partials/_default.html.erb +1 -7
- data/app/views/collections/_document_header.html.erb +0 -4
- data/app/views/collections/_edit_actions.html.erb +0 -1
- data/app/views/collections/_form.html.erb +1 -0
- data/app/views/collections/_show_actions.html.erb +1 -1
- data/app/views/collections/edit.html.erb +2 -2
- data/app/views/curation_concerns/admin/workflow_roles/index.html.erb +2 -1
- data/app/views/curation_concerns/base/_attributes.html.erb +3 -0
- data/app/views/curation_concerns/base/_file_manager_member_resource_options.html.erb +2 -2
- data/app/views/curation_concerns/base/_file_manager_members.html.erb +5 -13
- data/app/views/curation_concerns/base/_file_manager_resource_form.html.erb +1 -1
- data/app/views/curation_concerns/base/_form.html.erb +0 -5
- data/app/views/curation_concerns/base/_form_member_of_collections.html.erb +4 -0
- data/app/views/curation_concerns/base/_form_supplementary_fields.html.erb +1 -0
- data/app/views/curation_concerns/base/_member_of_collections.html.erb +10 -0
- data/app/views/curation_concerns/base/_show_actions.html.erb +0 -4
- data/app/views/curation_concerns/base/file_manager.html.erb +2 -2
- data/app/views/curation_concerns/base/show.json.jbuilder +1 -2
- data/config/locales/curation_concerns.en.yml +0 -4
- data/curation_concerns.gemspec +3 -2
- data/lib/curation_concerns/version.rb +1 -1
- data/lib/generators/curation_concerns/templates/catalog_controller.rb +1 -0
- data/spec/actors/curation_concerns/apply_order_actor_spec.rb +0 -20
- data/spec/actors/curation_concerns/work_actor_spec.rb +10 -14
- data/spec/controllers/curation_concerns/collections_controller_spec.rb +19 -14
- data/spec/controllers/curation_concerns/generic_works_controller_spec.rb +1 -2
- data/spec/controllers/downloads_controller_spec.rb +6 -5
- data/spec/features/collection_spec.rb +21 -6
- data/spec/features/create_child_work_spec.rb +2 -16
- data/spec/features/create_work_spec.rb +6 -13
- data/spec/features/work_generator_spec.rb +0 -9
- data/spec/forms/work_form_spec.rb +0 -8
- data/spec/indexers/collection_indexer_spec.rb +14 -0
- data/spec/models/collection_spec.rb +11 -48
- data/spec/models/curation_concerns/work_behavior_spec.rb +3 -3
- data/spec/models/file_set_spec.rb +3 -2
- data/spec/presenters/curation_concerns/work_show_presenter_spec.rb +21 -27
- data/spec/services/curation_concerns/workflow/grant_edit_to_depositor_spec.rb +4 -15
- data/spec/services/curation_concerns/workflow/permission_query_spec.rb +1 -7
- data/spec/services/curation_concerns/workflow/workflow_importer_spec.rb +2 -5
- data/spec/services/curation_concerns/workflow/workflow_schema_spec.rb +0 -1
- data/spec/services/graph_exporter_spec.rb +3 -3
- data/spec/views/curation_concerns/base/_show_actions.html.erb_spec.rb +1 -1
- data/spec/views/curation_concerns/base/file_manager.html.erb_spec.rb +8 -10
- data/spec/views/curation_concerns/base/show.json.jbuilder_spec.rb +1 -3
- metadata +28 -32
- data/app/actors/curation_concerns/actors/add_to_collection_actor.rb +0 -42
- data/app/actors/curation_concerns/optimistic_lock_validator.rb +0 -28
- data/app/forms/curation_concerns/forms/file_manager_form.rb +0 -27
- data/app/presenters/curation_concerns/member_presenter_factory.rb +0 -70
- data/app/search_builders/curation_concerns/member_search_builder.rb +0 -21
- data/app/views/catalog/_action_menu_partials/_collection.html.erb +0 -27
- data/app/views/curation_concerns/base/_form_in_works_error.html.erb +0 -3
- data/app/views/curation_concerns/base/_form_ordered_members_error.html.erb +0 -3
- data/db/migrate/20170308175556_add_allows_access_grant_to_workflow.rb +0 -5
- data/spec/actors/curation_concerns/add_to_collections_actor_spec.rb +0 -66
- data/spec/actors/curation_concerns/optimistic_lock_validator_spec.rb +0 -50
- data/spec/forms/curation_concerns/forms/file_manager_form_spec.rb +0 -19
- data/spec/presenters/curation_concerns/member_presenter_factory_spec.rb +0 -25
- data/spec/views/curation_concerns/admin/workflow_roles/index.html.erb_spec.rb +0 -33
- data/spec/views/curation_concerns/base/_form.html.erb_spec.rb +0 -35
@@ -10,6 +10,11 @@ module CurationConcerns
|
|
10
10
|
# Index the size of the collection in bytes
|
11
11
|
solr_doc[Solrizer.solr_name(:bytes, STORED_LONG)] = object.bytes
|
12
12
|
solr_doc['thumbnail_path_ss'] = thumbnail_path
|
13
|
+
|
14
|
+
object.in_collections.each do |col|
|
15
|
+
(solr_doc['member_of_collection_ids_ssim'] ||= []) << col.id
|
16
|
+
(solr_doc['member_of_collections_ssim'] ||= []) << col.first_title
|
17
|
+
end
|
13
18
|
end
|
14
19
|
end
|
15
20
|
end
|
@@ -6,6 +6,8 @@ module CurationConcerns
|
|
6
6
|
def generate_solr_document
|
7
7
|
super.tap do |solr_doc|
|
8
8
|
solr_doc[Solrizer.solr_name('member_ids', :symbol)] = object.member_ids
|
9
|
+
solr_doc[Solrizer.solr_name('member_of_collections', :symbol)] = object.member_of_collections.map(&:first_title)
|
10
|
+
solr_doc[Solrizer.solr_name('member_of_collection_ids', :symbol)] = object.member_of_collections.map(&:id)
|
9
11
|
Solrizer.set_field(solr_doc, 'generic_type', 'Work', :facetable)
|
10
12
|
end
|
11
13
|
end
|
@@ -1,6 +1,4 @@
|
|
1
1
|
class CharacterizeJob < ActiveJob::Base
|
2
|
-
include CurationConcerns::Lockable
|
3
|
-
|
4
2
|
queue_as CurationConcerns.config.ingest_queue_name
|
5
3
|
|
6
4
|
# @param [FileSet] file_set
|
@@ -9,16 +7,11 @@ class CharacterizeJob < ActiveJob::Base
|
|
9
7
|
def perform(file_set, file_id, filepath = nil)
|
10
8
|
filename = CurationConcerns::WorkingDirectory.find_or_retrieve(file_id, file_set.id, filepath)
|
11
9
|
raise LoadError, "#{file_set.class.characterization_proxy} was not found" unless file_set.characterization_proxy?
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
file_set.characterization_proxy.save!
|
18
|
-
file_set.update_index
|
19
|
-
file_set.parent.in_collections.each(&:update_index) if file_set.parent
|
20
|
-
end
|
21
|
-
|
10
|
+
Hydra::Works::CharacterizationService.run(file_set.characterization_proxy, filename)
|
11
|
+
Rails.logger.debug "Ran characterization on #{file_set.characterization_proxy.id} (#{file_set.characterization_proxy.mime_type})"
|
12
|
+
file_set.characterization_proxy.save!
|
13
|
+
file_set.update_index
|
14
|
+
file_set.parent.in_collections.each(&:update_index) if file_set.parent
|
22
15
|
CreateDerivativesJob.perform_later(file_set, file_id, filename)
|
23
16
|
end
|
24
17
|
end
|
@@ -1,6 +1,4 @@
|
|
1
1
|
class CreateDerivativesJob < ActiveJob::Base
|
2
|
-
include CurationConcerns::Lockable
|
3
|
-
|
4
2
|
queue_as CurationConcerns.config.ingest_queue_name
|
5
3
|
|
6
4
|
# @param [FileSet] file_set
|
@@ -10,15 +8,12 @@ class CreateDerivativesJob < ActiveJob::Base
|
|
10
8
|
return if file_set.video? && !CurationConcerns.config.enable_ffmpeg
|
11
9
|
filename = CurationConcerns::WorkingDirectory.find_or_retrieve(file_id, file_set.id, filepath)
|
12
10
|
|
13
|
-
|
14
|
-
acquire_lock_for(file_set.id) do
|
15
|
-
file_set.create_derivatives(filename)
|
11
|
+
file_set.create_derivatives(filename)
|
16
12
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
end
|
13
|
+
# Reload from Fedora and reindex for thumbnail and extracted text
|
14
|
+
file_set.reload
|
15
|
+
file_set.update_index
|
16
|
+
file_set.parent.update_index if parent_needs_reindex?(file_set)
|
22
17
|
end
|
23
18
|
|
24
19
|
# If this file_set is the thumbnail for the parent work,
|
data/app/jobs/ingest_file_job.rb
CHANGED
@@ -1,6 +1,4 @@
|
|
1
1
|
class IngestFileJob < ActiveJob::Base
|
2
|
-
include CurationConcerns::Lockable
|
3
|
-
|
4
2
|
queue_as CurationConcerns.config.ingest_queue_name
|
5
3
|
|
6
4
|
# @param [FileSet] file_set
|
@@ -17,17 +15,15 @@ class IngestFileJob < ActiveJob::Base
|
|
17
15
|
local_file.mime_type = opts.fetch(:mime_type, nil)
|
18
16
|
local_file.original_name = opts.fetch(:filename, File.basename(filepath))
|
19
17
|
|
20
|
-
#
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
file_set.save!
|
30
|
-
end
|
18
|
+
# Tell AddFileToFileSet service to skip versioning because versions will be minted by
|
19
|
+
# VersionCommitter when necessary during save_characterize_and_record_committer.
|
20
|
+
Hydra::Works::AddFileToFileSet.call(file_set,
|
21
|
+
local_file,
|
22
|
+
relation,
|
23
|
+
versioning: false)
|
24
|
+
|
25
|
+
# Persist changes to the file_set
|
26
|
+
file_set.save!
|
31
27
|
|
32
28
|
repository_file = file_set.send(relation)
|
33
29
|
|
@@ -6,9 +6,23 @@ module CurationConcerns
|
|
6
6
|
include CurationConcerns::RequiredMetadata
|
7
7
|
include Hydra::Works::CollectionBehavior
|
8
8
|
|
9
|
+
# Add members using the members association.
|
9
10
|
def add_members(new_member_ids)
|
10
11
|
return if new_member_ids.nil? || new_member_ids.empty?
|
11
12
|
members << ActiveFedora::Base.find(new_member_ids)
|
12
13
|
end
|
14
|
+
|
15
|
+
# Add member objects by adding this collection to the objects' member_of_collection association.
|
16
|
+
def add_member_objects(new_member_ids)
|
17
|
+
Array(new_member_ids).each do |member_id|
|
18
|
+
member = ActiveFedora::Base.find(member_id)
|
19
|
+
member.member_of_collections << self
|
20
|
+
member.save!
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def member_objects
|
25
|
+
ActiveFedora::Base.where("member_of_collection_ids_ssim:#{id}")
|
26
|
+
end
|
13
27
|
end
|
14
28
|
end
|
@@ -11,6 +11,10 @@ module CurationConcerns
|
|
11
11
|
index.as :stored_searchable, :facetable
|
12
12
|
end
|
13
13
|
|
14
|
+
def first_title
|
15
|
+
title.first
|
16
|
+
end
|
17
|
+
|
14
18
|
# We reserve date_uploaded for the original creation date of the record.
|
15
19
|
# For example, when migrating data from a fedora3 repo to fedora4,
|
16
20
|
# fedora's system created date will reflect the date when the record
|
@@ -174,6 +174,10 @@ module CurationConcerns
|
|
174
174
|
first(Solrizer.solr_name('workflow_state_name', :symbol))
|
175
175
|
end
|
176
176
|
|
177
|
+
def member_of_collection_ids
|
178
|
+
fetch(Solrizer.solr_name('member_of_collection_ids', :symbol), [])
|
179
|
+
end
|
180
|
+
|
177
181
|
private
|
178
182
|
|
179
183
|
def date_field(field_name)
|
@@ -24,12 +24,6 @@ module CurationConcerns::WorkBehavior
|
|
24
24
|
self.indexer = CurationConcerns::WorkIndexer
|
25
25
|
end
|
26
26
|
|
27
|
-
# TODO: Move this into ActiveFedora
|
28
|
-
def etag
|
29
|
-
raise "Unable to produce an etag for a unsaved object" unless persisted?
|
30
|
-
ldp_source.head.etag
|
31
|
-
end
|
32
|
-
|
33
27
|
module ClassMethods
|
34
28
|
# This governs which partial to draw when you render this type of object
|
35
29
|
def _to_partial_path #:nodoc:
|
@@ -16,10 +16,6 @@ module CurationConcerns
|
|
16
16
|
@agent = agent
|
17
17
|
end
|
18
18
|
|
19
|
-
def responsibilities_present?
|
20
|
-
@agent.workflow_responsibilities.any?
|
21
|
-
end
|
22
|
-
|
23
19
|
def responsibilities
|
24
20
|
@agent.workflow_responsibilities.each do |responsibility|
|
25
21
|
yield ResponsibilityPresenter.new(responsibility)
|
@@ -4,11 +4,17 @@ module CurationConcerns
|
|
4
4
|
include PresentsAttributes
|
5
5
|
attr_accessor :solr_document, :current_ability, :request
|
6
6
|
|
7
|
-
class_attribute :collection_presenter_class
|
7
|
+
class_attribute :collection_presenter_class, :file_presenter_class, :work_presenter_class
|
8
8
|
|
9
9
|
# modify this attribute to use an alternate presenter class for the collections
|
10
10
|
self.collection_presenter_class = CollectionPresenter
|
11
11
|
|
12
|
+
# modify this attribute to use an alternate presenter class for the files
|
13
|
+
self.file_presenter_class = FileSetPresenter
|
14
|
+
|
15
|
+
# modify this attribute to use an alternate presenter class for the child works
|
16
|
+
self.work_presenter_class = self
|
17
|
+
|
12
18
|
# Methods used by blacklight helpers
|
13
19
|
delegate :has?, :first, :fetch, :export_formats, :export_as, to: :solr_document
|
14
20
|
|
@@ -33,7 +39,12 @@ module CurationConcerns
|
|
33
39
|
delegate :title, :date_created, :date_modified, :date_uploaded, :description,
|
34
40
|
:creator, :contributor, :subject, :publisher, :language, :embargo_release_date,
|
35
41
|
:lease_expiration_date, :rights, :source, :thumbnail_id, :representative_id,
|
36
|
-
to: :solr_document
|
42
|
+
:member_of_collection_ids, to: :solr_document
|
43
|
+
|
44
|
+
# @return [Array<FileSetPresenter>] presenters for the orderd_members that are FileSets
|
45
|
+
def file_set_presenters
|
46
|
+
@file_set_presenters ||= member_presenters(ordered_ids & file_set_ids)
|
47
|
+
end
|
37
48
|
|
38
49
|
def workflow
|
39
50
|
@workflow ||= WorkflowPresenter.new(solr_document, current_ability)
|
@@ -57,10 +68,26 @@ module CurationConcerns
|
|
57
68
|
end
|
58
69
|
end
|
59
70
|
|
60
|
-
# @return [Array<
|
61
|
-
def
|
62
|
-
|
63
|
-
|
71
|
+
# @return [Array<WorkShowPresenter>] presenters for the ordered_members that are not FileSets
|
72
|
+
def work_presenters
|
73
|
+
@work_presenters ||= member_presenters(ordered_ids - file_set_ids, work_presenter_class)
|
74
|
+
end
|
75
|
+
|
76
|
+
# @param [Array<String>] ids a list of ids to build presenters for
|
77
|
+
# @param [Class] presenter_class the type of presenter to build
|
78
|
+
# @return [Array<presenter_class>] presenters for the ordered_members (not filtered by class)
|
79
|
+
def member_presenters(ids = ordered_ids, presenter_class = composite_presenter_class)
|
80
|
+
PresenterFactory.build_presenters(ids, presenter_class, *presenter_factory_arguments)
|
81
|
+
end
|
82
|
+
|
83
|
+
def composite_presenter_class
|
84
|
+
CompositePresenterFactory.new(file_presenter_class, work_presenter_class, ordered_ids & file_set_ids)
|
85
|
+
end
|
86
|
+
|
87
|
+
# Get presenters for the collections this work is a member of via the member_of_collections association.
|
88
|
+
# @return [Array<CollectionPresenter>] presenters
|
89
|
+
def member_of_collection_presenters
|
90
|
+
PresenterFactory.build_presenters(member_of_collection_ids, collection_presenter_class,
|
64
91
|
*presenter_factory_arguments)
|
65
92
|
end
|
66
93
|
|
@@ -80,27 +107,33 @@ module CurationConcerns
|
|
80
107
|
graph.dump(:ttl)
|
81
108
|
end
|
82
109
|
|
83
|
-
delegate :member_presenters, :file_set_presenters, :work_presenters, to: :member_presenter_factory
|
84
|
-
|
85
110
|
private
|
86
111
|
|
87
|
-
def
|
88
|
-
|
112
|
+
def graph
|
113
|
+
GraphExporter.new(solr_document, request).fetch
|
89
114
|
end
|
90
115
|
|
91
|
-
|
92
|
-
|
93
|
-
ActiveFedora::SolrService.query("{!field f=member_ids_ssim}#{id}",
|
94
|
-
fl: ActiveFedora.id_field)
|
95
|
-
.map { |x| x.fetch(ActiveFedora.id_field) }
|
116
|
+
def presenter_factory_arguments
|
117
|
+
[current_ability, request]
|
96
118
|
end
|
97
119
|
|
98
|
-
|
99
|
-
|
120
|
+
# TODO: Extract this to ActiveFedora::Aggregations::ListSource
|
121
|
+
def ordered_ids
|
122
|
+
@ordered_ids ||= begin
|
123
|
+
ActiveFedora::SolrService.query("proxy_in_ssi:#{id}", fl: "ordered_targets_ssim")
|
124
|
+
.flat_map { |x| x.fetch("ordered_targets_ssim", []) }
|
125
|
+
end
|
100
126
|
end
|
101
127
|
|
102
|
-
|
103
|
-
|
128
|
+
# These are the file sets that belong to this work, but not necessarily
|
129
|
+
# in order.
|
130
|
+
def file_set_ids
|
131
|
+
@file_set_ids ||= begin
|
132
|
+
ActiveFedora::SolrService.query("{!field f=has_model_ssim}FileSet",
|
133
|
+
fl: ActiveFedora.id_field,
|
134
|
+
fq: "{!join from=ordered_targets_ssim to=id}id:\"#{id}/list_source\"")
|
135
|
+
.flat_map { |x| x.fetch(ActiveFedora.id_field, []) }
|
136
|
+
end
|
104
137
|
end
|
105
138
|
end
|
106
139
|
end
|
@@ -1,5 +1,19 @@
|
|
1
1
|
module CurationConcerns
|
2
|
-
class CollectionMemberSearchBuilder <
|
2
|
+
class CollectionMemberSearchBuilder < ::SearchBuilder
|
3
3
|
include CurationConcerns::FilterByType
|
4
|
+
|
5
|
+
class_attribute :collection_membership_field
|
6
|
+
self.collection_membership_field = 'member_of_collection_ids_ssim'
|
7
|
+
|
8
|
+
# Defines which search_params_logic should be used when searching for Collection members
|
9
|
+
self.default_processor_chain += [:member_of_collection]
|
10
|
+
|
11
|
+
delegate :collection, to: :scope
|
12
|
+
|
13
|
+
# include filters into the query to only include the collection memebers
|
14
|
+
def member_of_collection(solr_parameters)
|
15
|
+
solr_parameters[:fq] ||= []
|
16
|
+
solr_parameters[:fq] << "#{collection_membership_field}:#{collection.id}"
|
17
|
+
end
|
4
18
|
end
|
5
19
|
end
|
@@ -257,10 +257,7 @@ module CurationConcerns
|
|
257
257
|
.and(entity_responsibilities[:entity_id].eq(entity.id))
|
258
258
|
)
|
259
259
|
|
260
|
-
|
261
|
-
cast = Arel::Nodes::NamedFunction.new "CAST", [agent_table[:proxy_for_id].as("integer")]
|
262
|
-
|
263
|
-
sub_query_for_user = agent_table.project(cast).where(
|
260
|
+
sub_query_for_user = agent_table.project(agent_table[:proxy_for_id]).where(
|
264
261
|
agent_table[:id].in(workflow_agent_id_subquery)
|
265
262
|
.or(agent_table[:id].in(entity_agent_id_subquery))
|
266
263
|
).where(
|
@@ -6,7 +6,7 @@ module CurationConcerns
|
|
6
6
|
|
7
7
|
# @param work [#to_global_id]
|
8
8
|
# @param attributes [Hash]
|
9
|
-
# @param strategy [#name] strategy for finding which workflow to use. Defaults to an instance of
|
9
|
+
# @param strategy [#name] strategy for finding which workflow to use. Defaults to an instance of DefaultWorkflowStrategy
|
10
10
|
# @return [TrueClass]
|
11
11
|
def self.create(work, attributes, user, strategy = nil)
|
12
12
|
strategy ||= workflow_strategy.new(work, attributes)
|
@@ -72,7 +72,6 @@ module CurationConcerns
|
|
72
72
|
workflow = Sipity::Workflow.find_or_initialize_by(name: configuration.fetch(:name)) do |wf|
|
73
73
|
wf.label = configuration.fetch(:label, nil)
|
74
74
|
wf.description = configuration.fetch(:description, nil)
|
75
|
-
wf.allows_access_grant = configuration.fetch(:allows_access_grant, nil)
|
76
75
|
wf.save!
|
77
76
|
end
|
78
77
|
|
@@ -34,7 +34,6 @@ module CurationConcerns
|
|
34
34
|
required(:name).filled(:str?) # Sipity::Workflow#name
|
35
35
|
optional(:label).filled(:str?) # Sipity::Workflow#label
|
36
36
|
optional(:description).filled(:str?) # Sipity::Workflow#description
|
37
|
-
optional(:allows_access_grant).filled(:bool?) # Sipity::Workflow#allows_access_grant?
|
38
37
|
required(:actions).each do
|
39
38
|
required(:name).filled(:str?) # Sipity::WorkflowAction#name
|
40
39
|
required(:from_states).each do
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<% if can?(:edit, document)
|
1
|
+
<% if can?(:edit, document) %>
|
2
2
|
<div class="btn-group">
|
3
3
|
<button class="btn btn-default btn-small dropdown-toggle" data-toggle="dropdown" href="#">Select an action <span class="caret"></span></button>
|
4
4
|
<ul class="dropdown-menu">
|
@@ -20,12 +20,6 @@
|
|
20
20
|
<% end %>
|
21
21
|
</li>
|
22
22
|
<% end %>
|
23
|
-
<% if can? :collect, document %>
|
24
|
-
<li>
|
25
|
-
<%= link_to_select_collection document %>
|
26
|
-
</li>
|
27
|
-
<% end %>
|
28
23
|
</ul>
|
29
|
-
<%= render 'collections/add_to_collection_modal', collectible: document if can? :collect, document %>
|
30
24
|
</div>
|
31
25
|
<% end %>
|
@@ -2,8 +2,4 @@
|
|
2
2
|
<div class="documentHeader clearfix">
|
3
3
|
<% # main title container for doc partial view -%>
|
4
4
|
<h5 class="index_title"><%= t('blacklight.search.documents.counter', :counter => (document_counter + 1 + @response.params[:start].to_i)) %><%= link_to_document document, :label=>document_show_link_field(document), :counter => (document_counter + 1 + @response.params[:start].to_i) %></h5>
|
5
|
-
|
6
|
-
<div class="documentFunctions span2">
|
7
|
-
<%= button_for_remove_from_collection(@collection, document) %>
|
8
|
-
</div>
|
9
5
|
</div>
|
@@ -16,6 +16,7 @@
|
|
16
16
|
<%= f.submit class: 'btn btn-primary require-contributor-agreement' %>
|
17
17
|
<% if @form.persisted? %>
|
18
18
|
<%= link_to 'Cancel', collection_path(@form), class: 'btn btn-link' %>
|
19
|
+
<%= link_to "Delete", [main_app, @form], class: 'btn btn-danger pull-right', data: { confirm: "Delete this Collection?" }, method: :delete %>
|
19
20
|
<% else %>
|
20
21
|
<%= link_to 'Cancel', main_app.root_path, class: 'btn btn-link' %>
|
21
22
|
<% end %>
|