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.
- data/app/controllers/accepts_controller.rb +83 -0
- data/app/controllers/items_controller.rb +2 -2
- data/app/controllers/manifestations_controller.rb +8 -8
- data/app/controllers/patrons_controller.rb +18 -4
- data/app/controllers/series_has_manifestations_controller.rb +1 -1
- data/app/controllers/series_statements_controller.rb +2 -5
- data/app/models/accept.rb +36 -0
- data/app/models/create.rb +0 -4
- data/app/models/donate.rb +0 -4
- data/app/models/exemplify.rb +0 -4
- data/app/models/import_request.rb +0 -4
- data/app/models/item.rb +2 -4
- data/app/models/manifestation.rb +5 -8
- data/app/models/own.rb +0 -3
- data/app/models/patron.rb +2 -4
- data/app/models/picture_file.rb +0 -4
- data/app/models/produce.rb +0 -4
- data/app/models/realize.rb +0 -4
- data/app/models/series_has_manifestation.rb +1 -3
- data/app/models/series_statement.rb +2 -4
- data/app/views/accepts/_form.html.erb +11 -0
- data/app/views/accepts/_list.html.erb +31 -0
- data/app/views/accepts/edit.html.erb +13 -0
- data/app/views/accepts/index.csv.erb +4 -0
- data/app/views/accepts/index.html.erb +49 -0
- data/app/views/accepts/index.js.erb +1 -0
- data/app/views/accepts/new.html.erb +14 -0
- data/app/views/accepts/show.html.erb +31 -0
- data/app/views/countries/index.html.erb +1 -1
- data/app/views/creates/_index.html.erb +1 -1
- data/app/views/creates/_index_patron.html.erb +1 -1
- data/app/views/creates/_index_work.html.erb +1 -1
- data/app/views/donates/index.html.erb +1 -1
- data/app/views/exemplifies/index.html.erb +1 -1
- data/app/views/extents/index.html.erb +1 -1
- data/app/views/import_requests/index.html.erb +1 -1
- data/app/views/items/index.html.erb +1 -1
- data/app/views/items/index.mobile.erb +1 -1
- data/app/views/languages/index.html.erb +1 -1
- data/app/views/licenses/index.html.erb +1 -1
- data/app/views/manifestations/_list.html.erb +2 -2
- data/app/views/manifestations/_manifestation.html.erb +1 -1
- data/app/views/manifestations/_question_list.html.erb +2 -2
- data/app/views/manifestations/_tab_list.html.erb +1 -1
- data/app/views/manifestations/index.html.erb +2 -2
- data/app/views/manifestations/index.mobile.erb +1 -1
- data/app/views/medium_of_performances/index.html.erb +1 -1
- data/app/views/owns/index.html.erb +1 -1
- data/app/views/patron_import_files/index.html.erb +1 -1
- data/app/views/patron_import_results/index.html.erb +1 -1
- data/app/views/patrons/_expression_list.html.erb +2 -2
- data/app/views/patrons/_index.html.erb +1 -1
- data/app/views/patrons/_index_expression.html.erb +1 -1
- data/app/views/patrons/_index_manifestation.html.erb +1 -1
- data/app/views/patrons/_index_patron.html.erb +1 -1
- data/app/views/patrons/_index_patron_merge_list.html.erb +1 -1
- data/app/views/patrons/_index_work.html.erb +1 -1
- data/app/views/patrons/_manifestation_list.html.erb +2 -2
- data/app/views/patrons/_work_list.html.erb +2 -2
- data/app/views/patrons/index.mobile.erb +1 -1
- data/app/views/picture_files/_index.html.erb +1 -1
- data/app/views/picture_files/_index_event.html.erb +1 -1
- data/app/views/picture_files/_index_manifestation.html.erb +1 -1
- data/app/views/picture_files/_index_patron.html.erb +1 -1
- data/app/views/picture_files/_index_shelf.html.erb +1 -1
- data/app/views/produces/_index.html.erb +1 -1
- data/app/views/produces/_index_manifestation.html.erb +1 -1
- data/app/views/produces/_index_patron.html.erb +1 -1
- data/app/views/realizes/_index.html.erb +1 -1
- data/app/views/realizes/_index_expression.html.erb +1 -1
- data/app/views/realizes/_index_patron.html.erb +1 -1
- data/app/views/resource_import_files/index.html.erb +1 -1
- data/app/views/resource_import_results/index.html.erb +1 -1
- data/app/views/series_has_manifestations/index.html.erb +1 -1
- data/app/views/series_statements/_index.html.erb +1 -1
- data/app/views/series_statements/_index_manifestation.html.erb +1 -1
- data/app/views/series_statements/_index_series_statement_merge_list.html.erb +1 -1
- data/app/views/series_statements/_manifestation_list.html.erb +2 -2
- data/{spec/dummy/db → db}/migrate/120_create_baskets.rb +0 -0
- data/{spec/dummy/db → db}/migrate/20120319173203_create_accepts.rb +0 -0
- data/lib/enju_biblio.rb +4 -0
- data/lib/enju_biblio/engine.rb +0 -3
- data/lib/enju_biblio/version.rb +1 -1
- data/lib/generators/enju_biblio/views_generator.rb +51 -0
- data/spec/controllers/accepts_controller_spec.rb +304 -0
- data/spec/dummy/app/models/ability.rb +2 -0
- data/spec/dummy/config/application.rb +9 -1
- data/spec/dummy/config/initializers/kaminari_config.rb +9 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/lib/plugins/ext.rb +0 -2
- data/spec/dummy/tmp/cache/4F7/F90/default_role +0 -0
- data/spec/dummy/tmp/cache/6E4/420/search_engine_all +0 -0
- data/spec/factories/accepts.rb +9 -0
- data/spec/factories/basket.rb +5 -0
- data/spec/models/accept_spec.rb +22 -0
- data/spec/requests/accepts_spec.rb +11 -0
- data/spec/routing/accepts_routing_spec.rb +27 -0
- data/spec/views/accepts/edit.html.erb_spec.rb +18 -0
- data/spec/views/accepts/index.html.erb_spec.rb +25 -0
- data/spec/views/accepts/new.html.erb_spec.rb +29 -0
- data/spec/views/accepts/show.html.erb_spec.rb +17 -0
- data/spec/views/creates/index.html.erb_spec.rb +2 -2
- data/spec/views/exemplifies/index.html.erb_spec.rb +2 -2
- data/spec/views/owns/index.html.erb_spec.rb +2 -2
- data/spec/views/produces/index.html.erb_spec.rb +2 -2
- data/spec/views/realizes/index.html.erb_spec.rb +2 -2
- data/spec/views/series_has_manifestations/index.html.erb_spec.rb +2 -2
- metadata +50 -42
- data/app/views/resource_import_files/_show_object_list.html.erb +0 -26
- data/spec/dummy/lib/enju_leaf.rb +0 -9
- data/spec/dummy/lib/enju_leaf/calculate_stat.rb +0 -30
- 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>
|
data/spec/dummy/lib/enju_leaf.rb
DELETED
@@ -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
|