enju_biblio 0.0.9 → 0.1.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. data/app/controllers/accepts_controller.rb +83 -0
  2. data/app/controllers/items_controller.rb +2 -2
  3. data/app/controllers/manifestations_controller.rb +8 -8
  4. data/app/controllers/patrons_controller.rb +18 -4
  5. data/app/controllers/series_has_manifestations_controller.rb +1 -1
  6. data/app/controllers/series_statements_controller.rb +2 -5
  7. data/app/models/accept.rb +36 -0
  8. data/app/models/create.rb +0 -4
  9. data/app/models/donate.rb +0 -4
  10. data/app/models/exemplify.rb +0 -4
  11. data/app/models/import_request.rb +0 -4
  12. data/app/models/item.rb +2 -4
  13. data/app/models/manifestation.rb +5 -8
  14. data/app/models/own.rb +0 -3
  15. data/app/models/patron.rb +2 -4
  16. data/app/models/picture_file.rb +0 -4
  17. data/app/models/produce.rb +0 -4
  18. data/app/models/realize.rb +0 -4
  19. data/app/models/series_has_manifestation.rb +1 -3
  20. data/app/models/series_statement.rb +2 -4
  21. data/app/views/accepts/_form.html.erb +11 -0
  22. data/app/views/accepts/_list.html.erb +31 -0
  23. data/app/views/accepts/edit.html.erb +13 -0
  24. data/app/views/accepts/index.csv.erb +4 -0
  25. data/app/views/accepts/index.html.erb +49 -0
  26. data/app/views/accepts/index.js.erb +1 -0
  27. data/app/views/accepts/new.html.erb +14 -0
  28. data/app/views/accepts/show.html.erb +31 -0
  29. data/app/views/countries/index.html.erb +1 -1
  30. data/app/views/creates/_index.html.erb +1 -1
  31. data/app/views/creates/_index_patron.html.erb +1 -1
  32. data/app/views/creates/_index_work.html.erb +1 -1
  33. data/app/views/donates/index.html.erb +1 -1
  34. data/app/views/exemplifies/index.html.erb +1 -1
  35. data/app/views/extents/index.html.erb +1 -1
  36. data/app/views/import_requests/index.html.erb +1 -1
  37. data/app/views/items/index.html.erb +1 -1
  38. data/app/views/items/index.mobile.erb +1 -1
  39. data/app/views/languages/index.html.erb +1 -1
  40. data/app/views/licenses/index.html.erb +1 -1
  41. data/app/views/manifestations/_list.html.erb +2 -2
  42. data/app/views/manifestations/_manifestation.html.erb +1 -1
  43. data/app/views/manifestations/_question_list.html.erb +2 -2
  44. data/app/views/manifestations/_tab_list.html.erb +1 -1
  45. data/app/views/manifestations/index.html.erb +2 -2
  46. data/app/views/manifestations/index.mobile.erb +1 -1
  47. data/app/views/medium_of_performances/index.html.erb +1 -1
  48. data/app/views/owns/index.html.erb +1 -1
  49. data/app/views/patron_import_files/index.html.erb +1 -1
  50. data/app/views/patron_import_results/index.html.erb +1 -1
  51. data/app/views/patrons/_expression_list.html.erb +2 -2
  52. data/app/views/patrons/_index.html.erb +1 -1
  53. data/app/views/patrons/_index_expression.html.erb +1 -1
  54. data/app/views/patrons/_index_manifestation.html.erb +1 -1
  55. data/app/views/patrons/_index_patron.html.erb +1 -1
  56. data/app/views/patrons/_index_patron_merge_list.html.erb +1 -1
  57. data/app/views/patrons/_index_work.html.erb +1 -1
  58. data/app/views/patrons/_manifestation_list.html.erb +2 -2
  59. data/app/views/patrons/_work_list.html.erb +2 -2
  60. data/app/views/patrons/index.mobile.erb +1 -1
  61. data/app/views/picture_files/_index.html.erb +1 -1
  62. data/app/views/picture_files/_index_event.html.erb +1 -1
  63. data/app/views/picture_files/_index_manifestation.html.erb +1 -1
  64. data/app/views/picture_files/_index_patron.html.erb +1 -1
  65. data/app/views/picture_files/_index_shelf.html.erb +1 -1
  66. data/app/views/produces/_index.html.erb +1 -1
  67. data/app/views/produces/_index_manifestation.html.erb +1 -1
  68. data/app/views/produces/_index_patron.html.erb +1 -1
  69. data/app/views/realizes/_index.html.erb +1 -1
  70. data/app/views/realizes/_index_expression.html.erb +1 -1
  71. data/app/views/realizes/_index_patron.html.erb +1 -1
  72. data/app/views/resource_import_files/index.html.erb +1 -1
  73. data/app/views/resource_import_results/index.html.erb +1 -1
  74. data/app/views/series_has_manifestations/index.html.erb +1 -1
  75. data/app/views/series_statements/_index.html.erb +1 -1
  76. data/app/views/series_statements/_index_manifestation.html.erb +1 -1
  77. data/app/views/series_statements/_index_series_statement_merge_list.html.erb +1 -1
  78. data/app/views/series_statements/_manifestation_list.html.erb +2 -2
  79. data/{spec/dummy/db → db}/migrate/120_create_baskets.rb +0 -0
  80. data/{spec/dummy/db → db}/migrate/20120319173203_create_accepts.rb +0 -0
  81. data/lib/enju_biblio.rb +4 -0
  82. data/lib/enju_biblio/engine.rb +0 -3
  83. data/lib/enju_biblio/version.rb +1 -1
  84. data/lib/generators/enju_biblio/views_generator.rb +51 -0
  85. data/spec/controllers/accepts_controller_spec.rb +304 -0
  86. data/spec/dummy/app/models/ability.rb +2 -0
  87. data/spec/dummy/config/application.rb +9 -1
  88. data/spec/dummy/config/initializers/kaminari_config.rb +9 -0
  89. data/spec/dummy/db/test.sqlite3 +0 -0
  90. data/spec/dummy/lib/plugins/ext.rb +0 -2
  91. data/spec/dummy/tmp/cache/4F7/F90/default_role +0 -0
  92. data/spec/dummy/tmp/cache/6E4/420/search_engine_all +0 -0
  93. data/spec/factories/accepts.rb +9 -0
  94. data/spec/factories/basket.rb +5 -0
  95. data/spec/models/accept_spec.rb +22 -0
  96. data/spec/requests/accepts_spec.rb +11 -0
  97. data/spec/routing/accepts_routing_spec.rb +27 -0
  98. data/spec/views/accepts/edit.html.erb_spec.rb +18 -0
  99. data/spec/views/accepts/index.html.erb_spec.rb +25 -0
  100. data/spec/views/accepts/new.html.erb_spec.rb +29 -0
  101. data/spec/views/accepts/show.html.erb_spec.rb +17 -0
  102. data/spec/views/creates/index.html.erb_spec.rb +2 -2
  103. data/spec/views/exemplifies/index.html.erb_spec.rb +2 -2
  104. data/spec/views/owns/index.html.erb_spec.rb +2 -2
  105. data/spec/views/produces/index.html.erb_spec.rb +2 -2
  106. data/spec/views/realizes/index.html.erb_spec.rb +2 -2
  107. data/spec/views/series_has_manifestations/index.html.erb_spec.rb +2 -2
  108. metadata +50 -42
  109. data/app/views/resource_import_files/_show_object_list.html.erb +0 -26
  110. data/spec/dummy/lib/enju_leaf.rb +0 -9
  111. data/spec/dummy/lib/enju_leaf/calculate_stat.rb +0 -30
  112. data/spec/dummy/lib/plugins/ext/will_paginate.rb +0 -64
@@ -0,0 +1,11 @@
1
+ <%= simple_form_for(@accept) do |f| %>
2
+ <%= f.error_notification %>
3
+
4
+ <div class="form-inputs">
5
+ <%= f.input :item_id %>
6
+ </div>
7
+
8
+ <div class="form-actions">
9
+ <%= f.button :submit %>
10
+ </div>
11
+ <% end %>
@@ -0,0 +1,31 @@
1
+ <div style="color: red"><%= flash[:message] -%></div>
2
+
3
+ <div class="search_form">
4
+ <%= form_for(@accept, :url => basket_accepts_path(@basket), :remote => true) do |f| %>
5
+ <%= f.error_messages %>
6
+ <p>
7
+ <%= t('activerecord.attributes.item.item_identifier') -%>:
8
+ <%= f.search_field :item_identifier, :class => 'resource_item_identifier', :value => nil -%>
9
+ <%= f.submit t('accept.accept'), 'data-disable-with' => t('page.saving') -%>
10
+ </p>
11
+ <%- end -%>
12
+ </div>
13
+
14
+ <table class="index">
15
+ <tr>
16
+ <th><%= t('activerecord.models.item') -%></th>
17
+ </tr>
18
+ <%- @accepts.each_with_index do |accept, i| -%>
19
+ <tr class="line<%= cycle("0", "1") -%>">
20
+ <td>
21
+ <%= render 'manifestations/show_index', :manifestation => accept.item.manifestation %>
22
+ <%= link_to accept.item.item_identifier, accept.item -%> / <%= accept.item.call_number %>
23
+ (<%= link_to accept.item.shelf.library.display_name.localize, accept.item.shelf.library %> /
24
+ <%= link_to accept.item.shelf.display_name.localize, accept.item.shelf %>)<br />
25
+ <%=l accept.created_at %>
26
+ </td>
27
+ </tr>
28
+ <%- end -%>
29
+ </table>
30
+
31
+ <%= javascript_tag("$('#accept_item_identifier').focus()") -%>
@@ -0,0 +1,13 @@
1
+ <div id="content_detail" class="ui-corner-all">
2
+ <h1 class="title"><%= t('page.editing', :model => t('activerecord.models.accept')) -%></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'), @accept -%></li>
11
+ <li><%= link_to t('page.back'), accepts_path -%></li>
12
+ </ul>
13
+ </div>
@@ -0,0 +1,4 @@
1
+ item_identifier basket_id accepted_at
2
+ <% @accepts.each do |accept| %>
3
+ <%= accept.item.item_identifier %> <%= accept.basket_id %> <%= accept.created_at %>
4
+ <% end %>
@@ -0,0 +1,49 @@
1
+ <div id="content_detail" class="ui-corner-all">
2
+ <h1 class="title"><%= t('page.listing', :model => t('activerecord.models.accept')) -%></h1>
3
+ <div id="content_list">
4
+
5
+ <div class="search_form">
6
+ <%= form_for(:accept, :html => {:method => :get}) do |f| %>
7
+ <p>
8
+ <%= t('activerecord.attributes.item.item_identifier') -%>:
9
+ <%= f.search_field :item_identifier, :value => @query, :class => 'resource_item_identifier' -%>
10
+ <%= f.submit t('page.search') -%>
11
+ </p>
12
+ <%- end -%>
13
+ </div>
14
+
15
+ <table class="table table-striped index">
16
+ <tr>
17
+ <th><%= t('activerecord.models.item') -%></th>
18
+ <th></th>
19
+ </tr>
20
+ <%- @accepts.each_with_index do |accept, i| -%>
21
+ <tr class="line<%= cycle("0", "1") -%>">
22
+ <td>
23
+ <% if accept.item %>
24
+ <%= render 'manifestations/show_index', :manifestation => accept.item.manifestation %>
25
+ <%= link_to accept.item.item_identifier, accept.item -%> / <%= accept.item.call_number %>
26
+ (<%= link_to accept.item.shelf.library.display_name.localize, accept.item.shelf.library %> /
27
+ <%= link_to accept.item.shelf.display_name.localize, accept.item.shelf %>)<br />
28
+ <%=l accept.created_at %>
29
+ <% end %>
30
+ </td>
31
+ <td>
32
+ <%- if can? :destroy, accept -%>
33
+ <%= link_to t('page.destroy'), accept, :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%>
34
+ <%- end -%>
35
+ </td>
36
+ </tr>
37
+ <%- end -%>
38
+ </table>
39
+ <%= javascript_tag("$('#accept_item_identifier').focus()") -%>
40
+
41
+ <%= paginate(@accepts) %>
42
+ </div>
43
+ </div>
44
+
45
+ <div id="submenu" class="ui-corner-all">
46
+ <ul>
47
+ <li><%= link_to t('page.new', :model => t('activerecord.models.accept')), new_accept_path -%></li>
48
+ </ul>
49
+ </div>
@@ -0,0 +1 @@
1
+ $("#accept_list").html("<%= escape_javascript(render('accepts/list')) %>");
@@ -0,0 +1,14 @@
1
+ <div id="content_detail" class="ui-corner-all">
2
+ <h1 class="title"><%= t('page.new', :model => t('activerecord.models.accept')) -%></h1>
3
+ <div id="content_list">
4
+ <div id="accept_list">
5
+ <%= render 'list' -%>
6
+ </div>
7
+ </div>
8
+ </div>
9
+
10
+ <div id="submenu" class="ui-corner-all">
11
+ <ul>
12
+ <li><%= link_to t('page.back'), accepts_path -%></li>
13
+ </ul>
14
+ </div>
@@ -0,0 +1,31 @@
1
+ <div id="content_detail" class="ui-corner-all">
2
+ <h1 class="title"><%= t('page.showing', :model => t('activerecord.models.accept')) -%></h1>
3
+ <div id="content_list">
4
+ <p id="notice"><%= notice %></p>
5
+
6
+ <p>
7
+ <strong><%= t('activerecord.models.item') -%>:</strong>
8
+ <% if @accept.item %>
9
+ <%= link_to @accept.item.item_identifier, @accept.item -%>
10
+ (<%= link_to @accept.item.manifestation.original_title, @accept.item.manifestation %>)
11
+ <% end %>
12
+ </p>
13
+
14
+ <p>
15
+ <strong><%= t('activerecord.models.user') -%>:</strong>
16
+ <%= link_to @accept.librarian.username, @accept.librarian if @accept.librarian -%>
17
+ </p>
18
+
19
+ <p>
20
+ <strong><%= t('page.created_at') -%>:</strong>
21
+ <%=l @accept.created_at %>
22
+ </p>
23
+
24
+ </div>
25
+ </div>
26
+
27
+ <div id="submenu" class="ui-corner-all">
28
+ <ul>
29
+ <li><%= back_to_index(flash[:page_info]) -%></li>
30
+ </ul>
31
+ </div>
@@ -32,7 +32,7 @@
32
32
  <%- end -%>
33
33
  </table>
34
34
 
35
- <%= will_paginate(@countries) -%>
35
+ <%= paginate(@countries) -%>
36
36
  </div>
37
37
  </div>
38
38
 
@@ -23,7 +23,7 @@
23
23
  <%- end -%>
24
24
  </table>
25
25
 
26
- <%= will_paginate(@creates) -%>
26
+ <%= paginate(@creates) -%>
27
27
  </div>
28
28
  </div>
29
29
 
@@ -35,7 +35,7 @@
35
35
  <%- end -%>
36
36
  </table>
37
37
 
38
- <%= will_paginate(@creates) -%>
38
+ <%= paginate(@creates) -%>
39
39
  </div>
40
40
  </div>
41
41
 
@@ -28,7 +28,7 @@
28
28
  <%- end -%>
29
29
  </table>
30
30
 
31
- <%= will_paginate(@creates) -%>
31
+ <%= paginate(@creates) -%>
32
32
  </div>
33
33
  </div>
34
34
 
@@ -31,7 +31,7 @@
31
31
  <%- end -%>
32
32
  </table>
33
33
 
34
- <%= will_paginate(@donates) -%>
34
+ <%= paginate(@donates) -%>
35
35
 
36
36
  </div>
37
37
  </div>
@@ -25,7 +25,7 @@
25
25
  <%- end -%>
26
26
  </table>
27
27
 
28
- <%= will_paginate(@exemplifies) -%>
28
+ <%= paginate(@exemplifies) -%>
29
29
  </div>
30
30
  </div>
31
31
 
@@ -36,7 +36,7 @@
36
36
  <%- end -%>
37
37
  </table>
38
38
 
39
- <%= will_paginate(@extents) -%>
39
+ <%= paginate(@extents) -%>
40
40
  </div>
41
41
  </div>
42
42
 
@@ -30,7 +30,7 @@
30
30
  <%- end -%>
31
31
  </table>
32
32
 
33
- <%= will_paginate(@import_requests) -%>
33
+ <%= paginate(@import_requests) -%>
34
34
  </div>
35
35
  </div>
36
36
 
@@ -60,7 +60,7 @@
60
60
  <%- end -%>
61
61
  </table>
62
62
 
63
- <%= will_paginate(@items) -%>
63
+ <%= paginate(@items) -%>
64
64
  </div>
65
65
  </div>
66
66
 
@@ -48,6 +48,6 @@
48
48
  <%- end -%>
49
49
  </table>
50
50
 
51
- <%= will_paginate(@items) -%>
51
+ <%= paginate(@items) -%>
52
52
  </div>
53
53
  </div>
@@ -36,7 +36,7 @@
36
36
  <%- end -%>
37
37
  </table>
38
38
 
39
- <%= will_paginate(@languages) -%>
39
+ <%= paginate(@languages) -%>
40
40
  </div>
41
41
  </div>
42
42
 
@@ -35,7 +35,7 @@
35
35
  <%- end -%>
36
36
  </table>
37
37
 
38
- <%= will_paginate(@licenses) -%>
38
+ <%= paginate(@licenses) -%>
39
39
  </div>
40
40
  </div>
41
41
 
@@ -2,11 +2,11 @@
2
2
  <%= render manifestations %>
3
3
  </table>
4
4
 
5
- <%= will_paginate(manifestations) -%>
5
+ <%= paginate(manifestations) -%>
6
6
  <br />
7
7
 
8
8
  <div>
9
- <%- if manifestations and manifestations.size > Manifestation.per_page.div(2) -%>
9
+ <%- if manifestations and manifestations.size > @manifestations.per_page.div(2) -%>
10
10
  <%= form_for :manifestations, :html => {:method => 'get'} do -%>
11
11
  <p>
12
12
  <%= t('page.search_term') -%>:
@@ -1,5 +1,5 @@
1
1
  <tr class="line<%= cycle("0", "1") -%>">
2
- <td style="width: 30px"><%= itemnum = @manifestations.offset + 1 + manifestation_counter -%></td>
2
+ <td style="width: 30px"><%= @manifestations.offset_value + 1 + manifestation_counter -%></td>
3
3
  <td style="480px">
4
4
  <% if manifestation.root_of_series? %>
5
5
  <%= render 'manifestations/show_series_index', :manifestation => manifestation -%>
@@ -1,13 +1,13 @@
1
1
  <div id="question">
2
2
  <div id="question_list">
3
3
  <ul>
4
- <% manifestation.questions(:user => current_user).each do |question| %>
4
+ <% @questions.each do |question| %>
5
5
  <li>
6
6
  <%= link_to question.body, question %>
7
7
  (<%= t('page.last_updated') %>: <%=l question.updated_at %>)
8
8
  </li>
9
9
  <% end %>
10
10
  </ul>
11
- <%= will_paginate(manifestation.questions(:user => current_user), :param_name => :question_page, :class => 'content_pagination digg_pagination') -%>
11
+ <%= paginate(@questions, :param_name => :question_page, :remote => true) -%>
12
12
  </div>
13
13
  </div>
@@ -1,7 +1,7 @@
1
1
  <%- if manifestation.original_manifestations.first or manifestation.derived_manifestations.first -%>
2
2
  <%= render 'manifestations/manifestation_list', :manifestation => manifestation -%>
3
3
  <%- end -%>
4
- <%- if defined?(EnjuQuestion) -%>
4
+ <%-if defined?(EnjuQuestion) -%>
5
5
  <%- unless manifestation.questions(:user => current_user).empty? -%>
6
6
  <%= render 'manifestations/question_list', :manifestation => manifestation -%>
7
7
  <%- end -%>
@@ -25,7 +25,7 @@
25
25
  <%= render 'show_series_statement' %>
26
26
  <% end %>
27
27
 
28
- <%- if @manifestations.total_entries > 0 -%>
28
+ <%- if @manifestations.total_count > 0 -%>
29
29
  <p>
30
30
  <%= t('page.number_of_search_results', :count => @count[:query_result], :numdocs => Manifestation.search.total, :seconds => sprintf("%.3f", @seconds)) -%>
31
31
  <%- if @count[:query_result] > configatron.max_number_of_results -%>
@@ -83,7 +83,7 @@
83
83
  <%= render 'submenu_series_statement' %>
84
84
  <% end %>
85
85
  <h3><%= link_to h("#{t('page.total')}: #{@count[:query_result]}"), url_for(params.merge(:action => 'index', :view => nil, :carrier_type => nil, :library => nil, :language => nil, :subject => nil, :only_path => true)) -%></h3>
86
- <%- if @manifestations.total_entries > 0 -%>
86
+ <%- if @manifestations.total_count > 0 -%>
87
87
  <%= render 'manifestations/all_facet' -%>
88
88
  <%- end -%>
89
89
  <div>
@@ -18,4 +18,4 @@
18
18
  <% end %>
19
19
  </ul>
20
20
 
21
- <%= will_paginate(@manifestations, :renderer => WillPaginateJqueryMobileRenderer) %>
21
+ <%= paginate(@manifestations, :window => 0) %>
@@ -33,7 +33,7 @@
33
33
  <%- end -%>
34
34
  </table>
35
35
 
36
- <%= will_paginate(@medium_of_performances) -%>
36
+ <%= paginate(@medium_of_performances) -%>
37
37
  </div>
38
38
  </div>
39
39
 
@@ -33,7 +33,7 @@
33
33
  <%- end -%>
34
34
  </table>
35
35
 
36
- <%= will_paginate(@owns) -%>
36
+ <%= paginate(@owns) -%>
37
37
  </div>
38
38
  </div>
39
39
 
@@ -29,7 +29,7 @@
29
29
  <%- end -%>
30
30
  </table>
31
31
 
32
- <%= will_paginate(@patron_import_files) -%>
32
+ <%= paginate(@patron_import_files) -%>
33
33
  </div>
34
34
  </div>
35
35
 
@@ -32,7 +32,7 @@
32
32
  <% end %>
33
33
  </table>
34
34
 
35
- <%= will_paginate(@patron_import_results) %>
35
+ <%= paginate(@patron_import_results) %>
36
36
 
37
37
  </div>
38
38
  </div>
@@ -1,5 +1,5 @@
1
1
  <div id="expression">
2
- <%= will_paginate(@expressions, :param_name => :expression_list_page, :class => 'content_pagination digg_pagination') -%>
2
+ <%= paginate(@expressions, :param_name => :expression_list_page, :remote => true) -%>
3
3
  <ul>
4
4
  <%- @expressions.each do |manifestation| -%>
5
5
  <li>
@@ -15,6 +15,6 @@
15
15
  </li>
16
16
  <%- end -%>
17
17
  </ul>
18
- <%= will_paginate(@expressions, :param_name => :expression_list_page, :class => 'content_pagination digg_pagination') -%>
18
+ <%= paginate(@expressions, :param_name => :expression_list_page, :remote => true) %>
19
19
  </div>
20
20
 
@@ -20,7 +20,7 @@
20
20
  <%= render @patrons %>
21
21
  </table>
22
22
 
23
- <%= will_paginate(@patrons) -%>
23
+ <%= paginate(@patrons) -%>
24
24
  </div>
25
25
  </div>
26
26
 
@@ -45,7 +45,7 @@
45
45
  <%- end -%>
46
46
  </table>
47
47
 
48
- <%= will_paginate(@patrons) -%>
48
+ <%= paginate(@patrons) -%>
49
49
  </div>
50
50
  </div>
51
51
 
@@ -42,7 +42,7 @@
42
42
  <%- end -%>
43
43
  </table>
44
44
 
45
- <%= will_paginate(@patrons) -%>
45
+ <%= paginate(@patrons) -%>
46
46
  </div>
47
47
  </div>
48
48
 
@@ -57,7 +57,7 @@
57
57
  <%- end -%>
58
58
  </table>
59
59
 
60
- <%= will_paginate(@patrons) -%>
60
+ <%= paginate(@patrons) -%>
61
61
  </div>
62
62
  </div>
63
63