fcrepo_admin 0.3.2 → 0.3.3
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.
- data/README.rdoc +1 -1
- data/app/controllers/fcrepo_admin/datastreams_controller.rb +3 -2
- data/app/controllers/fcrepo_admin/objects_controller.rb +9 -9
- data/app/views/fcrepo_admin/objects/_context_nav_items.html.erb +2 -0
- data/app/views/fcrepo_admin/objects/audit_trail.html.erb +1 -1
- data/config/locales/fcrepo_admin.en.yml +1 -0
- data/lib/fcrepo_admin/controller_behavior.rb +18 -0
- data/lib/fcrepo_admin/version.rb +1 -1
- data/spec/internal/app/models/content_model.rb +1 -0
- metadata +4 -3
data/README.rdoc
CHANGED
@@ -46,7 +46,7 @@ See https://github.com/projecthydra/hydra-head/wiki/Installation-Prerequisites.
|
|
46
46
|
|
47
47
|
* Customize catalog search results (optional)
|
48
48
|
|
49
|
-
If you would like
|
49
|
+
If you would like catalog search results items to link to the object admin view
|
50
50
|
instead of the catalog show view, create app/helpers/blacklight_helper.rb with this content:
|
51
51
|
|
52
52
|
module BlacklightHelper
|
@@ -3,6 +3,8 @@ require 'mime/types'
|
|
3
3
|
module FcrepoAdmin
|
4
4
|
class DatastreamsController < ApplicationController
|
5
5
|
|
6
|
+
include FcrepoAdmin::ControllerBehavior
|
7
|
+
|
6
8
|
layout 'fcrepo_admin/datastreams'
|
7
9
|
|
8
10
|
# Additional types of content that should be displayed inline
|
@@ -69,8 +71,7 @@ module FcrepoAdmin
|
|
69
71
|
protected
|
70
72
|
|
71
73
|
def inline_filter
|
72
|
-
@inline = @datastream.mimeType.start_with?('text/') || TEXT_MIME_TYPES.include?(@datastream.mimeType)
|
73
|
-
# @inline &&= @datastream.dsSize <= MAX_INLINE_SIZE
|
74
|
+
@inline = (@datastream.mimeType.start_with?('text/') || TEXT_MIME_TYPES.include?(@datastream.mimeType)) && @datastream.dsSize <= MAX_INLINE_SIZE
|
74
75
|
end
|
75
76
|
|
76
77
|
end
|
@@ -1,6 +1,8 @@
|
|
1
1
|
module FcrepoAdmin
|
2
2
|
class ObjectsController < ApplicationController
|
3
3
|
|
4
|
+
include FcrepoAdmin::ControllerBehavior
|
5
|
+
|
4
6
|
layout 'fcrepo_admin/objects'
|
5
7
|
|
6
8
|
PROPERTIES = [:owner_id, :state, :create_date, :modified_date, :label]
|
@@ -14,10 +16,12 @@ module FcrepoAdmin
|
|
14
16
|
end
|
15
17
|
|
16
18
|
def audit_trail
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
19
|
+
if object_is_auditable?
|
20
|
+
if params[:download]
|
21
|
+
send_data @object.audit_trail.to_xml, :disposition => 'inline', :type => 'text/xml'
|
22
|
+
end
|
23
|
+
else
|
24
|
+
render :text => I18n.t("fcrepo_admin.object.audit_trail.not_implemented"), :status => 404
|
21
25
|
end
|
22
26
|
end
|
23
27
|
|
@@ -40,11 +44,7 @@ module FcrepoAdmin
|
|
40
44
|
protected
|
41
45
|
|
42
46
|
def object_properties
|
43
|
-
|
44
|
-
@object_properties = {}
|
45
|
-
PROPERTIES.each { |p| @object_properties[p] = @object.send(p) }
|
46
|
-
end
|
47
|
-
@object_properties
|
47
|
+
@object_properties ||= PROPERTIES.inject(Hash.new) { |h, p| h[p] = @object.send(p); h }
|
48
48
|
end
|
49
49
|
|
50
50
|
def apo_relationship_name
|
@@ -4,6 +4,8 @@
|
|
4
4
|
<li>
|
5
5
|
<%= link_to_unless_current t("fcrepo_admin.object.nav.items.summary"), fcrepo_admin.object_path(object) %>
|
6
6
|
</li>
|
7
|
+
<% if object_is_auditable? %>
|
7
8
|
<li>
|
8
9
|
<%= link_to_unless_current t("fcrepo_admin.object.nav.items.audit_trail"), fcrepo_admin.audit_trail_object_path(object) %>
|
9
10
|
</li>
|
11
|
+
<% end %>
|
@@ -31,6 +31,7 @@ en:
|
|
31
31
|
enforcement_disabled: 'Admin policy access control enforcement is disabled'
|
32
32
|
relationship_undefined: 'This object type does not define an admin policy relationship'
|
33
33
|
audit_trail:
|
34
|
+
not_implemented: 'This object does implement access to the Fedora audit trail (ActiveFedora::Auditable)'
|
34
35
|
title: 'Audit Trail'
|
35
36
|
download: 'Download'
|
36
37
|
record:
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module FcrepoAdmin
|
2
|
+
module ControllerBehavior
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
|
5
|
+
included do
|
6
|
+
helper_method :object_is_auditable?
|
7
|
+
end
|
8
|
+
|
9
|
+
def object_is_auditable?
|
10
|
+
begin
|
11
|
+
@object && @object.is_a?(ActiveFedora::Auditable)
|
12
|
+
rescue
|
13
|
+
false
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
data/lib/fcrepo_admin/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fcrepo_admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2013-04-
|
15
|
+
date: 2013-04-25 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: hydra-head
|
@@ -289,6 +289,7 @@ files:
|
|
289
289
|
- lib/assets/.gitkeep
|
290
290
|
- lib/fcrepo_admin.rb
|
291
291
|
- lib/fcrepo_admin/blacklight_helper_behavior.rb
|
292
|
+
- lib/fcrepo_admin/controller_behavior.rb
|
292
293
|
- lib/fcrepo_admin/datastream_ability.rb
|
293
294
|
- lib/fcrepo_admin/engine.rb
|
294
295
|
- lib/fcrepo_admin/solr_document_extension.rb
|
@@ -376,7 +377,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
376
377
|
version: '0'
|
377
378
|
segments:
|
378
379
|
- 0
|
379
|
-
hash:
|
380
|
+
hash: -492490096386514261
|
380
381
|
requirements: []
|
381
382
|
rubyforge_project:
|
382
383
|
rubygems_version: 1.8.25
|