enju_biblio 0.1.3 → 0.2.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +3 -3
- data/app/controllers/agent_import_files_controller.rb +13 -3
- data/app/controllers/agent_import_results_controller.rb +12 -1
- data/app/controllers/agent_merge_lists_controller.rb +11 -1
- data/app/controllers/agent_merges_controller.rb +12 -2
- data/app/controllers/agent_relationship_types_controller.rb +13 -2
- data/app/controllers/agent_relationships_controller.rb +13 -4
- data/app/controllers/agent_types_controller.rb +13 -2
- data/app/controllers/agents_controller.rb +18 -12
- data/app/controllers/carrier_types_controller.rb +12 -2
- data/app/controllers/concerns/enju_biblio/controller.rb +99 -0
- data/app/controllers/content_types_controller.rb +12 -1
- data/app/controllers/countries_controller.rb +12 -1
- data/app/controllers/create_types_controller.rb +13 -2
- data/app/controllers/creates_controller.rb +13 -4
- data/app/controllers/donates_controller.rb +11 -1
- data/app/controllers/form_of_works_controller.rb +13 -2
- data/app/controllers/frequencies_controller.rb +13 -2
- data/app/controllers/identifier_types_controller.rb +13 -2
- data/app/controllers/import_requests_controller.rb +19 -9
- data/app/controllers/items_controller.rb +25 -13
- data/app/controllers/languages_controller.rb +12 -1
- data/app/controllers/licenses_controller.rb +13 -2
- data/app/controllers/manifestation_relationship_types_controller.rb +12 -1
- data/app/controllers/manifestation_relationships_controller.rb +13 -4
- data/app/controllers/manifestations_controller.rb +58 -30
- data/app/controllers/medium_of_performances_controller.rb +13 -2
- data/app/controllers/owns_controller.rb +12 -3
- data/app/controllers/picture_files_controller.rb +13 -3
- data/app/controllers/produce_types_controller.rb +13 -2
- data/app/controllers/produces_controller.rb +13 -4
- data/app/controllers/realize_types_controller.rb +13 -2
- data/app/controllers/realizes_controller.rb +13 -4
- data/app/controllers/resource_export_files_controller.rb +13 -3
- data/app/controllers/resource_import_files_controller.rb +14 -4
- data/app/controllers/resource_import_results_controller.rb +12 -1
- data/app/controllers/series_statement_merge_lists_controller.rb +11 -1
- data/app/controllers/series_statement_merges_controller.rb +12 -2
- data/app/controllers/series_statements_controller.rb +13 -5
- data/app/helpers/manifestations_helper.rb +8 -8
- data/app/jobs/agent_import_file_job.rb +7 -0
- data/app/jobs/resource_export_file_job.rb +7 -0
- data/app/jobs/resource_import_file_job.rb +7 -0
- data/app/models/agent.rb +23 -1
- data/app/models/agent_import_file.rb +0 -1
- data/app/models/carrier_type.rb +0 -1
- data/app/models/identifier.rb +1 -1
- data/app/models/item.rb +2 -9
- data/app/models/manifestation.rb +180 -75
- data/app/models/picture_file.rb +1 -1
- data/app/models/resource_export_file.rb +5 -3
- data/app/models/resource_import_file.rb +34 -50
- data/app/models/series_statement.rb +8 -1
- data/app/policies/agent_import_file_policy.rb +21 -0
- data/app/policies/agent_import_result_policy.rb +21 -0
- data/app/policies/agent_merge_list_policy.rb +25 -0
- data/app/policies/agent_merge_policy.rb +25 -0
- data/app/policies/agent_policy.rb +30 -0
- data/app/policies/agent_relationship_policy.rb +21 -0
- data/app/policies/agent_relationship_type_policy.rb +21 -0
- data/app/policies/agent_type_policy.rb +23 -0
- data/app/policies/carrier_type_policy.rb +23 -0
- data/app/policies/content_type_policy.rb +23 -0
- data/app/policies/country_policy.rb +21 -0
- data/app/policies/create_policy.rb +21 -0
- data/app/policies/create_type_policy.rb +21 -0
- data/app/policies/donate_policy.rb +21 -0
- data/app/policies/form_of_work_policy.rb +21 -0
- data/app/policies/frequency_policy.rb +23 -0
- data/app/policies/identifier_type_policy.rb +23 -0
- data/app/policies/import_request_policy.rb +21 -0
- data/app/policies/item_policy.rb +27 -0
- data/app/policies/language_policy.rb +21 -0
- data/app/policies/license_policy.rb +21 -0
- data/app/policies/manifestation_policy.rb +67 -0
- data/app/policies/manifestation_relationship_policy.rb +21 -0
- data/app/policies/manifestation_relationship_type_policy.rb +21 -0
- data/app/policies/medium_of_performance_policy.rb +21 -0
- data/app/policies/own_policy.rb +21 -0
- data/app/policies/picture_file_policy.rb +32 -0
- data/app/policies/produce_policy.rb +21 -0
- data/app/policies/produce_type_policy.rb +21 -0
- data/app/policies/realize_policy.rb +21 -0
- data/app/policies/realize_type_policy.rb +21 -0
- data/app/policies/resource_export_file_policy.rb +21 -0
- data/app/policies/resource_import_file_policy.rb +21 -0
- data/app/policies/resource_import_result_policy.rb +21 -0
- data/app/policies/series_statement_merge_list_policy.rb +25 -0
- data/app/policies/series_statement_merge_policy.rb +25 -0
- data/app/policies/series_statement_policy.rb +25 -0
- data/app/views/agent_relationship_types/index.html.erb +4 -4
- data/app/views/agent_types/index.html.erb +4 -4
- data/app/views/agent_types/show.html.erb +1 -1
- data/app/views/agents/_agent.html.erb +2 -2
- data/app/views/agents/_index.html.erb +1 -1
- data/app/views/agents/_index_agent.html.erb +4 -4
- data/app/views/agents/_index_agent_merge_list.html.erb +2 -2
- data/app/views/agents/_index_expression.html.erb +3 -3
- data/app/views/agents/_index_manifestation.html.erb +3 -3
- data/app/views/agents/_index_work.html.erb +3 -3
- data/app/views/agents/edit.html.erb +1 -1
- data/app/views/agents/{index.mobile.erb → index.html+phone.erb} +0 -0
- data/app/views/agents/index.json.jbuilder +5 -0
- data/app/views/agents/index.rss.builder +2 -2
- data/app/views/agents/{show.mobile.erb → show.html+phone.erb} +0 -0
- data/app/views/agents/show.html.erb +3 -3
- data/app/views/carrier_types/_form.html.erb +1 -1
- data/app/views/carrier_types/index.html.erb +4 -4
- data/app/views/carrier_types/show.html.erb +1 -1
- data/app/views/content_types/index.html.erb +4 -4
- data/app/views/content_types/show.html.erb +1 -1
- data/app/views/countries/index.html.erb +3 -3
- data/app/views/countries/show.html.erb +1 -1
- data/app/views/create_types/index.html.erb +4 -4
- data/app/views/creates/_index.html.erb +2 -2
- data/app/views/creates/_index_agent.html.erb +3 -3
- data/app/views/creates/_index_work.html.erb +2 -2
- data/app/views/donates/index.html.erb +2 -2
- data/app/views/form_of_works/index.html.erb +4 -4
- data/app/views/form_of_works/show.html.erb +1 -1
- data/app/views/frequencies/index.html.erb +4 -4
- data/app/views/frequencies/show.html.erb +1 -1
- data/app/views/identifier_types/index.html.erb +4 -4
- data/app/views/identifier_types/show.html.erb +1 -1
- data/app/views/import_requests/index.html.erb +1 -1
- data/app/views/items/{_shelf_picture.mobile.erb → _shelf_picture.html+phone.erb} +0 -0
- data/app/views/items/edit.html.erb +2 -2
- data/app/views/items/{index.mobile.erb → index.html+phone.erb} +1 -1
- data/app/views/items/index.html.erb +2 -2
- data/app/views/items/new.html.erb +1 -5
- data/app/views/items/{show.mobile.erb → show.html+phone.erb} +0 -0
- data/app/views/items/show.html.erb +10 -6
- data/app/views/languages/index.html.erb +3 -3
- data/app/views/languages/show.html.erb +1 -1
- data/app/views/layouts/{agents.mobile.erb → agents.html+phone.erb} +1 -1
- data/app/views/layouts/agents.html.erb +2 -2
- data/app/views/layouts/{manifestations.mobile.erb → manifestations.html+phone.erb} +1 -1
- data/app/views/layouts/manifestations.html.erb +2 -2
- data/app/views/licenses/index.html.erb +4 -4
- data/app/views/manifestation_relationship_types/index.html.erb +4 -4
- data/app/views/manifestations/_attachment_file.html.erb +1 -1
- data/app/views/manifestations/_carrier_type_facet.html.erb +1 -1
- data/app/views/manifestations/_classification_facet.html.erb +2 -2
- data/app/views/manifestations/_contributor_fields.html.erb +4 -0
- data/app/views/manifestations/_creator_fields.html.erb +5 -0
- data/app/views/manifestations/_edit_detail.html.erb +1 -1
- data/app/views/manifestations/_export_list.html.erb +3 -3
- data/app/views/manifestations/_form.html.erb +25 -30
- data/app/views/manifestations/_holding.html.erb +6 -8
- data/app/views/manifestations/_identifier_fields.html.erb +5 -0
- data/app/views/manifestations/_index_form_contributor.html.erb +2 -2
- data/app/views/manifestations/_index_form_creator.html.erb +2 -2
- data/app/views/manifestations/_index_form_item.html.erb +2 -2
- data/app/views/manifestations/_index_form_manifestation.html.erb +2 -2
- data/app/views/manifestations/_index_form_parent.html.erb +1 -1
- data/app/views/manifestations/_index_form_publisher.html.erb +2 -2
- data/app/views/manifestations/_index_form_series_statement.html.erb +2 -2
- data/app/views/manifestations/_language_facet.html.erb +1 -1
- data/app/views/manifestations/_library_facet.html.erb +1 -1
- data/app/views/manifestations/_manifestation.html.erb +6 -2
- data/app/views/manifestations/_manifestation.txt.erb +1 -1
- data/app/views/manifestations/_paginate_id_store.html.erb +8 -6
- data/app/views/manifestations/_pub_year_facet.html.erb +1 -1
- data/app/views/manifestations/_publisher_fields.html.erb +4 -0
- data/app/views/manifestations/_reservable_facet.html.erb +2 -2
- data/app/views/manifestations/_series_statement_fields.html.erb +13 -0
- data/app/views/manifestations/_show.rdf.builder +3 -87
- data/app/views/manifestations/{_show_creators.mobile.erb → _show_creators.html+phone.erb} +0 -0
- data/app/views/manifestations/_show_creators.html.erb +0 -1
- data/app/views/manifestations/_show_detail_librarian.html.erb +20 -22
- data/app/views/manifestations/_show_detail_user.html.erb +13 -15
- data/app/views/manifestations/{_show_holding.mobile.erb → _show_holding.html+phone.erb} +0 -0
- data/app/views/manifestations/_show_holding.html.erb +1 -1
- data/app/views/manifestations/{_show_index.mobile.erb → _show_index.html+phone.erb} +0 -0
- data/app/views/manifestations/_submenu_parent.html.erb +3 -3
- data/app/views/manifestations/{_title.mobile.erb → _title.html+phone.erb} +0 -0
- data/app/views/manifestations/edit.html.erb +2 -6
- data/app/views/manifestations/{index.mobile.erb → index.html+phone.erb} +0 -0
- data/app/views/manifestations/index.html.erb +40 -24
- data/app/views/manifestations/index.rdf.builder +5 -3
- data/app/views/manifestations/index.rss.builder +2 -2
- data/app/views/manifestations/index.txt.erb +1 -2
- data/app/views/manifestations/{show.mobile.erb → show.html+phone.erb} +1 -1
- data/app/views/manifestations/show.html.erb +1 -1
- data/app/views/manifestations/show.txt.erb +1 -2
- data/app/views/medium_of_performances/index.html.erb +4 -4
- data/app/views/owns/index.html.erb +2 -2
- data/app/views/picture_files/_index.html.erb +3 -3
- data/app/views/picture_files/_index_agent.html.erb +4 -4
- data/app/views/picture_files/_index_manifestation.html.erb +4 -4
- data/app/views/picture_files/{_link.mobile.erb → _link.html+phone.erb} +0 -0
- data/app/views/picture_files/{show.mobile.erb → show.html+phone.erb} +0 -0
- data/app/views/produce_types/index.html.erb +4 -4
- data/app/views/produces/_index.html.erb +2 -2
- data/app/views/produces/_index_agent.html.erb +2 -2
- data/app/views/produces/_index_manifestation.html.erb +2 -2
- data/app/views/realize_types/index.html.erb +4 -4
- data/app/views/realizes/_index.html.erb +2 -2
- data/app/views/realizes/_index_agent.html.erb +2 -2
- data/app/views/realizes/_index_expression.html.erb +2 -2
- data/app/views/series_statement_merges/show.html.erb +0 -2
- data/app/views/series_statements/_index.html.erb +4 -4
- data/app/views/series_statements/_index_series_statement_merge_list.html.erb +2 -2
- data/app/views/series_statements/show.html.erb +1 -1
- data/config/locales/translation_en.yml +13 -0
- data/config/locales/translation_ja.yml +13 -0
- data/config/routes.rb +3 -43
- data/lib/enju_biblio/engine.rb +0 -1
- data/lib/enju_biblio/version.rb +1 -1
- data/lib/enju_biblio.rb +0 -107
- data/lib/tasks/enju_biblio_tasks.rake +1 -1
- data/spec/cassette_library/ImportRequest/import/should_import_bibliographic_record.yml +43 -43
- data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Administrator/with_isbn_which_is_already_imported/redirects_to_the_created_import_request.yml +45 -45
- data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Administrator/with_valid_params/assigns_a_newly_created_import_request_as_import_request.yml +50 -50
- data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Administrator/with_valid_params/redirects_to_the_created_import_request.yml +44 -44
- data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Librarian/with_valid_params/assigns_a_newly_created_import_request_as_import_request.yml +48 -48
- data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Librarian/with_valid_params/redirects_to_the_created_import_request.yml +41 -41
- data/spec/cassette_library/ResourceImportFile/should_import_in_background.yml +50 -50
- data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/ISBN_import/with_record_not_found/should_record_an_error_message.yml +49 -49
- data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_has_only_isbn/should_be_imported.yml +45 -45
- data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_shift_jis/should_be_imported.yml +50 -50
- data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_utf-8/should_be_imported.yml +48 -48
- data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_utf-8/should_be_searchable_right_after_the_import.yml +512 -0
- data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_utf-8/should_send_message_when_import_is_completed.yml +42 -42
- data/spec/controllers/agent_import_files_controller_spec.rb +5 -5
- data/spec/controllers/agent_import_results_controller_spec.rb +3 -3
- data/spec/controllers/agent_merge_lists_controller_spec.rb +9 -9
- data/spec/controllers/agent_merges_controller_spec.rb +9 -9
- data/spec/controllers/agent_relationship_types_controller_spec.rb +14 -14
- data/spec/controllers/agent_relationships_controller_spec.rb +9 -9
- data/spec/controllers/agent_types_controller_spec.rb +2 -2
- data/spec/controllers/agents_controller_spec.rb +8 -8
- data/spec/controllers/carrier_types_controller_spec.rb +1 -1
- data/spec/controllers/content_types_controller_spec.rb +1 -1
- data/spec/controllers/countries_controller_spec.rb +10 -10
- data/spec/controllers/create_types_controller_spec.rb +2 -2
- data/spec/controllers/creates_controller_spec.rb +7 -7
- data/spec/controllers/donates_controller_spec.rb +9 -9
- data/spec/controllers/form_of_works_controller_spec.rb +2 -2
- data/spec/controllers/frequencies_controller_spec.rb +2 -2
- data/spec/controllers/identifier_types_controller_spec.rb +2 -2
- data/spec/controllers/import_requests_controller_spec.rb +9 -9
- data/spec/controllers/items_controller_spec.rb +13 -7
- data/spec/controllers/languages_controller_spec.rb +8 -8
- data/spec/controllers/licenses_controller_spec.rb +2 -2
- data/spec/controllers/manifestation_relationship_types_controller_spec.rb +10 -10
- data/spec/controllers/manifestation_relationships_controller_spec.rb +9 -9
- data/spec/controllers/manifestations_controller_spec.rb +86 -12
- data/spec/controllers/medium_of_performances_controller_spec.rb +2 -2
- data/spec/controllers/owns_controller_spec.rb +7 -7
- data/spec/controllers/picture_files_controller_spec.rb +9 -9
- data/spec/controllers/produce_types_controller_spec.rb +2 -2
- data/spec/controllers/produces_controller_spec.rb +7 -7
- data/spec/controllers/realize_types_controller_spec.rb +2 -2
- data/spec/controllers/realizes_controller_spec.rb +7 -7
- data/spec/controllers/resource_export_files_controller_spec.rb +9 -15
- data/spec/controllers/resource_import_files_controller_spec.rb +7 -7
- data/spec/controllers/resource_import_results_controller_spec.rb +3 -3
- data/spec/controllers/series_statement_merge_lists_controller_spec.rb +9 -9
- data/spec/controllers/series_statement_merges_controller_spec.rb +9 -9
- data/spec/controllers/series_statements_controller_spec.rb +7 -7
- data/spec/dummy/app/assets/javascripts/application.js +0 -2
- data/spec/dummy/app/controllers/application_controller.rb +10 -6
- data/spec/dummy/app/models/user.rb +4 -4
- data/spec/dummy/config/application.rb +13 -41
- data/spec/dummy/config/environments/development.rb +22 -18
- data/spec/dummy/config/environments/production.rb +46 -34
- data/spec/dummy/config/environments/test.rb +19 -14
- data/spec/dummy/config/initializers/assets.rb +1 -1
- data/spec/dummy/config/initializers/enju_leaf.rb +8 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/db/migrate/20150924115059_create_withdraws.rb +13 -0
- data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +13 -0
- data/spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +9 -0
- data/spec/dummy/db/schema.rb +27 -2
- data/spec/factories/classification_type.rb +5 -0
- data/spec/factories/reserve.rb +12 -0
- data/spec/factories/role.rb +9 -0
- data/spec/factories/subject.rb +7 -0
- data/spec/factories/subject_heading_type.rb +5 -0
- data/spec/factories/subject_heading_type_has_subject.rb +6 -0
- data/spec/factories/subject_type.rb +5 -0
- data/spec/fixtures/checked_items.yml +4 -4
- data/spec/fixtures/checkouts.yml +12 -12
- data/spec/fixtures/classification_types.yml +1 -1
- data/spec/fixtures/classifications.yml +1 -0
- data/spec/fixtures/manifestations.yml +4 -4
- data/spec/fixtures/reserves.yml +16 -16
- data/spec/fixtures/subjects.yml +79 -0
- data/spec/models/agent_import_file_spec.rb +1 -1
- data/spec/models/manifestation_spec.rb +27 -13
- data/spec/models/resource_export_file_spec.rb +15 -2
- data/spec/models/resource_import_file_spec.rb +29 -9
- data/spec/models/series_statement_merge_list_spec.rb +1 -1
- data/spec/policies/manifestation_policy_spec.rb +24 -0
- data/spec/rails_helper.rb +82 -0
- data/spec/spec_helper.rb +81 -56
- data/spec/support/devise.rb +2 -2
- data/spec/support/vcr.rb +8 -0
- data/spec/views/agent_types/index.html.erb_spec.rb +2 -1
- data/spec/views/agent_types/show.html.erb_spec.rb +1 -0
- data/spec/views/create_types/index.html.erb_spec.rb +2 -1
- data/spec/views/creates/edit.html.erb_spec.rb +0 -3
- data/spec/views/creates/index.html.erb_spec.rb +2 -4
- data/spec/views/creates/new.html.erb_spec.rb +0 -3
- data/spec/views/creates/show.html.erb_spec.rb +0 -3
- data/spec/views/import_requests/index.html.erb_spec.rb +3 -2
- data/spec/views/manifestations/index.html.erb_spec.rb +25 -0
- data/spec/views/manifestations/index.rdf.builder_spec.rb +23 -0
- data/spec/views/manifestations/index.txt.erb_spec.rb +17 -0
- data/spec/views/manifestations/show.html.erb_spec.rb +2 -3
- data/spec/views/manifestations/show.txt.erb_spec.rb +16 -0
- data/spec/views/owns/edit.html.erb_spec.rb +0 -3
- data/spec/views/owns/index.html.erb_spec.rb +2 -4
- data/spec/views/owns/new.html.erb_spec.rb +0 -3
- data/spec/views/owns/show.html.erb_spec.rb +0 -3
- data/spec/views/produce_types/index.html.erb_spec.rb +2 -1
- data/spec/views/produces/edit.html.erb_spec.rb +0 -3
- data/spec/views/produces/index.html.erb_spec.rb +2 -4
- data/spec/views/produces/new.html.erb_spec.rb +0 -3
- data/spec/views/produces/show.html.erb_spec.rb +0 -3
- data/spec/views/realize_types/index.html.erb_spec.rb +2 -1
- data/spec/views/realizes/edit.html.erb_spec.rb +0 -3
- data/spec/views/realizes/index.html.erb_spec.rb +2 -4
- data/spec/views/realizes/new.html.erb_spec.rb +0 -3
- data/spec/views/realizes/show.html.erb_spec.rb +0 -3
- data/spec/views/resource_import_files/index.html.erb_spec.rb +0 -3
- data/spec/views/resource_import_files/{show.html.erb_spec.erb → show.html.erb_spec.rb} +0 -3
- data/spec/views/resource_import_results/index.html.erb_spec.rb +0 -3
- data/spec/views/resource_import_results/{show.html.erb_spec.erb → show.html.erb_spec.rb} +1 -4
- data/spec/views/series_statement_merge_lists/index.html.erb_spec.rb +1 -1
- data/spec/views/series_statement_merges/edit.html.erb_spec.rb +0 -3
- data/spec/views/series_statement_merges/index.html.erb_spec.rb +0 -3
- data/spec/views/series_statement_merges/new.html.erb_spec.rb +0 -3
- data/spec/views/series_statement_merges/show.html.erb_spec.rb +0 -3
- metadata +170 -131
- data/app/models/enju_biblio/ability.rb +0 -238
- data/app/workers/agent_import_file_queue.rb +0 -7
- data/app/workers/resource_export_file_queue.rb +0 -7
- data/app/workers/resource_import_file_queue.rb +0 -7
- data/spec/dummy/config/application.yml +0 -42
@@ -0,0 +1,21 @@
|
|
1
|
+
class ResourceImportResultPolicy < ApplicationPolicy
|
2
|
+
def index?
|
3
|
+
true if user.try(:has_role?, 'Librarian')
|
4
|
+
end
|
5
|
+
|
6
|
+
def show?
|
7
|
+
true if user.try(:has_role?, 'Librarian')
|
8
|
+
end
|
9
|
+
|
10
|
+
def create?
|
11
|
+
false
|
12
|
+
end
|
13
|
+
|
14
|
+
def update?
|
15
|
+
false
|
16
|
+
end
|
17
|
+
|
18
|
+
def destroy?
|
19
|
+
false
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class SeriesStatementMergeListPolicy < ApplicationPolicy
|
2
|
+
def index?
|
3
|
+
true if user.try(:has_role?, 'Librarian')
|
4
|
+
end
|
5
|
+
|
6
|
+
def show?
|
7
|
+
true if user.try(:has_role?, 'Librarian')
|
8
|
+
end
|
9
|
+
|
10
|
+
def create?
|
11
|
+
true if user.try(:has_role?, 'Librarian')
|
12
|
+
end
|
13
|
+
|
14
|
+
def edit?
|
15
|
+
true if user.try(:has_role?, 'Librarian')
|
16
|
+
end
|
17
|
+
|
18
|
+
def update?
|
19
|
+
true if user.try(:has_role?, 'Librarian')
|
20
|
+
end
|
21
|
+
|
22
|
+
def destroy?
|
23
|
+
true if user.try(:has_role?, 'Librarian')
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class SeriesStatementMergePolicy < ApplicationPolicy
|
2
|
+
def index?
|
3
|
+
true if user.try(:has_role?, 'Librarian')
|
4
|
+
end
|
5
|
+
|
6
|
+
def show?
|
7
|
+
true if user.try(:has_role?, 'Librarian')
|
8
|
+
end
|
9
|
+
|
10
|
+
def create?
|
11
|
+
true if user.try(:has_role?, 'Librarian')
|
12
|
+
end
|
13
|
+
|
14
|
+
def edit?
|
15
|
+
true if user.try(:has_role?, 'Librarian')
|
16
|
+
end
|
17
|
+
|
18
|
+
def update?
|
19
|
+
true if user.try(:has_role?, 'Librarian')
|
20
|
+
end
|
21
|
+
|
22
|
+
def destroy?
|
23
|
+
true if user.try(:has_role?, 'Librarian')
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class SeriesStatementPolicy < ApplicationPolicy
|
2
|
+
def index?
|
3
|
+
true
|
4
|
+
end
|
5
|
+
|
6
|
+
def show?
|
7
|
+
true
|
8
|
+
end
|
9
|
+
|
10
|
+
def create?
|
11
|
+
true if user.try(:has_role?, 'Librarian')
|
12
|
+
end
|
13
|
+
|
14
|
+
def edit?
|
15
|
+
true if user.try(:has_role?, 'Librarian')
|
16
|
+
end
|
17
|
+
|
18
|
+
def update?
|
19
|
+
true if user.try(:has_role?, 'Librarian')
|
20
|
+
end
|
21
|
+
|
22
|
+
def destroy?
|
23
|
+
true if user.try(:has_role?, 'Librarian')
|
24
|
+
end
|
25
|
+
end
|
@@ -18,7 +18,7 @@
|
|
18
18
|
<%- @agent_relationship_types.each do |agent_relationship_type| -%>
|
19
19
|
<tr class="line<%= cycle("0", "1") -%>">
|
20
20
|
<td>
|
21
|
-
<%- if
|
21
|
+
<%- if policy(agent).update?_relationship_type -%>
|
22
22
|
<%= move_position(agent_relationship_type) -%>
|
23
23
|
<%- end -%>
|
24
24
|
</td>
|
@@ -29,10 +29,10 @@
|
|
29
29
|
<%= agent_relationship_type.note %>
|
30
30
|
</td>
|
31
31
|
<td>
|
32
|
-
<%- if
|
32
|
+
<%- if policy(agent).update?_relationship_type -%>
|
33
33
|
<%= link_to t('page.edit'), edit_agent_relationship_type_path(agent_relationship_type) -%>
|
34
34
|
<% end %>
|
35
|
-
<%- if
|
35
|
+
<%- if policy(agent).destroy?_relationship_type -%>
|
36
36
|
<%= link_to t('page.destroy'), agent_relationship_type_path(agent_relationship_type), data: {confirm: t('page.are_you_sure')}, method: :delete -%>
|
37
37
|
<%- end -%>
|
38
38
|
</td>
|
@@ -45,7 +45,7 @@
|
|
45
45
|
|
46
46
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
47
47
|
<ul>
|
48
|
-
<%- if
|
48
|
+
<%- if policy(AgentRelationshipType).create? -%>
|
49
49
|
<li><%= link_to t('page.new', model: t('activerecord.models.agent_relationship_type')), new_agent_relationship_type_path -%></li>
|
50
50
|
<%- end -%>
|
51
51
|
</ul>
|
@@ -18,7 +18,7 @@
|
|
18
18
|
<%- @agent_types.each do |agent_type| -%>
|
19
19
|
<tr class="line<%= cycle("0", "1") -%>">
|
20
20
|
<td>
|
21
|
-
<%- if
|
21
|
+
<%- if policy(agent_type).update? -%>
|
22
22
|
<%= move_position(agent_type) -%>
|
23
23
|
<%- end -%>
|
24
24
|
</td>
|
@@ -29,10 +29,10 @@
|
|
29
29
|
<%= agent_type.note %>
|
30
30
|
</td>
|
31
31
|
<td>
|
32
|
-
<%- if
|
32
|
+
<%- if policy(agent_type).update? -%>
|
33
33
|
<%= link_to t('page.edit'), edit_agent_type_path(agent_type) -%>
|
34
34
|
<% end %>
|
35
|
-
<%- if
|
35
|
+
<%- if policy(agent_type).destroy? -%>
|
36
36
|
<%= link_to t('page.destroy'), agent_type_path(agent_type), data: {confirm: t('page.are_you_sure')}, method: :delete -%>
|
37
37
|
<%- end -%>
|
38
38
|
</td>
|
@@ -45,7 +45,7 @@
|
|
45
45
|
|
46
46
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
47
47
|
<ul>
|
48
|
-
<%- if
|
48
|
+
<%- if policy(AgentType).create? -%>
|
49
49
|
<li><%= link_to t('page.new', model: t('activerecord.models.agent_type')), new_agent_type_path -%></li>
|
50
50
|
<%- end -%>
|
51
51
|
</ul>
|
@@ -23,7 +23,7 @@
|
|
23
23
|
|
24
24
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
25
25
|
<ul>
|
26
|
-
<%- if
|
26
|
+
<%- if policy(@agent_type).update? -%>
|
27
27
|
<li><%= link_to t('page.edit'), edit_agent_type_path(@agent_type) -%></li>
|
28
28
|
<%- end -%>
|
29
29
|
<li><%= back_to_index(flash[:page_info]) -%></li>
|
@@ -5,9 +5,9 @@
|
|
5
5
|
</td>
|
6
6
|
<td><%= agent.agent_type.display_name.localize -%></td>
|
7
7
|
<td>
|
8
|
-
<%- if
|
8
|
+
<%- if policy(agent).destroy? -%>
|
9
9
|
<%= link_to t('page.edit'), edit_agent_path(agent) -%>
|
10
|
-
<%= link_to t('agent.add_derivation'),
|
10
|
+
<%= link_to t('agent.add_derivation'), agents_path(agent_id: agent.id, mode: 'add') -%>
|
11
11
|
<%- end -%>
|
12
12
|
</td>
|
13
13
|
</tr>
|
@@ -26,7 +26,7 @@
|
|
26
26
|
|
27
27
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
28
28
|
<ul>
|
29
|
-
<%- if
|
29
|
+
<%- if policy(Agent).create? -%>
|
30
30
|
<li><%= link_to t('agent.add'), new_agent_path -%></li>
|
31
31
|
<li><%= link_to t('page.merge', model: t('activerecord.models.agent')), agent_merge_lists_path -%></li>
|
32
32
|
<%- end -%>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<%= form_for :agents, url: agents_path(agent_id: agent.id), html: {method: 'get'} do -%>
|
11
11
|
<p>
|
12
12
|
<%= label_tag :search_form_top, t('page.search_term') -%>: <%= search_field_tag 'query', h(@query), {id: 'search_form_top', class: 'search_form', placeholder: t('page.search_term')} -%>
|
13
|
-
<%- if
|
13
|
+
<%- if policy(agent).update? -%>
|
14
14
|
<%= render 'page/add' %>
|
15
15
|
<%- end -%>
|
16
16
|
<%= submit_tag t('page.search') -%>
|
@@ -35,12 +35,12 @@
|
|
35
35
|
<td><%= agent.agent_type.display_name.localize -%></td>
|
36
36
|
<td><%=l agent.date_of_birth if agent.date_of_birth -%></td>
|
37
37
|
<td>
|
38
|
-
<%- if
|
38
|
+
<%- if policy(agent).destroy? -%>
|
39
39
|
<%= link_to t('page.edit'), edit_agent_path(agent) -%>
|
40
40
|
<% end %>
|
41
41
|
</td>
|
42
42
|
<td>
|
43
|
-
<%- if
|
43
|
+
<%- if policy(agent).destroy? -%>
|
44
44
|
<%- if params[:mode] == "add" -%>
|
45
45
|
<%= link_to t('page.add'), new_agent_relationship_path(agent_id: agent.id, child_id: agent.id) unless agent.derived_agents.include?(agent) or agent == agent -%>
|
46
46
|
<%- else -%>
|
@@ -59,7 +59,7 @@
|
|
59
59
|
|
60
60
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
61
61
|
<ul>
|
62
|
-
<%- if
|
62
|
+
<%- if policy(Agent).create? -%>
|
63
63
|
<li><%= link_to t('agent.add'), new_agent_path -%></li>
|
64
64
|
<li><%= link_to t('page.merge', model: t('activerecord.models.agent')), agent_merge_lists_path -%></li>
|
65
65
|
<%- end -%>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<%= form_for :agents, url: agent_merge_list_agents_path(@agent_merge_list), html: {method: 'get'} do -%>
|
7
7
|
<p>
|
8
8
|
<%= label_tag :search_form_top, t('page.search_term') -%>: <%= search_field_tag 'query', h(@query), {id: 'search_form_top', class: 'search_form', placeholder: t('page.search_term')} -%>
|
9
|
-
<%- if
|
9
|
+
<%- if policy(@agent_merge_list).update? -%>
|
10
10
|
<%= render 'page/add' %>
|
11
11
|
<%- end -%>
|
12
12
|
<%= submit_tag t('page.search') -%>
|
@@ -29,7 +29,7 @@
|
|
29
29
|
<td><%= agent.agent_type.display_name.localize -%></td>
|
30
30
|
<td><%=l agent.date_of_birth if agent.date_of_birth -%></td>
|
31
31
|
<td>
|
32
|
-
<%- if
|
32
|
+
<%- if policy(agent).destroy? -%>
|
33
33
|
<%- if params[:mode] == 'add' -%>
|
34
34
|
<%= link_to t('page.add'), new_agent_merge_list_agent_merge_path(@agent_merge_list, agent_id: agent.id) unless @agent_merge_list.agents.include?(agent) -%>
|
35
35
|
<%- else -%>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<%= form_for :agents, url: expression_agents_path(expression), html: {method: 'get'} do -%>
|
12
12
|
<p>
|
13
13
|
<%= label_tag :search_form_top, t('page.search_term') -%>: <%= search_field_tag 'query', h(@query), {id: 'search_form_top', class: 'search_form', placeholder: t('page.search_term')} -%>
|
14
|
-
<%- if
|
14
|
+
<%- if policy(expression).update? -%>
|
15
15
|
<%= render 'page/add' %>
|
16
16
|
<%- end -%>
|
17
17
|
<%= submit_tag t('page.search') -%>
|
@@ -33,7 +33,7 @@
|
|
33
33
|
<td><%= expression.realized(agent).realize_type.display_name.localize if params[:mode] != 'add' and expression.realized(agent).try(:realize_type) -%></td>
|
34
34
|
<td><%= agent.agent_type.display_name.localize -%></td>
|
35
35
|
<td>
|
36
|
-
<%- if
|
36
|
+
<%- if policy(agent).destroy? -%>
|
37
37
|
<%- if params[:mode] == 'add' -%>
|
38
38
|
<%= link_to t('page.add'), new_expression_realize_path(expression, agent_id: agent.id) unless expression.contributors.include?(agent) -%>
|
39
39
|
<%- else -%>
|
@@ -51,7 +51,7 @@
|
|
51
51
|
|
52
52
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
53
53
|
<ul>
|
54
|
-
<%- if
|
54
|
+
<%- if policy(Agent).create? -%>
|
55
55
|
<li><%= link_to t('page.new', model: t('activerecord.models.agent')), new_expression_agent_path(expression) -%></li>
|
56
56
|
<li><%= link_to t('page.rearrange_order'), expression_realizes_path(expression) %></li>
|
57
57
|
<%- end -%>
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<%= form_for :agents, url: agents_path(manifestation_id: manifestation.id), html: {method: 'get'} do -%>
|
8
8
|
<p>
|
9
9
|
<%= label_tag :search_form_top, t('page.search_term') -%>: <%= search_field_tag 'query', h(@query), {id: 'search_form_top', class: 'search_form', placeholder: t('page.search_term')} -%>
|
10
|
-
<%- if
|
10
|
+
<%- if policy(manifestation).update? -%>
|
11
11
|
<%= render 'page/add' %>
|
12
12
|
<%- end -%>
|
13
13
|
<%= submit_tag t('page.search') -%>
|
@@ -29,7 +29,7 @@
|
|
29
29
|
<td><%= manifestation.produced(agent).produce_type.display_name.localize if params[:mode] != 'add' and manifestation.produced(agent).try(:produce_type) -%></td>
|
30
30
|
<td><%= agent.agent_type.display_name.localize -%></td>
|
31
31
|
<td>
|
32
|
-
<%- if
|
32
|
+
<%- if policy(agent).destroy? -%>
|
33
33
|
<%- if params[:mode] == 'add' -%>
|
34
34
|
<%= link_to t('page.add'), new_produce_path(manifestation_id: manifestation.id, agent_id: agent.id) unless manifestation.publishers.include?(agent) -%>
|
35
35
|
<%- else -%>
|
@@ -51,7 +51,7 @@
|
|
51
51
|
<ul>
|
52
52
|
<li><%= link_to t('activerecord.models.manifestation'), manifestations_path -%></li>
|
53
53
|
<li><%= link_to t('page.listing', model: t('activerecord.models.item')), items_path(manifestation_id: manifestation.id) -%></li>
|
54
|
-
<%- if
|
54
|
+
<%- if policy(Agent).create? -%>
|
55
55
|
<li><%= link_to t('page.new', model: t('activerecord.models.agent')), new_agent_path(manifestation_id: manifestation.id) -%></li>
|
56
56
|
<li><%= link_to t('page.rearrange_order'), produces_path(manifestation_id: manifestation.id) %></li>
|
57
57
|
<%- end -%>
|
@@ -14,7 +14,7 @@
|
|
14
14
|
<%= form_for :agents, url: work_agents_path(work), html: {method: 'get'} do -%>
|
15
15
|
<p>
|
16
16
|
<%= label_tag :search_form_top, t('page.search_term') -%>: <%= search_field_tag 'query', h(@query), {id: 'search_form_top', class: 'search_form', placeholder: t('page.search_term')} -%>
|
17
|
-
<%- if
|
17
|
+
<%- if policy(work).update? -%>
|
18
18
|
<%= render 'page/add' %>
|
19
19
|
<% end %>
|
20
20
|
<%= submit_tag t('page.search') -%>
|
@@ -37,7 +37,7 @@
|
|
37
37
|
<td><%= work.created(agent).create_type.display_name.localize if params[:mode] != 'add' and work.created(agent).try(:create_type) -%></td>
|
38
38
|
<td><%= agent.agent_type.display_name.localize -%></td>
|
39
39
|
<td>
|
40
|
-
<%- if
|
40
|
+
<%- if policy(agent).destroy? -%>
|
41
41
|
<%- if params[:mode] == 'add' -%>
|
42
42
|
<%= link_to t('page.add'), new_work_create_path(work, agent_id: agent.id) unless work.creators.include?(agent) -%>
|
43
43
|
<%- else -%>
|
@@ -58,7 +58,7 @@
|
|
58
58
|
|
59
59
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
60
60
|
<ul>
|
61
|
-
<%- if
|
61
|
+
<%- if policy(Agent).create? -%>
|
62
62
|
<li><%= link_to t('page.new', model: t('activerecord.models.agent')), new_work_agent_path(work) -%></li>
|
63
63
|
<li><%= link_to t('page.rearrange_order'), work_creates_path(work) %></li>
|
64
64
|
<%- end -%>
|
@@ -8,7 +8,7 @@
|
|
8
8
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
9
9
|
<ul>
|
10
10
|
<li><%= link_to t('page.show'), @agent -%></li>
|
11
|
-
<%- if
|
11
|
+
<%- if policy(@agent).destroy? -%>
|
12
12
|
<li><%= link_to t('page.destroy'), @agent, data: {confirm: t('page.are_you_sure')}, method: :delete -%></li>
|
13
13
|
<%- end -%>
|
14
14
|
<li><%= link_to t('page.back'), agents_path -%></li>
|
File without changes
|
@@ -4,11 +4,11 @@ xml.rss('version' => "2.0",
|
|
4
4
|
'xmlns:atom' => "http://www.w3.org/2005/Atom"){
|
5
5
|
xml.channel{
|
6
6
|
xml.title t('agent.library_group_agent', library_group_name: @library_group.display_name.localize)
|
7
|
-
xml.link "#{request.protocol}#{request.host_with_port}#{url_for(params.merge(format: nil, only_path: true))}"
|
7
|
+
xml.link "#{request.protocol}#{request.host_with_port}#{url_for(params.permit.merge(format: nil, only_path: true))}"
|
8
8
|
xml.description "Next-L Enju, an open source integrated library system developed by Project Next-L"
|
9
9
|
xml.language @locale.to_s
|
10
10
|
xml.ttl "60"
|
11
|
-
xml.tag! "atom:link", rel: 'self', href: "#{request.protocol}#{request.host_with_port}#{url_for(params.merge(format: :rss, only_path: true))}"
|
11
|
+
xml.tag! "atom:link", rel: 'self', href: "#{request.protocol}#{request.host_with_port}#{url_for(params.permit.merge(format: :rss, only_path: true))}"
|
12
12
|
xml.tag! "atom:link", rel: 'alternate', href: agents_url
|
13
13
|
xml.tag! "atom:link", rel: 'search', type: 'application/opensearchdescription+xml', href: page_opensearch_url
|
14
14
|
unless params[:query].blank?
|
File without changes
|
@@ -91,17 +91,17 @@
|
|
91
91
|
})
|
92
92
|
</script>
|
93
93
|
<% end %>
|
94
|
-
<%- if
|
94
|
+
<%- if policy(PictureFile).create? -%>
|
95
95
|
<li><%= link_to t('page.new', model: t('activerecord.models.picture_file')), new_picture_file_path(agent_id: @agent.id) -%></li>
|
96
96
|
<%- end -%>
|
97
97
|
</ul>
|
98
98
|
<ul>
|
99
99
|
<li><%= back_to_index(flash[:page_info]) -%></li>
|
100
|
-
<%- if
|
100
|
+
<%- if policy(Agent).create? -%>
|
101
101
|
<li><%= link_to t('page.edit'), edit_agent_path(@agent) -%></li>
|
102
102
|
<li><%= link_to t('agent.add_derivation'), agents_path(agent_id: @agent.id, mode: 'add') -%></li>
|
103
103
|
<%- end -%>
|
104
|
-
<%- if
|
104
|
+
<%- if policy(@agent).destroy? -%>
|
105
105
|
<li><%= link_to t('page.new', model: t('activerecord.models.agent')), new_agent_path -%></li>
|
106
106
|
<li><%= link_to t('page.destroy'), @agent, data: {confirm: t('page.are_you_sure')}, method: :delete -%></li>
|
107
107
|
<%- end -%>
|
@@ -18,7 +18,7 @@
|
|
18
18
|
<%- @carrier_types.each do |carrier_type| -%>
|
19
19
|
<tr class="line<%= cycle("0", "1") -%>">
|
20
20
|
<td>
|
21
|
-
<%- if
|
21
|
+
<%- if policy(carrier_type).update? -%>
|
22
22
|
<%= move_position(carrier_type) -%>
|
23
23
|
<%- end -%>
|
24
24
|
</td>
|
@@ -29,10 +29,10 @@
|
|
29
29
|
<%= carrier_type.note %>
|
30
30
|
</td>
|
31
31
|
<td>
|
32
|
-
<%- if
|
32
|
+
<%- if policy(carrier_type).update? -%>
|
33
33
|
<%= link_to t('page.edit'), edit_carrier_type_path(carrier_type) -%>
|
34
34
|
<% end %>
|
35
|
-
<%- if
|
35
|
+
<%- if policy(carrier_type).destroy? -%>
|
36
36
|
<%= link_to t('page.destroy'), carrier_type_path(carrier_type), data: {confirm: t('page.are_you_sure')}, method: :delete -%>
|
37
37
|
<%- end -%>
|
38
38
|
</td>
|
@@ -45,7 +45,7 @@
|
|
45
45
|
|
46
46
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
47
47
|
<ul>
|
48
|
-
<%- if
|
48
|
+
<%- if policy(CarrierType).create? -%>
|
49
49
|
<li><%= link_to t('page.new', model: t('activerecord.models.carrier_type')), new_carrier_type_path -%></li>
|
50
50
|
<%- end -%>
|
51
51
|
</ul>
|
@@ -34,7 +34,7 @@
|
|
34
34
|
|
35
35
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
36
36
|
<ul>
|
37
|
-
<%- if
|
37
|
+
<%- if policy(@carrier_type).update? -%>
|
38
38
|
<li><%= link_to t('page.edit'), edit_carrier_type_path(@carrier_type) -%></li>
|
39
39
|
<%- end -%>
|
40
40
|
<li><%= back_to_index(flash[:page_info]) -%></li>
|
@@ -18,7 +18,7 @@
|
|
18
18
|
<%- @content_types.each do |content_type| -%>
|
19
19
|
<tr class="line<%= cycle("0", "1") -%>">
|
20
20
|
<td>
|
21
|
-
<%- if
|
21
|
+
<%- if policy(content_type).update? -%>
|
22
22
|
<%= move_position(content_type) -%>
|
23
23
|
<%- end -%>
|
24
24
|
</td>
|
@@ -29,10 +29,10 @@
|
|
29
29
|
<%= content_type.note %>
|
30
30
|
</td>
|
31
31
|
<td>
|
32
|
-
<%- if
|
32
|
+
<%- if policy(content_type).update? -%>
|
33
33
|
<%= link_to t('page.edit'), edit_content_type_path(content_type) -%>
|
34
34
|
<% end %>
|
35
|
-
<%- if
|
35
|
+
<%- if policy(content_type).destroy? -%>
|
36
36
|
<%= link_to t('page.destroy'), content_type_path(content_type), data: {confirm: t('page.are_you_sure')}, method: :delete -%>
|
37
37
|
<%- end -%>
|
38
38
|
</td>
|
@@ -45,7 +45,7 @@
|
|
45
45
|
|
46
46
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
47
47
|
<ul>
|
48
|
-
<%- if
|
48
|
+
<%- if policy(ContentType).create? -%>
|
49
49
|
<li><%= link_to t('page.new', model: t('activerecord.models.content_type')), new_content_type_path -%></li>
|
50
50
|
<%- end -%>
|
51
51
|
</ul>
|
@@ -23,7 +23,7 @@
|
|
23
23
|
|
24
24
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
25
25
|
<ul>
|
26
|
-
<%- if
|
26
|
+
<%- if policy(@content_type).update? -%>
|
27
27
|
<li><%= link_to t('page.edit'), edit_content_type_path(@content_type) -%></li>
|
28
28
|
<%- end -%>
|
29
29
|
<li><%= back_to_index(flash[:page_info]) -%></li>
|
@@ -14,7 +14,7 @@
|
|
14
14
|
<%- @countries.each do |country| -%>
|
15
15
|
<tr class="line<%= cycle("0", "1") -%>">
|
16
16
|
<td>
|
17
|
-
<%- if
|
17
|
+
<%- if policy(country).update? -%>
|
18
18
|
<%= move_position(country) -%>
|
19
19
|
<%- end -%>
|
20
20
|
</td>
|
@@ -26,7 +26,7 @@
|
|
26
26
|
numeric: <%= country.numeric_3 -%>
|
27
27
|
</td>
|
28
28
|
<td>
|
29
|
-
<%- if
|
29
|
+
<%- if policy(country).update? -%>
|
30
30
|
<%= link_to t('page.edit'), edit_country_path(country) -%>
|
31
31
|
<%- end -%>
|
32
32
|
</td>
|
@@ -40,7 +40,7 @@
|
|
40
40
|
|
41
41
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
42
42
|
<ul>
|
43
|
-
<%- if
|
43
|
+
<%- if policy(Country).create? -%>
|
44
44
|
<li><%= link_to t('page.new', model: t('activerecord.models.country')), new_country_path -%></li>
|
45
45
|
<%- end -%>
|
46
46
|
</ul>
|
@@ -23,7 +23,7 @@
|
|
23
23
|
|
24
24
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
25
25
|
<ul>
|
26
|
-
<%- if
|
26
|
+
<%- if policy(@country).update? %>
|
27
27
|
<li><%= link_to t('page.edit'), edit_country_path(@country) %></li>
|
28
28
|
<%- end -%>
|
29
29
|
<li><%= back_to_index(flash[:page_info]) -%></li>
|
@@ -18,7 +18,7 @@
|
|
18
18
|
<%- @create_types.each do |create_type| -%>
|
19
19
|
<tr class="line<%= cycle("0", "1") -%>">
|
20
20
|
<td>
|
21
|
-
<%- if
|
21
|
+
<%- if policy(create_type).update? -%>
|
22
22
|
<%= move_position(create_type) -%>
|
23
23
|
<%- end -%>
|
24
24
|
</td>
|
@@ -29,10 +29,10 @@
|
|
29
29
|
<%= create_type.note %>
|
30
30
|
</td>
|
31
31
|
<td>
|
32
|
-
<%- if
|
32
|
+
<%- if policy(create_type).update? -%>
|
33
33
|
<%= link_to t('page.edit'), edit_create_type_path(create_type) -%>
|
34
34
|
<% end %>
|
35
|
-
<%- if
|
35
|
+
<%- if policy(create_type).destroy? -%>
|
36
36
|
<%= link_to t('page.destroy'), create_type_path(create_type), data: {confirm: t('page.are_you_sure')}, method: :delete -%>
|
37
37
|
<%- end -%>
|
38
38
|
</td>
|
@@ -45,7 +45,7 @@
|
|
45
45
|
|
46
46
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
47
47
|
<ul>
|
48
|
-
<%- if
|
48
|
+
<%- if policy(CreateType).create? -%>
|
49
49
|
<li><%= link_to t('page.new', model: t('activerecord.models.create_type')), new_create_type_path -%></li>
|
50
50
|
<%- end -%>
|
51
51
|
</ul>
|
@@ -14,7 +14,7 @@
|
|
14
14
|
<td><%= link_to create.agent.full_name, create.agent -%></td>
|
15
15
|
<td><%= link_to create.work.original_title, create.work -%></td>
|
16
16
|
<td>
|
17
|
-
<%- if
|
17
|
+
<%- if policy(create).destroy? -%>
|
18
18
|
<%= link_to t('page.show'), create -%>
|
19
19
|
<%= link_to t('page.destroy'), create, data: {confirm: t('page.are_you_sure')}, method: :delete -%>
|
20
20
|
<%- end -%>
|
@@ -28,7 +28,7 @@
|
|
28
28
|
</div>
|
29
29
|
|
30
30
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
31
|
-
<%- if
|
31
|
+
<%- if policy(Create).create? -%>
|
32
32
|
<ul>
|
33
33
|
<li><%= link_to t('page.new', model: t('activerecord.models.create')), new_create_path -%></li>
|
34
34
|
</ul>
|
@@ -17,7 +17,7 @@
|
|
17
17
|
<%- @creates.each do |create| -%>
|
18
18
|
<tr class="line<%= cycle("0", "1") -%>">
|
19
19
|
<td>
|
20
|
-
<%- if
|
20
|
+
<%- if policy(create).destroy? -%>
|
21
21
|
<%= create.first? ? image_tag('icons/stop.png', size: '16x16') : link_to(image_tag('icons/arrow_up.png', size: '16x16', alt: t('page.asc')), {action: 'update', move: 'higher', id: create.id, agent_id: agent.id}, method: :put) -%>
|
22
22
|
<%= create.last? ? image_tag('icons/stop.png', size: '16x16') : link_to(image_tag('icons/arrow_down.png', size: '16x16', alt: t('page.desc')), {action: 'update', move: 'lower', id: create.id, agent_id: agent.id}, method: :put) -%>
|
23
23
|
<%- end -%>
|
@@ -26,7 +26,7 @@
|
|
26
26
|
<td><%= l(create.created_at) -%></td>
|
27
27
|
<td><%= l(create.updated_at) -%></td>
|
28
28
|
<td>
|
29
|
-
<%- if
|
29
|
+
<%- if policy(create).destroy? -%>
|
30
30
|
<%= link_to t('page.destroy'), create_path(create, agent_id: agent.id), data: {confirm: t('page.are_you_sure')}, method: :delete -%>
|
31
31
|
<%- end -%>
|
32
32
|
</td>
|
@@ -40,7 +40,7 @@
|
|
40
40
|
|
41
41
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
42
42
|
<ul>
|
43
|
-
<%- if
|
43
|
+
<%- if policy(Create).create? -%>
|
44
44
|
<li><%= link_to t('page.new', model: t('activerecord.models.create')), new_create_path(agent_id: agent.id) -%></li>
|
45
45
|
<%- end -%>
|
46
46
|
</ul>
|
@@ -16,7 +16,7 @@
|
|
16
16
|
<%- @creates.each do |create| -%>
|
17
17
|
<tr class="line<%= cycle("0", "1") -%>">
|
18
18
|
<td>
|
19
|
-
<%- if
|
19
|
+
<%- if policy(create).destroy? -%>
|
20
20
|
<%= create.first? ? image_tag('icons/stop.png') : link_to(image_tag('icons/arrow_up.png', size: '16x16', alt: t('page.asc')), work_create_path(create.work, create, move: 'higher'), method: :put) -%>
|
21
21
|
<%= create.last? ? image_tag('icons/stop.png') : link_to(image_tag('icons/arrow_down.png', size: '16x16', alt: t('page.desc')), work_create_path(create.work, create, move: 'lower'), method: :put) -%>
|
22
22
|
<%- end-%>
|
@@ -34,7 +34,7 @@
|
|
34
34
|
|
35
35
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
36
36
|
<ul>
|
37
|
-
<%- if
|
37
|
+
<%- if policy(Create).create? -%>
|
38
38
|
<li><%= link_to t('page.new', model: t('activerecord.models.create')), new_work_create_path(work) -%></li>
|
39
39
|
<%- end -%>
|
40
40
|
</ul>
|
@@ -22,7 +22,7 @@
|
|
22
22
|
</td>
|
23
23
|
<td><%= link_to t('page.show'), donate -%></td>
|
24
24
|
<td>
|
25
|
-
<%- if
|
25
|
+
<%- if policy(donate).destroy? -%>
|
26
26
|
<%= link_to t('page.edit'), edit_donate_path(donate) -%>
|
27
27
|
<%= link_to t('page.destroy'), donate, data: {confirm: t('page.are_you_sure')}, method: :delete -%>
|
28
28
|
<%- end -%>
|
@@ -38,7 +38,7 @@
|
|
38
38
|
|
39
39
|
<div id="submenu" class="ui-corner-all ui-widget-content">
|
40
40
|
<ul>
|
41
|
-
<%- if
|
41
|
+
<%- if policy(Donate).create? -%>
|
42
42
|
<li><%= link_to t('page.new', model: t('activerecord.models.donate')), new_donate_path -%></li>
|
43
43
|
<%- end -%>
|
44
44
|
</ul>
|