enju_library 0.1.2 → 0.2.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +3 -3
- data/Rakefile +15 -8
- data/app/controllers/accepts_controller.rb +13 -3
- data/app/controllers/baskets_controller.rb +11 -1
- data/app/controllers/bookstores_controller.rb +12 -1
- data/app/controllers/budget_types_controller.rb +13 -2
- data/app/controllers/concerns/enju_library/controller.rb +43 -0
- data/app/controllers/libraries_controller.rb +13 -4
- data/app/controllers/library_groups_controller.rb +16 -6
- data/app/controllers/request_status_types_controller.rb +13 -2
- data/app/controllers/request_types_controller.rb +13 -2
- data/app/controllers/search_engines_controller.rb +13 -2
- data/app/controllers/shelves_controller.rb +14 -4
- data/app/controllers/subscribes_controller.rb +12 -2
- data/app/controllers/subscriptions_controller.rb +12 -3
- data/app/controllers/withdraws_controller.rb +14 -3
- data/app/helpers/shelves_helper.rb +2 -2
- data/app/models/accept.rb +2 -4
- data/app/models/basket.rb +0 -2
- data/app/models/budget_type.rb +0 -1
- data/app/models/concerns/enju_library/enju_item.rb +32 -0
- data/app/models/library_group.rb +9 -16
- data/app/models/request_status_type.rb +0 -1
- data/app/models/request_type.rb +0 -1
- data/app/models/search_engine.rb +0 -1
- data/app/models/withdraw.rb +8 -4
- data/app/policies/accept_policy.rb +21 -0
- data/app/policies/basket_policy.rb +21 -0
- data/app/policies/bookstore_policy.rb +23 -0
- data/app/policies/budget_type_policy.rb +21 -0
- data/app/policies/library_group_policy.rb +23 -0
- data/app/policies/library_policy.rb +25 -0
- data/app/policies/request_status_type_policy.rb +21 -0
- data/app/policies/request_type_policy.rb +21 -0
- data/app/policies/search_engine_policy.rb +21 -0
- data/app/policies/shelf_policy.rb +23 -0
- data/app/policies/subscribe_policy.rb +21 -0
- data/app/policies/subscription_policy.rb +21 -0
- data/app/policies/withdraw_policy.rb +21 -0
- data/app/views/accepts/index.html.erb +1 -1
- data/app/views/accepts/show.html.erb +1 -1
- data/app/views/baskets/edit.html.erb +1 -1
- data/app/views/baskets/new.html.erb +3 -1
- data/app/views/bookstores/index.html.erb +4 -4
- data/app/views/bookstores/show.html.erb +2 -2
- data/app/views/budget_types/index.html.erb +4 -4
- data/app/views/budget_types/show.html.erb +2 -2
- data/app/views/libraries/{_map.mobile.erb → _map.html+phone.erb} +0 -0
- data/app/views/libraries/index.html.erb +4 -4
- data/app/views/libraries/{show.mobile.erb → show.html+phone.erb} +0 -0
- data/app/views/libraries/show.html.erb +5 -5
- data/app/views/library_groups/_color_fields.html.erb +5 -0
- data/app/views/library_groups/_form.html.erb +17 -7
- data/app/views/library_groups/edit.html.erb +1 -1
- data/app/views/library_groups/index.html.erb +1 -1
- data/app/views/library_groups/show.html.erb +6 -2
- data/app/views/picture_files/_index_shelf.html.erb +4 -4
- data/app/views/request_status_types/index.html.erb +6 -4
- data/app/views/request_status_types/show.html.erb +1 -1
- data/app/views/request_types/index.html.erb +6 -4
- data/app/views/request_types/show.html.erb +1 -1
- data/app/views/search_engines/index.html.erb +4 -4
- data/app/views/search_engines/show.html.erb +2 -2
- data/app/views/shelves/_library_facet.html.erb +1 -1
- data/app/views/shelves/index.html.erb +4 -4
- data/app/views/shelves/{show.mobile.erb → show.html+phone.erb} +0 -0
- data/app/views/shelves/show.html.erb +3 -3
- data/app/views/subscriptions/index.html.erb +3 -1
- data/app/views/subscriptions/show.html.erb +1 -1
- data/app/views/withdraws/index.html.erb +1 -1
- data/app/views/withdraws/show.html.erb +1 -1
- data/config/locales/translation_en.yml +2 -1
- data/config/locales/translation_ja.yml +2 -1
- data/db/migrate/20151213070943_add_translation_table_to_library_group.rb +13 -0
- data/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +9 -0
- data/lib/enju_library/engine.rb +3 -0
- data/lib/enju_library/version.rb +1 -1
- data/lib/enju_library.rb +0 -41
- data/lib/generators/enju_library/setup/setup_generator.rb +2 -0
- data/lib/generators/enju_library/setup/templates/db/fixtures/library_group/translations.yml +10 -0
- data/lib/tasks/enju_library_tasks.rake +6 -2
- data/spec/controllers/accepts_controller_spec.rb +6 -6
- data/spec/controllers/baskets_controller_spec.rb +7 -7
- data/spec/controllers/bookstores_controller_spec.rb +11 -11
- data/spec/controllers/budget_types_controller_spec.rb +1 -1
- data/spec/controllers/libraries_controller_spec.rb +9 -9
- data/spec/controllers/library_groups_controller_spec.rb +3 -3
- data/spec/controllers/request_status_types_controller_spec.rb +16 -16
- data/spec/controllers/request_types_controller_spec.rb +16 -16
- data/spec/controllers/search_engines_controller_spec.rb +13 -13
- data/spec/controllers/shelves_controller_spec.rb +10 -9
- data/spec/controllers/subscribes_controller_spec.rb +8 -8
- data/spec/controllers/subscriptions_controller_spec.rb +8 -8
- data/spec/controllers/withdraws_controller_spec.rb +11 -3
- data/spec/dummy/app/controllers/application_controller.rb +6 -3
- data/spec/dummy/app/models/user.rb +2 -2
- data/spec/dummy/config/application.rb +8 -38
- data/spec/dummy/config/environments/development.rb +22 -18
- data/spec/dummy/config/environments/production.rb +46 -34
- data/spec/dummy/config/environments/test.rb +21 -14
- data/spec/dummy/config/initializers/enju_leaf.rb +6 -0
- data/spec/dummy/db/schema.rb +13 -1
- data/spec/models/withdraw_spec.rb +2 -0
- data/spec/spec_helper.rb +1 -1
- data/spec/views/accepts/index.html.erb_spec.rb +1 -0
- data/spec/views/budget_types/index.html.erb_spec.rb +1 -0
- data/spec/views/budget_types/show.html.erb_spec.rb +1 -0
- data/spec/views/libraries/show.html.erb_spec.rb +2 -1
- data/spec/views/library_groups/edit.html.erb_spec.rb +1 -0
- data/spec/views/library_groups/show.html.erb_spec.rb +2 -0
- data/spec/views/withdraws/index.html.erb_spec.rb +2 -0
- metadata +52 -105
- data/app/models/enju_library/ability.rb +0 -72
- data/lib/enju_library/item.rb +0 -39
- data/spec/dummy/app/models/ability.rb +0 -68
@@ -17,7 +17,7 @@
|
|
17
17
|
<%- @picture_files.each do |picture_file| -%>
|
18
18
|
<tr class="line<%= cycle("0", "1") -%>">
|
19
19
|
<td>
|
20
|
-
<%- if
|
20
|
+
<%- if policy(picture_file).update? -%>
|
21
21
|
<%= move_position(picture_file) -%>
|
22
22
|
<%- end -%>
|
23
23
|
</td>
|
@@ -29,10 +29,10 @@
|
|
29
29
|
<td><%= link_to picture_file.picture_file_name, picture_file_path(picture_file, format: :download, size: 'original') -%></td>
|
30
30
|
<td>
|
31
31
|
<%= link_to t('page.show'), picture_file -%>
|
32
|
-
<%- if
|
32
|
+
<%- if policy(picture_file).update? -%>
|
33
33
|
<%= link_to t('page.edit'), edit_picture_file_path(picture_file) -%>
|
34
34
|
<% end %>
|
35
|
-
<%- if
|
35
|
+
<%- if policy(picture_file).destroy? -%>
|
36
36
|
<%= link_to t('page.destroy'), picture_file, data: {confirm: t('page.are_you_sure')}, method: :delete -%>
|
37
37
|
<%- end -%>
|
38
38
|
</td>
|
@@ -45,7 +45,7 @@
|
|
45
45
|
</div>
|
46
46
|
|
47
47
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
48
|
-
<%- if
|
48
|
+
<%- if policy(PictureFile).create? -%>
|
49
49
|
<ul>
|
50
50
|
<li><%= link_to t('page.new', model: t('activerecord.models.picture_file')), new_picture_file_path(shelf_id: shelf.id) -%></li>
|
51
51
|
<li><%= link_to t('picture_file.all_picture'), picture_files_path -%></li>
|
@@ -13,17 +13,17 @@
|
|
13
13
|
<%- @request_status_types.each do |request_status_type| -%>
|
14
14
|
<tr class="line<%= cycle("0", "1") -%>">
|
15
15
|
<td>
|
16
|
-
<%- if
|
16
|
+
<%- if policy(request_status_type).update? -%>
|
17
17
|
<%= move_position(request_status_type) -%>
|
18
18
|
<%- end -%>
|
19
19
|
</td>
|
20
20
|
<td><%= link_to request_status_type.name, request_status_type -%></td>
|
21
21
|
<td><%= link_to request_status_type.display_name.localize, request_status_type -%></td>
|
22
22
|
<td>
|
23
|
-
<%- if
|
23
|
+
<%- if policy(request_status_type).update? -%>
|
24
24
|
<%= link_to t('page.edit'), edit_request_status_type_path(request_status_type) -%>
|
25
25
|
<% end %>
|
26
|
-
<%- if
|
26
|
+
<%- if policy(request_status_type).destroy? -%>
|
27
27
|
<%= link_to t('page.destroy'), request_status_type, data: {confirm: t('page.are_you_sure')}, method: :delete -%>
|
28
28
|
<% end %>
|
29
29
|
</td>
|
@@ -35,6 +35,8 @@
|
|
35
35
|
|
36
36
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
37
37
|
<ul>
|
38
|
-
|
38
|
+
<% policy(RequestStatusType).create? %>
|
39
|
+
<li><%= link_to t('page.new', model: t('activerecord.models.request_status_type')), new_request_status_type_path -%></li>
|
40
|
+
<% end %>
|
39
41
|
</ul>
|
40
42
|
</div>
|
@@ -24,6 +24,6 @@
|
|
24
24
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
25
25
|
<ul>
|
26
26
|
<li><%= link_to t('page.edit'), edit_request_status_type_path(@request_status_type) -%></li>
|
27
|
-
<li><%=
|
27
|
+
<li><%= link_to t('page.back'), :back -%></li>
|
28
28
|
</ul>
|
29
29
|
</div>
|
@@ -13,17 +13,17 @@
|
|
13
13
|
<%- @request_types.each do |request_type| -%>
|
14
14
|
<tr class="line<%= cycle("0", "1") -%>">
|
15
15
|
<td>
|
16
|
-
<%- if
|
16
|
+
<%- if policy(request_type).update? -%>
|
17
17
|
<%= move_position(request_type) -%>
|
18
18
|
<%- end -%>
|
19
19
|
</td>
|
20
20
|
<td><%= link_to request_type.name, request_type -%></td>
|
21
21
|
<td><%= link_to request_type.display_name.localize, request_type -%></td>
|
22
22
|
<td>
|
23
|
-
<%- if
|
23
|
+
<%- if policy(request_type).update? -%>
|
24
24
|
<%= link_to t('page.edit'), edit_request_type_path(request_type) -%>
|
25
25
|
<% end %>
|
26
|
-
<%- if
|
26
|
+
<%- if policy(request_type).destroy? -%>
|
27
27
|
<%= link_to t('page.destroy'), request_type, data: {confirm: t('page.are_you_sure')}, method: :delete -%>
|
28
28
|
<% end %>
|
29
29
|
</td>
|
@@ -35,6 +35,8 @@
|
|
35
35
|
|
36
36
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
37
37
|
<ul>
|
38
|
-
|
38
|
+
<% policy(RequestStatusType).create? %>
|
39
|
+
<li><%= link_to t('page.new', model: t('activerecord.models.request_type')), new_request_type_path -%></li>
|
40
|
+
<% end %>
|
39
41
|
</ul>
|
40
42
|
</div>
|
@@ -24,6 +24,6 @@
|
|
24
24
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
25
25
|
<ul>
|
26
26
|
<li><%= link_to t('page.edit'), edit_request_type_path(@request_type) -%></li>
|
27
|
-
<li><%=
|
27
|
+
<li><%= link_to t('page.back'), :back -%></li>
|
28
28
|
</ul>
|
29
29
|
</div>
|
@@ -14,7 +14,7 @@
|
|
14
14
|
<%- @search_engines.each do |search_engine| -%>
|
15
15
|
<tr class="line<%= cycle("0", "1") -%>">
|
16
16
|
<td>
|
17
|
-
<%- if
|
17
|
+
<%- if policy(search_engine).update? -%>
|
18
18
|
<%= move_position(search_engine) -%>
|
19
19
|
<%- end -%>
|
20
20
|
</td>
|
@@ -22,10 +22,10 @@
|
|
22
22
|
<td><%= search_engine.note -%></td>
|
23
23
|
<td><%= link_to t('page.show'), search_engine -%></td>
|
24
24
|
<td>
|
25
|
-
<%- if
|
25
|
+
<%- if policy(search_engine).update? -%>
|
26
26
|
<%= link_to t('page.edit'), edit_search_engine_path(search_engine) -%>
|
27
27
|
<% end %>
|
28
|
-
<%- if
|
28
|
+
<%- if policy(search_engine).destroy? -%>
|
29
29
|
<%= link_to t('page.destroy'), search_engine, data: {confirm: t('page.are_you_sure')}, method: :delete -%>
|
30
30
|
<%- end -%>
|
31
31
|
</td>
|
@@ -38,7 +38,7 @@
|
|
38
38
|
|
39
39
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
40
40
|
<ul>
|
41
|
-
<%- if
|
41
|
+
<%- if policy(SearchEngine).create? -%>
|
42
42
|
<li><%= link_to t('page.new', model: t('activerecord.models.search_engine')), new_search_engine_path -%></li>
|
43
43
|
<%- end -%>
|
44
44
|
</ul>
|
@@ -43,9 +43,9 @@
|
|
43
43
|
|
44
44
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
45
45
|
<ul>
|
46
|
-
<%- if
|
46
|
+
<%- if policy(@search_engine).update? -%>
|
47
47
|
<li><%= link_to t('page.edit'), edit_search_engine_path(@search_engine) -%></li>
|
48
48
|
<%- end -%>
|
49
|
-
<li><%=
|
49
|
+
<li><%= link_to t('page.back'), :back -%></li>
|
50
50
|
</ul>
|
51
51
|
</div>
|
@@ -4,6 +4,6 @@
|
|
4
4
|
<%= library_shelf_facet(@library, facet) %>
|
5
5
|
<%- end -%>
|
6
6
|
<%- if params[:library_id] -%>
|
7
|
-
<li><%= link_to t('page.remove_this_facet'), url_for(params.merge(library_id: nil, page: nil, only_path: true)) -%></li>
|
7
|
+
<li><%= link_to t('page.remove_this_facet'), url_for(params.permit.merge(library_id: nil, page: nil, only_path: true)) -%></li>
|
8
8
|
<%- end -%>
|
9
9
|
</ul>
|
@@ -29,7 +29,7 @@
|
|
29
29
|
<tr class="line<%= cycle("0", "1") -%>">
|
30
30
|
<td>
|
31
31
|
<% if @library and params[:query].blank? and params[:order].blank? %>
|
32
|
-
<%- if
|
32
|
+
<%- if policy(shelf).update? -%>
|
33
33
|
<%= move_position(shelf) -%>
|
34
34
|
<%- end -%>
|
35
35
|
<% end %>
|
@@ -48,10 +48,10 @@
|
|
48
48
|
<%= shelf.library.name if current_user.try(:has_role?, 'Librarian') %>
|
49
49
|
</td>
|
50
50
|
<td>
|
51
|
-
<%- if
|
51
|
+
<%- if policy(shelf).update? -%>
|
52
52
|
<%= link_to t('page.edit'), edit_shelf_path(shelf) -%>
|
53
53
|
<% end %>
|
54
|
-
<%- if
|
54
|
+
<%- if policy(shelf).destroy? -%>
|
55
55
|
<%= link_to t('page.destroy'), shelf, data: {confirm: t('page.are_you_sure')}, method: :delete -%>
|
56
56
|
<%- end -%>
|
57
57
|
</td>
|
@@ -66,7 +66,7 @@
|
|
66
66
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
67
67
|
<%= render 'library_facet' %>
|
68
68
|
<ul>
|
69
|
-
<%- if
|
69
|
+
<%- if policy(Shelf).create? -%>
|
70
70
|
<li><%= link_to t('page.new', model: t('activerecord.models.shelf')), new_shelf_path -%></li>
|
71
71
|
<%- end -%>
|
72
72
|
</ul>
|
File without changes
|
@@ -47,19 +47,19 @@
|
|
47
47
|
|
48
48
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
49
49
|
<ul>
|
50
|
-
<% if
|
50
|
+
<% if policy(Shelf).create? %>
|
51
51
|
<%- if @library -%>
|
52
52
|
<li><%= link_to t('page.new', model: t('activerecord.models.shelf')), new_shelf_path(library_id: @library.id) -%></li>
|
53
53
|
<%- else -%>
|
54
54
|
<li><%= link_to t('page.new', model: t('activerecord.models.shelf')), new_shelf_path -%></li>
|
55
55
|
<%- end -%>
|
56
56
|
<% end %>
|
57
|
-
<% if
|
57
|
+
<% if policy(@shelf).update? %>
|
58
58
|
<li><%= link_to t('page.edit'), edit_shelf_path(@shelf) -%></li>
|
59
59
|
<li><%= link_to t('page.listing', model: t('activerecord.models.picture_file')), picture_files_path(shelf_id: @shelf.id) -%></li>
|
60
60
|
<% end %>
|
61
61
|
<li>
|
62
|
-
<%=
|
62
|
+
<%= link_to t('page.back'), :back -%>
|
63
63
|
</li>
|
64
64
|
</ul>
|
65
65
|
</div>
|
@@ -14,8 +14,10 @@
|
|
14
14
|
<td><%= link_to subscription.title, subscription -%></td>
|
15
15
|
<td><%= subscription.works.size -%></td>
|
16
16
|
<td>
|
17
|
-
<% if
|
17
|
+
<% if policy(subscription).update? %>
|
18
18
|
<%= link_to t('page.edit'), edit_subscription_path(subscription) -%>
|
19
|
+
<% end %>
|
20
|
+
<% if policy(subscription).destroy? %>
|
19
21
|
<%= link_to t('page.destroy'), subscription, data: {confirm: t('page.are_you_sure')}, method: :delete -%>
|
20
22
|
<% end %>
|
21
23
|
</td>
|
@@ -35,6 +35,6 @@
|
|
35
35
|
<ul>
|
36
36
|
<li><%= link_to t('page.edit'), edit_subscription_path(@subscription) -%></li>
|
37
37
|
<li><%= link_to t('work.add'), subscription_manifestations_path(@subscription) -%></li>
|
38
|
-
<li><%=
|
38
|
+
<li><%= link_to t('page.back'), :back -%></li>
|
39
39
|
</ul>
|
40
40
|
</div>
|
@@ -2,7 +2,7 @@ en:
|
|
2
2
|
activerecord:
|
3
3
|
models:
|
4
4
|
library: Library
|
5
|
-
library_group:
|
5
|
+
library_group: System configuration
|
6
6
|
shelf: Shelf
|
7
7
|
accept: Accept
|
8
8
|
budget_type: Budget type
|
@@ -52,6 +52,7 @@ en:
|
|
52
52
|
admin_networks: Admin networks
|
53
53
|
note: Note
|
54
54
|
login_banner: Login banner
|
55
|
+
footer_banner: Footer banner
|
55
56
|
post_to_union_catalog: Post to union catalog
|
56
57
|
url: URL
|
57
58
|
color: Color
|
@@ -2,7 +2,7 @@ ja:
|
|
2
2
|
activerecord:
|
3
3
|
models:
|
4
4
|
library: 図書館
|
5
|
-
library_group:
|
5
|
+
library_group: システム全体の設定
|
6
6
|
shelf: 本棚
|
7
7
|
accept: 検収
|
8
8
|
budget_type: 予算種別
|
@@ -52,6 +52,7 @@ ja:
|
|
52
52
|
admin_networks: 管理用として扱うネットワーク
|
53
53
|
note: 注記
|
54
54
|
login_banner: ログイン画面でのメッセージ
|
55
|
+
footer_banner: フッターのメッセージ
|
55
56
|
post_to_union_catalog: 総合目録に登録する
|
56
57
|
url: URL
|
57
58
|
color: 色
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class AddTranslationTableToLibraryGroup < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
LibraryGroup.create_translation_table!({
|
4
|
+
login_banner: :text
|
5
|
+
}, {
|
6
|
+
migrate_data: true
|
7
|
+
})
|
8
|
+
end
|
9
|
+
|
10
|
+
def down
|
11
|
+
LibraryGroup.drop_translation_table! migrate_data: true
|
12
|
+
end
|
13
|
+
end
|
data/lib/enju_library/engine.rb
CHANGED
data/lib/enju_library/version.rb
CHANGED
data/lib/enju_library.rb
CHANGED
@@ -1,45 +1,4 @@
|
|
1
1
|
require "enju_library/engine"
|
2
|
-
require "enju_library/item"
|
3
2
|
|
4
3
|
module EnjuLibrary
|
5
|
-
def self.included(base)
|
6
|
-
base.extend(ClassMethods)
|
7
|
-
end
|
8
|
-
|
9
|
-
module ClassMethods
|
10
|
-
def enju_library
|
11
|
-
include EnjuLibrary::InstanceMethods
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
module InstanceMethods
|
16
|
-
private
|
17
|
-
|
18
|
-
def get_library_group
|
19
|
-
@library_group = LibraryGroup.site_config
|
20
|
-
end
|
21
|
-
|
22
|
-
def get_shelf
|
23
|
-
@shelf = Shelf.includes(:library).find(params[:shelf_id]) if params[:shelf_id]
|
24
|
-
end
|
25
|
-
|
26
|
-
def get_library
|
27
|
-
@library = Library.find(params[:library_id]) if params[:library_id]
|
28
|
-
end
|
29
|
-
|
30
|
-
def get_libraries
|
31
|
-
@libraries = Library.all_cache
|
32
|
-
end
|
33
|
-
|
34
|
-
def get_bookstore
|
35
|
-
@bookstore = Bookstore.find(params[:bookstore_id]) if params[:bookstore_id]
|
36
|
-
end
|
37
|
-
|
38
|
-
def get_subscription
|
39
|
-
@subscription = Subscription.find(params[:subscription_id]) if params[:subscription_id]
|
40
|
-
end
|
41
|
-
end
|
42
4
|
end
|
43
|
-
|
44
|
-
ActiveRecord::Base.send :include, EnjuLibrary::LibraryItem
|
45
|
-
ActionController::Base.send(:include, EnjuLibrary)
|
@@ -5,5 +5,7 @@ class EnjuLibrary::SetupGenerator < Rails::Generators::Base
|
|
5
5
|
def copy_setup_files
|
6
6
|
directory("db/fixtures", "db/fixtures/enju_library")
|
7
7
|
return if file == 'fixture'
|
8
|
+
inject_into_file 'app/controllers/application_controller.rb',
|
9
|
+
" include EnjuLibrary::Controller\n", after: "include EnjuLeaf::Controller\n"
|
8
10
|
end
|
9
11
|
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
library_group_00001_translations_ja:
|
2
|
+
locale: ja
|
3
|
+
footer_banner: "[Next-L Enju Leaf __VERSION__](https://github.com/next-l/enju_leaf), オープンソース統合図書館システム | [このシステムについて](/page/about) | [不具合を報告する](https://github.com/next-l/enju_leaf/issues) | [マニュアル](http://next-l.github.io/manual/1.2/)<br/>\r\n\
|
4
|
+
Developed by [Kosuke Tanabe](https://github.com/nabeta) and [Project Next-L](http://next-l.jp)."
|
5
|
+
library_group_id: 1
|
6
|
+
library_group_00001_translations_en:
|
7
|
+
locale: en
|
8
|
+
footer_banner: "[Next-L Enju Leaf __VERSION__](https://github.com/next-l/enju_leaf), an open source integrated library system | [About this system](/page/about) | [Report bugs](https://github.com/next-l/enju_leaf/issues) | [Manual](http://next-l.github.io/manual/1.2/)<br/>\r\n\
|
9
|
+
Developed by [Kosuke Tanabe](https://github.com/nabeta) and [Project Next-L](http://next-l.jp)."
|
10
|
+
library_group_id: 1
|
@@ -4,8 +4,12 @@ require 'tasks/color'
|
|
4
4
|
desc "create initial records for enju_library"
|
5
5
|
namespace :enju_library do
|
6
6
|
task :setup => :environment do
|
7
|
-
Dir.glob(Rails.root.to_s + '/db/fixtures/enju_library
|
8
|
-
|
7
|
+
Dir.glob(Rails.root.to_s + '/db/fixtures/enju_library/**/*.yml').each do |file|
|
8
|
+
dirname = File.basename(File.dirname file)
|
9
|
+
dirname = nil if dirname == "enju_library"
|
10
|
+
basename = [ dirname, File.basename(file, ".*") ].compact
|
11
|
+
basename = File.join(*basename)
|
12
|
+
ActiveRecord::FixtureSet.create_fixtures('db/fixtures/enju_library', basename)
|
9
13
|
end
|
10
14
|
end
|
11
15
|
|
@@ -123,7 +123,7 @@ describe AcceptsController do
|
|
123
123
|
|
124
124
|
it "should not assign the requested accept as @accept" do
|
125
125
|
get :new
|
126
|
-
assigns(:accept).
|
126
|
+
assigns(:accept).should be_nil
|
127
127
|
response.should be_forbidden
|
128
128
|
end
|
129
129
|
end
|
@@ -131,7 +131,7 @@ describe AcceptsController do
|
|
131
131
|
describe "When not logged in" do
|
132
132
|
it "should not assign the requested accept as @accept" do
|
133
133
|
get :new
|
134
|
-
assigns(:accept).
|
134
|
+
assigns(:accept).should be_nil
|
135
135
|
response.should redirect_to(new_user_session_url)
|
136
136
|
end
|
137
137
|
end
|
@@ -149,7 +149,7 @@ describe AcceptsController do
|
|
149
149
|
describe "with valid params" do
|
150
150
|
it "assigns a newly created accept as @accept" do
|
151
151
|
post :create, :accept => @attrs
|
152
|
-
assigns(:accept).
|
152
|
+
assigns(:accept).should be_nil
|
153
153
|
end
|
154
154
|
|
155
155
|
it "should not create a new accept without basket_id" do
|
@@ -169,7 +169,7 @@ describe AcceptsController do
|
|
169
169
|
describe "with invalid params" do
|
170
170
|
it "assigns a newly created but unsaved accept as @accept" do
|
171
171
|
post :create, :accept => @invalid_attrs
|
172
|
-
assigns(:accept).
|
172
|
+
assigns(:accept).should be_nil
|
173
173
|
end
|
174
174
|
|
175
175
|
it "should be forbidden" do
|
@@ -191,7 +191,7 @@ describe AcceptsController do
|
|
191
191
|
describe "with valid params" do
|
192
192
|
it "assigns a newly created accept as @accept" do
|
193
193
|
post :create, :accept => @attrs
|
194
|
-
assigns(:accept).
|
194
|
+
assigns(:accept).should be_nil
|
195
195
|
end
|
196
196
|
|
197
197
|
it "should not create a new accept without basket_id" do
|
@@ -207,7 +207,7 @@ describe AcceptsController do
|
|
207
207
|
describe "with valid params" do
|
208
208
|
it "assigns a newly created accept as @accept" do
|
209
209
|
post :create, :accept => @attrs
|
210
|
-
assigns(:accept).
|
210
|
+
assigns(:accept).should be_nil
|
211
211
|
end
|
212
212
|
|
213
213
|
it "should be forbidden" do
|
@@ -34,7 +34,7 @@ describe BasketsController do
|
|
34
34
|
|
35
35
|
it "assigns all baskets as @baskets" do
|
36
36
|
get :index, :user_id => users(:user1).username
|
37
|
-
assigns(:baskets).should
|
37
|
+
assigns(:baskets).should be_nil
|
38
38
|
response.should be_forbidden
|
39
39
|
end
|
40
40
|
end
|
@@ -42,7 +42,7 @@ describe BasketsController do
|
|
42
42
|
describe "When not logged in" do
|
43
43
|
it "assigns all baskets as @baskets" do
|
44
44
|
get :index, :user_id => users(:user1).username
|
45
|
-
assigns(:baskets).should
|
45
|
+
assigns(:baskets).should be_nil
|
46
46
|
response.should redirect_to(new_user_session_url)
|
47
47
|
end
|
48
48
|
end
|
@@ -110,7 +110,7 @@ describe BasketsController do
|
|
110
110
|
|
111
111
|
it "should not assign the requested basket as @basket" do
|
112
112
|
get :new
|
113
|
-
assigns(:basket).
|
113
|
+
assigns(:basket).should be_nil
|
114
114
|
response.should be_forbidden
|
115
115
|
end
|
116
116
|
end
|
@@ -118,7 +118,7 @@ describe BasketsController do
|
|
118
118
|
describe "When not logged in" do
|
119
119
|
it "should not assign the requested basket as @basket" do
|
120
120
|
get :new
|
121
|
-
assigns(:basket).
|
121
|
+
assigns(:basket).should be_nil
|
122
122
|
response.should redirect_to(new_user_session_url)
|
123
123
|
end
|
124
124
|
end
|
@@ -269,7 +269,7 @@ describe BasketsController do
|
|
269
269
|
describe "with valid params" do
|
270
270
|
it "assigns a newly created basket as @basket" do
|
271
271
|
post :create, :basket => {:user_number => users(:user1).profile.user_number }
|
272
|
-
assigns(:basket).
|
272
|
+
assigns(:basket).should be_nil
|
273
273
|
end
|
274
274
|
|
275
275
|
it "should be forbidden" do
|
@@ -288,12 +288,12 @@ describe BasketsController do
|
|
288
288
|
describe "with blank params" do
|
289
289
|
it "assigns a newly created basket as @basket" do
|
290
290
|
post :create, :basket => { note: 'test' }
|
291
|
-
assigns(:basket).
|
291
|
+
assigns(:basket).should be_nil
|
292
292
|
end
|
293
293
|
|
294
294
|
it "should be redirected to new_user_session_url" do
|
295
295
|
post :create, :basket => { note: 'test' }
|
296
|
-
assigns(:basket).
|
296
|
+
assigns(:basket).should be_nil
|
297
297
|
assert_response :redirect
|
298
298
|
response.should redirect_to new_user_session_url
|
299
299
|
end
|
@@ -37,7 +37,7 @@ describe BookstoresController do
|
|
37
37
|
|
38
38
|
it "assigns all bookstores as @bookstores" do
|
39
39
|
get :index
|
40
|
-
assigns(:bookstores).should
|
40
|
+
assigns(:bookstores).should be_nil
|
41
41
|
response.should be_forbidden
|
42
42
|
end
|
43
43
|
end
|
@@ -45,7 +45,7 @@ describe BookstoresController do
|
|
45
45
|
describe "When not logged in" do
|
46
46
|
it "assigns all bookstores as @bookstores" do
|
47
47
|
get :index
|
48
|
-
assigns(:bookstores).should
|
48
|
+
assigns(:bookstores).should be_nil
|
49
49
|
response.should redirect_to(new_user_session_url)
|
50
50
|
end
|
51
51
|
end
|
@@ -107,7 +107,7 @@ describe BookstoresController do
|
|
107
107
|
|
108
108
|
it "should not assign the requested bookstore as @bookstore" do
|
109
109
|
get :new
|
110
|
-
assigns(:bookstore).
|
110
|
+
assigns(:bookstore).should be_nil
|
111
111
|
response.should be_forbidden
|
112
112
|
end
|
113
113
|
end
|
@@ -117,7 +117,7 @@ describe BookstoresController do
|
|
117
117
|
|
118
118
|
it "should not assign the requested bookstore as @bookstore" do
|
119
119
|
get :new
|
120
|
-
assigns(:bookstore).
|
120
|
+
assigns(:bookstore).should be_nil
|
121
121
|
response.should be_forbidden
|
122
122
|
end
|
123
123
|
end
|
@@ -125,7 +125,7 @@ describe BookstoresController do
|
|
125
125
|
describe "When not logged in" do
|
126
126
|
it "should not assign the requested bookstore as @bookstore" do
|
127
127
|
get :new
|
128
|
-
assigns(:bookstore).
|
128
|
+
assigns(:bookstore).should be_nil
|
129
129
|
response.should redirect_to(new_user_session_url)
|
130
130
|
end
|
131
131
|
end
|
@@ -211,7 +211,7 @@ describe BookstoresController do
|
|
211
211
|
describe "with valid params" do
|
212
212
|
it "assigns a newly created bookstore as @bookstore" do
|
213
213
|
post :create, :bookstore => @attrs
|
214
|
-
assigns(:bookstore).should
|
214
|
+
assigns(:bookstore).should be_nil
|
215
215
|
end
|
216
216
|
|
217
217
|
it "should be forbidden" do
|
@@ -223,7 +223,7 @@ describe BookstoresController do
|
|
223
223
|
describe "with invalid params" do
|
224
224
|
it "assigns a newly created but unsaved bookstore as @bookstore" do
|
225
225
|
post :create, :bookstore => @invalid_attrs
|
226
|
-
assigns(:bookstore).
|
226
|
+
assigns(:bookstore).should be_nil
|
227
227
|
end
|
228
228
|
|
229
229
|
it "should be forbidden" do
|
@@ -239,7 +239,7 @@ describe BookstoresController do
|
|
239
239
|
describe "with valid params" do
|
240
240
|
it "assigns a newly created bookstore as @bookstore" do
|
241
241
|
post :create, :bookstore => @attrs
|
242
|
-
assigns(:bookstore).should
|
242
|
+
assigns(:bookstore).should be_nil
|
243
243
|
end
|
244
244
|
|
245
245
|
it "should be forbidden" do
|
@@ -251,7 +251,7 @@ describe BookstoresController do
|
|
251
251
|
describe "with invalid params" do
|
252
252
|
it "assigns a newly created but unsaved bookstore as @bookstore" do
|
253
253
|
post :create, :bookstore => @invalid_attrs
|
254
|
-
assigns(:bookstore).
|
254
|
+
assigns(:bookstore).should be_nil
|
255
255
|
end
|
256
256
|
|
257
257
|
it "should be forbidden" do
|
@@ -265,7 +265,7 @@ describe BookstoresController do
|
|
265
265
|
describe "with valid params" do
|
266
266
|
it "assigns a newly created bookstore as @bookstore" do
|
267
267
|
post :create, :bookstore => @attrs
|
268
|
-
assigns(:bookstore).should
|
268
|
+
assigns(:bookstore).should be_nil
|
269
269
|
end
|
270
270
|
|
271
271
|
it "should be forbidden" do
|
@@ -277,7 +277,7 @@ describe BookstoresController do
|
|
277
277
|
describe "with invalid params" do
|
278
278
|
it "assigns a newly created but unsaved bookstore as @bookstore" do
|
279
279
|
post :create, :bookstore => @invalid_attrs
|
280
|
-
assigns(:bookstore).
|
280
|
+
assigns(:bookstore).should be_nil
|
281
281
|
end
|
282
282
|
|
283
283
|
it "should be forbidden" do
|
@@ -33,7 +33,7 @@ describe BudgetTypesController do
|
|
33
33
|
it "assigns all budget_types as @budget_types" do
|
34
34
|
budget_type = BudgetType.create! valid_attributes
|
35
35
|
get :index
|
36
|
-
assigns(:budget_types).should eq(BudgetType.
|
36
|
+
assigns(:budget_types).should eq(BudgetType.order(:position))
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|