enju_library 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +3 -0
  3. data/Rakefile +47 -0
  4. data/app/controllers/bookstores_controller.rb +17 -0
  5. data/app/controllers/budget_types_controller.rb +13 -0
  6. data/app/controllers/libraries_controller.rb +125 -0
  7. data/app/controllers/library_groups_controller.rb +46 -0
  8. data/app/controllers/request_status_types_controller.rb +13 -0
  9. data/app/controllers/request_types_controller.rb +13 -0
  10. data/app/controllers/search_engines_controller.rb +17 -0
  11. data/app/controllers/shelves_controller.rb +138 -0
  12. data/app/controllers/subscribes_controller.rb +82 -0
  13. data/app/controllers/subscriptions_controller.rb +87 -0
  14. data/app/helpers/shelves_helper.rb +13 -0
  15. data/app/models/bookstore.rb +37 -0
  16. data/app/models/budget_type.rb +19 -0
  17. data/app/models/library.rb +131 -0
  18. data/app/models/library_group.rb +86 -0
  19. data/app/models/library_group_sweeper.rb +12 -0
  20. data/app/models/request_status_type.rb +20 -0
  21. data/app/models/request_type.rb +19 -0
  22. data/app/models/search_engine.rb +52 -0
  23. data/app/models/shelf.rb +66 -0
  24. data/app/models/subscribe.rb +23 -0
  25. data/app/models/subscription.rb +44 -0
  26. data/app/views/accepts/_form.html.erb +11 -0
  27. data/app/views/accepts/_list.html.erb +31 -0
  28. data/app/views/accepts/edit.html.erb +13 -0
  29. data/app/views/accepts/index.csv.erb +4 -0
  30. data/app/views/accepts/index.html.erb +49 -0
  31. data/app/views/accepts/index.js.erb +1 -0
  32. data/app/views/accepts/new.html.erb +14 -0
  33. data/app/views/accepts/show.html.erb +31 -0
  34. data/app/views/bookstores/_form.html.erb +42 -0
  35. data/app/views/bookstores/edit.html.erb +13 -0
  36. data/app/views/bookstores/index.html.erb +49 -0
  37. data/app/views/bookstores/new.html.erb +12 -0
  38. data/app/views/bookstores/show.html.erb +52 -0
  39. data/app/views/budget_types/_form.html.erb +19 -0
  40. data/app/views/budget_types/edit.html.erb +13 -0
  41. data/app/views/budget_types/index.html.erb +43 -0
  42. data/app/views/budget_types/new.html.erb +12 -0
  43. data/app/views/budget_types/show.html.erb +29 -0
  44. data/app/views/libraries/_calendar.html.erb +13 -0
  45. data/app/views/libraries/_form.html.erb +90 -0
  46. data/app/views/libraries/_map.html.erb +25 -0
  47. data/app/views/libraries/_map.mobile.erb +25 -0
  48. data/app/views/libraries/edit.html.erb +13 -0
  49. data/app/views/libraries/index.html.erb +75 -0
  50. data/app/views/libraries/new.html.erb +12 -0
  51. data/app/views/libraries/show.html.erb +131 -0
  52. data/app/views/libraries/show.mobile.erb +26 -0
  53. data/app/views/library_groups/_form.html.erb +59 -0
  54. data/app/views/library_groups/edit.html.erb +12 -0
  55. data/app/views/library_groups/index.html.erb +30 -0
  56. data/app/views/library_groups/new.html.erb +12 -0
  57. data/app/views/library_groups/show.html.erb +66 -0
  58. data/app/views/request_status_types/_form.html.erb +19 -0
  59. data/app/views/request_status_types/edit.html.erb +13 -0
  60. data/app/views/request_status_types/index.html.erb +40 -0
  61. data/app/views/request_status_types/new.html.erb +12 -0
  62. data/app/views/request_status_types/show.html.erb +29 -0
  63. data/app/views/request_types/_form.html.erb +19 -0
  64. data/app/views/request_types/edit.html.erb +13 -0
  65. data/app/views/request_types/index.html.erb +40 -0
  66. data/app/views/request_types/new.html.erb +12 -0
  67. data/app/views/request_types/show.html.erb +29 -0
  68. data/app/views/search_engines/_form.html.erb +44 -0
  69. data/app/views/search_engines/edit.html.erb +13 -0
  70. data/app/views/search_engines/index.html.erb +44 -0
  71. data/app/views/search_engines/new.html.erb +12 -0
  72. data/app/views/search_engines/show.html.erb +49 -0
  73. data/app/views/shelves/_form.html.erb +37 -0
  74. data/app/views/shelves/_library_facet.html.erb +12 -0
  75. data/app/views/shelves/_select_form.html.erb +1 -0
  76. data/app/views/shelves/edit.html.erb +13 -0
  77. data/app/views/shelves/index.html.erb +73 -0
  78. data/app/views/shelves/new.html.erb +18 -0
  79. data/app/views/shelves/show.html.erb +65 -0
  80. data/app/views/subscribes/edit.html.erb +37 -0
  81. data/app/views/subscribes/index.html.erb +31 -0
  82. data/app/views/subscribes/new.html.erb +48 -0
  83. data/app/views/subscribes/show.html.erb +34 -0
  84. data/app/views/subscriptions/edit.html.erb +29 -0
  85. data/app/views/subscriptions/index.html.erb +39 -0
  86. data/app/views/subscriptions/new.html.erb +28 -0
  87. data/app/views/subscriptions/show.html.erb +40 -0
  88. data/config/routes.rb +17 -0
  89. data/db/migrate/059_create_libraries.rb +28 -0
  90. data/db/migrate/069_create_shelves.rb +15 -0
  91. data/db/migrate/080_create_library_groups.rb +20 -0
  92. data/db/migrate/124_create_bookstores.rb +17 -0
  93. data/db/migrate/130_create_request_status_types.rb +12 -0
  94. data/db/migrate/131_create_request_types.rb +12 -0
  95. data/db/migrate/20081006090811_create_subscriptions.rb +17 -0
  96. data/db/migrate/20081006093246_create_subscribes.rb +14 -0
  97. data/db/migrate/20081023092436_create_search_engines.rb +17 -0
  98. data/db/migrate/20110222073537_add_url_to_library_group.rb +9 -0
  99. data/db/migrate/20110620173525_add_bookstore_id_to_item.rb +11 -0
  100. data/db/migrate/20110627122938_add_number_of_day_to_notify_overdue_to_user_group.rb +13 -0
  101. data/db/migrate/20120105074911_add_isil_to_library.rb +5 -0
  102. data/db/migrate/20120129014038_create_budget_types.rb +12 -0
  103. data/db/migrate/20120510140958_add_closed_to_shelf.rb +5 -0
  104. data/lib/enju_library/engine.rb +16 -0
  105. data/lib/enju_library/master_model.rb +19 -0
  106. data/lib/enju_library/url_validator.rb +10 -0
  107. data/lib/enju_library/version.rb +3 -0
  108. data/lib/enju_library.rb +49 -0
  109. data/lib/tasks/enju_library_tasks.rake +4 -0
  110. data/test/dummy/README.rdoc +261 -0
  111. data/test/dummy/Rakefile +7 -0
  112. data/test/dummy/app/assets/javascripts/application.js +15 -0
  113. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  114. data/test/dummy/app/controllers/application_controller.rb +3 -0
  115. data/test/dummy/app/helpers/application_helper.rb +2 -0
  116. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  117. data/test/dummy/config/application.rb +56 -0
  118. data/test/dummy/config/boot.rb +10 -0
  119. data/test/dummy/config/database.yml +25 -0
  120. data/test/dummy/config/environment.rb +5 -0
  121. data/test/dummy/config/environments/development.rb +37 -0
  122. data/test/dummy/config/environments/production.rb +67 -0
  123. data/test/dummy/config/environments/test.rb +37 -0
  124. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  125. data/test/dummy/config/initializers/inflections.rb +15 -0
  126. data/test/dummy/config/initializers/mime_types.rb +5 -0
  127. data/test/dummy/config/initializers/secret_token.rb +7 -0
  128. data/test/dummy/config/initializers/session_store.rb +8 -0
  129. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  130. data/test/dummy/config/locales/en.yml +5 -0
  131. data/test/dummy/config/routes.rb +58 -0
  132. data/test/dummy/config.ru +4 -0
  133. data/test/dummy/db/development.sqlite3 +0 -0
  134. data/test/dummy/db/test.sqlite3 +0 -0
  135. data/test/dummy/log/development.log +0 -0
  136. data/test/dummy/log/test.log +0 -0
  137. data/test/dummy/public/404.html +26 -0
  138. data/test/dummy/public/422.html +26 -0
  139. data/test/dummy/public/500.html +25 -0
  140. data/test/dummy/public/favicon.ico +0 -0
  141. data/test/dummy/script/rails +6 -0
  142. data/test/enju_library_test.rb +7 -0
  143. data/test/integration/navigation_test.rb +10 -0
  144. data/test/test_helper.rb +15 -0
  145. metadata +576 -0
@@ -0,0 +1,12 @@
1
+ <h4><%= t('activerecord.models.library') -%></h4>
2
+ <ul>
3
+ <%- @library_facet.each do |facet| -%>
4
+ <%- library = Library.where(:name => facet.value).select([:name, :display_name]).first -%>
5
+ <li>
6
+ <%= library_shelf_facet(library, @library, facet) %>
7
+ </li>
8
+ <%- end -%>
9
+ <%- if params[:library_id] -%>
10
+ <li><%= link_to t('page.remove_this_facet'), url_for(params.merge(:library_id => nil, :page => nil, :only_path => true)) -%></li>
11
+ <%- end -%>
12
+ </ul>
@@ -0,0 +1 @@
1
+ <%= options_for_select @shelves.collect{|s| [s.display_name.localize, s.id]} %>
@@ -0,0 +1,13 @@
1
+ <div id="content_detail" class="ui-corner-all">
2
+ <h1 class="title"><%= t('page.editing', :model => t('activerecord.models.shelf')) -%></h1>
3
+ <div id="content_list">
4
+ <%= render 'form' %>
5
+ </div>
6
+ </div>
7
+
8
+ <div id="submenu" class="ui-corner-all">
9
+ <ul>
10
+ <li><%= link_to t('page.show'), @shelf -%></li>
11
+ <li><%= link_to t('page.back'), shelves_path -%></li>
12
+ </ul>
13
+ </div>
@@ -0,0 +1,73 @@
1
+ <div id="content_detail" class="ui-corner-all">
2
+ <h1 class="title"><%= t('page.listing', :model => t('activerecord.models.shelf')) -%></h1>
3
+ <div id="content_list">
4
+ <% if @library %>
5
+ <h2 class="resource_title">
6
+ <%= link_to @library.display_name.localize, @library -%>
7
+ </h2>
8
+ <% end %>
9
+
10
+ <div class="search_form">
11
+ <%= form_for :shelves, :url => shelves_path, :html => {:method => 'get'} do -%>
12
+ <p>
13
+ <%= t('page.search_term') -%>: <%= search_field_tag 'query', h(@query), {:id => 'search_form_top', :class => 'search_form', :placeholder => t('page.search_term')} -%>
14
+ <%= submit_tag t('page.search') -%>
15
+ <%= hidden_field_tag :library_id, @library.name if @library -%>
16
+ </p>
17
+ <%- end -%>
18
+ </div>
19
+
20
+ <table class="index">
21
+ <tr>
22
+ <th id="position"></th>
23
+ <th><%= t('activerecord.attributes.shelf.name') -%></th>
24
+ <th><%= t('activerecord.models.library') -%></th>
25
+ <th></th>
26
+ </tr>
27
+
28
+ <%- @shelves.each_with_index do |shelf, i| -%>
29
+ <tr class="line<%= cycle("0", "1") -%>">
30
+ <td>
31
+ <% if @library and params[:query].blank? and params[:order].blank? %>
32
+ <%- if can? :update, shelf -%>
33
+ <%= move_position(shelf) -%>
34
+ <%- end -%>
35
+ <% end %>
36
+ </td>
37
+ <td>
38
+ <%= link_to shelf.display_name.localize, shelf -%>
39
+ <br />
40
+ <%= shelf.name if can? :update, shelf %>
41
+ </td>
42
+ <td>
43
+ <%= link_to shelf.library.display_name.localize, library_path(shelf.library) -%>
44
+ <% if shelf.closed? %>
45
+ <%= t('activerecord.attributes.shelf.closed') %>
46
+ <% end %>
47
+ <br />
48
+ <%= shelf.library.name if can? :update, shelf.library %>
49
+ </td>
50
+ <td>
51
+ <%- if can? :update, shelf -%>
52
+ <%= link_to t('page.edit'), edit_shelf_path(shelf) -%>
53
+ <% end %>
54
+ <%- if can? :destroy, shelf -%>
55
+ <%= link_to t('page.destroy'), shelf, :confirm => t('page.are_you_sure'), :method => :delete -%>
56
+ <%- end -%>
57
+ </td>
58
+ </tr>
59
+ <%- end -%>
60
+ </table>
61
+
62
+ <%= will_paginate(@shelves) -%>
63
+ </div>
64
+ </div>
65
+
66
+ <div id="submenu" class="ui-corner-all">
67
+ <%= render 'library_facet' %>
68
+ <ul>
69
+ <%- if can? :create, Shelf -%>
70
+ <li><%= link_to t('page.new', :model => t('activerecord.models.shelf')), new_shelf_path -%></li>
71
+ <%- end -%>
72
+ </ul>
73
+ </div>
@@ -0,0 +1,18 @@
1
+ <div id="content_detail" class="ui-corner-all">
2
+ <h1 class="title"><%= t('page.new', :model => t('activerecord.models.shelf')) -%></h1>
3
+ <div id="content_list">
4
+ <%= render 'form' %>
5
+ </div>
6
+ </div>
7
+
8
+ <div id="submenu" class="ui-corner-all">
9
+ <ul>
10
+ <li>
11
+ <%- if @shelf.library -%>
12
+ <%= link_to t('page.back'), library_shelves_path(@shelf.library) -%>
13
+ <%- else -%>
14
+ <%= link_to t('page.back'), shelves_path -%>
15
+ <%- end -%>
16
+ </li>
17
+ </ul>
18
+ </div>
@@ -0,0 +1,65 @@
1
+ <div id="content_detail" class="ui-corner-all">
2
+ <h1 class="title"><%= t('page.listing', :model => t('activerecord.models.shelf')) -%></h1>
3
+ <div id="content_list">
4
+ <p id="notice"><%= notice %></p>
5
+
6
+ <h2 class="resource_title">
7
+ <%= link_to @shelf.library.display_name.localize, @shelf.library -%>
8
+ <%= @shelf.display_name.localize -%>
9
+ </h2>
10
+
11
+ <% if current_user.try(:has_role?, 'Librarian') %>
12
+ <p>
13
+ <strong><%= t('activerecord.attributes.shelf.name') -%>:</strong>
14
+ <%= @shelf.name %>
15
+ </p>
16
+ <% end %>
17
+
18
+ <p>
19
+ <strong><%= t('activerecord.attributes.shelf.closed') -%>:</strong>
20
+ <%= localized_boolean(@shelf.closed) -%>
21
+ </p>
22
+
23
+ <p>
24
+ <strong><%= t('activerecord.attributes.shelf.note') -%>:</strong>
25
+ <%= @shelf.note -%>
26
+ </p>
27
+
28
+ <p>
29
+ <strong><%= t('activerecord.models.picture_file') -%>:</strong><br />
30
+ <%- @shelf.picture_files.each do |picture_file| -%>
31
+ <%= render 'picture_files/link', :picture_file => picture_file %>
32
+ <%- end -%>
33
+ </p>
34
+
35
+ <p>
36
+ <strong><%= t('page.created_at') -%>:</strong>
37
+ <%= l(@shelf.created_at) -%>
38
+ </p>
39
+
40
+ <p>
41
+ <strong><%= t('page.updated_at') -%>:</strong>
42
+ <%= l(@shelf.updated_at) -%>
43
+ </p>
44
+
45
+ </div>
46
+ </div>
47
+
48
+ <div id="submenu" class="ui-corner-all">
49
+ <ul>
50
+ <% if can? :create, Shelf %>
51
+ <%- if @library -%>
52
+ <li><%= link_to t('page.new', :model => t('activerecord.models.shelf')), new_library_shelf_path(@library) -%></li>
53
+ <%- else -%>
54
+ <li><%= link_to t('page.new', :model => t('activerecord.models.shelf')), new_shelf_path -%></li>
55
+ <%- end -%>
56
+ <% end %>
57
+ <% if can? :update, @shelf %>
58
+ <li><%= link_to t('page.edit'), edit_shelf_path(@shelf) -%></li>
59
+ <li><%= link_to t('page.listing', :model => t('activerecord.models.picture_file')), shelf_picture_files_path(@shelf) -%></li>
60
+ <% end %>
61
+ <li>
62
+ <%= back_to_index(flash[:page_info]) -%>
63
+ </li>
64
+ </ul>
65
+ </div>
@@ -0,0 +1,37 @@
1
+ <div id="content_detail" class="ui-corner-all">
2
+ <h1 class="title"><%= t('page.editing', :model => t('activerecord.models.subscribe')) -%></h1>
3
+ <div id="content_list">
4
+
5
+ <%= form_for(@subscribe) do |f| -%>
6
+ <%= f.error_messages -%>
7
+
8
+ <div class="field">
9
+ <%= f.label t('activerecord.models.subscription') -%><br />
10
+ <%= f.text_field :subscription_id -%>
11
+ </div>
12
+ <div class="field">
13
+ <%= f.label t('activerecord.models.work') -%><br />
14
+ <%= f.text_field :work_id -%>
15
+ </div>
16
+ <div class="field">
17
+ <%= f.label :start_at -%><br />
18
+ <%= f.text_field :start_at, :value => @subscribe.start_at.try(:strftime, "%Y-%m-%d"), :class => 'date_field' -%>
19
+ </div>
20
+ <div class="field">
21
+ <%= f.label :end_at -%><br />
22
+ <%= f.text_field :end_at, :value => @subscribe.end_at.try(:strftime, "%Y-%m-%d"), :class => 'date_field' -%>
23
+ </div>
24
+ <div class="actions">
25
+ <%= f.submit %>
26
+ </div>
27
+ <%- end -%>
28
+
29
+ </div>
30
+ </div>
31
+
32
+ <div id="submenu" class="ui-corner-all">
33
+ <ul>
34
+ <li><%= link_to t('page.show'), @subscribe -%></li>
35
+ <li><%= link_to t('page.back'), subscribes_path -%></li>
36
+ </ul>
37
+ </div>
@@ -0,0 +1,31 @@
1
+ <div id="content_detail" class="ui-corner-all">
2
+ <h1 class="title"><%= t('page.listing', :model => t('activerecord.models.subscribe')) -%></h1>
3
+ <div id="content_list">
4
+
5
+ <table class="index">
6
+ <tr>
7
+ <th><%= t('activerecord.models.subscription') -%></th>
8
+ <th><%= t('activerecord.models.work') -%></th>
9
+ </tr>
10
+
11
+ <%- @subscribes.each do |subscribe| -%>
12
+ <tr class="line<%= cycle("0", "1") -%>">
13
+ <td><%= link_to subscribe.subscription.title, subscribe.subscription -%></td>
14
+ <td><%= link_to subscribe.work.original_title, subscribe.work -%></td>
15
+ <td><%= link_to t('page.show'), subscribe -%></td>
16
+ <td><%= link_to t('page.edit'), edit_subscribe_path(subscribe) -%></td>
17
+ <td><%= link_to t('page.destroy'), subscribe, :confirm => t('page.are_you_sure'), :method => :delete -%></td>
18
+ </tr>
19
+ <%- end -%>
20
+ </table>
21
+
22
+ <%= will_paginate(@subscribes) -%>
23
+
24
+ </div>
25
+ </div>
26
+
27
+ <div id="submenu" class="ui-corner-all">
28
+ <ul>
29
+ <li><%= link_to t('page.new', :model => t('activerecord.models.subscribe')), new_subscribe_path -%></li>
30
+ </ul>
31
+ </div>
@@ -0,0 +1,48 @@
1
+ <div id="content_detail" class="ui-corner-all">
2
+ <h1 class="title"><%= t('page.new', :model => t('activerecord.models.subscribe')) -%></h1>
3
+ <div id="content_list">
4
+
5
+ <%= form_for(@subscribe) do |f| -%>
6
+ <%= f.error_messages -%>
7
+ <div class="field">
8
+ <%= f.label t('activerecord.models.subscription') -%><br />
9
+ <%- if @subscription -%>
10
+ <%= link_to @subscription.title, @subscription -%>
11
+ <%= f.hidden_field :subscription_id, :value => @subscription.id -%>
12
+ <%- else -%>
13
+ <%= f.text_field :subscription_id, :value => params[:subscription_id] -%>
14
+ <%- end -%>
15
+ </div>
16
+
17
+ <div class="field">
18
+ <%= f.label t('activerecord.models.work') -%><br />
19
+ <%- if @work -%>
20
+ <%= link_to @work.original_title, @work -%>
21
+ <%= f.hidden_field :work_id, :value => @work.id -%>
22
+ <%- else -%>
23
+ <%= f.text_field :work_id, :value => params[:work_id] -%>
24
+ <%- end -%>
25
+ </div>
26
+ <div class="field">
27
+ <%= f.label :start_at -%><br />
28
+ <%= f.text_field :start_at, :class => 'date_field' -%>
29
+ </div>
30
+ <div class="field">
31
+ <%= f.label :end_at -%><br />
32
+ <%= f.text_field :start_at, :class => 'date_field' -%>
33
+ </div>
34
+
35
+ <div class="actions">
36
+ <%= f.submit %>
37
+ </div>
38
+ <%- end -%>
39
+
40
+ </div>
41
+ </div>
42
+
43
+ <div id="submenu" class="ui-corner-all">
44
+ <ul>
45
+ <li><%= link_to t('activerecord.models.subscription'), subscription_path(@subscription) if @subscription -%>
46
+ <li><%= link_to t('page.listing', :model => t('activerecord.models.work')), subscription_works_path(@subscription) if @subscription -%>
47
+ </ul>
48
+ </div>
@@ -0,0 +1,34 @@
1
+ <div id="content_detail" class="ui-corner-all">
2
+ <h1 class="title"><%= t('page.showing', :model => t('activerecord.models.subscribe')) -%></h1>
3
+ <div id='content_list'>
4
+ <p id="notice"><%= notice %></p>
5
+
6
+ <p>
7
+ <strong><%= t('activerecord.models.subscription') -%>:</strong>
8
+ <%= link_to @subscribe.subscription.title, @subscribe.subscription -%>
9
+ </p>
10
+
11
+ <p>
12
+ <strong><%= t('activerecord.models.work') -%>:</strong>
13
+ <%= link_to @subscribe.work.original_title, @subscribe.work -%>
14
+ </p>
15
+
16
+ <p>
17
+ <strong><%= t('activerecord.attributes.subscribe.start_at') -%>:</strong>
18
+ <%=l @subscribe.start_at -%>
19
+ </p>
20
+
21
+ <p>
22
+ <strong><%= t('activerecord.attributes.subscribe.end_at') -%>:</strong>
23
+ <%=l @subscribe.end_at -%>
24
+ </p>
25
+
26
+ </div>
27
+ </div>
28
+
29
+ <div id="submenu" class="ui-corner-all">
30
+ <ul>
31
+ <li><%= link_to t('page.edit'), edit_subscribe_path(@subscribe) -%></li>
32
+ <li><%= bakc_to_index -%></li>
33
+ </ul>
34
+ </div>
@@ -0,0 +1,29 @@
1
+ <div id="content_detail" class="ui-corner-all">
2
+ <h1 class="title"><%= t('page.editing', :model => t('activerecord.models.subscription')) -%></h1>
3
+ <div id="content_list">
4
+
5
+ <%= form_for(@subscription) do |f| -%>
6
+ <%= f.error_messages -%>
7
+
8
+ <div class="field">
9
+ <%= f.label :title -%><br />
10
+ <%= f.text_field :title, :class => 'resource_title' -%>
11
+ </div>
12
+ <div class="field">
13
+ <%= f.label :note -%><br />
14
+ <%= f.text_area :note, :class => 'resource_textarea' -%>
15
+ </div>
16
+ <div class="actions">
17
+ <%= f.submit %>
18
+ </div>
19
+ <%- end -%>
20
+
21
+ </div>
22
+ </div>
23
+
24
+ <div id="submenu" class="ui-corner-all">
25
+ <ul>
26
+ <li><%= link_to t('page.show'), @subscription -%></li>
27
+ <li><%= link_to t('page.back'), subscriptions_path -%></li>
28
+ </ul>
29
+ </div>
@@ -0,0 +1,39 @@
1
+ <div id="content_detail" class="ui-corner-all">
2
+ <h1 class="title"><%= t('page.listing', :model => t('activerecord.models.subscription')) -%></h1>
3
+ <div id="content_list">
4
+
5
+ <table class="index">
6
+ <tr>
7
+ <th><%= t('page.title') -%></th>
8
+ <th><%= t('activerecord.attributes.subscription.subscribes_count') -%></th>
9
+ <th></th>
10
+ </tr>
11
+
12
+ <%- @subscriptions.each do |subscription| -%>
13
+ <tr class="line<%= cycle("0", "1") -%>">
14
+ <td><%= link_to subscription.title, subscription -%></td>
15
+ <td><%= subscription.works.size -%></td>
16
+ <td>
17
+ <% if can? :destroy, subscription %>
18
+ <%= link_to t('page.edit'), edit_subscription_path(subscription) -%>
19
+ <%= link_to t('page.destroy'), subscription, :confirm => t('page.are_you_sure'), :method => :delete -%>
20
+ <% end %>
21
+ </td>
22
+ </tr>
23
+ <%- end -%>
24
+ </table>
25
+
26
+ <%= will_paginate(@subscrpitions) -%>
27
+
28
+ </div>
29
+ </div>
30
+
31
+ <div id="submenu" class="ui-corner-all">
32
+ <ul>
33
+ <%- if @work -%>
34
+ <li><%= link_to t('page.add', :model => t('activerecord.models.work')), subscriptions_path -%></li>
35
+ <%- else -%>
36
+ <li><%= link_to t('page.new', :model => t('activerecord.models.subscription')), new_subscription_path -%></li>
37
+ <%- end -%>
38
+ </ul>
39
+ </div>
@@ -0,0 +1,28 @@
1
+ <div id="content_detail" class="ui-corner-all">
2
+ <h1 class="title"><%= t('page.new', :model => t('activerecord.models.subscription')) -%></h1>
3
+ <div id="content_list">
4
+
5
+ <%= form_for(@subscription) do |f| -%>
6
+ <%= f.error_messages -%>
7
+
8
+ <div class="field">
9
+ <%= f.label :title -%><br />
10
+ <%= f.text_field :title, :class => 'resource_title' -%>
11
+ </div>
12
+ <div class="field">
13
+ <%= f.label :note -%><br />
14
+ <%= f.text_area :note, :class => 'resource_textarea' -%>
15
+ </div>
16
+ <div class="actions">
17
+ <%= f.submit %>
18
+ </div>
19
+ <%- end -%>
20
+
21
+ </div>
22
+ </div>
23
+
24
+ <div id="submenu" class="ui-corner-all">
25
+ <ul>
26
+ <li><%= link_to t('page.back'), subscriptions_path -%></li>
27
+ </ul>
28
+ </div>
@@ -0,0 +1,40 @@
1
+ <div id="content_detail" class="ui-corner-all">
2
+ <h1 class="title"><%= t('page.showing', :model => t('activerecord.models.subscription')) -%></h1>
3
+ <div id="content_list">
4
+ <p id="notice"><%= notice %></p>
5
+
6
+ <p>
7
+ <strong><%= t('page.title') -%>:</strong>
8
+ <%= @subscription.title -%>
9
+ </p>
10
+
11
+ <p>
12
+ <strong><%= t('activerecord.attributes.subscription.note') -%>:</strong>
13
+ <%= @subscription.note -%>
14
+ </p>
15
+
16
+ <table class="index">
17
+ <tr>
18
+ <th><%= t('page.title') -%></th>
19
+ </tr>
20
+ <%- @subscription.works.each do |work| -%>
21
+ <tr class="line<%= cycle("0", "1") -%>">
22
+ <td>
23
+ <strong><%= link_to work.original_title, work -%></strong>
24
+ <br />
25
+ <%= patrons_list(work.creators.readable_by(current_user)) -%>
26
+ </td>
27
+ </tr>
28
+ <%- end -%>
29
+ </table>
30
+
31
+ </div>
32
+ </div>
33
+
34
+ <div id="submenu" class="ui-corner-all">
35
+ <ul>
36
+ <li><%= link_to t('page.edit'), edit_subscription_path(@subscription) -%></li>
37
+ <li><%= link_to t('work.add'), subscription_manifestations_path(@subscription) -%></li>
38
+ <li><%= back_to_index(flash[:page_info]) -%></li>
39
+ </ul>
40
+ </div>
data/config/routes.rb ADDED
@@ -0,0 +1,17 @@
1
+ Rails.application.routes.draw do
2
+ resources :libraries do
3
+ resources :shelves
4
+ end
5
+ resources :shelves do
6
+ resources :picture_files
7
+ end
8
+
9
+ resources :bookstores
10
+ resources :library_groups, :except => [:new, :create, :destroy]
11
+ resources :subscriptions
12
+ resources :subscribes
13
+ resources :search_engines
14
+ resources :request_status_types
15
+ resources :request_types
16
+ resources :budget_types
17
+ end
@@ -0,0 +1,28 @@
1
+ class CreateLibraries < ActiveRecord::Migration
2
+ def change
3
+ create_table :libraries do |t|
4
+ t.string :name, :null => false
5
+ t.text :display_name
6
+ t.string :short_display_name, :null => false
7
+ t.string :zip_code
8
+ t.text :street
9
+ t.text :locality
10
+ t.text :region
11
+ t.string :telephone_number_1
12
+ t.string :telephone_number_2
13
+ t.string :fax_number
14
+ t.text :note
15
+ t.integer :call_number_rows, :default => 1, :null => false
16
+ t.string :call_number_delimiter, :default => "|", :null => false
17
+ t.integer :library_group_id, :default => 1, :null => false
18
+ t.integer :users_count, :default => 0, :null => false
19
+ t.integer :position
20
+ t.integer :country_id
21
+
22
+ t.timestamps
23
+ t.datetime :deleted_at
24
+ end
25
+ add_index :libraries, :library_group_id
26
+ add_index :libraries, :name, :unique => true
27
+ end
28
+ end
@@ -0,0 +1,15 @@
1
+ class CreateShelves < ActiveRecord::Migration
2
+ def change
3
+ create_table :shelves do |t|
4
+ t.string :name, :null => false
5
+ t.text :display_name
6
+ t.text :note
7
+ t.integer :library_id, :default => 1, :null => false
8
+ t.integer :items_count, :default => 0, :null => false
9
+ t.integer :position
10
+ t.timestamps
11
+ t.datetime :deleted_at
12
+ end
13
+ add_index :shelves, :library_id
14
+ end
15
+ end
@@ -0,0 +1,20 @@
1
+ class CreateLibraryGroups < ActiveRecord::Migration
2
+ def change
3
+ create_table :library_groups do |t|
4
+ t.string :name, :null => false
5
+ t.text :display_name
6
+ t.string :short_name, :null => false
7
+ t.string :email
8
+ t.text :my_networks
9
+ t.boolean :use_dsbl, :default => false, :null => false
10
+ t.text :dsbl_list
11
+ t.text :login_banner
12
+ t.text :note
13
+ t.integer :valid_period_for_new_user, :default => 365, :null => false
14
+ t.integer :country_id
15
+
16
+ t.timestamps
17
+ end
18
+ add_index :library_groups, :short_name
19
+ end
20
+ end
@@ -0,0 +1,17 @@
1
+ class CreateBookstores < ActiveRecord::Migration
2
+ def change
3
+ create_table :bookstores do |t|
4
+ t.text :name, :null => false
5
+ t.string :zip_code
6
+ t.text :address
7
+ t.text :note
8
+ t.string :telephone_number
9
+ t.string :fax_number
10
+ t.string :url
11
+ t.integer :position
12
+ t.datetime :deleted_at
13
+
14
+ t.timestamps
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,12 @@
1
+ class CreateRequestStatusTypes < ActiveRecord::Migration
2
+ def change
3
+ create_table :request_status_types do |t|
4
+ t.string :name, :null => false
5
+ t.text :display_name
6
+ t.text :note
7
+ t.integer :position
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ class CreateRequestTypes < ActiveRecord::Migration
2
+ def change
3
+ create_table :request_types do |t|
4
+ t.string :name, :null => false
5
+ t.text :display_name
6
+ t.text :note
7
+ t.integer :position
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,17 @@
1
+ class CreateSubscriptions < ActiveRecord::Migration
2
+ def change
3
+ create_table :subscriptions do |t|
4
+ t.text :title, :null => false
5
+ t.text :note
6
+ #t.integer :subscription_list_id, :integer
7
+ t.integer :user_id
8
+ t.integer :order_list_id
9
+ t.datetime :deleted_at
10
+ t.integer :subscribes_count, :default => 0, :null => false
11
+
12
+ t.timestamps
13
+ end
14
+ add_index :subscriptions, :user_id
15
+ add_index :subscriptions, :order_list_id
16
+ end
17
+ end
@@ -0,0 +1,14 @@
1
+ class CreateSubscribes < ActiveRecord::Migration
2
+ def change
3
+ create_table :subscribes do |t|
4
+ t.integer :subscription_id, :null => false
5
+ t.integer :work_id, :null => false
6
+ t.datetime :start_at, :null => false
7
+ t.datetime :end_at, :null => false
8
+
9
+ t.timestamps
10
+ end
11
+ add_index :subscribes, :subscription_id
12
+ add_index :subscribes, :work_id
13
+ end
14
+ end
@@ -0,0 +1,17 @@
1
+ class CreateSearchEngines < ActiveRecord::Migration
2
+ def change
3
+ create_table :search_engines do |t|
4
+ t.string :name, :null => false
5
+ t.text :display_name
6
+ t.string :url, :null => false
7
+ t.text :base_url, :null => false
8
+ t.text :http_method, :null => false
9
+ t.text :query_param, :null => false
10
+ t.text :additional_param
11
+ t.text :note
12
+ t.integer :position
13
+
14
+ t.timestamps
15
+ end
16
+ end
17
+ end