enju_flower 0.1.0.pre22 → 0.1.0.pre23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/app/views/manifestations/_manifestation.html.erb +2 -3
- data/app/views/manifestations/_show_creators.html.erb +2 -2
- data/app/views/manifestations/_show_detail_librarian.html.erb +6 -0
- data/app/views/manifestations/show.html.erb +1 -1
- data/lib/enju_flower/engine.rb +2 -0
- data/lib/enju_flower/version.rb +1 -1
- data/spec/dummy/app/models/user.rb +1 -0
- data/spec/factories/user.rb +0 -3
- data/spec/fixtures/item_has_use_restrictions.yml +60 -0
- data/spec/views/manifestations/index.html.erb_spec.rb +0 -35
- data/spec/views/manifestations/show.html.erb_spec.rb +4 -1
- metadata +13 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7655037b45dfd20776d9e8e949f94c8865bd0cb8
|
4
|
+
data.tar.gz: a38c82612797330fc478e36c697fa2cd96d0b2df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5af23cdcdf03b9ca1bec945c16a37d81d868ebf10973b6d47155e64a8dfde69117647aaa0bdbc827e15e45215c8832b39615648c649d22f63957bf3828ff0404
|
7
|
+
data.tar.gz: 7f2734294c1801faaaf6acff8cc7867bb8fe67e0c079c4e9a5371d6fc28a411947e926d6e1ecd5c5d5cda2a217e60d9491e82de728a572bef5da640d3ab2a9ee
|
data/MIT-LICENSE
CHANGED
@@ -34,12 +34,11 @@
|
|
34
34
|
<% if manifestation.is_reservable_by?(current_user) %>
|
35
35
|
<%- reserve = manifestation.is_reserved_by?(current_user) -%>
|
36
36
|
<%- if reserve -%>
|
37
|
-
<%= link_to t('reserve.show'), reserve
|
37
|
+
<%= link_to t('reserve.show'), reserve -%><br />
|
38
38
|
<%- else -%>
|
39
|
-
<%= link_to t('activerecord.models.reserve'), new_reserve_path(manifestation_id: manifestation.id) if can? :create, Reserve
|
39
|
+
<%= link_to t('activerecord.models.reserve'), new_reserve_path(manifestation_id: manifestation.id) if can? :create, Reserve -%><br />
|
40
40
|
<%- end -%>
|
41
41
|
<% end %>
|
42
|
-
<br />
|
43
42
|
<% end %>
|
44
43
|
<% end %>
|
45
44
|
<%- if can? :update, manifestation -%>
|
@@ -16,8 +16,8 @@
|
|
16
16
|
(<%= manifestation.pub_date -%>)
|
17
17
|
<%- end -%>
|
18
18
|
<% if defined?(EnjuSubject) %>
|
19
|
-
;
|
20
|
-
<% manifestation.classifications.
|
19
|
+
<%= ';' if manifestation.classifications.count >= 1 %>
|
20
|
+
<% manifestation.classifications.each_with_index do |classification| %>
|
21
21
|
<%= link_to "#{classification.classification_type.display_name.localize}: #{classification.category}", manifestations_path(query: "classification_sm:#{classification.classification_type.name}_#{classification.category}") %>
|
22
22
|
<% end %>
|
23
23
|
<% end %>
|
@@ -77,6 +77,12 @@
|
|
77
77
|
<%= identifier_link(identifier) %>
|
78
78
|
</li>
|
79
79
|
<% end %>
|
80
|
+
<% if manifestation.manifestation_identifier %>
|
81
|
+
<li>
|
82
|
+
<%= t('activerecord.attributes.manifestation.manifestation_identifier') %>:
|
83
|
+
<%= manifestation.manifestation_identifier %>
|
84
|
+
</li>
|
85
|
+
<% end %>
|
80
86
|
</ul>
|
81
87
|
</td>
|
82
88
|
</tr>
|
@@ -46,7 +46,7 @@
|
|
46
46
|
<ul>
|
47
47
|
<%- if user_signed_in? -%>
|
48
48
|
<%- if current_user.email.present? -%>
|
49
|
-
<li><%= link_to t('manifestation.send_email'), manifestation_path(mode: 'send_email'), data: {confirm: t('page.are_you_sure')} -%></li>
|
49
|
+
<li><%= link_to t('manifestation.send_email'), manifestation_path(@manifestation, mode: 'send_email'), data: {confirm: t('page.are_you_sure')} -%></li>
|
50
50
|
<%- end -%>
|
51
51
|
<% if defined?(EnjuBookmark) %>
|
52
52
|
<li><%= link_to_bookmark(@manifestation) %></li>
|
data/lib/enju_flower/engine.rb
CHANGED
data/lib/enju_flower/version.rb
CHANGED
data/spec/factories/user.rb
CHANGED
@@ -2,7 +2,6 @@ FactoryGirl.define do
|
|
2
2
|
factory :admin, :class => User do |f|
|
3
3
|
f.sequence(:username){|n| "admin_#{n}"}
|
4
4
|
f.sequence(:email){|n| "admin_#{n}@example.jp"}
|
5
|
-
f.email_confirmation{|u| u.email}
|
6
5
|
f.password 'adminpassword'
|
7
6
|
f.password_confirmation 'adminpassword'
|
8
7
|
f.after(:create) do |user|
|
@@ -16,7 +15,6 @@ FactoryGirl.define do
|
|
16
15
|
factory :librarian, :class => User do |f|
|
17
16
|
f.sequence(:username){|n| "librarian_#{n}"}
|
18
17
|
f.sequence(:email){|n| "librarian_#{n}@example.jp"}
|
19
|
-
f.email_confirmation{|u| u.email}
|
20
18
|
f.password 'librarianpassword'
|
21
19
|
f.password_confirmation 'librarianpassword'
|
22
20
|
f.after(:create) do |user|
|
@@ -30,7 +28,6 @@ FactoryGirl.define do
|
|
30
28
|
factory :user, :class => User do |f|
|
31
29
|
f.sequence(:username){|n| "user_#{n}"}
|
32
30
|
f.sequence(:email){|n| "user_#{n}@example.jp"}
|
33
|
-
f.email_confirmation{|u| u.email}
|
34
31
|
f.password 'userpassword'
|
35
32
|
f.password_confirmation 'userpassword'
|
36
33
|
f.after(:create) do |user|
|
@@ -0,0 +1,60 @@
|
|
1
|
+
---
|
2
|
+
item_has_use_restriction_00001:
|
3
|
+
item_id: 1
|
4
|
+
updated_at: 2008-02-13 12:29:36.013448 +09:00
|
5
|
+
id: 1
|
6
|
+
use_restriction_id: 10
|
7
|
+
created_at: 2008-02-13 12:29:36.013448 +09:00
|
8
|
+
item_has_use_restriction_00002:
|
9
|
+
item_id: 2
|
10
|
+
updated_at: 2008-02-13 17:58:37.527556 +09:00
|
11
|
+
id: 2
|
12
|
+
use_restriction_id: 2
|
13
|
+
created_at: 2008-02-13 17:58:37.527556 +09:00
|
14
|
+
item_has_use_restriction_00003:
|
15
|
+
item_id: 3
|
16
|
+
updated_at: 2008-02-13 17:58:49.490086 +09:00
|
17
|
+
id: 3
|
18
|
+
use_restriction_id: 3
|
19
|
+
created_at: 2008-02-13 17:58:49.490086 +09:00
|
20
|
+
item_has_use_restriction_00004:
|
21
|
+
item_id: 17
|
22
|
+
updated_at: 2008-02-13 12:29:36.013448 +09:00
|
23
|
+
id: 4
|
24
|
+
use_restriction_id: 4
|
25
|
+
created_at: 2008-02-13 12:29:36.013448 +09:00
|
26
|
+
item_has_use_restriction_00005:
|
27
|
+
item_id: 21
|
28
|
+
updated_at: 2008-02-13 12:29:36.013448 +09:00
|
29
|
+
id: 5
|
30
|
+
use_restriction_id: 4
|
31
|
+
created_at: 2008-02-13 12:29:36.013448 +09:00
|
32
|
+
item_has_use_restriction_00006:
|
33
|
+
item_id: 11
|
34
|
+
updated_at: 2008-02-13 12:29:36.013448 +09:00
|
35
|
+
id: 6
|
36
|
+
use_restriction_id: 4
|
37
|
+
created_at: 2008-02-13 12:29:36.013448 +09:00
|
38
|
+
item_has_use_restriction_00007:
|
39
|
+
item_id: 6
|
40
|
+
updated_at: 2008-02-13 12:29:36.013448 +09:00
|
41
|
+
id: 7
|
42
|
+
use_restriction_id: 4
|
43
|
+
created_at: 2008-02-13 12:29:36.013448 +09:00
|
44
|
+
item_has_use_restriction_00008:
|
45
|
+
item_id: 24
|
46
|
+
updated_at: 2008-02-13 12:29:36.013448 +09:00
|
47
|
+
id: 8
|
48
|
+
use_restriction_id: 4
|
49
|
+
created_at: 2008-02-13 12:29:36.013448 +09:00
|
50
|
+
|
51
|
+
# == Schema Information
|
52
|
+
#
|
53
|
+
# Table name: item_has_use_restrictions
|
54
|
+
#
|
55
|
+
# id :integer not null, primary key
|
56
|
+
# item_id :integer not null
|
57
|
+
# use_restriction_id :integer not null
|
58
|
+
# created_at :datetime
|
59
|
+
# updated_at :datetime
|
60
|
+
#
|
@@ -35,39 +35,4 @@ describe "manifestations/index" do
|
|
35
35
|
render
|
36
36
|
#expect( rendered ).to have_selector( "div.holding_index tr td:first-child", count: 3, visible: false )
|
37
37
|
end
|
38
|
-
|
39
|
-
it "render items with default sort order" do
|
40
|
-
allow(view).to receive(:policy).and_return double(create?: true, update?: true)
|
41
|
-
item1 = FactoryGirl.create( :item_for_checkout, shelf_id: 2 )
|
42
|
-
item2 = FactoryGirl.create( :item_for_checkout, shelf_id: 4 )
|
43
|
-
@manifestations.first.items = [ item1, item2 ]
|
44
|
-
render
|
45
|
-
expect( rendered ).to have_selector( "div.holding_index tr td:first-child a", visible: false, text: item1.item_identifier )
|
46
|
-
end
|
47
|
-
|
48
|
-
it "render items with sort order to prefer user's library" do
|
49
|
-
allow(view).to receive(:policy).and_return double(create?: true, update?: true)
|
50
|
-
user = FactoryGirl.create(:user)
|
51
|
-
user.profile = FactoryGirl.create(:profile, library_id: 3)
|
52
|
-
sign_in( user )
|
53
|
-
|
54
|
-
item1 = FactoryGirl.create( :item_for_checkout, shelf_id: 2 )
|
55
|
-
item2 = FactoryGirl.create( :item_for_checkout, shelf_id: 4 )
|
56
|
-
@manifestations.first.items = [ item1, item2 ]
|
57
|
-
render
|
58
|
-
expect( rendered ).to have_selector( "div.holding_index tr:nth-child(2) td:first-child a", visible: false )
|
59
|
-
end
|
60
|
-
|
61
|
-
it "render items with sort order to prefer user's library for a different user" do
|
62
|
-
allow(view).to receive(:policy).and_return double(create?: true, update?: true)
|
63
|
-
user = FactoryGirl.create(:user)
|
64
|
-
user.profile = FactoryGirl.create(:profile, library_id: 2)
|
65
|
-
sign_in( user )
|
66
|
-
|
67
|
-
item1 = FactoryGirl.create( :item_for_checkout, shelf_id: 2 )
|
68
|
-
item2 = FactoryGirl.create( :item_for_checkout, shelf_id: 4 )
|
69
|
-
@manifestations.first.items = [ item2, item1 ]
|
70
|
-
render
|
71
|
-
expect( rendered ).to have_selector( "div.holding_index tr:nth-child(2) td:first-child a", visible: false, text: item1.item_identifier )
|
72
|
-
end
|
73
38
|
end
|
@@ -4,10 +4,13 @@ describe "manifestations/show" do
|
|
4
4
|
fixtures :all
|
5
5
|
|
6
6
|
before(:each) do
|
7
|
-
@manifestation =
|
7
|
+
@manifestation = FactoryGirl.create(:manifestation)
|
8
8
|
@ability = Object.new
|
9
9
|
@ability.extend(CanCan::Ability)
|
10
10
|
controller.stub(:current_ability) { @ability }
|
11
|
+
@item1 = FactoryGirl.create( :item_for_checkout, shelf_id: 2 )
|
12
|
+
@item2 = FactoryGirl.create( :item_for_checkout, shelf_id: 4 )
|
13
|
+
assign(:manifestation, @manifestation)
|
11
14
|
end
|
12
15
|
|
13
16
|
it "renders attributes in <p>" do
|
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.
|
4
|
+
version: 0.1.0.pre23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kosuke Tanabe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sqlite3
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '3.
|
61
|
+
version: '3.3'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '3.
|
68
|
+
version: '3.3'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: vcr
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.1.0.
|
131
|
+
version: 1.1.0.rc20
|
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: 1.1.0.
|
138
|
+
version: 1.1.0.rc20
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: enju_manifestation_viewer
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,14 +156,14 @@ dependencies:
|
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 0.1.0.
|
159
|
+
version: 0.1.0.pre47
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: 0.1.0.
|
166
|
+
version: 0.1.0.pre47
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: enju_bookmark
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -184,14 +184,14 @@ dependencies:
|
|
184
184
|
requirements:
|
185
185
|
- - "~>"
|
186
186
|
- !ruby/object:Gem::Version
|
187
|
-
version: 0.1.0.
|
187
|
+
version: 0.1.0.pre33
|
188
188
|
type: :development
|
189
189
|
prerelease: false
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
192
|
- - "~>"
|
193
193
|
- !ruby/object:Gem::Version
|
194
|
-
version: 0.1.0.
|
194
|
+
version: 0.1.0.pre33
|
195
195
|
- !ruby/object:Gem::Dependency
|
196
196
|
name: mobylette
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
@@ -631,6 +631,7 @@ files:
|
|
631
631
|
- spec/fixtures/identifier_types.yml
|
632
632
|
- spec/fixtures/identifiers.yml
|
633
633
|
- spec/fixtures/import_requests.yml
|
634
|
+
- spec/fixtures/item_has_use_restrictions.yml
|
634
635
|
- spec/fixtures/items.yml
|
635
636
|
- spec/fixtures/languages.yml
|
636
637
|
- spec/fixtures/libraries.yml
|
@@ -688,7 +689,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
688
689
|
version: 1.3.1
|
689
690
|
requirements: []
|
690
691
|
rubyforge_project:
|
691
|
-
rubygems_version: 2.4.5
|
692
|
+
rubygems_version: 2.4.5.1
|
692
693
|
signing_key:
|
693
694
|
specification_version: 4
|
694
695
|
summary: Next-L Enju Flower
|
@@ -985,6 +986,7 @@ test_files:
|
|
985
986
|
- spec/fixtures/identifier_types.yml
|
986
987
|
- spec/fixtures/identifiers.yml
|
987
988
|
- spec/fixtures/import_requests.yml
|
989
|
+
- spec/fixtures/item_has_use_restrictions.yml
|
988
990
|
- spec/fixtures/items.yml
|
989
991
|
- spec/fixtures/languages.yml
|
990
992
|
- spec/fixtures/libraries.yml
|