worthwhile 0.0.1.alpha → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -1
- data/.rspec +1 -0
- data/.travis.yml +19 -0
- data/Gemfile +7 -11
- data/README.md +8 -12
- data/Rakefile +17 -2
- data/app/actors/concerns/worthwhile/manages_embargoes_actor.rb +79 -0
- data/app/actors/curation_concern/base_actor.rb +68 -0
- data/app/actors/curation_concern/generic_file_actor.rb +40 -0
- data/app/actors/curation_concern/generic_work_actor.rb +92 -0
- data/app/actors/curation_concern/linked_resource_actor.rb +4 -0
- data/app/assets/images/default.png +0 -0
- data/app/assets/images/nope.png +0 -0
- data/app/assets/javascripts/.gitkeep +0 -0
- data/app/assets/javascripts/modernizr.js +3 -0
- data/app/assets/javascripts/worthwhile/.gitkeep +0 -0
- data/app/assets/javascripts/worthwhile/accept_contributor_agreement.js +15 -0
- data/app/assets/javascripts/worthwhile/application.js +18 -0
- data/app/assets/javascripts/worthwhile/browse_everything_implement.js +7 -0
- data/app/assets/javascripts/worthwhile/embargoes.js +17 -0
- data/app/assets/javascripts/worthwhile/facet_mine.js +22 -0
- data/app/assets/javascripts/worthwhile/help_modal.js +36 -0
- data/app/assets/javascripts/worthwhile/link_groups.js.coffee +123 -0
- data/app/assets/javascripts/worthwhile/link_users.js.coffee +126 -0
- data/app/assets/javascripts/worthwhile/manage_repeating_fields.js +74 -0
- data/app/assets/javascripts/worthwhile/proxy_rights.js.coffee +95 -0
- data/app/assets/javascripts/worthwhile/proxy_submission.js +23 -0
- data/app/assets/javascripts/worthwhile/select_works.js.coffee +20 -0
- data/app/assets/javascripts/worthwhile/worthwhile.js +45 -0
- data/app/assets/stylesheets/worthwhile.css.scss +23 -0
- data/app/assets/stylesheets/worthwhile/_global-variables.css.scss +5 -0
- data/app/assets/stylesheets/worthwhile/_modules.css.scss +14 -0
- data/app/assets/stylesheets/worthwhile/_positioning.css.scss +138 -0
- data/app/assets/stylesheets/worthwhile/_theme.css.scss +46 -0
- data/app/assets/stylesheets/worthwhile/_typography.css.scss +142 -0
- data/app/assets/stylesheets/worthwhile/_variables_bootstrap.css.scss +7 -0
- data/app/assets/stylesheets/worthwhile/_worthwhile.css.scss +7 -0
- data/app/assets/stylesheets/worthwhile/downloads.css.scss +3 -0
- data/app/assets/stylesheets/worthwhile/help_requests.css.scss +3 -0
- data/app/assets/stylesheets/worthwhile/modules/accessibility.css.scss +50 -0
- data/app/assets/stylesheets/worthwhile/modules/accordion.css.scss +33 -0
- data/app/assets/stylesheets/worthwhile/modules/attributes.css.scss +26 -0
- data/app/assets/stylesheets/worthwhile/modules/classify_work.css.scss +100 -0
- data/app/assets/stylesheets/worthwhile/modules/collections.css.scss +42 -0
- data/app/assets/stylesheets/worthwhile/modules/embargoes.css.scss +15 -0
- data/app/assets/stylesheets/worthwhile/modules/emphatic_action_area.css.scss +14 -0
- data/app/assets/stylesheets/worthwhile/modules/forms.css.scss +116 -0
- data/app/assets/stylesheets/worthwhile/modules/multi_value_fields.css.scss +52 -0
- data/app/assets/stylesheets/worthwhile/modules/pagination.css.scss +4 -0
- data/app/assets/stylesheets/worthwhile/modules/search_results.css.scss +55 -0
- data/app/assets/stylesheets/worthwhile/modules/site_actions.css.scss +53 -0
- data/app/assets/stylesheets/worthwhile/modules/site_search.css.scss +46 -0
- data/app/controllers/catalog_controller.rb +3 -0
- data/app/controllers/collections_controller.rb +59 -0
- data/app/controllers/concerns/worthwhile/application_controller_behavior.rb +23 -0
- data/app/controllers/concerns/worthwhile/catalog_controller.rb +347 -0
- data/app/controllers/concerns/worthwhile/curation_concern_controller.rb +131 -0
- data/app/controllers/concerns/worthwhile/files_controller.rb +149 -0
- data/app/controllers/concerns/worthwhile/manages_embargoes.rb +22 -0
- data/app/controllers/concerns/worthwhile/parent_container.rb +31 -0
- data/app/controllers/concerns/worthwhile/themed_layout_controller.rb +31 -0
- data/app/controllers/concerns/worthwhile/without_namespace.rb +15 -0
- data/app/controllers/curation_concern/generic_files_controller.rb +6 -0
- data/app/controllers/curation_concern/generic_works_controller.rb +6 -0
- data/app/controllers/curation_concern/linked_resources_controller.rb +68 -0
- data/app/controllers/curation_concern/permissions_controller.rb +19 -0
- data/app/controllers/downloads_controller.rb +4 -0
- data/app/controllers/embargoes_controller.rb +44 -0
- data/app/controllers/leases_controller.rb +34 -0
- data/app/controllers/registrations_controller.rb +20 -0
- data/app/controllers/sessions_controller.rb +4 -0
- data/app/controllers/worthwhile/application_controller.rb +7 -0
- data/app/controllers/worthwhile/classify_concerns_controller.rb +35 -0
- data/app/datastreams/generic_work_metadata.rb +3 -0
- data/app/datastreams/worthwhile/generic_work_rdf_properties.rb +57 -0
- data/app/datastreams/worthwhile/properties_datastream.rb +28 -0
- data/app/helpers/curate/collections_helper.rb +133 -0
- data/app/helpers/worthwhile/ability_helper.rb +46 -0
- data/app/helpers/worthwhile/attribute_helper.rb +67 -0
- data/app/helpers/worthwhile/catalog_helper.rb +38 -0
- data/app/helpers/worthwhile/collections_helper.rb +19 -0
- data/app/helpers/worthwhile/embargo_helper.rb +17 -0
- data/app/helpers/worthwhile/generic_file_helper.rb +19 -0
- data/app/helpers/worthwhile/lease_helper.rb +18 -0
- data/app/helpers/worthwhile/main_app_helpers.rb +14 -0
- data/app/helpers/worthwhile/render_constraints_helper.rb +42 -0
- data/app/helpers/worthwhile/search_paths_helper.rb +13 -0
- data/app/helpers/worthwhile/thumbnail_helper.rb +11 -0
- data/app/helpers/worthwhile/title_helper.rb +23 -0
- data/app/helpers/worthwhile/url_helper.rb +16 -0
- data/app/inputs/multi_value_input.rb +72 -0
- data/app/models/collection.rb +15 -0
- data/app/models/concerns/curation_concern/collection_model.rb +62 -0
- data/app/models/concerns/curation_concern/curatable.rb +77 -0
- data/app/models/concerns/curation_concern/has_representative.rb +14 -0
- data/app/models/concerns/curation_concern/human_readable_type.rb +23 -0
- data/app/models/concerns/curation_concern/with_basic_metadata.rb +49 -0
- data/app/models/concerns/curation_concern/with_editors.rb +44 -0
- data/app/models/concerns/curation_concern/with_generic_files.rb +23 -0
- data/app/models/concerns/curation_concern/with_linked_resources.rb +21 -0
- data/app/models/concerns/curation_concern/work.rb +24 -0
- data/app/models/concerns/worthwhile/ability.rb +34 -0
- data/app/models/concerns/worthwhile/generic_file/versioned_content.rb +18 -0
- data/app/models/concerns/worthwhile/generic_file_base.rb +64 -0
- data/app/models/concerns/worthwhile/solr_document_behavior.rb +140 -0
- data/app/models/generic_work.rb +5 -0
- data/app/models/worthwhile/classify_concern.rb +47 -0
- data/app/models/worthwhile/content_version.rb +23 -0
- data/app/models/worthwhile/contributor_agreement.rb +23 -0
- data/app/models/worthwhile/generic_file.rb +5 -0
- data/app/models/worthwhile/linked_resource.rb +41 -0
- data/app/models/worthwhile/quick_classification_query.rb +31 -0
- data/app/services/worthwhile/curation_concern.rb +21 -0
- data/app/services/worthwhile/embargo_service.rb +26 -0
- data/app/services/worthwhile/lease_service.rb +23 -0
- data/app/views/catalog/_action_menu_partials/_collection.html.erb +27 -0
- data/app/views/catalog/_action_menu_partials/_default.html.erb +27 -0
- data/app/views/catalog/_document.html.erb +3 -0
- data/app/views/catalog/_document_list.html.erb +5 -0
- data/app/views/catalog/_home_text.html.erb +8 -0
- data/app/views/catalog/_index_default.html.erb +17 -0
- data/app/views/catalog/_index_header_list_default.html.erb +17 -0
- data/app/views/catalog/_navbar.html.erb +12 -0
- data/app/views/catalog/_show_partials/_default.html.erb +22 -0
- data/app/views/catalog/_show_partials/_default_details.html.erb +15 -0
- data/app/views/catalog/_show_partials/_facets.html.erb +52 -0
- data/app/views/catalog/index.html.erb +48 -0
- data/app/views/collections/_batch_edits_actions.html.erb +3 -0
- data/app/views/collections/_button_for_creating_empty_collection.html.erb +3 -0
- data/app/views/collections/_collection.html.erb +1 -0
- data/app/views/collections/_dashboard_document_list.html.erb +6 -0
- data/app/views/collections/_document_list.html.erb +7 -0
- data/app/views/collections/_edit_actions.html.erb +5 -0
- data/app/views/collections/_edit_descriptions.html.erb +20 -0
- data/app/views/collections/_form.html.erb +26 -0
- data/app/views/collections/_form_for_select_collection.html.erb +34 -0
- data/app/views/collections/_form_permission.html.erb +36 -0
- data/app/views/collections/_form_required_information.html.erb +11 -0
- data/app/views/collections/_identifier_and_action.html.erb +15 -0
- data/app/views/collections/_media_display.html.erb +1 -0
- data/app/views/collections/_paginate.html.erb +6 -0
- data/app/views/collections/_search_collection_dashboard_form.html.erb +10 -0
- data/app/views/collections/_show_actions.html.erb +8 -0
- data/app/views/collections/_show_descriptions.html.erb +10 -0
- data/app/views/collections/_show_fields.html.erb +0 -0
- data/app/views/collections/_single_item_action_fields.html.erb +6 -0
- data/app/views/collections/_sort_and_per_page.html.erb +29 -0
- data/app/views/collections/_view_type_group.html.erb +13 -0
- data/app/views/collections/edit.html.erb +22 -0
- data/app/views/collections/new.html.erb +15 -0
- data/app/views/collections/show.html.erb +24 -0
- data/app/views/curate/collections/_add_to_collection_modal.html.erb +15 -0
- data/app/views/curate/collections/_button_remove_from_collection.html.erb +6 -0
- data/app/views/curate/collections/_form_to_add_member.html.erb +27 -0
- data/app/views/curate/collections/add_member_form.html.erb +6 -0
- data/app/views/curation_concern/base/_attributes.html.erb +25 -0
- data/app/views/curation_concern/base/_collections.html.erb +26 -0
- data/app/views/curation_concern/base/_form.html.erb +27 -0
- data/app/views/curation_concern/base/_form_additional_information.html.erb +9 -0
- data/app/views/curation_concern/base/_form_content_license.html.erb +16 -0
- data/app/views/curation_concern/base/_form_contributor_agreement.html.erb +29 -0
- data/app/views/curation_concern/base/_form_descriptive_fields.erb +23 -0
- data/app/views/curation_concern/base/_form_files_and_links.html.erb +29 -0
- data/app/views/curation_concern/base/_form_permission.html.erb +52 -0
- data/app/views/curation_concern/base/_form_permission_embargo.html.erb +6 -0
- data/app/views/curation_concern/base/_form_permission_lease.html.erb +6 -0
- data/app/views/curation_concern/base/_form_permission_under_embargo.html.erb +16 -0
- data/app/views/curation_concern/base/_form_permission_under_lease.html.erb +18 -0
- data/app/views/curation_concern/base/_form_representative_image.html.erb +13 -0
- data/app/views/curation_concern/base/_form_required_information.html.erb +11 -0
- data/app/views/curation_concern/base/_form_supplementary_fields.html.erb +15 -0
- data/app/views/curation_concern/base/_legally_binding_text.html.erb +33 -0
- data/app/views/curation_concern/base/_related_files.html.erb +24 -0
- data/app/views/curation_concern/base/_related_resources.html.erb +40 -0
- data/app/views/curation_concern/base/_representative_media.html.erb +8 -0
- data/app/views/curation_concern/base/edit.html.erb +15 -0
- data/app/views/curation_concern/base/new.html.erb +14 -0
- data/app/views/curation_concern/base/show.html.erb +32 -0
- data/app/views/curation_concern/base/unauthorized.html.erb +3 -0
- data/app/views/curation_concern/generic_files/_form.html.erb +35 -0
- data/app/views/curation_concern/generic_files/_media_display.html.erb +20 -0
- data/app/views/curation_concern/generic_files/edit.html.erb +5 -0
- data/app/views/curation_concern/generic_files/show.html.erb +15 -0
- data/app/views/curation_concern/generic_works/_generic_work.html.erb +3 -0
- data/app/views/curation_concern/linked_resources/_form.html.erb +11 -0
- data/app/views/curation_concern/linked_resources/edit.html.erb +5 -0
- data/app/views/curation_concern/linked_resources/new.html.erb +5 -0
- data/app/views/curation_concern/permissions/confirm.html.erb +13 -0
- data/app/views/curation_concern/worthwhile/generic_files/_actions.html.erb +16 -0
- data/app/views/curation_concern/worthwhile/generic_files/_generic_file.html.erb +12 -0
- data/app/views/embargoes/_embargo_history.html.erb +7 -0
- data/app/views/embargoes/_list_active_embargoes.html.erb +16 -0
- data/app/views/embargoes/_list_deactivated_embargoes.html.erb +10 -0
- data/app/views/embargoes/_list_expired_active_embargoes.html.erb +44 -0
- data/app/views/embargoes/edit.html.erb +43 -0
- data/app/views/embargoes/index.html.erb +18 -0
- data/app/views/layouts/boilerplate.html.erb +22 -0
- data/app/views/layouts/common_objects.html.erb +36 -0
- data/app/views/layouts/curate_nd.html.erb +33 -0
- data/app/views/layouts/curate_nd/1_column.html.erb +22 -0
- data/app/views/layouts/curate_nd/2_column.html.erb +26 -0
- data/app/views/layouts/curate_nd/catalog.html.erb +38 -0
- data/app/views/layouts/curate_nd/dashboard.html.erb +22 -0
- data/app/views/leases/_lease_history.html.erb +7 -0
- data/app/views/leases/_list_active_leases.html.erb +16 -0
- data/app/views/leases/_list_deactivated_leases.html.erb +4 -0
- data/app/views/leases/_list_expired_active_leases.html.erb +38 -0
- data/app/views/leases/edit.html.erb +43 -0
- data/app/views/leases/index.html.erb +18 -0
- data/app/views/shared/_add_content.html.erb +32 -0
- data/app/views/shared/_brand_bar.html.erb +10 -0
- data/app/views/shared/_flash_message.html.erb +17 -0
- data/app/views/shared/_footer.html.erb +10 -0
- data/app/views/shared/_ga.html.erb +6 -0
- data/app/views/shared/_header.html.erb +12 -0
- data/app/views/shared/_my_actions.html.erb +21 -0
- data/app/views/shared/_site_actions.html.erb +7 -0
- data/app/views/shared/_site_search.html.erb +12 -0
- data/app/views/shared/_title_bar.html.erb +16 -0
- data/app/views/worthwhile/classify_concerns/new.html.erb +27 -0
- data/app/workers/visibility_copy_worker.rb +29 -0
- data/config/initializers/simple_form.rb +31 -0
- data/config/locales/sufia.en.yml +26 -0
- data/config/locales/worthwhile.en.yml +68 -0
- data/config/routes.rb +4 -0
- data/lib/generators/worthwhile/install_generator.rb +74 -0
- data/lib/generators/worthwhile/templates/worthwhile.css.scss +3 -0
- data/lib/generators/worthwhile/templates/worthwhile.js +1 -0
- data/lib/generators/worthwhile/templates/worthwhile_config.rb +3 -0
- data/lib/generators/worthwhile/templates/worthwhile_helper.rb +4 -0
- data/lib/worthwhile.rb +3 -1
- data/lib/worthwhile/configuration.rb +74 -0
- data/lib/worthwhile/controller_resource.rb +10 -0
- data/lib/worthwhile/engine.rb +20 -0
- data/lib/worthwhile/rails/routes.rb +78 -0
- data/lib/worthwhile/spec_support.rb +10 -0
- data/lib/worthwhile/version.rb +1 -1
- data/spec/abilities/generic_file_abilities_spec.rb +62 -0
- data/spec/abilities/generic_work_abilities_spec.rb +58 -0
- data/spec/actors/curation_concern/generic_work_actor_spec.rb +215 -0
- data/spec/actors/curation_concern/linked_resource_actor_spec.rb +36 -0
- data/spec/actors/worthwile/manages_embargoes_actor_spec.rb +95 -0
- data/spec/controllers/catalog_controller_spec.rb +114 -0
- data/spec/controllers/collections_controller_spec.rb +216 -0
- data/spec/controllers/curation_concern/generic_files_controller_spec.rb +258 -0
- data/spec/controllers/curation_concern/generic_works_controller_spec.rb +171 -0
- data/spec/controllers/curation_concern/linked_resources_controller_spec.rb +123 -0
- data/spec/controllers/curation_concern/permissions_controller_spec.rb +29 -0
- data/spec/controllers/downloads_controller_spec.rb +53 -0
- data/spec/controllers/embargoes_controller_spec.rb +107 -0
- data/spec/controllers/leases_controller_spec.rb +95 -0
- data/spec/controllers/worthwhile/classify_concerns_controller_spec.rb +35 -0
- data/spec/factories/collections_factory.rb +21 -0
- data/spec/factories/create_curation_concern.rb +3 -0
- data/spec/factories/generic_files.rb +18 -0
- data/spec/factories/generic_works.rb +37 -0
- data/spec/factories/linked_resources_factory.rb +18 -0
- data/spec/factories/users.rb +15 -0
- data/spec/features/add_external_link_spec.rb +25 -0
- data/spec/features/add_file_spec.rb +28 -0
- data/spec/features/collection_spec.rb +238 -0
- data/spec/features/embargo_spec.rb +45 -0
- data/spec/features/lease_spec.rb +43 -0
- data/spec/features/update_file_spec.rb +28 -0
- data/spec/fixtures/files/image.png +0 -0
- data/spec/helpers/catalog_helper_spec.rb +58 -0
- data/spec/helpers/configuration_helper_spec.rb +13 -0
- data/spec/helpers/render_constraints_helper_spec.rb +19 -0
- data/spec/helpers/thumbnail_helper_spec.rb +21 -0
- data/spec/helpers/url_helper_spec.rb +19 -0
- data/spec/matchers.rb +24 -0
- data/spec/matchers/metadata_field_matchers.rb +28 -0
- data/spec/models/collection_spec.rb +136 -0
- data/spec/models/curation_concern/collection_model_spec.rb +50 -0
- data/spec/models/curation_concern/work_spec.rb +30 -0
- data/spec/models/generic_work_spec.rb +24 -0
- data/spec/models/worthwhile/content_version_spec.rb +27 -0
- data/spec/models/worthwhile/generic_file_spec.rb +77 -0
- data/spec/models/worthwhile/linked_resource_spec.rb +76 -0
- data/spec/routing/worthwhile/routes_spec.rb +23 -0
- data/spec/services/embargo_service_spec.rb +38 -0
- data/spec/services/lease_service_spec.rb +37 -0
- data/spec/spec_helper.rb +30 -5
- data/spec/support/controllers/engine_helpers.rb +7 -0
- data/spec/support/curation_concern/factory_helpers.rb +14 -0
- data/spec/support/features.rb +19 -0
- data/spec/support/features/fixture_file_upload.rb +14 -0
- data/spec/support/features/session_helpers.rb +41 -0
- data/spec/support/shared/shared_examples_has_dc_metadata.rb +17 -0
- data/spec/support/shared/shared_examples_is_a_curation_concern_model.rb +40 -0
- data/spec/support/shared/shared_examples_is_embargoable.rb +8 -0
- data/spec/support/shared/shared_examples_with_access_rights.rb +63 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +8 -29
- data/spec/views/curation_concern/base/_attributes.html.erb_spec.rb +25 -0
- data/spec/views/curation_concern/base/show.html.erb_spec.rb +25 -0
- data/spec/views/shared/_add_content.html.erb_spec.rb +42 -0
- data/spec/views/shared/_my_actions.html.erb_spec.rb +23 -0
- data/spec/workers/visibility_copy_worker_spec.rb +68 -0
- data/vendor/assets/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/vendor/assets/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/vendor/assets/javascripts/handlebars.js +2278 -0
- data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.autocomplete.js +602 -0
- data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.core.js +356 -0
- data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.effect-highlight.js +50 -0
- data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.effect.js +1276 -0
- data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.menu.js +610 -0
- data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.position.js +498 -0
- data/vendor/assets/javascripts/jquery-ui-1.9.2/jquery.ui.widget.js +528 -0
- data/vendor/assets/javascripts/jquery.tokeninput.js +1061 -0
- data/vendor/assets/stylesheets/jquery-ui-lightness.css +474 -0
- data/vendor/assets/stylesheets/token-input-facebook.css +122 -0
- data/vendor/assets/stylesheets/token-input-mac.css +204 -0
- data/vendor/assets/stylesheets/token-input.css +127 -0
- data/worthwhile.gemspec +9 -3
- metadata +469 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99fe1f3999559e6ebe5f243a20805860f628bd43
|
4
|
+
data.tar.gz: ead1fe02d3000867e4e0fb14d9dee96e6ec22b0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a5985f9051d774cf571c3ea6b91528ac138cf0301ef15240f95114fff5f73c7de9b730474365c01d554bb7d2ffe111d141b865e77de59450b2418ea2f52f0c4
|
7
|
+
data.tar.gz: 68ca47870dd430304eb046f9cd400f157b5d39a60ccf1954ac3d638004a0d8e82d17db2c6d1f397628c7b5cdb9719acc229aaeb25ad5b977e23cb49ac4b50b84
|
data/.gitignore
CHANGED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--colour
|
data/.travis.yml
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
language: ruby
|
2
|
+
rvm:
|
3
|
+
- 2.1
|
4
|
+
env:
|
5
|
+
global:
|
6
|
+
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
|
7
|
+
notifications:
|
8
|
+
email:
|
9
|
+
recipients:
|
10
|
+
- "justin@curationexperts.com"
|
11
|
+
- "matt@curationexperts.com"
|
12
|
+
- "alicia@curationexperts.com"
|
13
|
+
on_success: "change"
|
14
|
+
on_failure: "always"
|
15
|
+
irc:
|
16
|
+
channels:
|
17
|
+
- "irc.freenode.org#curationexperts"
|
18
|
+
template:
|
19
|
+
- "%{repository}//%{branch}@%{commit} by %{author}: %{message} - %{build_url}"
|
data/Gemfile
CHANGED
@@ -3,19 +3,15 @@ source 'https://rubygems.org'
|
|
3
3
|
# Specify your gem's dependencies in worthwhile.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
-
|
7
|
-
gem 'sufia-models', github: 'projecthydra/sufia', branch: 'dce_dev'
|
8
6
|
gem 'byebug' unless ENV['TRAVIS']
|
7
|
+
gem 'sass-rails', '~> 4.0.3'
|
9
8
|
|
10
|
-
|
11
|
-
#
|
12
|
-
#
|
13
|
-
gem '
|
14
|
-
|
15
|
-
|
16
|
-
# Gemfile.lock but since sass-rails gets generated (rails new) into the test app
|
17
|
-
# it'll want sass 3.2.0 and we'll have a conflict
|
18
|
-
gem 'sass', '~> 3.2.0'
|
9
|
+
group :test do
|
10
|
+
# Peg simplecov to < 0.8 until this is resolved:
|
11
|
+
# https://github.com/colszowka/simplecov/issues/281
|
12
|
+
gem 'simplecov', '~> 0.7.1', require: false
|
13
|
+
gem 'poltergeist'
|
14
|
+
end
|
19
15
|
|
20
16
|
file = File.expand_path("Gemfile", ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path("../spec/internal", __FILE__))
|
21
17
|
if File.exists?(file)
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Worthwhile
|
2
2
|
|
3
|
-
|
3
|
+
A very simple extensible IR platform for Hydra
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -12,18 +12,14 @@ And then execute:
|
|
12
12
|
|
13
13
|
$ bundle
|
14
14
|
|
15
|
-
|
15
|
+
Then:
|
16
16
|
|
17
|
-
$
|
17
|
+
$ rails generate worthwhile:install
|
18
|
+
$ rake db:migrate
|
18
19
|
|
19
|
-
##
|
20
|
+
## Testing
|
20
21
|
|
21
|
-
|
22
|
+
$ rake jetty:clean
|
23
|
+
$ rake engine_cart:generate
|
24
|
+
$ rake spec
|
22
25
|
|
23
|
-
## Contributing
|
24
|
-
|
25
|
-
1. Fork it ( https://github.com/[my-github-username]/worthwhile/fork )
|
26
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
-
5. Create a new Pull Request
|
data/Rakefile
CHANGED
@@ -1,8 +1,23 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
2
|
require 'bundler/setup'
|
3
|
-
|
4
|
-
require 'engine_cart/rake_task'
|
3
|
+
APP_ROOT="." # for jettywrapper
|
5
4
|
|
6
5
|
require 'rspec/core/rake_task'
|
7
6
|
RSpec::Core::RakeTask.new(:spec)
|
8
7
|
|
8
|
+
require 'jettywrapper'
|
9
|
+
require 'engine_cart/rake_task'
|
10
|
+
|
11
|
+
task ci: ['engine_cart:generate', 'jetty:clean'] do
|
12
|
+
ENV['environment'] = "test"
|
13
|
+
jetty_params = Jettywrapper.load_config
|
14
|
+
jetty_params[:startup_wait]= 90
|
15
|
+
|
16
|
+
Jettywrapper.wrap(jetty_params) do
|
17
|
+
# run the tests
|
18
|
+
Rake::Task["spec"].invoke
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
task clean: 'engine_cart:clean'
|
23
|
+
task default: :ci
|
@@ -0,0 +1,79 @@
|
|
1
|
+
module Worthwhile
|
2
|
+
# To use this module, include it in your Actor class
|
3
|
+
# and then add its interpreters wherever you want them to run.
|
4
|
+
# They should be called _before_ apply_attributes is called because
|
5
|
+
# they intercept values in the attributes Hash.
|
6
|
+
#
|
7
|
+
# @example
|
8
|
+
# class MyActorClass < BaseActor
|
9
|
+
# include Worthwile::ManagesEmbargoesActor
|
10
|
+
#
|
11
|
+
# def create
|
12
|
+
# interpret_visibility && super && copy_visibility
|
13
|
+
# end
|
14
|
+
#
|
15
|
+
# def update
|
16
|
+
# interpret_visibility && super && copy_visibility
|
17
|
+
# end
|
18
|
+
# end
|
19
|
+
#
|
20
|
+
module ManagesEmbargoesActor
|
21
|
+
extend ActiveSupport::Concern
|
22
|
+
|
23
|
+
# Interprets embargo & lease visibility if necessary
|
24
|
+
# returns false if there are any errors
|
25
|
+
def interpret_visibility
|
26
|
+
interpret_embargo_visibility && interpret_lease_visibility
|
27
|
+
end
|
28
|
+
|
29
|
+
# If user has set visibility to embargo, interprets the relevant information and applies it
|
30
|
+
# Returns false if there are any errors and sets an error on the curation_concern
|
31
|
+
def interpret_embargo_visibility
|
32
|
+
if attributes[:visibility] != Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_EMBARGO
|
33
|
+
# clear embargo_release_date even if it isn't being used. Otherwise it sets the embargo_date
|
34
|
+
# even though they didn't select embargo on the form.
|
35
|
+
attributes.delete(:visibility_during_embargo)
|
36
|
+
attributes.delete(:visibility_after_embargo)
|
37
|
+
attributes.delete(:embargo_release_date)
|
38
|
+
true
|
39
|
+
elsif !attributes[:embargo_release_date]
|
40
|
+
curation_concern.errors.add(:visibility, 'When setting visibility to "embargo" you must also specify embargo release date.')
|
41
|
+
false
|
42
|
+
else
|
43
|
+
attributes.delete(:visibility)
|
44
|
+
curation_concern.apply_embargo(attributes[:embargo_release_date], attributes.delete(:visibility_during_embargo),
|
45
|
+
attributes.delete(:visibility_after_embargo))
|
46
|
+
@needs_to_copy_visibility = true
|
47
|
+
true
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# If user has set visibility to lease, interprets the relevant information and applies it
|
52
|
+
# Returns false if there are any errors and sets an error on the curation_concern
|
53
|
+
def interpret_lease_visibility
|
54
|
+
if attributes[:visibility] != Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_LEASE
|
55
|
+
# clear lease_expiration_date even if it isn't being used. Otherwise it sets the lease_expiration
|
56
|
+
# even though they didn't select lease on the form.
|
57
|
+
attributes.delete(:visibility_during_lease)
|
58
|
+
attributes.delete(:visibility_after_lease)
|
59
|
+
attributes.delete(:lease_expiration_date)
|
60
|
+
true
|
61
|
+
elsif !attributes[:lease_expiration_date]
|
62
|
+
curation_concern.errors.add(:visibility, 'When setting visibility to "lease" you must also specify lease expiration date.')
|
63
|
+
false
|
64
|
+
else
|
65
|
+
curation_concern.apply_lease(attributes[:lease_expiration_date], attributes.delete(:visibility_during_lease),
|
66
|
+
attributes.delete(:visibility_after_lease))
|
67
|
+
@needs_to_copy_visibility = true
|
68
|
+
attributes.delete(:visibility)
|
69
|
+
true
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
|
74
|
+
def copy_visibility
|
75
|
+
Sufia.queue.push(VisibilityCopyWorker.new(curation_concern.id)) if @needs_to_copy_visibility
|
76
|
+
true
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
|
2
|
+
module CurationConcern
|
3
|
+
# The CurationConcern base actor should respond to three primary actions:
|
4
|
+
# * #create
|
5
|
+
# * #update
|
6
|
+
# * #delete
|
7
|
+
class BaseActor
|
8
|
+
attr_reader :curation_concern, :user, :attributes, :cloud_resources
|
9
|
+
def initialize(curation_concern, user, input_attributes)
|
10
|
+
@curation_concern = curation_concern
|
11
|
+
@user = user
|
12
|
+
@attributes = input_attributes.dup.with_indifferent_access
|
13
|
+
@visibility = attributes[:visibility]
|
14
|
+
@cloud_resources= attributes.delete(:cloud_resources.to_s)
|
15
|
+
end
|
16
|
+
|
17
|
+
attr_reader :visibility
|
18
|
+
protected :visibility
|
19
|
+
|
20
|
+
delegate :visibility_changed?, to: :curation_concern
|
21
|
+
|
22
|
+
def create
|
23
|
+
apply_creation_data_to_curation_concern
|
24
|
+
apply_save_data_to_curation_concern
|
25
|
+
save
|
26
|
+
end
|
27
|
+
|
28
|
+
def update
|
29
|
+
apply_update_data_to_curation_concern
|
30
|
+
apply_save_data_to_curation_concern
|
31
|
+
save
|
32
|
+
end
|
33
|
+
|
34
|
+
protected
|
35
|
+
def apply_creation_data_to_curation_concern
|
36
|
+
apply_depositor_metadata
|
37
|
+
apply_deposit_date
|
38
|
+
end
|
39
|
+
|
40
|
+
def apply_update_data_to_curation_concern
|
41
|
+
true
|
42
|
+
end
|
43
|
+
|
44
|
+
def apply_depositor_metadata
|
45
|
+
curation_concern.apply_depositor_metadata(user.user_key)
|
46
|
+
curation_concern.edit_users += [user.user_key]
|
47
|
+
end
|
48
|
+
|
49
|
+
def apply_deposit_date
|
50
|
+
curation_concern.date_uploaded = Date.today
|
51
|
+
end
|
52
|
+
|
53
|
+
def save
|
54
|
+
curation_concern.save
|
55
|
+
end
|
56
|
+
|
57
|
+
def apply_save_data_to_curation_concern
|
58
|
+
attributes[:rights] = Array(attributes[:rights]) if attributes.key? :rights
|
59
|
+
curation_concern.attributes = attributes
|
60
|
+
curation_concern.date_modified = Date.today
|
61
|
+
end
|
62
|
+
|
63
|
+
def attach_file(generic_file, file_to_attach)
|
64
|
+
ActiveSupport::Deprecation.warn("removing #{self.class}#attach_file, use CurationConcern.attach_file instead")
|
65
|
+
CurationConcern.attach_file(generic_file, user, file_to_attach)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module CurationConcern
|
2
|
+
class GenericFileActor < Sufia::GenericFile::Actor
|
3
|
+
include Worthwhile::ManagesEmbargoesActor
|
4
|
+
|
5
|
+
attr_reader :attributes, :curation_concern
|
6
|
+
|
7
|
+
def initialize(generic_file, user, attributes)
|
8
|
+
super(generic_file, user)
|
9
|
+
# we're setting attributes and curation_concern to bridge the difference
|
10
|
+
# between Sufia::GenericFile::Actor and ManagesEmbargoesActor
|
11
|
+
@curation_concern = generic_file
|
12
|
+
@attributes = attributes
|
13
|
+
end
|
14
|
+
|
15
|
+
# we can trim this down a bit when Sufia 7.1 is released (adds update_visibility)
|
16
|
+
def update_metadata(_, _)
|
17
|
+
interpret_visibility
|
18
|
+
generic_file.visibility = attributes[:visibility] if attributes.key?(:visibility)
|
19
|
+
generic_file.attributes = generic_file.sanitize_attributes(attributes)
|
20
|
+
generic_file.date_modified = DateTime.now
|
21
|
+
remove_from_feature_works if generic_file.visibility_changed? && !generic_file.public?
|
22
|
+
save_and_record_committer do
|
23
|
+
if Sufia.config.respond_to?(:after_update_metadata)
|
24
|
+
Sufia.config.after_update_metadata.call(generic_file, user)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def create_metadata(batch_id)
|
30
|
+
if batch_id
|
31
|
+
generic_file.visibility = load_parent(batch_id).visibility
|
32
|
+
end
|
33
|
+
super
|
34
|
+
end
|
35
|
+
|
36
|
+
def load_parent(batch_id)
|
37
|
+
@parent ||= GenericWork.find(batch_id)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
|
2
|
+
module CurationConcern
|
3
|
+
class GenericWorkActor < CurationConcern::BaseActor
|
4
|
+
include Worthwhile::ManagesEmbargoesActor
|
5
|
+
|
6
|
+
def create
|
7
|
+
assign_pid && interpret_visibility && super && attach_files && create_linked_resources && assign_representative && copy_visibility
|
8
|
+
end
|
9
|
+
|
10
|
+
def update
|
11
|
+
add_to_collections(attributes.delete(:collection_ids)) && interpret_visibility &&
|
12
|
+
super && attach_files && create_linked_resources && copy_visibility
|
13
|
+
end
|
14
|
+
|
15
|
+
delegate :visibility_changed?, to: :curation_concern
|
16
|
+
|
17
|
+
protected
|
18
|
+
|
19
|
+
def assign_pid
|
20
|
+
curation_concern.inner_object.pid ||= Worthwhile::CurationConcern.mint_a_pid
|
21
|
+
end
|
22
|
+
|
23
|
+
def files
|
24
|
+
return @files if defined?(@files)
|
25
|
+
@files = [attributes[:files]].flatten.compact
|
26
|
+
end
|
27
|
+
|
28
|
+
def attach_files
|
29
|
+
files.all? do |file|
|
30
|
+
attach_file(file)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
# The default behavior of active_fedora's has_and_belongs_to_many association,
|
35
|
+
# when assigning the id accessor (e.g. collection_ids = ['foo:1']) is to add
|
36
|
+
# to new collections, but not remove from old collections.
|
37
|
+
# This method ensures it's removed from the old collections.
|
38
|
+
def add_to_collections(new_collection_ids)
|
39
|
+
return true unless new_collection_ids
|
40
|
+
#remove from old collections
|
41
|
+
(curation_concern.collection_ids - new_collection_ids).each do |old_id|
|
42
|
+
Collection.find(old_id).members.delete(curation_concern)
|
43
|
+
end
|
44
|
+
|
45
|
+
#add to new
|
46
|
+
curation_concern.collection_ids = new_collection_ids
|
47
|
+
true
|
48
|
+
end
|
49
|
+
|
50
|
+
def linked_resource_urls
|
51
|
+
@linked_resource_urls ||= Array(attributes[:linked_resource_urls]).flatten.compact
|
52
|
+
end
|
53
|
+
|
54
|
+
def create_linked_resources
|
55
|
+
linked_resource_urls.all? do |link_resource_url|
|
56
|
+
create_linked_resource(link_resource_url)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def create_linked_resource(link_resource_url)
|
61
|
+
return true unless link_resource_url.present?
|
62
|
+
resource = Worthwhile::LinkedResource.new.tap do |link|
|
63
|
+
link.url = link_resource_url
|
64
|
+
link.batch = curation_concern
|
65
|
+
link.label = curation_concern.human_readable_type
|
66
|
+
end
|
67
|
+
Sufia::GenericFile::Actor.new(resource, user).create_metadata(curation_concern.pid)
|
68
|
+
resource.save
|
69
|
+
end
|
70
|
+
|
71
|
+
def assign_representative
|
72
|
+
curation_concern.representative = curation_concern.generic_file_ids.first
|
73
|
+
curation_concern.save
|
74
|
+
end
|
75
|
+
|
76
|
+
private
|
77
|
+
def attach_file(file)
|
78
|
+
generic_file = Worthwhile::GenericFile.new
|
79
|
+
generic_file.file = file
|
80
|
+
generic_file.batch = curation_concern
|
81
|
+
Sufia::GenericFile::Actor.new(generic_file, user).create_metadata(curation_concern.pid)
|
82
|
+
generic_file.embargo_release_date = curation_concern.embargo_release_date
|
83
|
+
generic_file.visibility = visibility
|
84
|
+
Worthwhile::CurationConcern.attach_file(generic_file, user, file)
|
85
|
+
end
|
86
|
+
|
87
|
+
|
88
|
+
def valid_file?(file_path)
|
89
|
+
return file_path.present? && File.exists?(file_path) && !File.zero?(file_path)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
Binary file
|
Binary file
|
File without changes
|
@@ -0,0 +1,3 @@
|
|
1
|
+
// Modernizr 2.6.2 (Custom Build) | MIT & BSD
|
2
|
+
// Build: http://modernizr.com/download/#-fontface-borderradius-rgba-textshadow-generatedcontent-cssgradients-inlinesvg-svg-touch-shiv-cssclasses-teststyles-testprop-testallprops-prefixes-domprefixes-load
|
3
|
+
;window.Modernizr=function(a,b,c){function B(a){j.cssText=a}function C(a,b){return B(n.join(a+";")+(b||""))}function D(a,b){return typeof a===b}function E(a,b){return!!~(""+a).indexOf(b)}function F(a,b){for(var d in a){var e=a[d];if(!E(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function G(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:D(f,"function")?f.bind(d||b):f}return!1}function H(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+p.join(d+" ")+d).split(" ");return D(b,"string")||D(b,"undefined")?F(e,b):(e=(a+" "+q.join(d+" ")+d).split(" "),G(e,b,c))}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l=":)",m={}.toString,n=" -webkit- -moz- -o- -ms- ".split(" "),o="Webkit Moz O ms",p=o.split(" "),q=o.toLowerCase().split(" "),r={svg:"http://www.w3.org/2000/svg"},s={},t={},u={},v=[],w=v.slice,x,y=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["­",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},z={}.hasOwnProperty,A;!D(z,"undefined")&&!D(z.call,"undefined")?A=function(a,b){return z.call(a,b)}:A=function(a,b){return b in a&&D(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=w.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(w.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(w.call(arguments)))};return e}),s.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:y(["@media (",n.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},s.rgba=function(){return B("background-color:rgba(150,255,150,.5)"),E(j.backgroundColor,"rgba")},s.borderradius=function(){return H("borderRadius")},s.textshadow=function(){return b.createElement("div").style.textShadow===""},s.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return B((a+"-webkit- ".split(" ").join(b+a)+n.join(c+a)).slice(0,-a.length)),E(j.backgroundImage,"gradient")},s.fontface=function(){var a;return y('@font-face {font-family:"font";src:url("https://")}',function(c,d){var e=b.getElementById("smodernizr"),f=e.sheet||e.styleSheet,g=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"";a=/src/i.test(g)&&g.indexOf(d.split(" ")[0])===0}),a},s.generatedcontent=function(){var a;return y(["#",h,"{font:0/0 a}#",h,':after{content:"',l,'";visibility:hidden;font:3px/1 a}'].join(""),function(b){a=b.offsetHeight>=3}),a},s.svg=function(){return!!b.createElementNS&&!!b.createElementNS(r.svg,"svg").createSVGRect},s.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="<svg/>",(a.firstChild&&a.firstChild.namespaceURI)==r.svg};for(var I in s)A(s,I)&&(x=I.toLowerCase(),e[x]=s[I](),v.push((e[x]?"":"no-")+x));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)A(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},B(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function p(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return r.shivMethods?n(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+l().join().replace(/\w+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(r,b.frag)}function q(a){a||(a=b);var c=m(a);return r.shivCSS&&!f&&!c.hasCSS&&(c.hasCSS=!!k(a,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),j||p(a,c),a}var c=a.html5||{},d=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,e=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,f,g="_html5shiv",h=0,i={},j;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._prefixes=n,e._domPrefixes=q,e._cssomPrefixes=p,e.testProp=function(a){return F([a])},e.testAllProps=H,e.testStyles=y,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+v.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):w(j)?B(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};
|
File without changes
|
@@ -0,0 +1,15 @@
|
|
1
|
+
(function($) {
|
2
|
+
$("a[rel=popover]").popover({ html : true, trigger: "hover" });
|
3
|
+
$("a[rel=popover]").click(function() { return false;});
|
4
|
+
|
5
|
+
$('#accept_contributor_agreement').each(function(){
|
6
|
+
$.fn.disableAgreeButton = function(element) {
|
7
|
+
var $submit_button = $('input.require-contributor-agreement');
|
8
|
+
$submit_button.prop("disabled", !element.checked);
|
9
|
+
};
|
10
|
+
$.fn.disableAgreeButton(this);
|
11
|
+
$(this).on('change', function(){
|
12
|
+
$.fn.disableAgreeButton(this);
|
13
|
+
});
|
14
|
+
});
|
15
|
+
})(jQuery);
|