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
@@ -1,26 +0,0 @@
1
- <div id="object_list">
2
- <table class="index">
3
- <%- @imported_objects.each do |imported_object| -%>
4
- <tr class="line<%= cycle("0", "1") -%>">
5
- <td><%= link_to h("#{imported_object.importable_type}/#{imported_object.importable_id}"), imported_object -%></td>
6
- <td>
7
- <%- case imported_object.importable_type when 'Work' -%>
8
- <%= link_to h(imported_object.importable.original_title), imported_object.importable -%>
9
- <%- when 'Expression' -%>
10
- <%= link_to h(imported_object.importable.original_title), imported_object.importable -%>
11
- <%- when 'Manifestation' -%>
12
- <%= link_to h(imported_object.importable.original_title), imported_object.importable -%>
13
- <%- when 'Item' -%>
14
- <%= link_to h(imported_object.importable.item_identifier), imported_object.importable -%>
15
- <%- if imported_object.importable.manifestation -%>
16
- (<%= link_to h(imported_object.importable.manifestation.original_title), imported_object.importable.manifestation -%>)
17
- <%- end -%>
18
- <%- end -%>
19
- </td>
20
- <!-- <td><%= imported_object.line_number -%></td> -->
21
- </tr>
22
- <%- end -%>
23
- </table>
24
-
25
- <%= will_paginate(@imported_objects, :param_name => :object_page, :class => 'content_pagination digg_pagination') -%>
26
- </div>
@@ -1,9 +0,0 @@
1
- require 'plugins'
2
- require 'enju_leaf/calculate_stat'
3
- require 'enju_library'
4
- require 'enju_circulation'
5
- require 'enju_inventory'
6
- require 'enju_bookmark'
7
- require 'enju_event'
8
- require 'enju_manifestation_viewer'
9
- require 'enju_book_jacket'
@@ -1,30 +0,0 @@
1
- module CalculateStat
2
-
3
- def self.included(base)
4
- base.extend ClassMethods
5
- base.send :include, InstanceMethods
6
- base.class_eval do
7
- validates_presence_of :start_date, :end_date
8
- validate :check_date
9
- end
10
- end
11
-
12
- module ClassMethods
13
- def calculate_stat
14
- self.not_calculated.each do |stat|
15
- stat.calculate!
16
- end
17
- end
18
- end
19
-
20
- module InstanceMethods
21
- def check_date
22
- if self.start_date and self.end_date
23
- if self.start_date >= self.end_date
24
- errors.add(:start_date)
25
- errors.add(:end_date)
26
- end
27
- end
28
- end
29
- end
30
- end
@@ -1,64 +0,0 @@
1
- require 'will_paginate/view_helpers/action_view'
2
-
3
- # https://gist.github.com/759937
4
- module JqueryMobileRenderer
5
- class WillPaginateJqueryMobileRenderer < WillPaginate::ActionView::LinkRenderer
6
-
7
- def to_html
8
- html = pagination.map do |item|
9
- item.is_a?(Fixnum) ?
10
- page_number(item) :
11
- tag(:li, send(item), :class => 'mobile_pagination')
12
- end.join(@options[:link_separator])
13
-
14
- @options[:container] ? html_container(html) : html
15
- end
16
-
17
- def container_attributes
18
- super.merge({
19
- :'data-role' => 'navbar'
20
- })
21
- end
22
-
23
- def pagination
24
- items = @options[:page_links] ? [current_page] : []
25
- items.unshift :previous_page
26
- items.push :next_page
27
- end
28
-
29
- protected
30
- def html_container(html)
31
- tag(:div, tag(:ul, html), container_attributes)
32
- end
33
-
34
- def page_number(page)
35
- first = (page - 1) * @collection.per_page + 1
36
- last = [ first + @collection.per_page - 1, @collection.total_entries ].min
37
- range = "#{first}-#{last}"
38
-
39
- c = (page == current_page) ? 'ui-btn-active' : nil
40
-
41
- tag(:li, link(range, page, :rel => rel_value(page), :class => c), :class => 'mobile_pagination')
42
- end
43
-
44
- def previous_or_next_page(page, text, classname)
45
- if page
46
- link(text, page, :class => classname)
47
- #else
48
- # tag(:span, text, :class => classname + ' disabled')
49
- end
50
- end
51
- end
52
- end
53
-
54
- module WillPaginate
55
- module ActionView
56
- include JqueryMobileRenderer
57
- end
58
- end
59
-
60
- module ActionView
61
- module CompiledTemplates
62
- include WillPaginate::ActionView
63
- end
64
- end