fcrepo_admin 0.3.5 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +7 -0
  2. data/HISTORY.rdoc +6 -0
  3. data/README.rdoc +42 -20
  4. data/app/controllers/fcrepo_admin/associations_controller.rb +7 -0
  5. data/app/controllers/fcrepo_admin/objects_controller.rb +2 -1
  6. data/app/helpers/fcrepo_admin/associations_helper.rb +5 -0
  7. data/app/views/fcrepo_admin/associations/_associations.html.erb +26 -0
  8. data/app/views/fcrepo_admin/associations/index.html.erb +1 -0
  9. data/app/views/fcrepo_admin/associations/show.html.erb +11 -0
  10. data/app/views/fcrepo_admin/catalog/_document.html.erb +6 -0
  11. data/app/views/fcrepo_admin/datastreams/_content.html.erb +4 -3
  12. data/app/views/fcrepo_admin/datastreams/_context_nav.html.erb +9 -0
  13. data/app/views/fcrepo_admin/datastreams/_context_nav_items.html.erb +21 -0
  14. data/app/views/fcrepo_admin/datastreams/{_datastreams.html → _datastreams.html.erb} +16 -3
  15. data/app/views/fcrepo_admin/datastreams/_profile.html.erb +9 -10
  16. data/app/views/fcrepo_admin/datastreams/content.html.erb +1 -0
  17. data/app/views/fcrepo_admin/datastreams/index.html.erb +1 -4
  18. data/app/views/fcrepo_admin/datastreams/show.html.erb +1 -14
  19. data/app/views/fcrepo_admin/objects/_context_nav.html.erb +9 -0
  20. data/app/views/fcrepo_admin/objects/_context_nav_datastreams.html.erb +13 -0
  21. data/app/views/fcrepo_admin/objects/_context_nav_items.html.erb +19 -0
  22. data/app/views/fcrepo_admin/objects/_direct_permissions.html.erb +8 -0
  23. data/app/views/fcrepo_admin/objects/_inherited_permissions.html.erb +23 -0
  24. data/app/views/fcrepo_admin/objects/_permissions_list.html.erb +18 -0
  25. data/app/views/fcrepo_admin/objects/{_permissions_row.html.erb → _permissions_list_item.html.erb} +0 -0
  26. data/app/views/fcrepo_admin/objects/_properties.html.erb +6 -5
  27. data/app/views/fcrepo_admin/objects/permissions.html.erb +5 -0
  28. data/app/views/fcrepo_admin/objects/show.html.erb +3 -46
  29. data/app/views/layouts/fcrepo_admin/datastreams.html.erb +2 -2
  30. data/app/views/layouts/fcrepo_admin/objects.html.erb +1 -1
  31. data/config/locales/fcrepo_admin.en.yml +24 -4
  32. data/config/routes.rb +7 -2
  33. data/lib/fcrepo_admin.rb +4 -1
  34. data/lib/fcrepo_admin/ability.rb +18 -0
  35. data/lib/fcrepo_admin/controller/associations_controller_behavior.rb +49 -0
  36. data/lib/fcrepo_admin/controller/catalog_controller_behavior.rb +9 -0
  37. data/lib/fcrepo_admin/controller/controller_behavior.rb +49 -0
  38. data/lib/fcrepo_admin/controller/datastreams_controller_behavior.rb +21 -28
  39. data/lib/fcrepo_admin/controller/objects_controller_behavior.rb +7 -32
  40. data/lib/fcrepo_admin/helpers/associations_helper_behavior.rb +23 -0
  41. data/lib/fcrepo_admin/helpers/datastreams_helper_behavior.rb +7 -10
  42. data/lib/fcrepo_admin/helpers/fcrepo_admin_helper_behavior.rb +5 -10
  43. data/lib/fcrepo_admin/helpers/objects_helper_behavior.rb +0 -36
  44. data/lib/fcrepo_admin/version.rb +1 -1
  45. data/spec/controllers/associations_controller_spec.rb +34 -0
  46. data/spec/controllers/datastreams_controller_spec.rb +14 -12
  47. data/spec/controllers/objects_controller_spec.rb +6 -6
  48. data/spec/factories/fcrepo_admin_factories.rb +10 -6
  49. data/spec/features/associations/index.html.erb_spec.rb +28 -0
  50. data/spec/features/datastreams/edit.html.erb_spec.rb +1 -1
  51. data/spec/features/datastreams/index.html.erb_spec.rb +12 -0
  52. data/spec/features/datastreams/show.html.erb_spec.rb +1 -1
  53. data/spec/features/datastreams/upload.html.erb_spec.rb +1 -1
  54. data/spec/features/objects/audit_trail.html.erb_spec.rb +1 -1
  55. data/spec/features/objects/permissions.html.erb_spec.rb +19 -0
  56. data/spec/features/objects/show.html.erb_spec.rb +7 -30
  57. data/spec/internal/app/models/ability.rb +1 -1
  58. data/spec/internal/app/models/admin_policy.rb +3 -0
  59. data/spec/internal/app/models/collection.rb +14 -0
  60. data/spec/internal/app/models/item.rb +15 -0
  61. data/spec/internal/app/models/{content_model.rb → part.rb} +2 -1
  62. metadata +65 -73
  63. data/app/views/fcrepo_admin/datastreams/_datastream_nav.html.erb +0 -18
  64. data/app/views/fcrepo_admin/objects/_more_info.html.erb +0 -6
  65. data/app/views/fcrepo_admin/objects/_permissions.html.erb +0 -12
  66. data/app/views/fcrepo_admin/objects/_permissions_header.html.erb +0 -7
  67. data/lib/fcrepo_admin/datastream_ability.rb +0 -22
@@ -1,6 +0,0 @@
1
- <h3><%= t("fcrepo_admin.object.more_info") %></h3>
2
- <ul>
3
- <li>
4
- <%= link_to t("fcrepo_admin.audit_trail.title"), fcrepo_admin.object_audit_trail_index_path(pid) %>
5
- </li>
6
- </ul>
@@ -1,12 +0,0 @@
1
- <% if permissions.empty? %>
2
- <p>
3
- <%= t("fcrepo_admin.object.permissions.no_permissions") %>
4
- </p>
5
- <% else %>
6
- <table class="table table-bordered table-condensed">
7
- <%= render :partial => "permissions_header" %>
8
- <tbody>
9
- <%= render :partial => "permissions_row", :collection => permissions, :as => :permission %>
10
- </tbody>
11
- </table>
12
- <% end %>
@@ -1,7 +0,0 @@
1
- <thead>
2
- <tr>
3
- <th scope="col"><%= t("fcrepo_admin.object.permissions.header.type") %></th>
4
- <th scope="col"><%= t("fcrepo_admin.object.permissions.header.name") %></th>
5
- <th scope="col"><%= t("fcrepo_admin.object.permissions.header.access") %></th>
6
- </tr>
7
- </thead>
@@ -1,22 +0,0 @@
1
- require 'cancan'
2
-
3
- module FcrepoAdmin
4
- module DatastreamAbility
5
- extend ActiveSupport::Concern
6
-
7
- included do
8
- self.ability_logic += [:datastream_permissions]
9
- end
10
-
11
- def datastream_permissions
12
- can :read, ActiveFedora::Datastream do |ds|
13
- test_read(ds.pid)
14
- end
15
-
16
- can [:edit, :update, :destroy], ActiveFedora::Datastream do |ds|
17
- test_edit(ds.pid)
18
- end
19
- end
20
-
21
- end
22
- end