enju_flower 0.1.0.pre2 → 0.1.0.pre3

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.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/resources.js +2 -0
  3. data/app/assets/stylesheets/resources.css +4 -0
  4. data/app/controllers/resources_controller.rb +5 -0
  5. data/app/helpers/manifestations_helper.rb +2 -2
  6. data/app/helpers/resources_helper.rb +2 -0
  7. data/app/views/manifestations/_manifestation.html.erb +36 -38
  8. data/app/views/manifestations/_show_detail_librarian.html.erb +1 -1
  9. data/app/views/resources/index.html.erb +7 -0
  10. data/lib/enju_flower/version.rb +1 -1
  11. data/spec/dummy/app/controllers/application_controller.rb +0 -4
  12. data/spec/dummy/app/models/ability.rb +197 -176
  13. data/spec/dummy/db/test.sqlite3 +0 -0
  14. data/spec/dummy/solr/data/test/index/_6m.fdt +0 -0
  15. data/spec/dummy/solr/data/test/index/_6m.fdx +0 -0
  16. data/spec/dummy/solr/data/test/index/_6m.fnm +7 -0
  17. data/spec/dummy/solr/data/test/index/_6m.frq +0 -0
  18. data/spec/dummy/solr/data/test/index/_6m.nrm +1 -0
  19. data/spec/dummy/solr/data/test/index/_6m.prx +0 -0
  20. data/spec/dummy/solr/data/test/index/_6m.tii +0 -0
  21. data/spec/dummy/solr/data/test/index/_6m.tis +0 -0
  22. data/spec/dummy/solr/data/test/index/_6n.fdt +0 -0
  23. data/spec/dummy/solr/data/test/index/_6n.fdx +0 -0
  24. data/spec/dummy/solr/data/test/index/_6n.fnm +7 -0
  25. data/spec/dummy/solr/data/test/index/_6n.frq +0 -0
  26. data/spec/dummy/solr/data/test/index/_6n.nrm +1 -0
  27. data/spec/dummy/solr/data/test/index/_6n.prx +0 -0
  28. data/spec/dummy/solr/data/test/index/_6n.tii +0 -0
  29. data/spec/dummy/solr/data/test/index/_6n.tis +0 -0
  30. data/spec/dummy/solr/data/test/index/_6o.fdt +0 -0
  31. data/spec/dummy/solr/data/test/index/_6o.fdx +0 -0
  32. data/spec/dummy/solr/data/test/index/_6o.fnm +8 -0
  33. data/spec/dummy/solr/data/test/index/_6o.frq +0 -0
  34. data/spec/dummy/solr/data/test/index/_6o.nrm +1 -0
  35. data/spec/dummy/solr/data/test/index/_6o.prx +0 -0
  36. data/spec/dummy/solr/data/test/index/_6o.tii +0 -0
  37. data/spec/dummy/solr/data/test/index/_6o.tis +0 -0
  38. data/spec/dummy/solr/data/test/index/segments.gen +0 -0
  39. data/spec/dummy/solr/data/test/index/segments_90 +0 -0
  40. data/spec/dummy/solr/data/test/spellchecker/segments.gen +0 -0
  41. data/spec/dummy/solr/data/test/spellchecker/segments_1 +0 -0
  42. data/spec/dummy/tmp/cache/4F7/F90/default_role +0 -0
  43. data/spec/dummy/tmp/cache/6E4/420/search_engine_all +0 -0
  44. metadata +73 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9f9ef6cfba6dcb23b73d3a29760ed0f96c2811e9
4
- data.tar.gz: df6677e3a38ba43b9e629165675130009897169e
3
+ metadata.gz: c0b67bcc42aea036dcf1a3ae592ec5369debff97
4
+ data.tar.gz: ea1aee2c43cb55feef5aa907544e5b73feef0127
5
5
  SHA512:
6
- metadata.gz: 182d6613b9540f00b1457ee7960e5c412e65c4c06d69903cd09caeeacb840e21a20ff62973ff30bfc3c0c65a2ac3f76af575a0d34ce3f6723fca75cfa2059674
7
- data.tar.gz: 3926576e41b9c8f95bff18871d99ecea5d4d3cc4c51144c1a0af4cc12eb77b2305fbcee44599dbd6bf3758c559089685b082f79ad67447f8f13050d3e30e5050
6
+ metadata.gz: cef87f7a9881875c70e86223c253a237148b587d421bd4f00434171e57694a62d805bfc5e9a5ae40ffbcae57495c298ed7fa00820115510fbb65f76c1f1d0634
7
+ data.tar.gz: 41918aedf564f893a4b656b39eda2ef896912eab76661dbd3f13107555cdabc254f5977d37a3cb29e23f5c565ea939bb0160109aef12fea723ffd123deb77091
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,5 @@
1
+ class ResourcesController < ApplicationController
2
+ def index
3
+ @resources = Manifestation.page(params[:page])
4
+ end
5
+ end
@@ -69,10 +69,10 @@ module ManifestationsHelper
69
69
  current = true if languages.include?(language.name)
70
70
  if current
71
71
  content_tag :strong do
72
- link_to("#{language.display_name.localize} (" + facet.count.to_s + ")", url_for(params.merge(:page => nil, :language => language.name, :carrier_type => nil, :view => nil, :only_path => true)))
72
+ link_to("#{language.display_name.localize} (" + facet.count.to_s + ")", url_for(params.merge(:page => nil, :language => language.name, :view => nil, :only_path => true)))
73
73
  end
74
74
  else
75
- link_to("#{language.display_name.localize} (" + facet.count.to_s + ")", url_for(params.merge(:page => nil, :language => language.name, :carrier_type => nil, :view => nil, :only_path => true)))
75
+ link_to("#{language.display_name.localize} (" + facet.count.to_s + ")", url_for(params.merge(:page => nil, :language => language.name, :view => nil, :only_path => true)))
76
76
  end
77
77
  end
78
78
 
@@ -0,0 +1,2 @@
1
+ module ResourcesHelper
2
+ end
@@ -1,10 +1,10 @@
1
- <tr class="line<%= cycle("0", "1") -%>">
2
- <td style="width: 30px"><%= @manifestations.offset_value + 1 + manifestation_counter -%></td>
1
+ <tr class="line<%= cycle("0", "1") -%>">
2
+ <td style="width: 30px"><%= @manifestations.offset_value + 1 + manifestation_counter -%></td>
3
+ <% cache([:manifestation => manifestation.id, :fragment => 'manifestation_html', :role => current_user_role_name, :locale => @locale]) do %>
3
4
  <td style="480px">
4
5
  <% if manifestation.root_of_series? %>
5
6
  <%= render 'manifestations/show_series_index', :manifestation => manifestation -%>
6
7
  <% else %>
7
- <% cache([:manifestation => manifestation.id, :fragment => 'manifestation_html', :role => current_user_role_name, :locale => @locale]) do %>
8
8
  <%= render 'manifestations/show_index', :manifestation => manifestation -%>
9
9
  <div class="access_address">
10
10
  <%= link_to manifestation.access_address, manifestation.access_address if manifestation.access_address.present? -%>
@@ -19,14 +19,11 @@
19
19
  <%= render 'manifestations/show_tag', :manifestation => manifestation -%>
20
20
  <% end %>
21
21
  <%= render 'manifestations/holding', :manifestation => manifestation -%>
22
- <%# グループ表示の部分テンプレート %>
23
- <%= render 'manifestations/show_group', :manifestation => manifestation -%>
24
- <% end %>
25
22
  <% end %>
26
23
  </td>
27
- <% if defined?(EnjuCirculation) %>
28
- <% if signed_in? %>
29
- <td id="edit_icons">
24
+ <% if signed_in? %>
25
+ <td id="edit_icons">
26
+ <% if defined?(EnjuCirculation) %>
30
27
  <% unless params[:mode] == 'add' %>
31
28
  <% if manifestation.is_reservable_by?(current_user) %>
32
29
  <%- reserve = manifestation.is_reserved_by?(current_user) -%>
@@ -38,36 +35,37 @@
38
35
  <% end %>
39
36
  <br />
40
37
  <% end %>
41
- <%- if can? :update, manifestation -%>
42
- <% unless params[:mode] == 'add' %>
43
- <%= link_to image_tag('icons/book_edit.png', :size => '16x16', :alt => t('page.edit')), edit_manifestation_path(manifestation) -%>
44
- <% if @series_statement %>
45
- <% if manifestation.series_statement == @series_statement %>
46
- <%= link_to t('page.destroy'), series_statement_series_has_manifestation_path(manifestation.series_statement, manifestation.series_has_manifestation), :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%>
47
- <% end %>
38
+ <% end %>
39
+ <%- if can? :update, manifestation -%>
40
+ <% unless params[:mode] == 'add' %>
41
+ <%= link_to image_tag('icons/book_edit.png', :size => '16x16', :alt => t('page.edit')), edit_manifestation_path(manifestation) -%>
42
+ <% if @series_statement %>
43
+ <% if manifestation.series_statement == @series_statement %>
44
+ <%= link_to t('page.destroy'), series_statement_series_has_manifestation_path(manifestation.series_statement, manifestation.series_has_manifestation), :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%>
48
45
  <% end %>
49
- <% else %>
50
- <% case %>
51
- <% when @index_patron[:creator] %>
52
- <%= link_to t('page.add'), new_patron_create_path(@index_patron[:creator], :work_id => manifestation.id) unless manifestation.creators.include?(@index_patron[:creator]) -%>
53
- <% when @index_patron[:contributor] %>
54
- <%= link_to t('page.add'), new_patron_realize_path(@index_patron[:contributor], :expression_id => manifestation.id) unless manifestation.contributors.include?(@index_patron[:contributor]) -%>
55
- <% when @index_patron[:publisher] %>
56
- <%= link_to t('page.add'), new_patron_produce_path(@index_patron[:publisher], :manifestation_id => manifestation.id) unless manifestation.publishers.include?(@index_patron[:publisher]) -%>
57
- <% when @series_statement %>
58
- <% unless manifestation.series_statement -%>
59
- <%= link_to t('page.add'), new_series_has_manifestation_path(:series_statement_id => @series_statement.id, :manifestation_id => manifestation.id) -%>
60
- <% end %>
61
- <% when @manifestation %>
62
- <%= link_to t('page.add'), new_manifestation_manifestation_relationship_path(@manifestation, :child_id => manifestation.id) unless @manifestation.derived_manifestations.include?(manifestation) or @manifestation == manifestation -%>
63
- <% when @item %>
64
- <%= link_to t('page.change'), edit_exemplify_path(@item.exemplify, :manifestation_id => manifestation.id) unless @item.manifestation == manifestation -%>
65
- <% else %>
66
- <%= link_to image_tag('icons/arrow_divide.png', :size => '16x16', :alt => t('manifestation.add_derivation')), manifestation_manifestations_path(manifestation, :mode => 'add') -%>
46
+ <% end %>
47
+ <% else %>
48
+ <% case %>
49
+ <% when @index_patron[:creator] %>
50
+ <%= link_to t('page.add'), new_patron_create_path(@index_patron[:creator], :work_id => manifestation.id) unless manifestation.creators.include?(@index_patron[:creator]) -%>
51
+ <% when @index_patron[:contributor] %>
52
+ <%= link_to t('page.add'), new_patron_realize_path(@index_patron[:contributor], :expression_id => manifestation.id) unless manifestation.contributors.include?(@index_patron[:contributor]) -%>
53
+ <% when @index_patron[:publisher] %>
54
+ <%= link_to t('page.add'), new_patron_produce_path(@index_patron[:publisher], :manifestation_id => manifestation.id) unless manifestation.publishers.include?(@index_patron[:publisher]) -%>
55
+ <% when @series_statement %>
56
+ <% unless manifestation.series_statement -%>
57
+ <%= link_to t('page.add'), new_series_has_manifestation_path(:series_statement_id => @series_statement.id, :manifestation_id => manifestation.id) -%>
67
58
  <% end %>
68
- <%- end -%>
59
+ <% when @manifestation %>
60
+ <%= link_to t('page.add'), new_manifestation_manifestation_relationship_path(@manifestation, :child_id => manifestation.id) unless @manifestation.derived_manifestations.include?(manifestation) or @manifestation == manifestation -%>
61
+ <% when @item %>
62
+ <%= link_to t('page.change'), edit_exemplify_path(@item.exemplify, :manifestation_id => manifestation.id) unless @item.manifestation == manifestation -%>
63
+ <% else %>
64
+ <%= link_to image_tag('icons/arrow_divide.png', :size => '16x16', :alt => t('manifestation.add_derivation')), manifestation_manifestations_path(manifestation, :mode => 'add') -%>
65
+ <% end %>
69
66
  <%- end -%>
70
- </td>
71
- <%- end -%>
67
+ <%- end -%>
68
+ </td>
72
69
  <% end %>
73
- </tr>
70
+ <% end %>
71
+ </tr>
@@ -74,7 +74,7 @@
74
74
  </td>
75
75
  </tr>
76
76
  <tr>
77
- <td><%= t('activerecord.attributes.classification.category') %></td>
77
+ <td><%= t('activerecord.attributes.classification.category') %>:</td>
78
78
  <td></td>
79
79
  </tr>
80
80
  <% end %>
@@ -0,0 +1,7 @@
1
+ <ul>
2
+ <% @resources.each do |resource| %>
3
+ <li><%= resource.original_title %></li>
4
+ <% end %>
5
+ </ul>
6
+
7
+ <%= paginate(@resources) %>
@@ -1,3 +1,3 @@
1
1
  module EnjuFlower
2
- VERSION = "0.1.0.pre2"
2
+ VERSION = "0.1.0.pre3"
3
3
  end
@@ -51,10 +51,6 @@ class ApplicationController < ActionController::Base
51
51
  Sunspot.commit
52
52
  end
53
53
 
54
- def current_ability
55
- @current_ability ||= Ability.new(current_user, request.remote_ip)
56
- end
57
-
58
54
  def move_position(resource, direction, redirect = true)
59
55
  if ['higher', 'lower'].include?(direction)
60
56
  resource.send("move_#{direction}")
@@ -1,186 +1,207 @@
1
- class Ability
2
- include CanCan::Ability
1
+ #module EnjuBiblio
2
+ class Ability
3
+ include CanCan::Ability
3
4
 
4
- def initialize(user, ip_addess = nil)
5
- case user.try(:role).try(:name)
6
- when 'Administrator'
7
- can [:read, :update], ContentType
8
- can [:read, :update], Country
9
- can :manage, Create
10
- can :manage, CreateType
11
- can :manage, Donate
12
- can :manage, Exemplify
13
- can [:read, :update], Extent
14
- can [:read, :update], Frequency
15
- can [:read, :update], FormOfWork
16
- can [:read, :create, :update], Item
17
- can :destroy, Item do |item|
18
- item.deletable?
19
- end
20
- can :manage, ImportRequest
21
- can [:read, :update], Language
22
- can [:read, :update], License
23
- can [:read, :create, :update], Manifestation
24
- can :destroy, Manifestation do |manifestation|
25
- if defined?(EnjuCirculation)
26
- manifestation.items.empty? and !manifestation.periodical_master? and !manifestation.is_reserved?
27
- else
28
- manifestation.items.empty? and !manifestation.periodical_master?
5
+ def initialize(user, ip_address = '0.0.0.0')
6
+ case user.try(:role).try(:name)
7
+ when 'Administrator'
8
+ can [:read, :create, :update], CarrierType
9
+ can [:destroy, :delete], CarrierType do |carrier_type|
10
+ true unless carrier_type.manifestations.exists?
11
+ end if LibraryGroup.site_config.network_access_allowed?(ip_address)
12
+ can [:read, :create, :update], Item
13
+ can [:destroy, :delete], Item do |item|
14
+ item.removable?
29
15
  end
30
- end
31
- can [:read, :update], MediumOfPerformance
32
- can :manage, Own
33
- can [:read, :create, :update], Patron
34
- can :destroy, Patron do |patron|
35
- true
36
- end
37
- can :manage, CarrierType
38
- can :manage, PatronImportFile
39
- can :read, PatronImportResult
40
- can :manage, PatronRelationship
41
- can :manage, PatronRelationshipType
42
- can [:read, :update], PatronType
43
- can :manage, PictureFile
44
- can :manage, Produce
45
- can :manage, ProduceType
46
- can :manage, ManifestationRelationship
47
- can :manage, ManifestationRelationshipType
48
- can :manage, Realize
49
- can :manage, RealizeType
50
- can :manage, ResourceImportFile
51
- can :read, ResourceImportResult
52
- can :manage, SeriesHasManifestation
53
- can :manage, SeriesStatement
54
- can :manage, SeriesStatementRelationship
55
- when 'Librarian'
56
- can [:read, :update], CarrierType
57
- can :read, ContentType
58
- can :read, Country
59
- can :manage, Create
60
- can :manage, Donate
61
- can :manage, Exemplify
62
- can :read, Extent
63
- can :read, Frequency
64
- can :read, FormOfWork
65
- can :manage, ImportRequest
66
- can [:read, :create, :update], Item
67
- can :destroy, Item do |item|
68
- if defined?(EnjuCirculation)
69
- item.checkouts.not_returned.empty?
70
- else
71
- true
16
+ can [:read, :create, :update], Manifestation
17
+ can [:destroy, :delete], Manifestation do |manifestation|
18
+ manifestation.items.empty? and !manifestation.periodical_master?
72
19
  end
73
- end
74
- can :read, Language
75
- can :read, License
76
- can [:read, :create, :update], Manifestation
77
- can :destroy, Manifestation do |manifestation|
78
- if defined?(EnjuCirculation)
79
- manifestation.items.empty? and !manifestation.periodical_master? and !manifestation.is_reserved?
80
- else
20
+ can :manage, [
21
+ Create,
22
+ CreateType,
23
+ Donate,
24
+ Exemplify,
25
+ ImportRequest,
26
+ ManifestationRelationship,
27
+ ManifestationRelationshipType,
28
+ Own,
29
+ Patron,
30
+ PatronImportFile,
31
+ PatronRelationship,
32
+ PatronRelationshipType,
33
+ PictureFile,
34
+ Produce,
35
+ ProduceType,
36
+ Realize,
37
+ RealizeType,
38
+ ResourceImportFile,
39
+ SeriesStatement,
40
+ SeriesStatementRelationship,
41
+ SeriesHasManifestation
42
+ ]
43
+ can :update, [
44
+ ContentType,
45
+ Country,
46
+ Extent,
47
+ Frequency,
48
+ FormOfWork,
49
+ Language,
50
+ License,
51
+ MediumOfPerformance,
52
+ PatronType,
53
+ RequestStatusType,
54
+ RequestType
55
+ ] if LibraryGroup.site_config.network_access_allowed?(ip_address)
56
+ can :read, [
57
+ CarrierType,
58
+ ContentType,
59
+ Country,
60
+ Extent,
61
+ Frequency,
62
+ FormOfWork,
63
+ Language,
64
+ License,
65
+ MediumOfPerformance,
66
+ PatronImportResult,
67
+ PatronType,
68
+ RequestStatusType,
69
+ RequestType,
70
+ ResourceImportResult
71
+ ]
72
+ when 'Librarian'
73
+ can :manage, Item
74
+ can :index, Manifestation
75
+ can [:show, :create, :update], Manifestation
76
+ can [:destroy, :delete], Manifestation do |manifestation|
81
77
  manifestation.items.empty? and !manifestation.periodical_master?
82
78
  end
83
- end
84
- can :read, MediumOfPerformance
85
- can :manage, Own
86
- can [:index, :create], Patron
87
- can [:show, :update, :destroy], Patron do |patron|
88
- patron.required_role_id <= 3
89
- end
90
- can :manage, PatronImportFile
91
- can :read, PatronImportResult
92
- can :manage, PatronRelationship
93
- can :read, PatronRelationshipType
94
- can :read, PatronType
95
- can :manage, PictureFile
96
- can :manage, Produce
97
- can :manage, ManifestationRelationship
98
- can :read, ManifestationRelationshipType
99
- can :manage, Realize
100
- can :manage, ResourceImportFile
101
- can :read, ResourceImportResult
102
- can :manage, SeriesHasManifestation
103
- can :manage, SeriesStatement
104
- can :manage, SeriesStatementRelationship
105
- when 'User'
106
- can :read, CarrierType
107
- can :read, ContentType
108
- can :read, Country
109
- can :read, Create
110
- can :read, Exemplify
111
- can :read, Extent
112
- can :read, Frequency
113
- can :read, FormOfWork
114
- can :index, Item
115
- can :show, Item do |item|
116
- item.required_role_id <= 2
117
- end
118
- can :read, Language
119
- can :read, License
120
- can [:read, :edit], Manifestation do |manifestation|
121
- manifestation.required_role_id <= 2
122
- end
123
- can :read, ManifestationRelationship
124
- can :read, ManifestationRelationshipType
125
- can :read, MediumOfPerformance
126
- can :read, Own
127
- can :index, Patron
128
- can :show, Patron do |patron|
129
- true if patron.required_role_id <= 2
130
- end
131
- can :read, PatronRelationship
132
- can :read, PatronRelationshipType
133
- can :index, PictureFile
134
- can :show, PictureFile do |picture_file|
135
- begin
136
- true if picture_file.picture_attachable.required_role_id <= 2
137
- rescue NoMethodError
138
- true
79
+ can [:index, :create], Patron
80
+ can :show, Patron do |patron|
81
+ patron.required_role_id <= 3
139
82
  end
140
- end
141
- can :show, User
142
- can :read, Produce
143
- can :read, Realize
144
- can :read, SeriesHasManifestation
145
- can :read, SeriesStatement
146
- else
147
- can :read, CarrierType
148
- can :read, ContentType
149
- can :read, Country
150
- can :read, Create
151
- can :read, Exemplify
152
- can :read, Extent
153
- can :read, Frequency
154
- can :read, FormOfWork
155
- can :read, Item
156
- can :read, Language
157
- can :read, License
158
- can :read, Manifestation do |manifestation|
159
- manifestation.required_role_id <= 1
160
- end
161
- can :read, ManifestationRelationship
162
- can :read, ManifestationRelationshipType
163
- can :read, MediumOfPerformance
164
- can :read, Own
165
- can :index, Patron
166
- can :show, Patron do |patron|
167
- true if patron.required_role_id <= 1
168
- end
169
- can :read, PatronRelationship
170
- can :read, PatronRelationshipType
171
- can :index, PictureFile
172
- can :show, PictureFile do |picture_file|
173
- begin
174
- true if picture_file.picture_attachable.required_role_id <= 2
175
- rescue NoMethodError
176
- true
83
+ can [:update, :destroy, :delete], Patron do |patron|
84
+ !patron.user.try(:has_role?, 'Librarian') and patron.required_role_id <= 3
85
+ end
86
+ can :manage, [
87
+ Create,
88
+ Donate,
89
+ Exemplify,
90
+ ImportRequest,
91
+ ManifestationRelationship,
92
+ Own,
93
+ PatronImportFile,
94
+ PatronRelationship,
95
+ PictureFile,
96
+ Produce,
97
+ Realize,
98
+ ResourceImportFile,
99
+ SeriesStatement,
100
+ SeriesStatementRelationship,
101
+ SeriesHasManifestation
102
+ ]
103
+ can :read, [
104
+ CarrierType,
105
+ ContentType,
106
+ Country,
107
+ Extent,
108
+ Frequency,
109
+ FormOfWork,
110
+ Language,
111
+ License,
112
+ ManifestationRelationshipType,
113
+ PatronImportResult,
114
+ PatronRelationshipType,
115
+ PatronType,
116
+ RequestStatusType,
117
+ RequestType,
118
+ ResourceImportResult,
119
+ MediumOfPerformance
120
+ ]
121
+ when 'User'
122
+ can :index, Item
123
+ can :show, Item do |item|
124
+ item.required_role_id <= 2
125
+ end
126
+ can :index, Manifestation
127
+ can [:show, :edit], Manifestation do |manifestation|
128
+ manifestation.required_role_id <= 2
129
+ end
130
+ can :index, Patron
131
+ can :update, Patron do |patron|
132
+ patron.user == user
133
+ end
134
+ can :show, Patron do |patron|
135
+ #if patron.user == user
136
+ # true
137
+ #elsif patron.user != user
138
+ true if patron.required_role_id <= 2 #name == 'Administrator'
139
+ #end
140
+ end
141
+ can :index, PictureFile
142
+ can :show, PictureFile do |picture_file|
143
+ begin
144
+ true if picture_file.picture_attachable.required_role_id <= 2
145
+ rescue NoMethodError
146
+ true
147
+ end
148
+ end
149
+ can :read, [
150
+ CarrierType,
151
+ ContentType,
152
+ Country,
153
+ Create,
154
+ Exemplify,
155
+ Extent,
156
+ Frequency,
157
+ FormOfWork,
158
+ Language,
159
+ License,
160
+ ManifestationRelationship,
161
+ ManifestationRelationshipType,
162
+ MediumOfPerformance,
163
+ Own,
164
+ PatronRelationship,
165
+ PatronRelationshipType,
166
+ Produce,
167
+ Realize,
168
+ SeriesStatement,
169
+ SeriesHasManifestation
170
+ ]
171
+ else
172
+ can :index, Manifestation
173
+ can :show, Manifestation do |manifestation|
174
+ manifestation.required_role_id == 1
175
+ end
176
+ can :index, Patron
177
+ can :show, Patron do |patron|
178
+ patron.required_role_id == 1 #name == 'Guest'
177
179
  end
180
+ can :read, [
181
+ CarrierType,
182
+ ContentType,
183
+ Country,
184
+ Create,
185
+ Exemplify,
186
+ Extent,
187
+ Frequency,
188
+ FormOfWork,
189
+ Item,
190
+ Language,
191
+ License,
192
+ ManifestationRelationship,
193
+ ManifestationRelationshipType,
194
+ MediumOfPerformance,
195
+ Own,
196
+ PatronRelationship,
197
+ PatronRelationshipType,
198
+ PictureFile,
199
+ Produce,
200
+ Realize,
201
+ SeriesStatement,
202
+ SeriesHasManifestation
203
+ ]
178
204
  end
179
- can :show, User
180
- can :read, Produce
181
- can :read, Realize
182
- can :read, SeriesHasManifestation
183
- can :read, SeriesStatement
184
205
  end
185
206
  end
186
- end
207
+ #end
Binary file
@@ -0,0 +1,7 @@
1
+ ����*idtype
2
+ class_nametitle_smconnect_title_sconnect_creator_sconnect_publisher_sisbn_smcarrier_type_s
3
+ library_sm
4
+ language_sitem_identifier_smshelf_sm created_at_d updated_at_dcreator_ids_imcontributor_ids_impublisher_ids_im item_ids_imrequired_role_id_i start_page_i
5
+ end_page_inumber_of_pages_iseries_statement_id_irepository_content_b
6
+ creator_sm sort_title_s periodical_bperiodical_master_b
7
+ title_text creator_textcontributor_textpublisher_textitem_identifier_text aulast_text aufirst_textau_text btitle_text isbn_textoriginal_manifestation_ids_im jtitle_text pub_date_dm
@@ -0,0 +1 @@
1
+ NRM�turxtuxutrtwsssuuvyrttrvrrtxtxswuywtrtyvywtuwwttptxy|||||||||||tuuu|||||||||||||||||||||||||||||||||wxwwx|||||||||||||||||||||||||||||||||||||||||||||wxwwx|||||||||||||||||||||||||||u|||||||||||||||||uvw|||||||x|||||||||||||||||||||||||||||||||||||||y||||||||||||w���|||||||||||||||||||||||||||||||||��|||||||||||w���|||||||||||||||||||||||||||||||||xy|||||||||||tuuu|||||||||||||||||||||||||||||||||turxtuxutrtwsssuuvyrttrvrrtxtxswuywtrtyvywtuwwttpt||||��|||||��||||||||||||||||||||||||||||||||||||||tu|||||||||||||||||||||||||||||||||||||||||||||||
@@ -0,0 +1,7 @@
1
+ ����*idtype
2
+ class_nametitle_smconnect_title_sconnect_creator_sconnect_publisher_sisbn_smcarrier_type_s
3
+ library_sm
4
+ language_sitem_identifier_smshelf_sm created_at_d updated_at_dcreator_ids_imcontributor_ids_impublisher_ids_im item_ids_imrequired_role_id_i start_page_i
5
+ end_page_inumber_of_pages_iseries_statement_id_irepository_content_b
6
+ creator_sm sort_title_s periodical_bperiodical_master_b
7
+ title_text creator_textcontributor_textpublisher_textitem_identifier_text aulast_text aufirst_textau_text btitle_text isbn_textoriginal_manifestation_ids_im jtitle_text pub_date_dm
@@ -0,0 +1 @@
1
+ NRM�xuuwuyutxxvxvxwtyvxwxxxvvtwwxvytwxwrwvxxyxuyxyuysx||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||xuuwuyutxxvxvxwtyvxwxxxvvtwwxvytwxwrwvxxyxuyxyuysx||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
@@ -0,0 +1,8 @@
1
+ ����2idtype
2
+ class_nametitle_smconnect_title_sconnect_creator_sconnect_publisher_sisbn_smcarrier_type_s
3
+ library_sm
4
+ language_sitem_identifier_smshelf_sm created_at_d updated_at_dcreator_ids_imcontributor_ids_impublisher_ids_im item_ids_imrequired_role_id_i start_page_i
5
+ end_page_inumber_of_pages_iseries_statement_id_irepository_content_b
6
+ creator_sm sort_title_s periodical_bperiodical_master_b
7
+ title_text creator_textcontributor_textpublisher_textitem_identifier_text aulast_text aufirst_textau_text btitle_text isbn_textoriginal_manifestation_ids_im jtitle_text pub_date_dmissn_sm issn_textvolume_number_iissue_number_iserial_number_i atitle_textdate_of_publication_d
8
+ pub_year_i
@@ -0,0 +1 @@
1
+ NRM�vruwvvuur|xutttttwwuuuuuuxx||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||xtt|uuutt||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||vruwvvuur|xu||tttwwuuuuuuxx|||||y|||��|||||||���������||||||||||||xw|||||||||||||||||||||||||y||||||||||||||||||||||||||tt|||||||||||||
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enju_flower
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre2
4
+ version: 0.1.0.pre3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kosuke Tanabe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-16 00:00:00.000000000 Z
11
+ date: 2013-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: 3.2.13.rc2
19
+ version: '3.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ~>
25
25
  - !ruby/object:Gem::Version
26
- version: 3.2.13.rc2
26
+ version: '3.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sqlite3
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -114,28 +114,28 @@ dependencies:
114
114
  requirements:
115
115
  - - ~>
116
116
  - !ruby/object:Gem::Version
117
- version: 0.1.0.pre25
117
+ version: 0.1.0.pre28
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - ~>
123
123
  - !ruby/object:Gem::Version
124
- version: 0.1.0.pre25
124
+ version: 0.1.0.pre28
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: enju_library
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ~>
130
130
  - !ruby/object:Gem::Version
131
- version: 0.1.0.pre13
131
+ version: 0.1.0.pre16
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - ~>
137
137
  - !ruby/object:Gem::Version
138
- version: 0.1.0.pre13
138
+ version: 0.1.0.pre16
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: mobylette
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -157,7 +157,11 @@ executables: []
157
157
  extensions: []
158
158
  extra_rdoc_files: []
159
159
  files:
160
+ - app/assets/javascripts/resources.js
161
+ - app/assets/stylesheets/resources.css
162
+ - app/controllers/resources_controller.rb
160
163
  - app/helpers/manifestations_helper.rb
164
+ - app/helpers/resources_helper.rb
161
165
  - app/views/manifestations/_all_facet.html.erb
162
166
  - app/views/manifestations/_attachment_file.html.erb
163
167
  - app/views/manifestations/_book_jacket.html.erb
@@ -225,6 +229,7 @@ files:
225
229
  - app/views/page/_footer.mobile.erb
226
230
  - app/views/page/add_on.html.erb
227
231
  - app/views/page/msie_acceralator.builder
232
+ - app/views/resources/index.html.erb
228
233
  - config/routes.rb
229
234
  - lib/enju_flower/engine.rb
230
235
  - lib/enju_flower/version.rb
@@ -452,6 +457,36 @@ files:
452
457
  - spec/dummy/solr/conf/spellings.txt
453
458
  - spec/dummy/solr/conf/stopwords.txt
454
459
  - spec/dummy/solr/conf/synonyms.txt
460
+ - spec/dummy/solr/data/test/index/_6m.fdt
461
+ - spec/dummy/solr/data/test/index/_6m.fdx
462
+ - spec/dummy/solr/data/test/index/_6m.fnm
463
+ - spec/dummy/solr/data/test/index/_6m.frq
464
+ - spec/dummy/solr/data/test/index/_6m.nrm
465
+ - spec/dummy/solr/data/test/index/_6m.prx
466
+ - spec/dummy/solr/data/test/index/_6m.tii
467
+ - spec/dummy/solr/data/test/index/_6m.tis
468
+ - spec/dummy/solr/data/test/index/_6n.fdt
469
+ - spec/dummy/solr/data/test/index/_6n.fdx
470
+ - spec/dummy/solr/data/test/index/_6n.fnm
471
+ - spec/dummy/solr/data/test/index/_6n.frq
472
+ - spec/dummy/solr/data/test/index/_6n.nrm
473
+ - spec/dummy/solr/data/test/index/_6n.prx
474
+ - spec/dummy/solr/data/test/index/_6n.tii
475
+ - spec/dummy/solr/data/test/index/_6n.tis
476
+ - spec/dummy/solr/data/test/index/_6o.fdt
477
+ - spec/dummy/solr/data/test/index/_6o.fdx
478
+ - spec/dummy/solr/data/test/index/_6o.fnm
479
+ - spec/dummy/solr/data/test/index/_6o.frq
480
+ - spec/dummy/solr/data/test/index/_6o.nrm
481
+ - spec/dummy/solr/data/test/index/_6o.prx
482
+ - spec/dummy/solr/data/test/index/_6o.tii
483
+ - spec/dummy/solr/data/test/index/_6o.tis
484
+ - spec/dummy/solr/data/test/index/segments.gen
485
+ - spec/dummy/solr/data/test/index/segments_90
486
+ - spec/dummy/solr/data/test/spellchecker/segments.gen
487
+ - spec/dummy/solr/data/test/spellchecker/segments_1
488
+ - spec/dummy/tmp/cache/4F7/F90/default_role
489
+ - spec/dummy/tmp/cache/6E4/420/search_engine_all
455
490
  - spec/factories/basket.rb
456
491
  - spec/factories/carrier_type.rb
457
492
  - spec/factories/content_type.rb
@@ -773,6 +808,36 @@ test_files:
773
808
  - spec/dummy/solr/conf/spellings.txt
774
809
  - spec/dummy/solr/conf/stopwords.txt
775
810
  - spec/dummy/solr/conf/synonyms.txt
811
+ - spec/dummy/solr/data/test/index/_6m.fdt
812
+ - spec/dummy/solr/data/test/index/_6m.fdx
813
+ - spec/dummy/solr/data/test/index/_6m.fnm
814
+ - spec/dummy/solr/data/test/index/_6m.frq
815
+ - spec/dummy/solr/data/test/index/_6m.nrm
816
+ - spec/dummy/solr/data/test/index/_6m.prx
817
+ - spec/dummy/solr/data/test/index/_6m.tii
818
+ - spec/dummy/solr/data/test/index/_6m.tis
819
+ - spec/dummy/solr/data/test/index/_6n.fdt
820
+ - spec/dummy/solr/data/test/index/_6n.fdx
821
+ - spec/dummy/solr/data/test/index/_6n.fnm
822
+ - spec/dummy/solr/data/test/index/_6n.frq
823
+ - spec/dummy/solr/data/test/index/_6n.nrm
824
+ - spec/dummy/solr/data/test/index/_6n.prx
825
+ - spec/dummy/solr/data/test/index/_6n.tii
826
+ - spec/dummy/solr/data/test/index/_6n.tis
827
+ - spec/dummy/solr/data/test/index/_6o.fdt
828
+ - spec/dummy/solr/data/test/index/_6o.fdx
829
+ - spec/dummy/solr/data/test/index/_6o.fnm
830
+ - spec/dummy/solr/data/test/index/_6o.frq
831
+ - spec/dummy/solr/data/test/index/_6o.nrm
832
+ - spec/dummy/solr/data/test/index/_6o.prx
833
+ - spec/dummy/solr/data/test/index/_6o.tii
834
+ - spec/dummy/solr/data/test/index/_6o.tis
835
+ - spec/dummy/solr/data/test/index/segments.gen
836
+ - spec/dummy/solr/data/test/index/segments_90
837
+ - spec/dummy/solr/data/test/spellchecker/segments.gen
838
+ - spec/dummy/solr/data/test/spellchecker/segments_1
839
+ - spec/dummy/tmp/cache/4F7/F90/default_role
840
+ - spec/dummy/tmp/cache/6E4/420/search_engine_all
776
841
  - spec/factories/basket.rb
777
842
  - spec/factories/carrier_type.rb
778
843
  - spec/factories/content_type.rb