enju_standalone_interface 0.0.1

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 (114) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +3 -0
  3. data/Rakefile +35 -0
  4. data/app/assets/javascripts/enju_standalone_interface/application.js +15 -0
  5. data/app/assets/javascripts/enju_standalone_interface/batch_action.js +2 -0
  6. data/app/assets/stylesheets/enju_standalone_interface/application.css +13 -0
  7. data/app/assets/stylesheets/enju_standalone_interface/batch_action.css +4 -0
  8. data/app/controllers/application_controller.rb +4 -0
  9. data/app/controllers/batch_action_controller.rb +9 -0
  10. data/app/helpers/enju_standalone_interface/application_helper.rb +4 -0
  11. data/app/helpers/enju_standalone_interface/batch_action_helper.rb +4 -0
  12. data/app/views/enju_standalone_interface/batch_action/recept.html.erb +1 -0
  13. data/app/views/layouts/enju_standalone_interface/application.html.erb +14 -0
  14. data/config/routes.rb +3 -0
  15. data/lib/enju_standalone_interface.rb +233 -0
  16. data/lib/enju_standalone_interface/engine.rb +5 -0
  17. data/lib/enju_standalone_interface/version.rb +3 -0
  18. data/lib/tasks/enju_standalone_interface_tasks.rake +4 -0
  19. data/spec/controllers/enju_standalone_interface/batch_action_controller_spec.rb +21 -0
  20. data/spec/dummy/README.rdoc +261 -0
  21. data/spec/dummy/Rakefile +7 -0
  22. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  23. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  24. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  25. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  26. data/spec/dummy/app/helpers/users_helper.rb +36 -0
  27. data/spec/dummy/app/models/basket.rb +70 -0
  28. data/spec/dummy/app/models/carrier_type.rb +33 -0
  29. data/spec/dummy/app/models/checked_item.rb +177 -0
  30. data/spec/dummy/app/models/checkout.rb +307 -0
  31. data/spec/dummy/app/models/checkout_type.rb +33 -0
  32. data/spec/dummy/app/models/circulation_status.rb +23 -0
  33. data/spec/dummy/app/models/event.rb +124 -0
  34. data/spec/dummy/app/models/item.rb +1234 -0
  35. data/spec/dummy/app/models/item_has_use_restriction.rb +23 -0
  36. data/spec/dummy/app/models/lending_policy.rb +32 -0
  37. data/spec/dummy/app/models/library.rb +105 -0
  38. data/spec/dummy/app/models/library_group.rb +88 -0
  39. data/spec/dummy/app/models/manifestation.rb +698 -0
  40. data/spec/dummy/app/models/patron.rb +342 -0
  41. data/spec/dummy/app/models/role.rb +47 -0
  42. data/spec/dummy/app/models/shelf.rb +83 -0
  43. data/spec/dummy/app/models/use_restriction.rb +22 -0
  44. data/spec/dummy/app/models/user.rb +580 -0
  45. data/spec/dummy/app/models/user_group.rb +43 -0
  46. data/spec/dummy/app/models/user_group_has_checkout_type.rb +80 -0
  47. data/spec/dummy/app/models/user_has_role.rb +4 -0
  48. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  49. data/spec/dummy/config.ru +4 -0
  50. data/spec/dummy/config/application.rb +57 -0
  51. data/spec/dummy/config/boot.rb +10 -0
  52. data/spec/dummy/config/database.yml +25 -0
  53. data/spec/dummy/config/environment.rb +5 -0
  54. data/spec/dummy/config/environments/development.rb +37 -0
  55. data/spec/dummy/config/environments/production.rb +67 -0
  56. data/spec/dummy/config/environments/test.rb +37 -0
  57. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  58. data/spec/dummy/config/initializers/inflections.rb +15 -0
  59. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  60. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  61. data/spec/dummy/config/initializers/session_store.rb +8 -0
  62. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  63. data/spec/dummy/config/locales/en.yml +5 -0
  64. data/spec/dummy/config/locales/translation_en.yml +1724 -0
  65. data/spec/dummy/config/locales/validates_timeliness.en.yml +16 -0
  66. data/spec/dummy/config/routes.rb +4 -0
  67. data/spec/dummy/db/development.sqlite3 +0 -0
  68. data/spec/dummy/db/migrate/20120322223037_create_users.rb +71 -0
  69. data/spec/dummy/db/migrate/20120323053037_create_roles.rb +15 -0
  70. data/spec/dummy/db/migrate/20120323060718_create_user_has_roles.rb +10 -0
  71. data/spec/dummy/db/migrate/20120323062239_create_libraries.rb +37 -0
  72. data/spec/dummy/db/migrate/20120323063602_create_items.rb +33 -0
  73. data/spec/dummy/db/migrate/20120323064619_craete_circulation_statuses.rb +13 -0
  74. data/spec/dummy/db/migrate/20120323065157_craete_checkout_types.rb +13 -0
  75. data/spec/dummy/db/migrate/20120323070102_craete_shelves.rb +17 -0
  76. data/spec/dummy/db/migrate/20120323071616_craete_library_groups.rb +24 -0
  77. data/spec/dummy/db/migrate/20120323073022_craete_patrons.rb +72 -0
  78. data/spec/dummy/db/migrate/20120323141030_create_manifestations.rb +97 -0
  79. data/spec/dummy/db/migrate/20120323142330_create_carrier_types.rb +12 -0
  80. data/spec/dummy/db/migrate/20120324132708_create_baskets.rb +20 -0
  81. data/spec/dummy/db/migrate/20120324135409_checked_items.rb +16 -0
  82. data/spec/dummy/db/migrate/20120324141007_create_user_groups.rb +22 -0
  83. data/spec/dummy/db/migrate/20120324141950_create_user_group_has_checkout_type.rb +26 -0
  84. data/spec/dummy/db/migrate/20120324151951_create_lending_policies.rb +22 -0
  85. data/spec/dummy/db/migrate/20120324153756_create_use_restrictions.rb +15 -0
  86. data/spec/dummy/db/migrate/20120324154009_create_item_has_use_restrictions.rb +16 -0
  87. data/spec/dummy/db/migrate/20120324164815_create_checkouts.rb +26 -0
  88. data/spec/dummy/db/migrate/20120325160112_create_events.rb +23 -0
  89. data/spec/dummy/db/schema.rb +518 -0
  90. data/spec/dummy/db/test.sqlite3 +0 -0
  91. data/spec/dummy/lib/enju_leaf.rb +6 -0
  92. data/spec/dummy/lib/enju_leaf/master_model.rb +41 -0
  93. data/spec/dummy/lib/enju_leaf/url_validator.rb +10 -0
  94. data/spec/dummy/log/development.log +116 -0
  95. data/spec/dummy/log/test.log +17849 -0
  96. data/spec/dummy/public/404.html +26 -0
  97. data/spec/dummy/public/422.html +26 -0
  98. data/spec/dummy/public/500.html +25 -0
  99. data/spec/dummy/public/favicon.ico +0 -0
  100. data/spec/dummy/script/rails +6 -0
  101. data/spec/factories/item.rb +9 -0
  102. data/spec/factories/manifestation.rb +6 -0
  103. data/spec/factories/user.rb +27 -0
  104. data/spec/fixtures/carrier_types.yml +38 -0
  105. data/spec/fixtures/checkout_types.yml +34 -0
  106. data/spec/fixtures/circulation_statuses.yml +135 -0
  107. data/spec/fixtures/libraries.yml +40 -0
  108. data/spec/fixtures/roles.yml +21 -0
  109. data/spec/fixtures/shelves.yml +53 -0
  110. data/spec/fixtures/user_group_has_checkout_types.yml +14 -0
  111. data/spec/fixtures/user_groups.yml +7 -0
  112. data/spec/libs/enju_standalone_interface_spec.rb +133 -0
  113. data/spec/spec_helper.rb +36 -0
  114. metadata +358 -0
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,25 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ </div>
24
+ </body>
25
+ </html>
File without changes
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -0,0 +1,9 @@
1
+ FactoryGirl.define do
2
+ factory :item do |f|
3
+ f.sequence(:item_identifier){|n| "item_#{n}"}
4
+ f.circulation_status_id {CirculationStatus.find(1).id}
5
+ f.manifestation_id {FactoryGirl.create(:manifestation).id}
6
+ f.shelf_id {Shelf.find_by_name('honkan01').id}
7
+ f.checkout_type_id { CheckoutType.find_by_name('book') }
8
+ end
9
+ end
@@ -0,0 +1,6 @@
1
+ FactoryGirl.define do
2
+ factory :manifestation do |f|
3
+ f.sequence(:original_title){|n| "manifestation_title_#{n}"}
4
+ f.carrier_type_id{CarrierType.find(1).id}
5
+ end
6
+ end
@@ -0,0 +1,27 @@
1
+ FactoryGirl.define do
2
+ factory :user_admin, :class => User do |f|
3
+ f.sequence(:username){|n| "admin_#{n}"}
4
+ f.role {Role.find_by_name('Administrator')}
5
+ f.library_id {Library.first.id}
6
+ end
7
+
8
+ factory :user_librarian, :class => User do |f|
9
+ f.sequence(:username){|n| "librarian_#{n}"}
10
+ f.sequence(:email){|n| "librarian_#{n}@example.jp"}
11
+ f.role {Role.find_by_name('Librarian')}
12
+ f.required_role {Role.find_by_name('User')}
13
+ f.library_id {Library.first.id}
14
+ end
15
+
16
+ factory :user_nakamura, :class => User do |f|
17
+ f.sequence(:username){|n| "nakamura_#{n}"}
18
+ #f.username "nakamura"
19
+ f.sequence(:email){|n| "user_#{n}@example.jp"}
20
+ f.role {Role.find_by_name('User')}
21
+ f.required_role {Role.find_by_name('User')}
22
+ f.user_number "nakamura"
23
+ f.library_id {Library.first.id}
24
+ f.user_group_id {UserGroup.first}
25
+ end
26
+
27
+ end
@@ -0,0 +1,38 @@
1
+ ---
2
+ carrier_type_00004:
3
+ name: file
4
+ display_name: file
5
+ updated_at: 2007-12-24 01:30:50.637433 +09:00
6
+ id: 4
7
+ note: !binary |
8
+ 44Kz44Oz44OU44Ol44O844K/44Gu44OV44Kh44Kk44Or44Gn44GZ44CC
9
+
10
+ created_at: 2007-12-24 01:30:50.637433 +09:00
11
+ position: 4
12
+
13
+ carrier_type_00001:
14
+ name: print
15
+ display_name: print
16
+ updated_at: 2007-11-20 16:04:29.853828 +09:00
17
+ id: 1
18
+ note: !binary |
19
+ 5pys44Gn44GZ44CC
20
+
21
+ created_at: 2007-11-20 15:47:03.641530 +09:00
22
+ position: 1
23
+ carrier_type_00002:
24
+ name: CD
25
+ display_name: CD
26
+ updated_at: 2007-12-19 01:45:26.040674 +09:00
27
+ id: 2
28
+ note: "\xE9\x9F\xB3\xE6\xA5\xBDCD\xE3\x81\xA7\xE3\x81\x99\xE3\x80\x82"
29
+ created_at: 2007-12-19 01:45:26.040674 +09:00
30
+ position: 2
31
+ carrier_type_00003:
32
+ name: DVD
33
+ display_name: DVD
34
+ updated_at: 2007-12-23 04:24:23.151410 +09:00
35
+ id: 3
36
+ note: "DVD\xE3\x81\xA7\xE3\x81\x99\xE3\x80\x82"
37
+ created_at: 2007-12-23 04:24:23.151410 +09:00
38
+ position: 3
@@ -0,0 +1,34 @@
1
+ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
+
3
+ checkout_type_00001:
4
+ id: 1
5
+ name: book
6
+ display_name: book
7
+ note:
8
+ position: 1
9
+ checkout_type_00002:
10
+ id: 2
11
+ name: serial
12
+ display_name: serial
13
+ note:
14
+ position: 2
15
+ checkout_type_00003:
16
+ id: 3
17
+ name: cd
18
+ display_name: cd
19
+ note:
20
+ position: 3
21
+
22
+ # == Schema Information
23
+ #
24
+ # Table name: checkout_types
25
+ #
26
+ # id :integer not null, primary key
27
+ # name :string(255) not null
28
+ # display_name :text
29
+ # note :text
30
+ # position :integer
31
+ # created_at :datetime
32
+ # updated_at :datetime
33
+ #
34
+
@@ -0,0 +1,135 @@
1
+ ---
2
+ circulation_status_00005:
3
+ name: In Process
4
+ display_name: In Process
5
+ updated_at: 2008-02-15 17:31:42.422676 +09:00
6
+ id: 5
7
+ note: ""
8
+ created_at: 2008-02-15 17:31:42.422676 +09:00
9
+ position: 5
10
+ circulation_status_00006:
11
+ name: In Transit Between Library Locations
12
+ display_name: In Transit Between Library Locations
13
+ updated_at: 2008-02-15 17:31:51.227056 +09:00
14
+ id: 6
15
+ note: ""
16
+ created_at: 2008-02-15 17:31:51.227056 +09:00
17
+ position: 6
18
+ circulation_status_00007:
19
+ name: Lost
20
+ display_name: Lost
21
+ updated_at: 2008-02-15 17:31:58.627987 +09:00
22
+ id: 7
23
+ note: ""
24
+ created_at: 2008-02-15 17:31:58.627987 +09:00
25
+ position: 7
26
+ circulation_status_00008:
27
+ name: Missing
28
+ display_name: Missing
29
+ updated_at: 2008-02-15 17:32:07.006541 +09:00
30
+ id: 8
31
+ note: ""
32
+ created_at: 2008-02-15 17:32:07.006541 +09:00
33
+ position: 8
34
+ circulation_status_00010:
35
+ name: On Loan
36
+ display_name: On Loan
37
+ updated_at: 2008-02-15 17:32:22.969896 +09:00
38
+ id: 10
39
+ note: ""
40
+ created_at: 2008-02-15 17:32:22.969896 +09:00
41
+ position: 10
42
+ circulation_status_00009:
43
+ name: Not Available
44
+ display_name: Not Available
45
+ updated_at: 2008-02-15 17:32:15.454067 +09:00
46
+ id: 9
47
+ note: ""
48
+ created_at: 2008-02-15 17:32:15.454067 +09:00
49
+ position: 9
50
+ circulation_status_00011:
51
+ name: On Order
52
+ display_name: On Order
53
+ updated_at: 2008-02-15 17:32:30.675735 +09:00
54
+ id: 11
55
+ note: ""
56
+ created_at: 2008-02-15 17:32:30.675735 +09:00
57
+ position: 11
58
+ circulation_status_00012:
59
+ name: Pending Transfer
60
+ display_name: Pending Transfer
61
+ updated_at: 2008-02-15 17:32:39.395000 +09:00
62
+ id: 12
63
+ note: ""
64
+ created_at: 2008-02-15 17:32:39.395000 +09:00
65
+ position: 12
66
+ circulation_status_00001:
67
+ name: Available For Pickup
68
+ display_name: Available For Pickup
69
+ updated_at: 2008-02-15 17:31:10.588524 +09:00
70
+ id: 1
71
+ note: ""
72
+ created_at: 2008-02-15 17:31:10.588524 +09:00
73
+ position: 1
74
+ circulation_status_00002:
75
+ name: Available On Shelf
76
+ display_name: Available On Shelf
77
+ updated_at: 2008-02-15 17:31:18.946298 +09:00
78
+ id: 2
79
+ note: ""
80
+ created_at: 2008-02-15 17:31:18.946298 +09:00
81
+ position: 2
82
+ circulation_status_00013:
83
+ name: Recalled
84
+ display_name: Recalled
85
+ updated_at: 2008-02-15 17:32:48.355304 +09:00
86
+ id: 13
87
+ note: ""
88
+ created_at: 2008-02-15 17:32:48.355304 +09:00
89
+ position: 13
90
+ circulation_status_00014:
91
+ name: Waiting To Be Reshelved
92
+ display_name: Waiting To Be Reshelved
93
+ updated_at: 2008-02-15 17:32:59.078750 +09:00
94
+ id: 14
95
+ note: ""
96
+ created_at: 2008-02-15 17:32:59.078750 +09:00
97
+ position: 14
98
+ circulation_status_00003:
99
+ name: Circulation Status Undefined
100
+ display_name: Circulation Status Undefined
101
+ updated_at: 2008-02-15 17:31:26.564769 +09:00
102
+ id: 3
103
+ note: ""
104
+ created_at: 2008-02-15 17:31:26.564769 +09:00
105
+ position: 3
106
+ circulation_status_00004:
107
+ name: Claimed Returned Or Never Borrowed
108
+ display_name: Claimed Returned Or Never Borrowed
109
+ updated_at: 2008-02-15 17:31:35.786404 +09:00
110
+ id: 4
111
+ note: ""
112
+ created_at: 2008-02-15 17:31:35.786404 +09:00
113
+ position: 4
114
+ circulation_status_00015:
115
+ name: Removed
116
+ display_name: Removed
117
+ updated_at: 2008-02-15 17:31:35.786404 +09:00
118
+ id: 15
119
+ note: ""
120
+ created_at: 2008-02-15 17:31:35.786404 +09:00
121
+ position: 15
122
+
123
+ # == Schema Information
124
+ #
125
+ # Table name: circulation_statuses
126
+ #
127
+ # id :integer not null, primary key
128
+ # name :string(255) not null
129
+ # display_name :text
130
+ # note :text
131
+ # position :integer
132
+ # created_at :datetime
133
+ # updated_at :datetime
134
+ #
135
+
@@ -0,0 +1,40 @@
1
+ ---
2
+ library_00001:
3
+ name: web
4
+ short_display_name: Web
5
+ display_name: World Wide Web
6
+ fax_number:
7
+ telephone_number_1:
8
+ telephone_number_2:
9
+ id: 1
10
+ region:
11
+ library_group_id: 1
12
+ patron_id: 1
13
+ call_number_delimiter: "|"
14
+ position: 1
15
+ library_00002:
16
+ name: komagome1
17
+ short_display_name: komagome1
18
+ display_name: 駒込中央図書館
19
+ fax_number:
20
+ telephone_number_1:
21
+ telephone_number_2:
22
+ id: 2
23
+ region: somewhere
24
+ library_group_id: 1
25
+ patron_id: 2
26
+ call_number_delimiter: "|"
27
+ position: 2
28
+ library_00003:
29
+ name: komagome2
30
+ short_display_name: komagome2
31
+ display_name: 駒込1丁目分館
32
+ fax_number:
33
+ telephone_number_1:
34
+ telephone_number_2:
35
+ id: 3
36
+ region: somewhere
37
+ library_group_id: 1
38
+ patron_id: 3
39
+ call_number_delimiter: "|"
40
+ position: 3
@@ -0,0 +1,21 @@
1
+ ---
2
+ role_00001:
3
+ name: Guest
4
+ display_name: Guest
5
+ id: 1
6
+ note:
7
+ role_00002:
8
+ name: User
9
+ display_name: User
10
+ id: 2
11
+ note:
12
+ role_00003:
13
+ name: Librarian
14
+ display_name: Librarian
15
+ id: 3
16
+ note:
17
+ role_00004:
18
+ name: Administrator
19
+ display_name: Administrator
20
+ id: 4
21
+ note:
@@ -0,0 +1,53 @@
1
+ ---
2
+ shelf_00001:
3
+ name: web
4
+ display_name: Library bookmark
5
+ id: 1
6
+ note:
7
+ library_id: 1
8
+ position: 1
9
+ shelf_00002:
10
+ name: web_in_process
11
+ display_name: 受入手続き中
12
+ id: 2
13
+ note:
14
+ library_id: 1
15
+ position: 2
16
+ open_access: 9
17
+ shelf_00003:
18
+ name: honkan01
19
+ display_name: 本館1F
20
+ id: 3
21
+ note:
22
+ library_id: 2
23
+ position: 3
24
+ shelf_00004:
25
+ name: honkan02
26
+ display_name: 本館2F
27
+ id: 4
28
+ note:
29
+ library_id: 2
30
+ position: 4
31
+ shelf_00005:
32
+ name: honkan02_in_process
33
+ display_name: 受入手続き中
34
+ id: 5
35
+ note:
36
+ library_id: 2
37
+ position: 5
38
+ open_access: 9
39
+ shelf_00006:
40
+ name: bunkan01
41
+ display_name: 分館1F
42
+ id: 6
43
+ note:
44
+ library_id: 3
45
+ position: 6
46
+ shelf_00007:
47
+ name: bunkan01_in_process
48
+ display_name: 受入手続き中
49
+ id: 7
50
+ note:
51
+ library_id: 3
52
+ position: 7
53
+ open_access: 9