enju_leaf 1.1.0.rc12 → 1.1.0.rc13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/enju.css +0 -1
- data/app/controllers/my_accounts_controller.rb +26 -18
- data/app/controllers/page_controller.rb +6 -6
- data/app/controllers/profiles_controller.rb +155 -0
- data/app/controllers/roles_controller.rb +5 -5
- data/app/controllers/user_export_files_controller.rb +100 -0
- data/app/controllers/user_groups_controller.rb +11 -11
- data/app/controllers/user_import_files_controller.rb +22 -11
- data/app/controllers/user_import_results_controller.rb +1 -1
- data/app/mailers/notifier.rb +7 -7
- data/app/models/enju_leaf/ability.rb +14 -13
- data/app/models/profile.rb +63 -16
- data/app/models/role.rb +2 -2
- data/app/models/user_export_file.rb +52 -0
- data/app/models/user_export_file_state_machine.rb +15 -0
- data/app/models/user_export_file_transition.rb +20 -0
- data/app/models/user_group.rb +3 -3
- data/app/models/user_has_role.rb +2 -2
- data/app/models/user_import_file.rb +139 -53
- data/app/views/kaminari/_first_page.html.erb +1 -1
- data/app/views/kaminari/_last_page.html.erb +1 -1
- data/app/views/kaminari/_next_page.html.erb +1 -1
- data/app/views/kaminari/_page.html.erb +1 -1
- data/app/views/kaminari/_prev_page.html.erb +1 -1
- data/app/views/kaminari/enju_leaf_mobile/_next_page.html.erb +1 -1
- data/app/views/kaminari/enju_leaf_mobile/_page.html.erb +1 -1
- data/app/views/kaminari/enju_leaf_mobile/_prev_page.html.erb +1 -1
- data/app/views/layouts/application.html.erb +4 -4
- data/app/views/my_accounts/_edit_credential.html.erb +67 -59
- data/app/views/my_accounts/edit.html.erb +6 -46
- data/app/views/my_accounts/show.html.erb +8 -8
- data/app/views/page/_add.html.erb +2 -2
- data/app/views/page/_footer.html.erb +3 -2
- data/app/views/page/_footer.mobile.erb +1 -1
- data/app/views/page/_header.html.erb +4 -4
- data/app/views/page/_include.html.erb +1 -1
- data/app/views/page/_index.html.erb +8 -8
- data/app/views/page/_index.mobile.erb +4 -4
- data/app/views/page/_menu.html.erb +9 -6
- data/app/views/page/_msie_acceralator.html.erb +1 -1
- data/app/views/page/_position.html.erb +2 -2
- data/app/views/page/_search_form.html.erb +2 -2
- data/app/views/page/_search_form.mobile.erb +2 -2
- data/app/views/page/_select_locale.html.erb +2 -2
- data/app/views/page/about.en.html.erb +2 -2
- data/app/views/page/about.ja.html.erb +2 -2
- data/app/views/page/advanced_search.html.erb +8 -8
- data/app/views/page/configuration.html.erb +5 -3
- data/app/views/page/export.html.erb +7 -17
- data/app/views/page/import.html.erb +1 -4
- data/app/views/page/index.html.erb +2 -2
- data/app/views/page/msie_acceralator.builder +1 -1
- data/app/views/page/opensearch.builder +2 -2
- data/app/views/profiles/_edit_credential.html.erb +78 -0
- data/app/views/profiles/_edit_profile.html.erb +42 -0
- data/app/views/{users → profiles}/_form.html.erb +0 -0
- data/app/views/{users → profiles}/_show.html.erb +0 -0
- data/app/views/profiles/edit.html.erb +36 -0
- data/app/views/profiles/index.html.erb +61 -0
- data/app/views/{users → profiles}/new.html.erb +34 -36
- data/app/views/{users → profiles}/show.html.erb +24 -22
- data/app/views/{users → profiles}/show.mobile.erb +0 -0
- data/app/views/roles/_form.html.erb +1 -1
- data/app/views/roles/edit.html.erb +1 -1
- data/app/views/roles/index.html.erb +2 -2
- data/app/views/roles/new.html.erb +1 -1
- data/app/views/roles/show.html.erb +1 -1
- data/app/views/user_export_files/_form.html.erb +22 -0
- data/app/views/user_export_files/edit.html.erb +6 -0
- data/app/views/user_export_files/index.html.erb +44 -0
- data/app/views/user_export_files/new.html.erb +16 -0
- data/app/views/user_export_files/show.html.erb +31 -0
- data/app/views/user_groups/_form.html.erb +5 -5
- data/app/views/user_groups/edit.html.erb +1 -1
- data/app/views/user_groups/index.html.erb +14 -8
- data/app/views/user_groups/new.html.erb +1 -1
- data/app/views/user_groups/show.html.erb +3 -3
- data/app/views/user_import_files/index.html.erb +11 -10
- data/app/views/user_import_files/new.html.erb +15 -3
- data/app/views/user_import_files/show.html.erb +13 -3
- data/app/views/user_import_results/index.html.erb +7 -7
- data/app/views/user_import_results/{index.tsv.erb → index.txt.erb} +1 -1
- data/app/views/user_import_results/show.html.erb +2 -2
- data/app/workers/user_export_file_queue.rb +7 -0
- data/config/initializers/mime_types.rb +1 -1
- data/config/locales/devise.en.yml +19 -18
- data/config/locales/devise.ja.yml +45 -42
- data/config/locales/en.yml +214 -0
- data/config/locales/ja.yml +10 -6
- data/config/locales/translation_en.yml +34 -5
- data/config/locales/translation_ja.yml +35 -6
- data/config/routes.rb +4 -7
- data/db/migrate/20130221154434_add_additional_attributes_to_user.rb +0 -9
- data/db/migrate/20140122054321_create_profiles.rb +1 -1
- data/db/migrate/20140709113413_create_user_export_files.rb +11 -0
- data/db/migrate/20140709113905_create_user_export_file_transitions.rb +14 -0
- data/db/migrate/20140720170714_add_default_library_id_to_user_import_file.rb +5 -0
- data/db/migrate/20140720170735_add_default_user_group_id_to_user_import_file.rb +5 -0
- data/db/migrate/20140811031145_add_expired_at_to_profile.rb +5 -0
- data/lib/enju_leaf/calculate_stat.rb +9 -0
- data/lib/enju_leaf/controller.rb +1 -1
- data/lib/enju_leaf/export_file.rb +26 -0
- data/lib/enju_leaf/import_file.rb +25 -0
- data/lib/enju_leaf/master_model.rb +15 -6
- data/lib/enju_leaf/url_validator.rb +4 -2
- data/lib/enju_leaf/user.rb +74 -68
- data/lib/enju_leaf/version.rb +1 -1
- data/lib/enju_leaf.rb +23 -24
- data/lib/generators/enju_leaf/quick_install/quick_install_generator.rb +2 -1
- data/lib/generators/enju_leaf/setup/setup_generator.rb +6 -0
- data/lib/generators/enju_leaf/setup/templates/db/fixtures/user_groups.yml +1 -1
- data/lib/generators/enju_leaf/setup/templates/db/seeds.rb +5 -4
- data/lib/tasks/enju_leaf_tasks.rake +18 -9
- data/lib/tasks/profile.rb +15 -0
- data/spec/controllers/my_accounts_controller_spec.rb +61 -43
- data/spec/controllers/page_controller_spec.rb +20 -20
- data/spec/controllers/profiles_controller_spec.rb +530 -0
- data/spec/controllers/roles_controller_spec.rb +19 -19
- data/spec/controllers/user_export_files_controller_spec.rb +297 -0
- data/spec/controllers/user_groups_controller_spec.rb +48 -48
- data/spec/controllers/user_import_files_controller_spec.rb +45 -41
- data/spec/controllers/user_import_results_controller_spec.rb +9 -9
- data/spec/dummy/app/models/user.rb +3 -0
- data/spec/dummy/config/application.rb +3 -1
- data/spec/dummy/config/environments/test.rb +2 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/{001_create_patrons.rb → 001_create_agents.rb} +1 -2
- data/spec/dummy/db/migrate/005_create_manifestations.rb +5 -17
- data/spec/dummy/db/migrate/006_create_items.rb +2 -3
- data/spec/dummy/db/migrate/032_create_checkins.rb +17 -0
- data/spec/dummy/db/migrate/033_create_checkouts.rb +25 -0
- data/spec/dummy/db/migrate/035_create_reserves.rb +27 -0
- data/spec/dummy/db/migrate/055_create_bookmarks.rb +22 -0
- data/spec/dummy/db/migrate/059_create_libraries.rb +5 -1
- data/spec/dummy/db/migrate/069_create_shelves.rb +5 -1
- data/spec/dummy/db/migrate/080_create_library_groups.rb +0 -2
- data/spec/dummy/db/migrate/113_create_events.rb +23 -0
- data/spec/dummy/db/migrate/114_create_event_categories.rb +16 -0
- data/spec/dummy/db/migrate/121_create_checked_items.rb +17 -0
- data/spec/dummy/db/migrate/127_create_use_restrictions.rb +16 -0
- data/spec/dummy/db/migrate/129_create_item_has_use_restrictions.rb +16 -0
- data/spec/dummy/db/migrate/130_create_request_status_types.rb +5 -1
- data/spec/dummy/db/migrate/131_create_request_types.rb +5 -1
- data/spec/dummy/db/migrate/132_create_circulation_statuses.rb +16 -0
- data/spec/dummy/db/migrate/149_create_message_templates.rb +18 -0
- data/spec/dummy/db/migrate/154_create_messages.rb +23 -0
- data/spec/dummy/db/migrate/20080819181903_create_message_requests.rb +18 -0
- data/spec/dummy/db/migrate/{20080905191442_create_patron_types.rb → 20080905191442_create_agent_types.rb} +1 -1
- data/spec/dummy/db/migrate/{20081028083142_create_patron_import_files.rb → 20081028083142_create_agent_import_files.rb} +2 -4
- data/spec/dummy/db/migrate/20081028083208_create_resource_import_files.rb +1 -3
- data/spec/dummy/db/migrate/20081030023412_create_checkout_types.rb +17 -0
- data/spec/dummy/db/migrate/20081030023518_create_user_group_has_checkout_types.rb +25 -0
- data/spec/dummy/db/migrate/20081030023615_create_carrier_type_has_checkout_types.rb +18 -0
- data/spec/dummy/db/migrate/20081212075554_create_checkout_stat_has_manifestations.rb +17 -0
- data/spec/dummy/db/migrate/20081212080038_create_manifestation_checkout_stats.rb +16 -0
- data/spec/dummy/db/migrate/20081212151614_create_bookmark_stats.rb +16 -0
- data/spec/dummy/db/migrate/20081212151820_create_bookmark_stat_has_manifestations.rb +13 -0
- data/spec/dummy/db/migrate/20081215094302_create_user_checkout_stats.rb +16 -0
- data/spec/dummy/db/migrate/20081215094955_create_checkout_stat_has_users.rb +17 -0
- data/spec/dummy/db/migrate/20081216190517_create_reserve_stat_has_manifestations.rb +17 -0
- data/spec/dummy/db/migrate/20081216190724_create_manifestation_reserve_stats.rb +16 -0
- data/spec/dummy/db/migrate/20081220023628_create_user_reserve_stats.rb +16 -0
- data/spec/dummy/db/migrate/20081220034117_create_reserve_stat_has_users.rb +17 -0
- data/spec/dummy/db/migrate/20090321130448_add_completed_at_to_user_checkout_stat.rb +27 -0
- data/spec/dummy/db/migrate/{20090812151902_create_patron_relationship_types.rb → 20090812151902_create_agent_relationship_types.rb} +1 -1
- data/spec/dummy/db/migrate/20090831220301_create_lending_policies.rb +21 -0
- data/spec/dummy/db/migrate/20100129142347_create_import_requests.rb +0 -1
- data/spec/dummy/db/migrate/20100222124420_add_allow_bookmark_external_url_to_library_group.rb +9 -0
- data/spec/dummy/db/migrate/20100525171356_acts_as_taggable_on_migration.rb +30 -0
- data/spec/dummy/db/migrate/{20100606073747_create_patron_relationships.rb → 20100606073747_create_agent_relationships.rb} +1 -1
- data/spec/dummy/db/migrate/{20100814091104_add_position_to_patron_relationship.rb → 20100814091104_add_position_to_agent_relationship.rb} +1 -1
- data/spec/dummy/db/migrate/{20100925074559_create_patron_import_results.rb → 20100925074559_create_agent_import_results.rb} +1 -1
- data/spec/dummy/db/migrate/{20110301121550_add_birth_date_and_death_date_to_patron.rb → 20110301121550_add_birth_date_and_death_date_to_agent.rb} +1 -1
- data/spec/dummy/db/migrate/20110301134521_add_expire_date_to_reserve.rb +9 -0
- data/spec/dummy/db/migrate/20110328130826_add_current_checkout_count_to_user_group_has_checkout_type.rb +9 -0
- data/spec/dummy/db/migrate/20110618091240_add_periodical_to_series_statement.rb +1 -1
- data/spec/dummy/db/migrate/20110621093332_remove_expire_date_from_reserve.rb +9 -0
- data/spec/dummy/db/migrate/20110913115320_add_lft_and_rgt_to_message.rb +11 -0
- data/spec/dummy/db/migrate/20111020063828_remove_dsbl_from_library_group.rb +11 -0
- data/spec/dummy/db/migrate/20111217234412_add_save_checkout_history_to_user.rb +5 -0
- data/spec/dummy/db/migrate/20111218002349_add_checkout_icalendar_token_to_user.rb +6 -0
- data/spec/dummy/db/migrate/20111231145823_add_share_bookmarks_to_user.rb +5 -0
- data/spec/dummy/db/migrate/20120125050502_add_depth_to_message.rb +6 -0
- data/spec/dummy/db/migrate/{20120413161403_add_fingerprint_to_patron_import_file.rb → 20120413161403_add_fingerprint_to_agent_import_file.rb} +1 -1
- data/spec/dummy/db/migrate/{20120413170720_add_error_message_to_patron_import_file.rb → 20120413170720_add_error_message_to_agent_import_file.rb} +1 -1
- data/spec/dummy/db/migrate/20120418121539_add_save_search_history_to_user.rb +5 -0
- data/spec/dummy/db/migrate/20120424103932_add_librarian_id_to_checked_item.rb +5 -0
- data/spec/dummy/db/migrate/{20120511072422_add_patron_identifier_to_patron.rb → 20120511072422_add_agent_identifier_to_agent.rb} +1 -1
- data/spec/dummy/db/migrate/{20120602141129_add_edit_mode_to_patron_import_file.rb → 20120602141129_add_edit_mode_to_agent_import_file.rb} +1 -1
- data/spec/dummy/db/migrate/20130303104849_add_state_index_to_reserve.rb +5 -0
- data/spec/dummy/db/migrate/20130303124821_add_retained_at_to_reserve.rb +5 -0
- data/spec/dummy/db/migrate/20130304015019_add_postponed_at_to_reserve.rb +5 -0
- data/spec/dummy/db/migrate/20130416054135_add_circulation_status_id_to_item.rb +8 -0
- data/spec/dummy/db/migrate/20130421155019_add_creator_string_to_series_statement.rb +7 -0
- data/spec/dummy/db/migrate/20130421164124_add_series_master_to_series_statement.rb +5 -0
- data/spec/dummy/db/migrate/20130509185724_add_statement_of_responsibility_to_manifestation.rb +5 -0
- data/spec/dummy/db/migrate/20130519065638_add_lock_version_to_reserve.rb +5 -0
- data/spec/dummy/db/migrate/20130519065837_add_lock_version_to_checkin.rb +5 -0
- data/spec/dummy/db/migrate/20140518050147_create_reserve_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140518111006_create_message_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140518135713_create_message_request_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140519170214_create_resource_import_file_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140519171220_create_import_request_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140524020735_create_agent_import_file_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140524135607_create_bookmark_stat_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140524142813_add_taggings_count_to_tag.rb +5 -0
- data/spec/dummy/db/migrate/20140528045518_create_user_checkout_stat_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140528045539_create_user_reserve_stat_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140528045600_create_manifestation_checkout_stat_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140528045617_create_manifestation_reserve_stat_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140529014410_create_item_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140614065404_create_resource_export_files.rb +11 -0
- data/spec/dummy/db/migrate/20140614141500_create_resource_export_file_transitions.rb +14 -0
- data/spec/dummy/db/migrate/20140628073524_add_user_encoding_to_agent_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20140628073535_add_user_encoding_to_resource_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20140810061942_add_user_id_to_stat.rb +12 -0
- data/spec/dummy/db/migrate/20140810091231_add_checkout_icalendar_token_to_profile.rb +6 -0
- data/spec/dummy/db/migrate/20140810091417_add_save_checkout_history_to_profile.rb +5 -0
- data/spec/dummy/db/migrate/20140811132912_add_save_search_history_to_profile.rb +5 -0
- data/spec/dummy/db/migrate/20140812093836_add_share_bookmarks_to_profile.rb +5 -0
- data/spec/dummy/db/schema.rb +632 -57
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/private/system/user_import_files/user_imports/980/190/963/original/user_delete_file.tsv +4 -0
- data/spec/dummy/private/system/user_import_files/user_imports/980/190/963/original/user_import_file_sample.tsv +7 -7
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/003/original/user_export_file_20140815-3963-1s1td26.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/003/original/user_export_file_20140815-69229-i0rcty.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/003/original/user_export_file_20140816-21120-1w731r8.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20140711-28652-1dj3e98.txt +148 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20140711-29117-13jb6ol.txt +148 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20140721-65743-1tnagd4.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20140815-3963-1kk8o87.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20140815-69229-188nwub.txt +8 -0
- data/spec/dummy/public/system/user_export_files/user_exports/000/000/004/original/user_export_file_20140816-21120-twzfb6.txt +8 -0
- data/spec/dummy/solr/default/data/index/_4h.fdt +0 -0
- data/spec/dummy/solr/default/data/index/{_3h.fdx → _4h.fdx} +0 -0
- data/spec/dummy/solr/default/data/index/{_3h.fnm → _4h.fnm} +0 -0
- data/spec/dummy/solr/default/data/index/{_3h.nvd → _4h.nvd} +0 -0
- data/spec/dummy/solr/default/data/index/{_3h.nvm → _4h.nvm} +0 -0
- data/spec/dummy/solr/default/data/index/{_3h.si → _4h.si} +0 -0
- data/spec/dummy/solr/default/data/index/_4h_Lucene41_0.doc +0 -0
- data/spec/dummy/solr/default/data/index/_4h_Lucene41_0.pos +0 -0
- data/spec/dummy/solr/default/data/index/_4h_Lucene41_0.tim +0 -0
- data/spec/dummy/solr/default/data/index/_4h_Lucene41_0.tip +0 -0
- data/spec/dummy/solr/default/data/index/segments.gen +0 -0
- data/spec/dummy/solr/default/data/index/segments_97 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000320 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000321 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000322 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000323 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000324 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000325 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000326 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000327 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000328 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000329 +0 -0
- data/spec/dummy/tmp/cache/4F7/F90/default_role +0 -0
- data/spec/dummy/tmp/cache/ACB/B20/manifestation_search_total +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/154f7b83f2da0e86effbe25f32135177 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/1b984bdbd3204a51a82d0e01a1569e2d +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/3054c50144654f9c7e57bb0639a276e9 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/3bd7a263237ba366f64d938fe5303757 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/62899096da1a3e67660f3b88068be8c9 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/65b2e4f67eab21b30217e29075f433b2 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/87d24a3f43f175d4d17babe9203c79a7 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/d38d8658b30de1d068603968227680d4 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/spec/dummy/tmp/cache/stdout +246 -279
- data/spec/dummy/tmp/pids/redis-test.pid +1 -1
- data/spec/factories/profile.rb +9 -0
- data/spec/factories/user.rb +0 -13
- data/spec/fixtures/agent_import_files.yml +0 -3
- data/spec/fixtures/agents.yml +54 -54
- data/spec/fixtures/baskets.yml +4 -4
- data/spec/fixtures/carrier_type_has_checkout_types.yml +30 -0
- data/spec/fixtures/checked_items.yml +34 -0
- data/spec/fixtures/checkins.yml +54 -0
- data/spec/fixtures/checkout_stat_has_manifestations.yml +23 -0
- data/spec/fixtures/checkout_stat_has_users.yml +23 -0
- data/spec/fixtures/checkout_types.yml +33 -0
- data/spec/fixtures/checkouts.yml +162 -0
- data/spec/fixtures/circulation_statuses.yml +119 -0
- data/spec/fixtures/event_categories.yml +55 -0
- data/spec/fixtures/events.yml +142 -0
- data/spec/fixtures/exemplifies.yml +12 -0
- data/spec/fixtures/import_requests.yml +0 -2
- data/spec/fixtures/item_has_use_restrictions.yml +60 -0
- data/spec/fixtures/items.yml +101 -11
- data/spec/fixtures/lending_policies.yml +98 -0
- data/spec/fixtures/libraries.yml +26 -25
- data/spec/fixtures/library_groups.yml +6 -8
- data/spec/fixtures/manifestation_checkout_stats.yml +30 -0
- data/spec/fixtures/manifestation_reserve_stats.yml +30 -0
- data/spec/fixtures/manifestations.yml +69 -207
- data/spec/fixtures/message_requests.yml +27 -0
- data/spec/fixtures/message_templates.yml +105 -0
- data/spec/fixtures/profiles.yml +98 -0
- data/spec/fixtures/request_status_types.yml +63 -0
- data/spec/fixtures/request_types.yml +55 -0
- data/spec/fixtures/reserve_stat_has_manifestations.yml +23 -0
- data/spec/fixtures/reserve_stat_has_users.yml +23 -0
- data/spec/fixtures/reserve_transitions.yml +88 -0
- data/spec/fixtures/reserves.yml +162 -0
- data/spec/fixtures/resource_import_files.yml +0 -3
- data/spec/fixtures/roles.yml +0 -4
- data/spec/fixtures/shelves.yml +2 -3
- data/spec/fixtures/use_restrictions.yml +92 -0
- data/spec/fixtures/user_checkout_stats.yml +30 -0
- data/spec/fixtures/user_export_files.yml +26 -0
- data/spec/fixtures/user_group_has_checkout_types.yml +110 -0
- data/spec/fixtures/user_import_files.yml +2 -0
- data/spec/fixtures/user_reserve_stats.yml +30 -0
- data/spec/fixtures/users.yml +1 -101
- data/spec/models/profile_spec.rb +66 -0
- data/spec/models/user_export_file_spec.rb +31 -0
- data/spec/models/user_import_file_spec.rb +42 -20
- data/spec/models/user_spec.rb +1 -18
- data/spec/requests/{users_spec.rb → profiles_spec.rb} +3 -3
- data/spec/routing/accounts_spec.rb +1 -1
- data/spec/routing/profiles_routing_spec.rb +35 -0
- data/spec/support/resque.rb +1 -0
- data/spec/views/{users → profiles}/edit.html.erb_spec.rb +5 -7
- data/spec/views/{users → profiles}/index.html.erb_spec.rb +3 -3
- data/spec/views/{users → profiles}/new.html.erb_spec.rb +5 -5
- data/spec/views/profiles/show.html.erb_spec.rb +20 -0
- data/vendor/assets/javascripts/jquery.colorbox.js +4 -3
- data/vendor/assets/stylesheets/colorbox.css +1 -1
- metadata +416 -132
- data/app/controllers/users_controller.rb +0 -195
- data/app/models/user_sweeper.rb +0 -18
- data/app/views/users/_edit_credential.html.erb +0 -79
- data/app/views/users/edit.html.erb +0 -76
- data/app/views/users/index.html.erb +0 -56
- data/lib/enju_leaf/expire_editable_fragment.rb +0 -30
- data/lib/enju_leaf/expire_fragment_cache.rb +0 -17
- data/spec/controllers/users_controller_spec.rb +0 -539
- data/spec/dummy/db/migrate/20110916053430_rename_manifestation_number_list_to_number_string.rb +0 -13
- data/spec/dummy/db/migrate/20120415060308_rename_resource_import_file_imported_at_to_executed_at.rb +0 -9
- data/spec/dummy/db/migrate/20120415060323_rename_patron_import_file_imported_at_to_executed_at.rb +0 -9
- data/spec/dummy/db/migrate/20121119153944_add_manifestation_id_to_item.rb +0 -5
- data/spec/dummy/solr/default/data/index/_3h.fdt +0 -0
- data/spec/dummy/solr/default/data/index/_3h_Lucene41_0.doc +0 -0
- data/spec/dummy/solr/default/data/index/_3h_Lucene41_0.pos +0 -0
- data/spec/dummy/solr/default/data/index/_3h_Lucene41_0.tim +0 -0
- data/spec/dummy/solr/default/data/index/_3h_Lucene41_0.tip +0 -0
- data/spec/dummy/solr/default/data/index/segments_71 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000242 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000243 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000244 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000245 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000246 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000247 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000248 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000249 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000250 +0 -0
- data/spec/dummy/solr/default/data/tlog/tlog.0000000000000000251 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/3f8d795856d1fdf902b0be679120571a +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/5998e66e374537d52eed3fe1ca5f2bfc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/5ea4a1824e1d67da6c4fb9aeef9f49f4 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/87f0cb69a0df1355e33cce3949919d5a +0 -0
- data/spec/routing/users_routing_spec.rb +0 -35
- data/spec/views/users/show.html.erb_spec.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30cec87ac36bc5f86229522a16fa000de67d4045
|
4
|
+
data.tar.gz: 1e767244cb0a31287ae1bf0f9a7e100c6495e129
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7280e3e949c72894314feb4fbd57679cf6c4b6e49641df908c949f060965e41736bff362e0f3c924010bd4b8a8499a424421a8b37809c07560cfbd64eede0e76
|
7
|
+
data.tar.gz: 5d12f151f53a63dc8eb387ebe89b8d403b121e83a247da1dc27f67378dd63a1e9d115658612c91f73201d80bd9dbc8b9ddc3eaf081ab0689b408196c35736c09
|
@@ -2,24 +2,24 @@ class MyAccountsController < ApplicationController
|
|
2
2
|
before_filter :authenticate_user!
|
3
3
|
|
4
4
|
def show
|
5
|
-
@
|
5
|
+
@profile = current_user.profile
|
6
6
|
|
7
7
|
respond_to do |format|
|
8
8
|
format.html
|
9
|
-
format.json { render :
|
9
|
+
format.json { render json: @profile }
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
13
|
def edit
|
14
|
-
@
|
14
|
+
@profile = current_user.profile
|
15
15
|
if defined?(EnjuCirculation)
|
16
16
|
if params[:mode] == 'feed_token'
|
17
17
|
if params[:disable] == 'true'
|
18
|
-
@
|
18
|
+
@profile.delete_checkout_icalendar_token
|
19
19
|
else
|
20
|
-
@
|
20
|
+
@profile.reset_checkout_icalendar_token
|
21
21
|
end
|
22
|
-
render :
|
22
|
+
render partial: 'feed_token'
|
23
23
|
return
|
24
24
|
end
|
25
25
|
end
|
@@ -27,34 +27,42 @@ class MyAccountsController < ApplicationController
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def update
|
30
|
-
@
|
30
|
+
@profile = current_user.profile
|
31
31
|
|
32
32
|
respond_to do |format|
|
33
33
|
if current_user.has_role?('Librarian')
|
34
|
-
saved = current_user.update_with_password(params[:
|
34
|
+
saved = current_user.update_with_password(params[:profile][:user_attributes], as: :admin)
|
35
|
+
@profile.assign_attributes(params[:profile], as: :admin)
|
35
36
|
else
|
36
|
-
saved = current_user.update_with_password(params[:
|
37
|
+
saved = current_user.update_with_password(params[:profile][:user_attributes])
|
38
|
+
@profile.assign_attributes(params[:profile])
|
37
39
|
end
|
38
40
|
|
39
41
|
if saved
|
40
|
-
|
41
|
-
|
42
|
-
|
42
|
+
if @profile.save
|
43
|
+
sign_in(current_user, :bypass => true)
|
44
|
+
format.html { redirect_to my_account_url, notice: t('controller.successfully_updated', model: t('activerecord.models.user')) }
|
45
|
+
format.json { head :no_content }
|
46
|
+
else
|
47
|
+
prepare_options
|
48
|
+
format.html { render action: "edit" }
|
49
|
+
format.json { render json: current_user.errors, status: :unprocessable_entity }
|
50
|
+
end
|
43
51
|
else
|
44
|
-
@
|
52
|
+
@profile.errors[:base] << I18n.t('activerecord.attributes.user.current_password')
|
45
53
|
prepare_options
|
46
|
-
format.html { render :
|
47
|
-
format.json { render :
|
54
|
+
format.html { render action: "edit" }
|
55
|
+
format.json { render json: current_user.errors, status: :unprocessable_entity }
|
48
56
|
end
|
49
57
|
end
|
50
58
|
end
|
51
59
|
|
52
60
|
def destroy
|
53
|
-
@
|
54
|
-
@
|
61
|
+
@profile = current_user.profile
|
62
|
+
@profile.destroy
|
55
63
|
|
56
64
|
respond_to do |format|
|
57
|
-
format.html { redirect_to my_account_url, :
|
65
|
+
format.html { redirect_to my_account_url, notice: 'devise.registrations.destroyed' }
|
58
66
|
format.json { head :no_content }
|
59
67
|
end
|
60
68
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
class PageController < ApplicationController
|
2
|
-
before_filter :clear_search_sessions, :
|
3
|
-
before_filter :store_location, :
|
4
|
-
before_filter :authenticate_user!, :
|
5
|
-
before_filter :check_librarian, :
|
2
|
+
before_filter :clear_search_sessions, only: [:index, :advanced_search]
|
3
|
+
before_filter :store_location, only: [:advanced_search, :about, :add_on, :msie_acceralator, :statistics]
|
4
|
+
before_filter :authenticate_user!, except: [:index, :advanced_search, :about, :add_on, :msie_acceralator, :opensearch, :statistics, :routing_error]
|
5
|
+
before_filter :check_librarian, except: [:index, :advanced_search, :about, :add_on, :msie_acceralator, :opensearch, :statistics, :routing_error]
|
6
6
|
helper_method :get_libraries
|
7
7
|
|
8
8
|
def index
|
@@ -32,11 +32,11 @@ class PageController < ApplicationController
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def msie_acceralator
|
35
|
-
render :
|
35
|
+
render layout: false
|
36
36
|
end
|
37
37
|
|
38
38
|
def opensearch
|
39
|
-
render :
|
39
|
+
render layout: false
|
40
40
|
end
|
41
41
|
|
42
42
|
def advanced_search
|
@@ -0,0 +1,155 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
class ProfilesController < ApplicationController
|
3
|
+
load_and_authorize_resource except: [:index, :create]
|
4
|
+
authorize_resource only: [:index, :create]
|
5
|
+
before_filter :prepare_options, only: [:new, :edit]
|
6
|
+
|
7
|
+
# GET /profiles
|
8
|
+
# GET /profiles.json
|
9
|
+
def index
|
10
|
+
query = flash[:query] = params[:query].to_s
|
11
|
+
@query = query.dup
|
12
|
+
@count = {}
|
13
|
+
|
14
|
+
sort = {sort_by: 'created_at', order: 'desc'}
|
15
|
+
case params[:sort_by]
|
16
|
+
when 'username'
|
17
|
+
sort[:sort_by] = 'username'
|
18
|
+
end
|
19
|
+
case params[:order]
|
20
|
+
when 'asc'
|
21
|
+
sort[:order] = 'asc'
|
22
|
+
when 'desc'
|
23
|
+
sort[:order] = 'desc'
|
24
|
+
end
|
25
|
+
|
26
|
+
query = params[:query]
|
27
|
+
page = params[:page] || 1
|
28
|
+
role = current_user.try(:role) || Role.default_role
|
29
|
+
|
30
|
+
search = Profile.search
|
31
|
+
search.build do
|
32
|
+
fulltext query if query
|
33
|
+
order_by sort[:sort_by], sort[:order]
|
34
|
+
end
|
35
|
+
search.query.paginate(page.to_i, Profile.default_per_page)
|
36
|
+
@profiles = search.execute!.results
|
37
|
+
@count[:query_result] = @profiles.total_entries
|
38
|
+
|
39
|
+
respond_to do |format|
|
40
|
+
format.html # index.html.erb
|
41
|
+
format.json { render json: @profiles }
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# GET /profiles/1
|
46
|
+
# GET /profiles/1.json
|
47
|
+
def show
|
48
|
+
if @profile.user == current_user
|
49
|
+
redirect_to my_account_url
|
50
|
+
return
|
51
|
+
end
|
52
|
+
|
53
|
+
respond_to do |format|
|
54
|
+
format.html # show.html.erb
|
55
|
+
format.json { render json: @profile }
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# GET /profiles/new
|
60
|
+
def new
|
61
|
+
@profile = Profile.new
|
62
|
+
@profile.user = User.new
|
63
|
+
@profile.user_group = current_user.profile.user_group
|
64
|
+
@profile.library = current_user.profile.library
|
65
|
+
@profile.locale = current_user.profile.locale
|
66
|
+
|
67
|
+
respond_to do |format|
|
68
|
+
format.html # new.html.erb
|
69
|
+
format.json { render json: @profile }
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
# GET /profiles/1/edit
|
74
|
+
def edit
|
75
|
+
if @profile.user == current_user
|
76
|
+
redirect_to edit_my_account_url
|
77
|
+
return
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
# POST /profiles
|
82
|
+
# POST /profiles.json
|
83
|
+
def create
|
84
|
+
if current_user.has_role?('Librarian')
|
85
|
+
@profile = Profile.new(params[:profile], as: :admin)
|
86
|
+
if @profile.user
|
87
|
+
@profile.user.operator = current_user
|
88
|
+
@profile.user.set_auto_generated_password
|
89
|
+
end
|
90
|
+
else
|
91
|
+
@profile = Profile.new(params[:profile])
|
92
|
+
end
|
93
|
+
|
94
|
+
respond_to do |format|
|
95
|
+
if @profile.save
|
96
|
+
if @profile.user
|
97
|
+
@profile.user.role = Role.where(name: 'User').first
|
98
|
+
flash[:temporary_password] = @profile.user.password
|
99
|
+
end
|
100
|
+
format.html { redirect_to @profile, notice: t('controller.successfully_created', model: t('activerecord.models.profile')) }
|
101
|
+
format.json { render json: @profile, status: :created, location: @profile }
|
102
|
+
else
|
103
|
+
prepare_options
|
104
|
+
format.html { render action: "new" }
|
105
|
+
format.json { render json: @profile.errors, status: :unprocessable_entity }
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
# PUT /profiles/1
|
111
|
+
# PUT /profiles/1.json
|
112
|
+
def update
|
113
|
+
if current_user.has_role?('Librarian')
|
114
|
+
@profile.update_attributes(params[:profile], as: :admin)
|
115
|
+
else
|
116
|
+
@profile.update_attributes(params[:profile])
|
117
|
+
end
|
118
|
+
if @profile.user
|
119
|
+
if @profile.user.auto_generated_password == "1"
|
120
|
+
@profile.user.set_auto_generated_password
|
121
|
+
flash[:temporary_password] = @profile.user.password
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
respond_to do |format|
|
126
|
+
if @profile.save
|
127
|
+
format.html { redirect_to @profile, notice: t('controller.successfully_updated', model: t('activerecord.models.profile')) }
|
128
|
+
format.json { head :no_content }
|
129
|
+
else
|
130
|
+
prepare_options
|
131
|
+
format.html { render action: "edit" }
|
132
|
+
format.json { render json: @profile.errors, status: :unprocessable_entity }
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
# DELETE /profiles/1
|
138
|
+
# DELETE /profiles/1.json
|
139
|
+
def destroy
|
140
|
+
@profile.destroy
|
141
|
+
|
142
|
+
respond_to do |format|
|
143
|
+
format.html { redirect_to profiles_url, notice: t('controller.successfully_deleted', model: t('activerecord.models.profile')) }
|
144
|
+
format.json { head :no_content }
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
private
|
149
|
+
def prepare_options
|
150
|
+
@user_groups = UserGroup.all
|
151
|
+
@roles = Role.all
|
152
|
+
@libraries = Library.all
|
153
|
+
@languages = Language.all
|
154
|
+
end
|
155
|
+
end
|
@@ -6,7 +6,7 @@ class RolesController < ApplicationController
|
|
6
6
|
def index
|
7
7
|
respond_to do |format|
|
8
8
|
format.html # index.html.erb
|
9
|
-
format.json { render :
|
9
|
+
format.json { render json: @roles }
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
@@ -15,7 +15,7 @@ class RolesController < ApplicationController
|
|
15
15
|
def show
|
16
16
|
respond_to do |format|
|
17
17
|
format.html # show.html.erb
|
18
|
-
format.json { render :
|
18
|
+
format.json { render json: @role }
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
@@ -33,11 +33,11 @@ class RolesController < ApplicationController
|
|
33
33
|
|
34
34
|
respond_to do |format|
|
35
35
|
if @role.update_attributes(params[:role])
|
36
|
-
format.html { redirect_to @role, :
|
36
|
+
format.html { redirect_to @role, notice: t('controller.successfully_updated', model: t('activerecord.models.role')) }
|
37
37
|
format.json { head :no_content }
|
38
38
|
else
|
39
|
-
format.html { render :
|
40
|
-
format.json { render :
|
39
|
+
format.html { render action: "edit" }
|
40
|
+
format.json { render json: @role.errors, status: :unprocessable_entity }
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
@@ -0,0 +1,100 @@
|
|
1
|
+
class UserExportFilesController < ApplicationController
|
2
|
+
load_and_authorize_resource
|
3
|
+
|
4
|
+
# GET /user_export_files
|
5
|
+
# GET /user_export_files.json
|
6
|
+
def index
|
7
|
+
@user_export_files = UserExportFile.order('id DESC').page(params[:page])
|
8
|
+
|
9
|
+
respond_to do |format|
|
10
|
+
format.html # index.html.erb
|
11
|
+
format.json { render json: @user_export_files }
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
# GET /user_export_files/1
|
16
|
+
# GET /user_export_files/1.json
|
17
|
+
def show
|
18
|
+
if @user_export_file.user_export.path
|
19
|
+
unless Setting.uploaded_file.storage == :s3
|
20
|
+
file = @user_export_file.user_export.path
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
respond_to do |format|
|
25
|
+
format.html # show.html.erb
|
26
|
+
format.json { render json: @user_export_file }
|
27
|
+
format.download {
|
28
|
+
if Setting.uploaded_file.storage == :s3
|
29
|
+
redirect_to @user_export_file.user_export.expiring_url(10)
|
30
|
+
else
|
31
|
+
send_file file, filename: @user_export_file.user_export_file_name, type: 'application/octet-stream'
|
32
|
+
end
|
33
|
+
}
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
# GET /user_export_files/new
|
38
|
+
# GET /user_export_files/new.json
|
39
|
+
def new
|
40
|
+
@user_export_file = UserExportFile.new
|
41
|
+
@user_export_file.user = current_user
|
42
|
+
|
43
|
+
respond_to do |format|
|
44
|
+
format.html # new.html.erb
|
45
|
+
format.json { render json: @user_export_file }
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
# GET /user_export_files/1/edit
|
50
|
+
def edit
|
51
|
+
end
|
52
|
+
|
53
|
+
# POST /user_export_files
|
54
|
+
# POST /user_export_files.json
|
55
|
+
def create
|
56
|
+
@user_export_file = UserExportFile.new(params[:user_export_file])
|
57
|
+
@user_export_file.user = current_user
|
58
|
+
|
59
|
+
respond_to do |format|
|
60
|
+
if @user_export_file.save
|
61
|
+
if @user_export_file.mode == 'export'
|
62
|
+
Resque.enqueue(UserExportFileQueue, @user_export_file.id)
|
63
|
+
end
|
64
|
+
format.html { redirect_to @user_export_file, notice: t('export.successfully_created', model: t('activerecord.models.user_export_file')) }
|
65
|
+
format.json { render json: @user_export_file, status: :created, location: @user_export_file }
|
66
|
+
else
|
67
|
+
format.html { render action: "new" }
|
68
|
+
format.json { render json: @user_export_file.errors, status: :unprocessable_entity }
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
# PUT /user_export_files/1
|
74
|
+
# PUT /user_export_files/1.json
|
75
|
+
def update
|
76
|
+
respond_to do |format|
|
77
|
+
if @user_export_file.update_attributes(params[:user_export_file])
|
78
|
+
if @user_export_file.mode == 'export'
|
79
|
+
UserExportFileQueue.perform(@user_export_file.id)
|
80
|
+
end
|
81
|
+
format.html { redirect_to @user_export_file, notice: t('controller.successfully_updated', model: t('activerecord.models.user_export_file')) }
|
82
|
+
format.json { head :no_content }
|
83
|
+
else
|
84
|
+
format.html { render action: "edit" }
|
85
|
+
format.json { render json: @user_export_file.errors, status: :unprocessable_entity }
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
# DELETE /user_export_files/1
|
91
|
+
# DELETE /user_export_files/1.json
|
92
|
+
def destroy
|
93
|
+
@user_export_file.destroy
|
94
|
+
|
95
|
+
respond_to do |format|
|
96
|
+
format.html { redirect_to user_export_files_url }
|
97
|
+
format.json { head :no_content }
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
class UserGroupsController < ApplicationController
|
3
3
|
load_and_authorize_resource
|
4
|
-
before_filter :prepare_options, :
|
4
|
+
before_filter :prepare_options, only: [:new, :edit]
|
5
5
|
|
6
6
|
# GET /user_groups
|
7
7
|
# GET /user_groups.json
|
@@ -10,7 +10,7 @@ class UserGroupsController < ApplicationController
|
|
10
10
|
|
11
11
|
respond_to do |format|
|
12
12
|
format.html # index.html.erb
|
13
|
-
format.json { render :
|
13
|
+
format.json { render json: @user_groups }
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
@@ -19,7 +19,7 @@ class UserGroupsController < ApplicationController
|
|
19
19
|
def show
|
20
20
|
respond_to do |format|
|
21
21
|
format.html # show.html.erb
|
22
|
-
format.json { render :
|
22
|
+
format.json { render json: @user_group }
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
@@ -29,7 +29,7 @@ class UserGroupsController < ApplicationController
|
|
29
29
|
|
30
30
|
respond_to do |format|
|
31
31
|
format.html # new.html.erb
|
32
|
-
format.json { render :
|
32
|
+
format.json { render json: @user_group }
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
@@ -44,12 +44,12 @@ class UserGroupsController < ApplicationController
|
|
44
44
|
|
45
45
|
respond_to do |format|
|
46
46
|
if @user_group.save
|
47
|
-
format.html { redirect_to @user_group, :
|
48
|
-
format.json { render :
|
47
|
+
format.html { redirect_to @user_group, notice: t('controller.successfully_created', model: t('activerecord.models.user_group')) }
|
48
|
+
format.json { render json: @user_group, status: :created, location: @user_group }
|
49
49
|
else
|
50
50
|
prepare_options
|
51
|
-
format.html { render :
|
52
|
-
format.json { render :
|
51
|
+
format.html { render action: "new" }
|
52
|
+
format.json { render json: @user_group.errors, status: :unprocessable_entity }
|
53
53
|
end
|
54
54
|
end
|
55
55
|
end
|
@@ -64,12 +64,12 @@ class UserGroupsController < ApplicationController
|
|
64
64
|
|
65
65
|
respond_to do |format|
|
66
66
|
if @user_group.update_attributes(params[:user_group])
|
67
|
-
format.html { redirect_to @user_group, :
|
67
|
+
format.html { redirect_to @user_group, notice: t('controller.successfully_updated', model: t('activerecord.models.user_group')) }
|
68
68
|
format.json { head :no_content }
|
69
69
|
else
|
70
70
|
prepare_options
|
71
|
-
format.html { render :
|
72
|
-
format.json { render :
|
71
|
+
format.html { render action: "edit" }
|
72
|
+
format.json { render json: @user_group.errors, status: :unprocessable_entity }
|
73
73
|
end
|
74
74
|
end
|
75
75
|
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
class UserImportFilesController < ApplicationController
|
2
2
|
load_and_authorize_resource
|
3
|
+
before_filter :prepare_options, only: [:new, :edit]
|
3
4
|
|
4
5
|
# GET /user_import_files
|
5
6
|
# GET /user_import_files.json
|
@@ -8,7 +9,7 @@ class UserImportFilesController < ApplicationController
|
|
8
9
|
|
9
10
|
respond_to do |format|
|
10
11
|
format.html # index.html.erb
|
11
|
-
format.json { render :
|
12
|
+
format.json { render json: @user_import_files }
|
12
13
|
end
|
13
14
|
end
|
14
15
|
|
@@ -23,12 +24,12 @@ class UserImportFilesController < ApplicationController
|
|
23
24
|
|
24
25
|
respond_to do |format|
|
25
26
|
format.html # show.html.erb
|
26
|
-
format.json { render :
|
27
|
+
format.json { render json: @user_import_file }
|
27
28
|
format.download {
|
28
29
|
if Setting.uploaded_file.storage == :s3
|
29
30
|
redirect_to @user_import_file.user_import.expiring_url(10)
|
30
31
|
else
|
31
|
-
send_file file, :
|
32
|
+
send_file file, filename: @user_import_file.user_import_file_name, type: 'application/octet-stream'
|
32
33
|
end
|
33
34
|
}
|
34
35
|
end
|
@@ -38,10 +39,12 @@ class UserImportFilesController < ApplicationController
|
|
38
39
|
# GET /user_import_files/new.json
|
39
40
|
def new
|
40
41
|
@user_import_file = UserImportFile.new
|
42
|
+
@user_import_file.default_user_group = current_user.profile.user_group
|
43
|
+
@user_import_file.default_library = current_user.profile.library
|
41
44
|
|
42
45
|
respond_to do |format|
|
43
46
|
format.html # new.html.erb
|
44
|
-
format.json { render :
|
47
|
+
format.json { render json: @user_import_file }
|
45
48
|
end
|
46
49
|
end
|
47
50
|
|
@@ -60,11 +63,12 @@ class UserImportFilesController < ApplicationController
|
|
60
63
|
if @user_import_file.mode == 'import'
|
61
64
|
Resque.enqueue(UserImportFileQueue, @user_import_file.id)
|
62
65
|
end
|
63
|
-
format.html { redirect_to @user_import_file, :
|
64
|
-
format.json { render :
|
66
|
+
format.html { redirect_to @user_import_file, notice: t('import.successfully_created', model: t('activerecord.models.user_import_file')) }
|
67
|
+
format.json { render json: @user_import_file, status: :created, location: @user_import_file }
|
65
68
|
else
|
66
|
-
|
67
|
-
format.
|
69
|
+
prepare_options
|
70
|
+
format.html { render action: "new" }
|
71
|
+
format.json { render json: @user_import_file.errors, status: :unprocessable_entity }
|
68
72
|
end
|
69
73
|
end
|
70
74
|
end
|
@@ -77,11 +81,12 @@ class UserImportFilesController < ApplicationController
|
|
77
81
|
if @user_import_file.mode == 'import'
|
78
82
|
Resque.enqueue(UserImportFileQueue, @user_import_file.id)
|
79
83
|
end
|
80
|
-
format.html { redirect_to @user_import_file, :
|
84
|
+
format.html { redirect_to @user_import_file, notice: t('controller.successfully_updated', model: t('activerecord.models.user_import_file')) }
|
81
85
|
format.json { head :no_content }
|
82
86
|
else
|
83
|
-
|
84
|
-
format.
|
87
|
+
prepare_options
|
88
|
+
format.html { render action: "edit" }
|
89
|
+
format.json { render json: @user_import_file.errors, status: :unprocessable_entity }
|
85
90
|
end
|
86
91
|
end
|
87
92
|
end
|
@@ -96,4 +101,10 @@ class UserImportFilesController < ApplicationController
|
|
96
101
|
format.json { head :no_content }
|
97
102
|
end
|
98
103
|
end
|
104
|
+
|
105
|
+
private
|
106
|
+
def prepare_options
|
107
|
+
@user_groups = UserGroup.all
|
108
|
+
@libraries = Library.all
|
109
|
+
end
|
99
110
|
end
|
data/app/mailers/notifier.rb
CHANGED
@@ -3,28 +3,28 @@ class Notifier < ActionMailer::Base
|
|
3
3
|
|
4
4
|
def message_notification(message_id)
|
5
5
|
message = Message.find(message_id)
|
6
|
-
I18n.locale = message.receiver.locale.try(:to_sym) || I18n.default_locale
|
7
|
-
from = "#{LibraryGroup.system_name(message.receiver.locale)} <#{LibraryGroup.site_config.email}>"
|
6
|
+
I18n.locale = message.receiver.profile.locale.try(:to_sym) || I18n.default_locale
|
7
|
+
from = "#{LibraryGroup.system_name(message.receiver.profile.locale)} <#{LibraryGroup.site_config.user.email}>"
|
8
8
|
if message.subject
|
9
9
|
subject = message.subject
|
10
10
|
else
|
11
|
-
subject = I18n.t('message.new_message_from_library', :library => LibraryGroup.system_name(message.receiver.user.locale))
|
11
|
+
subject = I18n.t('message.new_message_from_library', :library => LibraryGroup.system_name(message.receiver.user.profile.locale))
|
12
12
|
end
|
13
13
|
if message.sender
|
14
14
|
@sender_name = message.sender.username
|
15
15
|
else
|
16
|
-
@sender_name = LibraryGroup.system_name(message.receiver.locale)
|
16
|
+
@sender_name = LibraryGroup.system_name(message.receiver.profile.locale)
|
17
17
|
end
|
18
18
|
@message = message
|
19
|
-
@locale = message.receiver.locale
|
19
|
+
@locale = message.receiver.profile.locale
|
20
20
|
mail(:from => from, :to => message.receiver.email, :subject => subject)
|
21
21
|
end
|
22
22
|
|
23
23
|
def manifestation_info(user_id, manifestation_id)
|
24
24
|
user = User.find(user_id)
|
25
25
|
manifestation = Manifestation.find(manifestation_id)
|
26
|
-
from = "#{LibraryGroup.system_name(user.locale)} <#{LibraryGroup.site_config.email}>"
|
27
|
-
subject = "#{manifestation.original_title} : #{LibraryGroup.system_name(user.locale)}"
|
26
|
+
from = "#{LibraryGroup.system_name(user.profile.locale)} <#{LibraryGroup.site_config.user.email}>"
|
27
|
+
subject = "#{manifestation.original_title} : #{LibraryGroup.system_name(user.profile.locale)}"
|
28
28
|
@user = user
|
29
29
|
@manifestation = manifestation
|
30
30
|
mail(:from => from, :to => user.email, :subject => subject)
|