fcrepo_admin 0.5.1 → 0.5.2
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/HISTORY.rdoc +6 -0
- data/README.rdoc +1 -1
- data/app/controllers/fcrepo_admin/associations_controller.rb +5 -4
- data/app/controllers/fcrepo_admin/objects_controller.rb +7 -3
- data/app/views/fcrepo_admin/associations/_pagination.html.erb +7 -0
- data/app/views/fcrepo_admin/associations/show.html.erb +1 -1
- data/app/views/fcrepo_admin/catalog/_document.html.erb +3 -5
- data/app/views/fcrepo_admin/catalog/_document_header.html.erb +7 -0
- data/app/views/fcrepo_admin/objects/audit_trail.html.erb +1 -1
- data/app/views/fcrepo_admin/objects/show.html.erb +7 -2
- data/config/locales/fcrepo_admin.en.yml +1 -0
- data/lib/fcrepo_admin/configurable.rb +1 -1
- data/lib/fcrepo_admin/decorators/active_fedora/base_decorator.rb +5 -0
- data/lib/fcrepo_admin/helpers/objects_helper_behavior.rb +2 -2
- data/lib/fcrepo_admin/version.rb +1 -1
- data/spec/features/objects/audit_trail.html.erb_spec.rb +2 -1
- metadata +4 -3
- data/app/views/fcrepo_admin/associations/_document_header.html.erb +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73679eaaaef9b035662e7ec5f145669cb75240ad
|
4
|
+
data.tar.gz: 2b63f18ebb6bf30df57796c87c071d2cf0d51d57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47491368bb3881dd03ba9adbce428d4a5858d031dde0bbc8b16163a5026b1ed2d2fad997d11a51bb3101bcc06b312fb9c0268d335a0198a12bf8610255e3ced3
|
7
|
+
data.tar.gz: 07a9a3c5fd32920518feaf74375dc799e6cd0b53a82141c494ee6ff049cd5c4947131f2745e55cb6faca15b06dac72b77fcf77eb4cd24fa9c9fa1cdb5be5d04c
|
data/HISTORY.rdoc
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
==== 0.5.2 (2013-05-22)
|
2
|
+
|
3
|
+
* Fixed association show view pagination by working around Kaminari.
|
4
|
+
* Object XML (FOXML) accessible from object context nav.
|
5
|
+
* Catalog show fields and show document actions displayed in object show view (summary).
|
6
|
+
|
1
7
|
==== 0.5.1 (2013-05-21)
|
2
8
|
|
3
9
|
* Association show view paginated (Fixes #18).
|
data/README.rdoc
CHANGED
@@ -120,7 +120,7 @@ Override datastreams helpers by creating app/helpers/fcrepo_admin/datastreams_he
|
|
120
120
|
|
121
121
|
The configuration settings that control the items on the context menus are:
|
122
122
|
|
123
|
-
FcrepoAdmin.object_nav_items = [:pid, :summary, :datastreams, :permissions, :associations, :audit_trail]
|
123
|
+
FcrepoAdmin.object_nav_items = [:pid, :summary, :datastreams, :permissions, :associations, :audit_trail, :object_xml]
|
124
124
|
FcrepoAdmin.datastream_nav_items = [:dsid, :version, :current_version, :summary, :content, :download, :edit, :upload, :history]
|
125
125
|
|
126
126
|
Each setting takes an array of symbols representing the items. You can start by copying the default values shown above.
|
@@ -12,8 +12,9 @@ module FcrepoAdmin
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def show
|
15
|
-
|
16
|
-
|
15
|
+
if @association.nil?
|
16
|
+
render :text => "Association not found", :status => 404
|
17
|
+
elsif @association.collection?
|
17
18
|
get_collection_from_solr
|
18
19
|
else
|
19
20
|
# This shouldn't normally happen b/c UI links directly to target object view in this case
|
@@ -39,9 +40,9 @@ module FcrepoAdmin
|
|
39
40
|
end
|
40
41
|
|
41
42
|
def collection_query_args
|
42
|
-
page = params[:page]
|
43
|
+
page = params[:page].blank? ? 1 : params[:page].to_i
|
43
44
|
rows = FcrepoAdmin.associated_objects_per_page
|
44
|
-
start = (page
|
45
|
+
start = (page - 1) * rows
|
45
46
|
args = {raw: true, start: start, rows: rows}
|
46
47
|
apply_gated_discovery(args, nil) # add args to enforce Hydra access controls
|
47
48
|
args
|
@@ -6,15 +6,19 @@ module FcrepoAdmin
|
|
6
6
|
include FcrepoAdmin::Controller::ControllerBehavior
|
7
7
|
|
8
8
|
before_filter :load_and_authorize_object
|
9
|
-
before_filter :load_solr_document, :only => :show
|
10
9
|
|
11
10
|
def show
|
11
|
+
respond_to do |format|
|
12
|
+
format.html { load_solr_document }
|
13
|
+
format.xml { render :xml => @object.object_xml }
|
14
|
+
end
|
12
15
|
end
|
13
16
|
|
14
17
|
def audit_trail
|
15
18
|
if @object.auditable?
|
16
|
-
|
17
|
-
|
19
|
+
respond_to do |format|
|
20
|
+
format.html
|
21
|
+
format.xml { render :xml => @object.audit_trail.to_xml }
|
18
22
|
end
|
19
23
|
else
|
20
24
|
render :text => I18n.t("fcrepo_admin.object.audit_trail.not_implemented"), :status => 404
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<ul>
|
2
|
+
<li class="<% if pagination_info.current_page == 1 %>disabled<% end %>"><a href="?page=<%= pagination_info.current_page - 1 %>">«</a></li>
|
3
|
+
<% (1..pagination_info.num_pages).each do |n| %>
|
4
|
+
<li class="<% if n == pagination_info.current_page %>active<% end %>"><a href="?page=<%= n %>"><%= n %></a></li>
|
5
|
+
<% end %>
|
6
|
+
<li class="<% if pagination_info.current_page == pagination_info.num_pages %>disabled<% end %>"><a href="?page=<%= pagination_info.current_page + 1 %>">»</a></li>
|
7
|
+
</ul>
|
@@ -9,7 +9,7 @@
|
|
9
9
|
<%= render :partial => 'catalog/document_list', :locals => {:documents => @documents} %>
|
10
10
|
<% if @response.total > associated_objects_per_page %>
|
11
11
|
<div class="pagination">
|
12
|
-
<%=
|
12
|
+
<%= render :partial => 'pagination', :locals => {:pagination_info => paginate_params(@response)} %>
|
13
13
|
</div>
|
14
14
|
<% end %>
|
15
15
|
<% else %>
|
@@ -1,6 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
<%= render :partial => '
|
4
|
-
<%# main container for doc partial view -%>
|
5
|
-
<%= render_document_partial document, :index %>
|
1
|
+
<div class="document <%= render_document_class document %>">
|
2
|
+
<%= render :partial => 'catalog/document_header', :locals => { :document => document, :document_counter => document_counter } %>
|
3
|
+
<%= render :partial => 'catalog/index_default', :locals => {:document => document} %>
|
6
4
|
</div>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<% # header bar for doc items in index view -%>
|
2
|
+
<div class="documentHeader clearfix">
|
3
|
+
<% # main title container for doc partial view -%>
|
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
|
+
<% # bookmark functions for items/docs -%>
|
6
|
+
<%= render_index_doc_actions document, :wrapping_class => "documentFunctions span2" %>
|
7
|
+
</div>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<h3><%= t("fcrepo_admin.object.audit_trail.title") %></h3>
|
2
2
|
|
3
3
|
<p>
|
4
|
-
<%= link_to t("fcrepo_admin.object.audit_trail.download"),
|
4
|
+
<%= link_to t("fcrepo_admin.object.audit_trail.download"), fcrepo_admin.audit_trail_object_path(@object, :format => 'xml'), :class => "btn btn-primary" %>
|
5
5
|
</p>
|
6
6
|
|
7
7
|
<table class="table table-bordered table-condensed table-striped">
|
@@ -1,5 +1,10 @@
|
|
1
|
-
<div class="row">
|
2
|
-
|
1
|
+
<div class="document row">
|
2
|
+
<div class="span7">
|
3
|
+
<%= render :partial => 'catalog/show_default', :locals => {:document => @document} %>
|
4
|
+
</div>
|
5
|
+
<div class="span2">
|
6
|
+
<%= render_show_doc_actions @document %>
|
7
|
+
</div>
|
3
8
|
</div>
|
4
9
|
<div class="row">
|
5
10
|
<div class="span5">
|
@@ -37,7 +37,7 @@ module FcrepoAdmin::Configurable
|
|
37
37
|
|
38
38
|
# Object context navigation items
|
39
39
|
mattr_accessor :object_nav_items
|
40
|
-
self.object_nav_items = [:pid, :summary, :datastreams, :permissions, :associations, :audit_trail, :
|
40
|
+
self.object_nav_items = [:pid, :summary, :datastreams, :permissions, :associations, :audit_trail, :object_xml]
|
41
41
|
|
42
42
|
# Datastream profile values to display on object show view
|
43
43
|
mattr_accessor :object_show_datastream_columns
|
@@ -27,5 +27,10 @@ ActiveFedora::Base.class_eval do
|
|
27
27
|
return reflection if reflection.macro == :belongs_to && reflection.options[:property] == :is_governed_by
|
28
28
|
end
|
29
29
|
end
|
30
|
+
|
31
|
+
def object_xml
|
32
|
+
# XXX https://github.com/projecthydra/rubydora/pull/26
|
33
|
+
inner_object.repository.object_xml(:pid => pid)
|
34
|
+
end
|
30
35
|
|
31
36
|
end
|
@@ -60,8 +60,7 @@ module FcrepoAdmin::Helpers
|
|
60
60
|
when item == :permissions then link_to_object item, @object.has_permissions? && can?(:permissions, @object)
|
61
61
|
when item == :associations then link_to_object item
|
62
62
|
when item == :audit_trail then link_to_object item, @object.auditable? && can?(:audit_trail, @object)
|
63
|
-
when item == :
|
64
|
-
render(:partial => 'catalog/bookmark_control', :locals => {:document=> @document}) if @document
|
63
|
+
when item == :object_xml then link_to_object item
|
65
64
|
else custom_object_nav_item item
|
66
65
|
end
|
67
66
|
end
|
@@ -79,6 +78,7 @@ module FcrepoAdmin::Helpers
|
|
79
78
|
when view == :permissions then fcrepo_admin.permissions_object_path(@object)
|
80
79
|
when view == :associations then fcrepo_admin.object_associations_path(@object)
|
81
80
|
when view == :audit_trail then fcrepo_admin.audit_trail_object_path(@object)
|
81
|
+
when view == :object_xml then fcrepo_admin.object_path(@object, :format => 'xml')
|
82
82
|
end
|
83
83
|
link_to_unless_current label, path
|
84
84
|
end
|
data/lib/fcrepo_admin/version.rb
CHANGED
@@ -6,6 +6,7 @@ describe "audit_trail.html.erb" do
|
|
6
6
|
it "should display the audit trail" do
|
7
7
|
visit fcrepo_admin.audit_trail_object_path(object)
|
8
8
|
page.should have_content(object.pid)
|
9
|
-
page.should have_link(I18n.t("fcrepo_admin.object.audit_trail.download"), :href =>
|
9
|
+
page.should have_link(I18n.t("fcrepo_admin.object.audit_trail.download"), :href => fcrepo_admin.audit_trail_object_path(object, :format =>
|
10
|
+
'xml'))
|
10
11
|
end
|
11
12
|
end
|
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.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Chandek-Stark
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2013-05-
|
14
|
+
date: 2013-05-22 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: hydra-head
|
@@ -250,10 +250,11 @@ files:
|
|
250
250
|
- app/mailers/.gitkeep
|
251
251
|
- app/models/.gitkeep
|
252
252
|
- app/views/fcrepo_admin/associations/_associations.html.erb
|
253
|
-
- app/views/fcrepo_admin/associations/
|
253
|
+
- app/views/fcrepo_admin/associations/_pagination.html.erb
|
254
254
|
- app/views/fcrepo_admin/associations/index.html.erb
|
255
255
|
- app/views/fcrepo_admin/associations/show.html.erb
|
256
256
|
- app/views/fcrepo_admin/catalog/_document.html.erb
|
257
|
+
- app/views/fcrepo_admin/catalog/_document_header.html.erb
|
257
258
|
- app/views/fcrepo_admin/datastreams/_active_fedora.html.erb
|
258
259
|
- app/views/fcrepo_admin/datastreams/_alert.html.erb
|
259
260
|
- app/views/fcrepo_admin/datastreams/_content.html.erb
|
@@ -1,12 +0,0 @@
|
|
1
|
-
|
2
|
-
<% # header bar for doc items in index view -%>
|
3
|
-
<div class="documentHeader clearfix">
|
4
|
-
|
5
|
-
<% # main title container for doc partial view -%>
|
6
|
-
<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>
|
7
|
-
|
8
|
-
|
9
|
-
<% # bookmark functions for items/docs -%>
|
10
|
-
<%= render_index_doc_actions document, :wrapping_class => "documentFunctions span2" %>
|
11
|
-
</div>
|
12
|
-
|