enju_biblio 0.1.0.pre42 → 0.1.0.pre43
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/creates_controller.rb +11 -11
- data/app/controllers/items_controller.rb +3 -3
- data/app/controllers/manifestations_controller.rb +14 -14
- data/app/controllers/owns_controller.rb +10 -10
- data/app/controllers/patron_import_files_controller.rb +34 -34
- data/app/controllers/patron_import_results_controller.rb +5 -5
- data/app/controllers/patron_relationship_types_controller.rb +3 -3
- data/app/controllers/patron_relationships_controller.rb +7 -7
- data/app/controllers/patron_types_controller.rb +3 -3
- data/app/controllers/patrons_controller.rb +61 -61
- data/app/controllers/picture_files_controller.rb +4 -4
- data/app/controllers/produces_controller.rb +11 -11
- data/app/controllers/realizes_controller.rb +11 -11
- data/app/helpers/{patrons_helper.rb → agents_helper.rb} +5 -5
- data/app/models/{patron.rb → agent.rb} +36 -36
- data/app/models/{patron_import_file.rb → agent_import_file.rb} +77 -77
- data/app/models/agent_import_result.rb +26 -0
- data/app/models/{patron_relationship.rb → agent_relationship.rb} +7 -7
- data/app/models/{patron_relationship_type.rb → agent_relationship_type.rb} +4 -4
- data/app/models/{patron_sweeper.rb → agent_sweeper.rb} +6 -6
- data/app/models/{patron_type.rb → agent_type.rb} +4 -4
- data/app/models/country.rb +1 -1
- data/app/models/create.rb +7 -7
- data/app/models/donate.rb +5 -5
- data/app/models/enju_biblio/ability.rb +24 -24
- data/app/models/item.rb +5 -5
- data/app/models/item_sweeper.rb +2 -2
- data/app/models/manifestation.rb +24 -20
- data/app/models/own.rb +7 -7
- data/app/models/page_sweeper.rb +4 -4
- data/app/models/picture_file.rb +1 -1
- data/app/models/produce.rb +7 -7
- data/app/models/realize.rb +7 -7
- data/app/models/resource_import_file.rb +19 -19
- data/app/views/{patron_import_files → agent_import_files}/edit.html.erb +6 -6
- data/app/views/agent_import_files/index.html.erb +40 -0
- data/app/views/{patron_import_files → agent_import_files}/new.html.erb +3 -3
- data/app/views/agent_import_files/show.html.erb +69 -0
- data/app/views/agent_import_results/index.csv.erb +3 -0
- data/app/views/agent_import_results/index.html.erb +52 -0
- data/app/views/agent_import_results/show.html.erb +38 -0
- data/app/views/{patron_relationship_types → agent_relationship_types}/_form.html.erb +1 -1
- data/app/views/{patron_relationship_types → agent_relationship_types}/edit.html.erb +3 -3
- data/app/views/agent_relationship_types/index.html.erb +43 -0
- data/app/views/{patron_relationship_types → agent_relationship_types}/new.html.erb +2 -2
- data/app/views/agent_relationship_types/show.html.erb +29 -0
- data/app/views/{patron_relationships → agent_relationships}/_form.html.erb +7 -7
- data/app/views/{patron_relationships → agent_relationships}/edit.html.erb +3 -3
- data/app/views/agent_relationships/index.html.erb +34 -0
- data/app/views/{patron_relationships → agent_relationships}/new.html.erb +2 -2
- data/app/views/agent_relationships/show.html.erb +24 -0
- data/app/views/{patron_types → agent_types}/_form.html.erb +1 -1
- data/app/views/{patron_types → agent_types}/edit.html.erb +3 -3
- data/app/views/agent_types/index.html.erb +43 -0
- data/app/views/{patron_types → agent_types}/new.html.erb +2 -2
- data/app/views/agent_types/show.html.erb +29 -0
- data/app/views/{patrons → agents}/_expression_list.html.erb +3 -3
- data/app/views/{patrons → agents}/_form.html.erb +9 -9
- data/app/views/{patrons → agents}/_form_family_name_first.html.erb +0 -0
- data/app/views/{patrons → agents}/_form_family_name_last.html.erb +0 -0
- data/app/views/{patrons → agents}/_history_list.html.erb +2 -2
- data/app/views/{patrons → agents}/_index.html.erb +9 -9
- data/app/views/{patrons → agents}/_index_expression.html.erb +15 -15
- data/app/views/{patrons → agents}/_index_manifestation.html.erb +16 -16
- data/app/views/agents/_index_patron.html.erb +71 -0
- data/app/views/agents/_index_patron_merge_list.html.erb +53 -0
- data/app/views/{patrons → agents}/_index_work.html.erb +17 -17
- data/app/views/{patrons → agents}/_manifestation_list.html.erb +3 -3
- data/app/views/agents/_patron.html.erb +13 -0
- data/app/views/agents/_patron_list.html.erb +18 -0
- data/app/views/{patrons → agents}/_work_list.html.erb +1 -1
- data/app/views/agents/edit.html.erb +16 -0
- data/app/views/agents/index.atom.builder +10 -0
- data/app/views/{patrons → agents}/index.html.erb +4 -4
- data/app/views/{patrons → agents}/index.mobile.erb +5 -5
- data/app/views/{patrons → agents}/index.rss.builder +11 -11
- data/app/views/{patrons → agents}/new.html.erb +2 -2
- data/app/views/agents/show.html.erb +152 -0
- data/app/views/{patrons → agents}/show.js.erb +0 -0
- data/app/views/agents/show.mobile.erb +69 -0
- data/app/views/creates/_form.html.erb +5 -5
- data/app/views/creates/_index.html.erb +2 -2
- data/app/views/creates/_index_patron.html.erb +6 -6
- data/app/views/creates/_index_work.html.erb +2 -2
- data/app/views/creates/index.html.erb +2 -2
- data/app/views/creates/new.html.erb +3 -3
- data/app/views/creates/show.html.erb +4 -4
- data/app/views/donates/edit.html.erb +2 -2
- data/app/views/donates/index.html.erb +2 -2
- data/app/views/donates/new.html.erb +2 -2
- data/app/views/donates/show.html.erb +2 -2
- data/app/views/items/index.html.erb +1 -1
- data/app/views/languages/index.html.erb +1 -1
- data/app/views/layouts/patrons.html.erb +2 -2
- data/app/views/manifestations/_index_form_contributor.html.erb +1 -1
- data/app/views/manifestations/_index_form_creator.html.erb +1 -1
- data/app/views/manifestations/_index_form_publisher.html.erb +1 -1
- data/app/views/manifestations/_manifestation_list.html.erb +6 -6
- data/app/views/manifestations/_show.mods.builder +4 -4
- data/app/views/manifestations/_show.rdf.builder +4 -4
- data/app/views/manifestations/_show_creators.html.erb +4 -4
- data/app/views/manifestations/_show_creators.mobile.erb +4 -4
- data/app/views/manifestations/_title.html.erb +3 -3
- data/app/views/manifestations/_title.mobile.erb +3 -3
- data/app/views/manifestations/edit.html.erb +2 -2
- data/app/views/manifestations/index.atom.builder +2 -2
- data/app/views/manifestations/index.html.erb +3 -3
- data/app/views/manifestations/index.opds.builder +2 -2
- data/app/views/manifestations/index.sru.builder +6 -6
- data/app/views/manifestations/new.html.erb +2 -2
- data/app/views/notifier/manifestation_info.en.text.erb +1 -1
- data/app/views/notifier/manifestation_info.ja.text.erb +1 -1
- data/app/views/owns/_form.html.erb +1 -1
- data/app/views/owns/index.html.erb +2 -2
- data/app/views/owns/show.html.erb +4 -4
- data/app/views/picture_files/_index.html.erb +1 -1
- data/app/views/picture_files/_index_patron.html.erb +2 -2
- data/app/views/picture_files/index.html.erb +2 -2
- data/app/views/picture_files/show.html.erb +2 -2
- data/app/views/produces/_form.html.erb +5 -5
- data/app/views/produces/_index.html.erb +2 -2
- data/app/views/produces/_index_manifestation.html.erb +3 -3
- data/app/views/produces/_index_patron.html.erb +3 -3
- data/app/views/produces/index.html.erb +2 -2
- data/app/views/produces/new.html.erb +3 -3
- data/app/views/produces/show.html.erb +4 -4
- data/app/views/realizes/_form.html.erb +5 -5
- data/app/views/realizes/_index.html.erb +2 -2
- data/app/views/realizes/_index_expression.html.erb +3 -3
- data/app/views/realizes/_index_patron.html.erb +3 -3
- data/app/views/realizes/index.html.erb +2 -2
- data/app/views/realizes/new.html.erb +3 -3
- data/app/views/realizes/show.html.erb +4 -4
- data/app/views/resource_import_results/show.html.erb +1 -1
- data/config/routes.rb +16 -16
- data/db/migrate/{001_create_patrons.rb → 001_create_agents.rb} +8 -8
- data/db/migrate/012_create_owns.rb +2 -2
- data/db/migrate/015_create_creates.rb +2 -2
- data/db/migrate/047_create_produces.rb +2 -2
- data/db/migrate/125_create_donates.rb +2 -2
- data/db/migrate/20080830154109_create_realizes.rb +2 -2
- data/db/migrate/{20080905191442_create_patron_types.rb → 20080905191442_create_agent_types.rb} +2 -2
- data/db/migrate/20081028083142_create_agent_import_files.rb +22 -0
- data/db/migrate/{20090812151902_create_patron_relationship_types.rb → 20090812151902_create_agent_relationship_types.rb} +2 -2
- data/db/migrate/20091012101112_add_dcndl_schema.rb +2 -2
- data/db/migrate/20100606073747_create_agent_relationships.rb +13 -0
- data/db/migrate/20100814091104_add_position_to_agent_relationship.rb +11 -0
- data/db/migrate/20100925074559_create_agent_import_results.rb +12 -0
- data/db/migrate/20110301121550_add_birth_date_and_death_date_to_agent.rb +11 -0
- data/db/migrate/20120413161403_add_fingerprint_to_agent_import_file.rb +5 -0
- data/db/migrate/20120413170720_add_error_message_to_agent_import_file.rb +5 -0
- data/db/migrate/20120511072422_add_agent_identifier_to_agent.rb +6 -0
- data/db/migrate/20120602141129_add_edit_mode_to_agent_import_file.rb +5 -0
- data/lib/enju_biblio/biblio_helper.rb +8 -8
- data/lib/enju_biblio/version.rb +1 -1
- data/lib/enju_biblio.rb +3 -3
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/patron_relationship_types.yml +3 -3
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/patron_types.yml +2 -2
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/patrons.yml +4 -4
- data/spec/controllers/agent_import_files_controller_spec.rb +321 -0
- data/spec/controllers/{patron_import_results_controller_spec.rb → agent_import_results_controller_spec.rb} +17 -17
- data/spec/controllers/agent_relationship_types_controller_spec.rb +445 -0
- data/spec/controllers/agent_relationships_controller_spec.rb +446 -0
- data/spec/controllers/agent_types_controller_spec.rb +447 -0
- data/spec/controllers/agents_controller_spec.rb +644 -0
- data/spec/controllers/countries_controller_spec.rb +1 -1
- data/spec/controllers/items_controller_spec.rb +4 -4
- data/spec/controllers/manifestation_relationship_types_controller_spec.rb +1 -1
- data/spec/controllers/manifestations_controller_spec.rb +4 -4
- data/spec/controllers/owns_controller_spec.rb +2 -2
- data/spec/controllers/resource_import_files_controller_spec.rb +1 -1
- data/spec/dummy/app/helpers/application_helper.rb +5 -222
- data/spec/dummy/app/models/ability.rb +31 -31
- data/spec/dummy/app/models/{local_patron.rb → local_agent.rb} +1 -1
- data/spec/dummy/app/models/user.rb +3 -3
- data/spec/dummy/config/application.rb +0 -1
- data/spec/dummy/config/environments/test.rb +1 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/035_create_reserves.rb +1 -1
- data/spec/dummy/db/migrate/20090519203307_create_participates.rb +2 -2
- data/spec/dummy/db/schema.rb +132 -132
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/private/system/agent_import_files/agent_imports/000/000/004/original/agent_delete_file.tsv +8 -0
- data/spec/dummy/private/system/agent_import_files/agent_imports/000/000/004/original/agent_import_file_sample1.tsv +5 -0
- data/spec/dummy/private/system/agent_import_files/agent_imports/000/000/004/original/agent_import_file_sample2.tsv +8 -0
- data/spec/dummy/private/system/agent_import_files/agent_imports/000/000/004/original/agent_import_file_sample3.tsv +5 -0
- data/spec/dummy/private/system/agent_import_files/agent_imports/000/000/004/original/agent_update_file.tsv +3 -0
- data/spec/dummy/solr/data/test/index/segments.gen +0 -0
- data/spec/dummy/solr/data/test/index/segments_q76 +0 -0
- data/spec/factories/{patron.rb → agent.rb} +3 -3
- data/spec/factories/create.rb +1 -1
- data/spec/factories/donate.rb +1 -1
- data/spec/factories/own.rb +1 -1
- data/spec/factories/patron_relationship.rb +3 -3
- data/spec/factories/patron_relationship_type.rb +2 -2
- data/spec/factories/patron_type.rb +2 -2
- data/spec/factories/produce.rb +1 -1
- data/spec/factories/realize.rb +1 -1
- data/spec/fixtures/{patron_import_files.yml → agent_import_files.yml} +18 -18
- data/spec/fixtures/{patron_import_results.yml → agent_import_results.yml} +7 -7
- data/spec/fixtures/{patron_relationship_types.yml → agent_relationship_types.yml} +4 -4
- data/spec/fixtures/{patron_relationships.yml → agent_relationships.yml} +4 -4
- data/spec/fixtures/{patron_types.yml → agent_types.yml} +4 -4
- data/spec/fixtures/{patrons.yml → agents.yml} +47 -47
- data/spec/fixtures/creates.yml +8 -8
- data/spec/fixtures/donates.yml +4 -4
- data/spec/fixtures/owns.yml +3 -3
- data/spec/fixtures/picture_files.yml +1 -1
- data/spec/fixtures/produces.yml +20 -20
- data/spec/fixtures/realizes.yml +11 -11
- data/spec/fixtures/reserves.yml +1 -1
- data/spec/models/agent_import_file_spec.rb +96 -0
- data/spec/models/{patron_import_result_spec.rb → agent_import_result_spec.rb} +4 -4
- data/spec/models/{patron_relationship_spec.rb → agent_relationship_spec.rb} +3 -3
- data/spec/models/{patron_relationship_type_spec.rb → agent_relationship_type_spec.rb} +2 -2
- data/spec/models/{patron_spec.rb → agent_spec.rb} +16 -16
- data/spec/models/{patron_type_spec.rb → agent_type_spec.rb} +2 -2
- data/spec/models/create_spec.rb +1 -1
- data/spec/models/donate_spec.rb +1 -1
- data/spec/models/manifestation_spec.rb +1 -1
- data/spec/models/own_spec.rb +1 -1
- data/spec/models/produce_spec.rb +1 -1
- data/spec/models/realize_spec.rb +1 -1
- data/spec/models/resource_import_file_spec.rb +8 -8
- data/spec/requests/agents_spec.rb +9 -0
- data/spec/routing/agent_relationship_types_routing_spec.rb +35 -0
- data/spec/routing/agent_relationships_routing_spec.rb +35 -0
- data/spec/routing/agents_routing_spec.rb +35 -0
- data/spec/views/creates/edit.html.erb_spec.rb +1 -1
- data/spec/views/creates/index.html.erb_spec.rb +2 -2
- data/spec/views/creates/new.html.erb_spec.rb +1 -1
- data/spec/views/creates/show.html.erb_spec.rb +1 -1
- data/spec/views/owns/edit.html.erb_spec.rb +1 -1
- data/spec/views/owns/index.html.erb_spec.rb +2 -2
- data/spec/views/owns/new.html.erb_spec.rb +1 -1
- data/spec/views/owns/show.html.erb_spec.rb +1 -1
- data/spec/views/produces/edit.html.erb_spec.rb +2 -2
- data/spec/views/produces/index.html.erb_spec.rb +2 -2
- data/spec/views/produces/new.html.erb_spec.rb +2 -2
- data/spec/views/produces/show.html.erb_spec.rb +1 -1
- data/spec/views/realizes/edit.html.erb_spec.rb +2 -2
- data/spec/views/realizes/index.html.erb_spec.rb +2 -2
- data/spec/views/realizes/new.html.erb_spec.rb +2 -2
- data/spec/views/realizes/show.html.erb_spec.rb +1 -1
- metadata +131 -187
- data/app/models/patron_import_result.rb +0 -26
- data/app/views/patron_import_files/index.html.erb +0 -40
- data/app/views/patron_import_files/show.html.erb +0 -69
- data/app/views/patron_import_results/index.csv.erb +0 -3
- data/app/views/patron_import_results/index.html.erb +0 -52
- data/app/views/patron_import_results/show.html.erb +0 -38
- data/app/views/patron_relationship_types/index.html.erb +0 -43
- data/app/views/patron_relationship_types/show.html.erb +0 -29
- data/app/views/patron_relationships/index.html.erb +0 -34
- data/app/views/patron_relationships/show.html.erb +0 -24
- data/app/views/patron_types/index.html.erb +0 -43
- data/app/views/patron_types/show.html.erb +0 -29
- data/app/views/patrons/_index_patron.html.erb +0 -71
- data/app/views/patrons/_index_patron_merge_list.html.erb +0 -53
- data/app/views/patrons/_patron.html.erb +0 -13
- data/app/views/patrons/_patron_list.html.erb +0 -18
- data/app/views/patrons/edit.html.erb +0 -16
- data/app/views/patrons/index.atom.builder +0 -10
- data/app/views/patrons/show.html.erb +0 -152
- data/app/views/patrons/show.mobile.erb +0 -69
- data/db/migrate/20081028083142_create_patron_import_files.rb +0 -22
- data/db/migrate/20100606073747_create_patron_relationships.rb +0 -13
- data/db/migrate/20100814091104_add_position_to_patron_relationship.rb +0 -11
- data/db/migrate/20100925074559_create_patron_import_results.rb +0 -12
- data/db/migrate/20110301121550_add_birth_date_and_death_date_to_patron.rb +0 -11
- data/db/migrate/20120413161403_add_fingerprint_to_patron_import_file.rb +0 -5
- data/db/migrate/20120413170720_add_error_message_to_patron_import_file.rb +0 -5
- data/db/migrate/20120511072422_add_patron_identifier_to_patron.rb +0 -6
- data/db/migrate/20120602141129_add_edit_mode_to_patron_import_file.rb +0 -5
- data/spec/controllers/patron_import_files_controller_spec.rb +0 -321
- data/spec/controllers/patron_relationship_types_controller_spec.rb +0 -445
- data/spec/controllers/patron_relationships_controller_spec.rb +0 -446
- data/spec/controllers/patron_types_controller_spec.rb +0 -447
- data/spec/controllers/patrons_controller_spec.rb +0 -644
- data/spec/dummy/app/mailers/notifier.rb +0 -40
- data/spec/dummy/lib/plugins/ext/event-calendar.rb +0 -38
- data/spec/dummy/lib/plugins/ext/sunspot/abstract_search.rb +0 -12
- data/spec/dummy/lib/plugins/ext/sunspot/dismax.rb +0 -41
- data/spec/dummy/lib/plugins/ext/sunspot/start_record.rb +0 -55
- data/spec/dummy/lib/plugins/ext/sunspot.rb +0 -3
- data/spec/dummy/lib/plugins/ext.rb +0 -1
- data/spec/dummy/lib/plugins.rb +0 -2
- data/spec/dummy/solr/data/test/index/_goc.fdt +0 -0
- data/spec/dummy/solr/data/test/index/_goc.fdx +0 -0
- data/spec/dummy/solr/data/test/index/_goc.fnm +0 -7
- data/spec/dummy/solr/data/test/index/_goc.frq +0 -0
- data/spec/dummy/solr/data/test/index/_goc.nrm +0 -1
- data/spec/dummy/solr/data/test/index/_goc.prx +0 -0
- data/spec/dummy/solr/data/test/index/_goc.tii +0 -0
- data/spec/dummy/solr/data/test/index/_goc.tis +0 -0
- data/spec/dummy/solr/data/test/index/_god.fdt +0 -0
- data/spec/dummy/solr/data/test/index/_god.fdx +0 -0
- data/spec/dummy/solr/data/test/index/_god.fnm +0 -7
- data/spec/dummy/solr/data/test/index/_god.frq +0 -0
- data/spec/dummy/solr/data/test/index/_god.nrm +0 -1
- data/spec/dummy/solr/data/test/index/_god.prx +0 -0
- data/spec/dummy/solr/data/test/index/_god.tii +0 -0
- data/spec/dummy/solr/data/test/index/_god.tis +0 -0
- data/spec/dummy/solr/data/test/index/_goe.fdt +0 -0
- data/spec/dummy/solr/data/test/index/_goe.fdx +0 -0
- data/spec/dummy/solr/data/test/index/_goe.fnm +0 -8
- data/spec/dummy/solr/data/test/index/_goe.frq +0 -0
- data/spec/dummy/solr/data/test/index/_goe.nrm +0 -1
- data/spec/dummy/solr/data/test/index/_goe.prx +0 -0
- data/spec/dummy/solr/data/test/index/_goe.tii +0 -0
- data/spec/dummy/solr/data/test/index/_goe.tis +0 -0
- data/spec/dummy/solr/data/test/index/segments_otc +0 -0
- data/spec/dummy/tmp/cache/4AD/470/country_all +0 -0
- data/spec/models/patron_import_file_spec.rb +0 -96
- data/spec/requests/patrons_spec.rb +0 -9
- data/spec/routing/patron_relationship_types_routing_spec.rb +0 -35
- data/spec/routing/patron_relationships_routing_spec.rb +0 -35
- data/spec/routing/patrons_routing_spec.rb +0 -35
@@ -184,7 +184,7 @@ describe OwnsController do
|
|
184
184
|
assigns(:own).should be_valid
|
185
185
|
end
|
186
186
|
|
187
|
-
it "redirects to the created
|
187
|
+
it "redirects to the created agent" do
|
188
188
|
post :create, :own => @attrs
|
189
189
|
response.should redirect_to(assigns(:own))
|
190
190
|
end
|
@@ -212,7 +212,7 @@ describe OwnsController do
|
|
212
212
|
assigns(:own).should be_valid
|
213
213
|
end
|
214
214
|
|
215
|
-
it "redirects to the created
|
215
|
+
it "redirects to the created agent" do
|
216
216
|
post :create, :own => @attrs
|
217
217
|
response.should redirect_to(assigns(:own))
|
218
218
|
end
|
@@ -128,7 +128,7 @@ describe ResourceImportFilesController do
|
|
128
128
|
sign_in @user
|
129
129
|
end
|
130
130
|
|
131
|
-
it "should create
|
131
|
+
it "should create agent_import_file" do
|
132
132
|
post :create, :resource_import_file => {:resource_import => fixture_file_upload("/../../examples/resource_import_file_sample1.tsv", 'text/csv') }
|
133
133
|
assigns(:resource_import_file).should be_valid
|
134
134
|
assigns(:resource_import_file).user.username.should eq @user.username
|
@@ -1,226 +1,9 @@
|
|
1
1
|
# Methods added to this helper will be available to all templates in the application.
|
2
2
|
module ApplicationHelper
|
3
|
-
include
|
4
|
-
include
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
when 'print'
|
9
|
-
image_tag('icons/book.png', :size => '16x16', :alt => carrier_type.display_name.localize)
|
10
|
-
when 'CD'
|
11
|
-
image_tag('icons/cd.png', :size => '16x16', :alt => carrier_type.display_name.localize)
|
12
|
-
when 'DVD'
|
13
|
-
image_tag('icons/dvd.png', :size => '16x16', :alt => carrier_type.display_name.localize)
|
14
|
-
when 'file'
|
15
|
-
image_tag('icons/monitor.png', :size => '16x16', :alt => carrier_type.display_name.localize)
|
16
|
-
else
|
17
|
-
image_tag('icons/help.png', :size => '16x16', :alt => t('page.unknown'))
|
18
|
-
end
|
19
|
-
rescue NoMethodError
|
20
|
-
image_tag('icons/help.png', :size => '16x16', :alt => t('page.unknown'))
|
21
|
-
end
|
22
|
-
|
23
|
-
def content_type_icon(content_type)
|
24
|
-
case content_type.name
|
25
|
-
when 'text'
|
26
|
-
image_tag('icons/page_white_text.png', :size => '16x16', :alt => content_type.display_name.localize)
|
27
|
-
when 'picture'
|
28
|
-
image_tag('icons/picture.png', :size => '16x16', :alt => content_type.display_name.localize)
|
29
|
-
when 'sound'
|
30
|
-
image_tag('icons/sound.png', :size => '16x16', :alt => content_type.display_name.localize)
|
31
|
-
when 'video'
|
32
|
-
image_tag('icons/film.png', :size => '16x16', :alt => content_type.display_name.localize)
|
33
|
-
else
|
34
|
-
image_tag('icons/help.png', :size => '16x16', :alt => t('page.unknown'))
|
35
|
-
end
|
36
|
-
rescue NoMethodError
|
37
|
-
image_tag('icons/help.png', :size => '16x16', :alt => t('page.unknown'))
|
38
|
-
end
|
39
|
-
|
40
|
-
def patron_type_icon(patron_type)
|
41
|
-
case patron_type
|
42
|
-
when 'Person'
|
43
|
-
image_tag('icons/user.png', :size => '16x16', :alt => 'Person')
|
44
|
-
when 'CorporateBody'
|
45
|
-
image_tag('icons/group.png', :size => '16x16', :alt => 'CorporateBody')
|
46
|
-
else
|
47
|
-
image_tag('icons/help.png', :size => '16x16', :alt => t('page.unknown'))
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
def link_to_tag(tag)
|
52
|
-
link_to tag, manifestations_path(:tag => tag.name)
|
53
|
-
end
|
54
|
-
|
55
|
-
def render_tag_cloud(tags, options = {})
|
56
|
-
return nil if tags.nil?
|
57
|
-
# TODO: add options to specify different limits and sorts
|
58
|
-
#tags = Tag.all(:limit => 100, :order => 'taggings_count DESC').sort_by(&:name)
|
59
|
-
|
60
|
-
# TODO: add option to specify which classes you want and overide this if you want?
|
61
|
-
classes = %w(popular v-popular vv-popular vvv-popular vvvv-popular)
|
62
|
-
|
63
|
-
max, min = 0, 0
|
64
|
-
tags.each do |tag|
|
65
|
-
#if options[:max] or options[:min]
|
66
|
-
# max = options[:max].to_i
|
67
|
-
# min = options[:min].to_i
|
68
|
-
#end
|
69
|
-
max = tag.taggings.size if tag.taggings.size > max
|
70
|
-
min = tag.taggings.size if tag.taggings.size < min
|
71
|
-
end
|
72
|
-
divisor = ((max - min).div(classes.size)) + 1
|
73
|
-
|
74
|
-
content_tag :div, :class => "hTagcloud" do
|
75
|
-
content_tag :ul, :class => "popularity" do
|
76
|
-
tags.each do |tag|
|
77
|
-
content_tag :li do
|
78
|
-
link_to(tag.name, manifestations_path(:tag => tag.name), :class => classes[(tag.taggings.size - min).div(divisor)])
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
def patrons_list(patrons = [], options = {})
|
86
|
-
return nil if patrons.blank?
|
87
|
-
patrons_list = []
|
88
|
-
if options[:nolink]
|
89
|
-
patrons_list = patrons.map{|patron| patron.full_name}
|
90
|
-
else
|
91
|
-
patrons_list = patrons.map{|patron| link_to(patron.full_name, patron, options)}
|
92
|
-
end
|
93
|
-
patrons_list.join(" ").html_safe
|
94
|
-
end
|
95
|
-
|
96
|
-
def book_jacket(manifestation)
|
97
|
-
if manifestation.picture_files.exists?
|
98
|
-
link = ''
|
99
|
-
manifestation.picture_files.each_with_index do |picture_file, i|
|
100
|
-
if i == 0
|
101
|
-
link += link_to(show_image(picture_file, :size => :thumb), picture_file_path(picture_file, :format => :download), :rel => "manifestation_#{manifestation.id}")
|
102
|
-
else
|
103
|
-
link += content_tag :span, :style => "display: none" do
|
104
|
-
link_to(show_image(picture_file, :size => :thumb), picture_file_path(picture_file, :format => :download), :rel => "manifestation_#{manifestation.id}")
|
105
|
-
end
|
106
|
-
end
|
107
|
-
end
|
108
|
-
return link.html_safe
|
109
|
-
else
|
110
|
-
link = book_jacket_tag(manifestation)
|
111
|
-
unless link
|
112
|
-
link = screenshot_tag(manifestation)
|
113
|
-
end
|
114
|
-
end
|
115
|
-
|
116
|
-
unless link
|
117
|
-
link = link_to image_tag('unknown_resource.png', :width => '100', :height => '100', :alt => '*', :itemprop => 'image'), manifestation
|
118
|
-
end
|
119
|
-
link
|
120
|
-
end
|
121
|
-
|
122
|
-
def database_adapter
|
123
|
-
case ActiveRecord::Base.configurations["#{Rails.env}"]['adapter']
|
124
|
-
when 'postgresql'
|
125
|
-
link_to 'PostgreSQL', 'http://www.postgresql.org/'
|
126
|
-
when 'jdbcpostgresql'
|
127
|
-
link_to 'PostgreSQL', 'http://www.postgresql.org/'
|
128
|
-
when 'mysql'
|
129
|
-
link_to 'MySQL', 'http://www.mysql.org/'
|
130
|
-
when 'jdbcmysql'
|
131
|
-
link_to 'MySQL', 'http://www.mysql.org/'
|
132
|
-
when 'sqlite3'
|
133
|
-
link_to 'SQLite', 'http://www.sqlite.org/'
|
134
|
-
when 'jdbcsqlite3'
|
135
|
-
link_to 'SQLite', 'http://www.sqlite.org/'
|
136
|
-
end
|
137
|
-
end
|
138
|
-
|
139
|
-
def title_action_name
|
140
|
-
case controller.action_name
|
141
|
-
when 'index'
|
142
|
-
t('title.index')
|
143
|
-
when 'show'
|
144
|
-
t('title.show')
|
145
|
-
when 'new'
|
146
|
-
t('title.new')
|
147
|
-
when 'edit'
|
148
|
-
t('title.edit')
|
149
|
-
end
|
150
|
-
end
|
151
|
-
|
152
|
-
def link_to_wikipedia(string)
|
153
|
-
link_to "Wikipedia", "http://#{I18n.locale}.wikipedia.org/wiki/#{URI.escape(string)}"
|
154
|
-
end
|
155
|
-
|
156
|
-
def locale_display_name(locale)
|
157
|
-
Language.where(:iso_639_1 => locale).first.display_name
|
158
|
-
end
|
159
|
-
|
160
|
-
def locale_native_name(locale)
|
161
|
-
Language.where(:iso_639_1 => locale).first.native_name
|
162
|
-
end
|
163
|
-
|
164
|
-
def move_position(object)
|
165
|
-
render :partial => 'page/position', :locals => {:object => object}
|
166
|
-
end
|
167
|
-
|
168
|
-
def localized_state(state)
|
169
|
-
case state
|
170
|
-
when 'pending'
|
171
|
-
t('state.pending')
|
172
|
-
when 'canceled'
|
173
|
-
t('state.canceled')
|
174
|
-
when 'started'
|
175
|
-
t('state.started')
|
176
|
-
when 'failed'
|
177
|
-
t('state.failed')
|
178
|
-
when 'completed'
|
179
|
-
t('state.completed')
|
180
|
-
else
|
181
|
-
state
|
182
|
-
end
|
183
|
-
end
|
184
|
-
|
185
|
-
def localized_boolean(bool)
|
186
|
-
case bool.to_s
|
187
|
-
when nil
|
188
|
-
when "true"
|
189
|
-
t('page.boolean.true')
|
190
|
-
when "false"
|
191
|
-
t('page.boolean.false')
|
192
|
-
end
|
193
|
-
end
|
194
|
-
|
195
|
-
def current_user_role_name
|
196
|
-
current_user.try(:role).try(:name) || 'Guest'
|
197
|
-
end
|
198
|
-
|
199
|
-
def title(controller_name)
|
200
|
-
string = ''
|
201
|
-
unless ['page', 'routing_error', 'my_accounts'].include?(controller_name)
|
202
|
-
string << t("activerecord.models.#{controller_name.singularize}") + ' - '
|
203
|
-
end
|
204
|
-
if controller_name == 'routing_error'
|
205
|
-
string << t("page.routing_error") + ' - '
|
206
|
-
end
|
207
|
-
string << LibraryGroup.system_name + ' - Next-L Enju Leaf'
|
208
|
-
string.html_safe
|
209
|
-
end
|
210
|
-
|
211
|
-
def back_to_index(options = {})
|
212
|
-
if options == nil
|
213
|
-
options = {}
|
214
|
-
else
|
215
|
-
options.reject!{|key, value| value.blank?}
|
216
|
-
options.delete(:page) if options[:page].to_i == 1
|
217
|
-
end
|
218
|
-
unless controller_name == 'test'
|
219
|
-
link_to t('page.listing', :model => t("activerecord.models.#{controller_name.singularize}")), url_for(params.merge(:controller => controller_name, :action => :index, :id => nil, :only_path => true).merge(options))
|
220
|
-
end
|
221
|
-
end
|
222
|
-
|
223
|
-
def set_focus_on_search_form
|
224
|
-
javascript_tag("$('#search_form').focus()") if @query.blank?
|
3
|
+
include EnjuLeaf::EnjuLeafHelper
|
4
|
+
include EnjuBiblio::BiblioHelper if defined?(EnjuBiblio)
|
5
|
+
if defined?(EnjuManifestationViewer)
|
6
|
+
include EnjuManifestationViewer::BookJacketHelper
|
7
|
+
include EnjuManifestationViewer::ManifestationViewerHelper
|
225
8
|
end
|
226
9
|
end
|
@@ -31,10 +31,10 @@
|
|
31
31
|
ManifestationRelationship,
|
32
32
|
ManifestationRelationshipType,
|
33
33
|
Own,
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
34
|
+
Agent,
|
35
|
+
AgentImportFile,
|
36
|
+
AgentRelationship,
|
37
|
+
AgentRelationshipType,
|
38
38
|
PictureFile,
|
39
39
|
Produce,
|
40
40
|
ProduceType,
|
@@ -52,7 +52,7 @@
|
|
52
52
|
Language,
|
53
53
|
License,
|
54
54
|
MediumOfPerformance,
|
55
|
-
|
55
|
+
AgentType,
|
56
56
|
RequestStatusType,
|
57
57
|
RequestType
|
58
58
|
] if LibraryGroup.site_config.network_access_allowed?(ip_address)
|
@@ -67,8 +67,8 @@
|
|
67
67
|
Language,
|
68
68
|
License,
|
69
69
|
MediumOfPerformance,
|
70
|
-
|
71
|
-
|
70
|
+
AgentImportResult,
|
71
|
+
AgentType,
|
72
72
|
RequestStatusType,
|
73
73
|
RequestType,
|
74
74
|
ResourceImportResult
|
@@ -80,12 +80,12 @@
|
|
80
80
|
can [:destroy, :delete], Manifestation do |manifestation|
|
81
81
|
manifestation.items.empty? and !manifestation.series_master?
|
82
82
|
end
|
83
|
-
can [:index, :create],
|
84
|
-
can :show,
|
85
|
-
|
83
|
+
can [:index, :create], Agent
|
84
|
+
can :show, Agent do |agent|
|
85
|
+
agent.required_role_id <= 3
|
86
86
|
end
|
87
|
-
can [:update, :destroy, :delete],
|
88
|
-
!
|
87
|
+
can [:update, :destroy, :delete], Agent do |agent|
|
88
|
+
!agent.user.try(:has_role?, 'Librarian') and agent.required_role_id <= 3
|
89
89
|
end
|
90
90
|
can :manage, [
|
91
91
|
Create,
|
@@ -95,8 +95,8 @@
|
|
95
95
|
ImportRequest,
|
96
96
|
ManifestationRelationship,
|
97
97
|
Own,
|
98
|
-
|
99
|
-
|
98
|
+
AgentImportFile,
|
99
|
+
AgentRelationship,
|
100
100
|
PictureFile,
|
101
101
|
Produce,
|
102
102
|
Realize,
|
@@ -114,9 +114,9 @@
|
|
114
114
|
Language,
|
115
115
|
License,
|
116
116
|
ManifestationRelationshipType,
|
117
|
-
|
118
|
-
|
119
|
-
|
117
|
+
AgentImportResult,
|
118
|
+
AgentRelationshipType,
|
119
|
+
AgentType,
|
120
120
|
RequestStatusType,
|
121
121
|
RequestType,
|
122
122
|
ResourceImportResult,
|
@@ -131,15 +131,15 @@
|
|
131
131
|
can [:show, :edit], Manifestation do |manifestation|
|
132
132
|
manifestation.required_role_id <= 2
|
133
133
|
end
|
134
|
-
can :index,
|
135
|
-
can :update,
|
136
|
-
|
134
|
+
can :index, Agent
|
135
|
+
can :update, Agent do |agent|
|
136
|
+
agent.user == user
|
137
137
|
end
|
138
|
-
can :show,
|
139
|
-
#if
|
138
|
+
can :show, Agent do |agent|
|
139
|
+
#if agent.user == user
|
140
140
|
# true
|
141
|
-
#elsif
|
142
|
-
true if
|
141
|
+
#elsif agent.user != user
|
142
|
+
true if agent.required_role_id <= 2 #name == 'Administrator'
|
143
143
|
#end
|
144
144
|
end
|
145
145
|
can :index, PictureFile
|
@@ -167,8 +167,8 @@
|
|
167
167
|
ManifestationRelationshipType,
|
168
168
|
MediumOfPerformance,
|
169
169
|
Own,
|
170
|
-
|
171
|
-
|
170
|
+
AgentRelationship,
|
171
|
+
AgentRelationshipType,
|
172
172
|
Produce,
|
173
173
|
Realize,
|
174
174
|
SeriesStatement
|
@@ -178,9 +178,9 @@
|
|
178
178
|
can :show, Manifestation do |manifestation|
|
179
179
|
manifestation.required_role_id == 1
|
180
180
|
end
|
181
|
-
can :index,
|
182
|
-
can :show,
|
183
|
-
|
181
|
+
can :index, Agent
|
182
|
+
can :show, Agent do |agent|
|
183
|
+
agent.required_role_id == 1 #name == 'Guest'
|
184
184
|
end
|
185
185
|
can :read, [
|
186
186
|
CarrierType,
|
@@ -200,8 +200,8 @@
|
|
200
200
|
ManifestationRelationshipType,
|
201
201
|
MediumOfPerformance,
|
202
202
|
Own,
|
203
|
-
|
204
|
-
|
203
|
+
AgentRelationship,
|
204
|
+
AgentRelationshipType,
|
205
205
|
PictureFile,
|
206
206
|
Produce,
|
207
207
|
Realize,
|
@@ -7,7 +7,7 @@ class User < ActiveRecord::Base
|
|
7
7
|
# Setup accessible (or protected) attributes for your model
|
8
8
|
attr_accessible :email, :password, :password_confirmation, :remember_me
|
9
9
|
|
10
|
-
has_one :
|
10
|
+
#has_one :agent
|
11
11
|
has_one :user_has_role
|
12
12
|
has_one :role, :through => :user_has_role
|
13
13
|
belongs_to :user_group
|
@@ -79,8 +79,8 @@ class User < ActiveRecord::Base
|
|
79
79
|
enju_bookmark_user_model if defined?(EnjuBookmark)
|
80
80
|
enju_message_user_model if defined?(EnjuBookmark)
|
81
81
|
|
82
|
-
def
|
83
|
-
|
82
|
+
def agent
|
83
|
+
LocalAgent.new(self)
|
84
84
|
end
|
85
85
|
|
86
86
|
def full_name
|
Binary file
|
@@ -11,7 +11,7 @@ class CreateReserves < ActiveRecord::Migration
|
|
11
11
|
t.datetime :expired_at
|
12
12
|
t.datetime :deleted_at
|
13
13
|
t.string :state
|
14
|
-
t.boolean :
|
14
|
+
t.boolean :expiration_notice_to_agent, :default => false
|
15
15
|
t.boolean :expiration_notice_to_library, :default => false
|
16
16
|
end
|
17
17
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
class CreateParticipates < ActiveRecord::Migration
|
2
2
|
def self.up
|
3
3
|
create_table :participates do |t|
|
4
|
-
t.integer :
|
4
|
+
t.integer :agent_id, :null => false
|
5
5
|
t.integer :event_id, :null => false
|
6
6
|
t.integer :position
|
7
7
|
|
8
8
|
t.timestamps
|
9
9
|
end
|
10
10
|
add_index :participates, :event_id
|
11
|
-
add_index :participates, :
|
11
|
+
add_index :participates, :agent_id
|
12
12
|
end
|
13
13
|
|
14
14
|
def self.down
|