sufia 5.0.0 → 6.0.0.beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +1 -8
- data/Gemfile +3 -12
- data/History.md +0 -36
- data/LICENSE.md +14 -0
- data/README.md +4 -8
- data/SUFIA_VERSION +1 -1
- data/app/assets/javascripts/sufia.js +1 -17
- data/app/assets/javascripts/sufia/batch_edit.js +43 -28
- data/app/assets/javascripts/sufia/edit_metadata.js +9 -14
- data/app/assets/javascripts/sufia/multiForm.js +67 -0
- data/app/assets/javascripts/sufia/permissions.js +92 -35
- data/app/assets/stylesheets/sufia.css.scss +1 -6
- data/app/assets/stylesheets/sufia/_batch-edit.scss +0 -8
- data/app/assets/stylesheets/sufia/_dashboard.scss +1 -15
- data/app/assets/stylesheets/sufia/_file-listing.scss +1 -1
- data/app/assets/stylesheets/sufia/_settings.scss +0 -1
- data/app/controllers/concerns/sufia/batch_edits_controller_behavior.rb +3 -10
- data/app/controllers/concerns/sufia/breadcrumbs.rb +3 -8
- data/app/controllers/concerns/sufia/catalog.rb +1 -1
- data/app/controllers/concerns/sufia/controller.rb +3 -1
- data/app/controllers/concerns/sufia/downloads_controller_behavior.rb +1 -1
- data/app/controllers/concerns/sufia/files_controller/browse_everything.rb +1 -1
- data/app/controllers/concerns/sufia/files_controller_behavior.rb +16 -4
- data/app/controllers/concerns/sufia/homepage_controller.rb +1 -1
- data/app/controllers/concerns/sufia/my_controller_behavior.rb +2 -2
- data/app/controllers/concerns/sufia/transfers_controller_behavior.rb +3 -4
- data/app/controllers/concerns/sufia/users_controller_behavior.rb +2 -7
- data/app/controllers/my/collections_controller.rb +3 -4
- data/app/controllers/my/highlights_controller.rb +2 -2
- data/app/controllers/my/shares_controller.rb +3 -3
- data/app/controllers/single_use_links_controller.rb +5 -9
- data/app/controllers/single_use_links_viewer_controller.rb +4 -4
- data/app/helpers/generic_file_helper.rb +9 -0
- data/app/helpers/sufia/records_helper_behavior.rb +16 -0
- data/app/helpers/sufia/sufia_helper_behavior.rb +0 -11
- data/app/jobs/content_depositor_change_event_job.rb +1 -1
- data/app/jobs/ingest_local_file_job.rb +2 -1
- data/app/models/concerns/sufia/solr_document_behavior.rb +10 -10
- data/app/models/featured_work_list.rb +7 -9
- data/app/presenters/sufia/version_list_presenter.rb +15 -0
- data/app/presenters/sufia/version_presenter.rb +30 -0
- data/app/views/batch/_metadata.html.erb +51 -29
- data/app/views/batch/_more_metadata.html.erb +1 -1
- data/app/views/batch/edit.html.erb +10 -8
- data/app/views/batch_edits/edit.html.erb +13 -9
- data/app/views/collections/_edit_descriptions.html.erb +1 -1
- data/app/views/collections/_form.html.erb +4 -4
- data/app/views/collections/_form_for_select_collection.html.erb +1 -1
- data/app/views/collections/_show_document_list_menu.html.erb +7 -5
- data/app/views/collections/_show_document_list_row.html.erb +2 -2
- data/app/views/collections/edit.html.erb +0 -1
- data/app/views/collections/edit_fields/_description.html.erb +4 -0
- data/app/views/collections/edit_fields/_title.html.erb +3 -0
- data/app/views/collections/show.html.erb +0 -1
- data/app/views/dashboard/_index_partials/_stats.html.erb +3 -3
- data/app/views/generic_files/_descriptions.html.erb +9 -9
- data/app/views/generic_files/_field_form.html.erb +11 -25
- data/app/views/generic_files/_permission.html.erb +6 -4
- data/app/views/generic_files/_permission_form.html.erb +15 -17
- data/app/views/generic_files/_show_details.html.erb +1 -11
- data/app/views/generic_files/_versioning.html.erb +5 -5
- data/app/views/generic_files/edit.html.erb +5 -4
- data/app/views/generic_files/show.html.erb +6 -6
- data/app/views/homepage/_featured_fields.html.erb +2 -2
- data/app/views/homepage/_recent_document.html.erb +1 -1
- data/app/views/layouts/_head_tag_content.html.erb +0 -2
- data/app/views/layouts/error.html.erb +0 -1
- data/app/views/my/_index_partials/_default_group.html.erb +1 -1
- data/app/views/my/_index_partials/_list_files.html.erb +1 -1
- data/app/views/my/index.html.erb +2 -2
- data/app/views/records/_edit_field.html.erb +17 -19
- data/app/views/records/edit_fields/_default.html.erb +10 -12
- data/app/views/records/edit_fields/_description.html.erb +10 -3
- data/app/views/records/edit_fields/_resource_type.html.erb +4 -5
- data/app/views/records/edit_fields/_rights.html.erb +9 -2
- data/app/views/records/edit_fields/_suffix.html.erb +10 -0
- data/app/views/records/edit_fields/_type.html.erb +8 -2
- data/app/views/records/show_fields/_based_near.html.erb +1 -1
- data/app/views/records/show_fields/_creator.html.erb +1 -1
- data/app/views/records/show_fields/_language.html.erb +1 -1
- data/app/views/records/show_fields/_publisher.html.erb +1 -1
- data/app/views/records/show_fields/_resource_type.html.erb +1 -1
- data/app/views/records/show_fields/_subject.html.erb +1 -1
- data/app/views/records/show_fields/_tag.html.erb +1 -1
- data/app/views/single_use_links/new_download.html.erb +2 -2
- data/app/views/users/_profile.html.erb +2 -1
- data/app/views/users/_social_media_info.html.erb +20 -0
- data/app/views/users/_user_info.html.erb +3 -20
- data/app/views/users/edit.html.erb +2 -11
- data/app/views/users/show.html.erb +1 -1
- data/bin/audit_repository +1 -1
- data/config/initializers/sufia_events.rb +4 -4
- data/config/locales/sufia.en.yml +0 -5
- data/config/routes.rb +1 -1
- data/lib/generators/sufia/install_generator.rb +0 -4
- data/lib/generators/sufia/templates/catalog_controller.rb +59 -59
- data/lib/sufia.rb +1 -4
- data/lib/sufia/version.rb +1 -1
- data/spec/actors/generic_file/actor_spec.rb +67 -8
- data/spec/controllers/batch_controller_spec.rb +72 -86
- data/spec/controllers/batch_edits_controller_spec.rb +17 -19
- data/spec/controllers/catalog_controller_spec.rb +16 -24
- data/spec/controllers/collections_controller_spec.rb +47 -74
- data/spec/controllers/downloads_controller_spec.rb +40 -35
- data/spec/controllers/generic_files_controller_spec.rb +363 -428
- data/spec/controllers/homepage_controller_spec.rb +12 -9
- data/spec/controllers/mailbox_controller_spec.rb +1 -4
- data/spec/controllers/my/files_controller_spec.rb +0 -10
- data/spec/controllers/single_use_links_controller_spec.rb +28 -35
- data/spec/controllers/single_use_links_viewer_controller_spec.rb +27 -41
- data/spec/controllers/transfers_controller_spec.rb +6 -6
- data/spec/controllers/users_controller_spec.rb +121 -124
- data/spec/factories/generic_files.rb +9 -17
- data/spec/features/browse_dashboard_files_spec.rb +8 -10
- data/spec/features/browse_files_spec.rb +12 -25
- data/spec/features/catalog_search_spec.rb +49 -49
- data/spec/features/collection_spec.rb +18 -24
- data/spec/features/contact_form_spec.rb +26 -20
- data/spec/features/ingest_upload_files_spec.rb +8 -6
- data/spec/features/ownership_transfer_spec.rb +2 -6
- data/spec/features/proxy_spec.rb +1 -1
- data/spec/features/search_spec.rb +2 -3
- data/spec/features/single_use_links_spec.rb +1 -1
- data/spec/features/users_spec.rb +1 -1
- data/spec/helpers/records_helper_spec.rb +24 -10
- data/spec/jobs/active_fedora_pid_based_job_spec.rb +1 -5
- data/spec/jobs/audit_job_spec.rb +66 -21
- data/spec/jobs/batch_update_job_spec.rb +49 -36
- data/spec/jobs/content_depositor_change_event_job_spec.rb +2 -4
- data/spec/jobs/create_derivatives_job_spec.rb +18 -19
- data/spec/jobs/event_jobs_spec.rb +17 -21
- data/spec/jobs/import_url_job_spec.rb +1 -6
- data/spec/jobs/ingest_local_file_job_spec.rb +0 -4
- data/spec/lib/sufia/breadcrumbs_spec.rb +8 -46
- data/spec/lib/sufia/id_service_spec.rb +8 -3
- data/spec/lib/sufia/user_stat_importer_spec.rb +18 -25
- data/spec/lib/sufia/writable_permissions_spec.rb +0 -4
- data/spec/models/ability_spec.rb +25 -18
- data/spec/models/batch_spec.rb +16 -45
- data/spec/models/characterization_spec.rb +1 -1
- data/spec/models/checksum_audit_log_spec.rb +51 -29
- data/spec/models/collection_spec.rb +0 -5
- data/spec/models/featured_work_list_spec.rb +2 -4
- data/spec/models/file_content_datastream_spec.rb +27 -60
- data/spec/models/file_usage_spec.rb +16 -21
- data/spec/models/fits_datastream_spec.rb +47 -2
- data/spec/models/generic_file/web_form_spec.rb +1 -1
- data/spec/models/generic_file_spec.rb +238 -735
- data/spec/models/local_authority_spec.rb +8 -13
- data/spec/models/proxy_deposit_request_spec.rb +3 -7
- data/spec/models/single_use_link_spec.rb +12 -16
- data/spec/models/solr_document_spec.rb +1 -1
- data/spec/models/trophy_spec.rb +1 -3
- data/spec/models/user_spec.rb +47 -75
- data/spec/presenters/sufia/version_list_presenter_spec.rb +22 -0
- data/spec/presenters/sufia/version_presenter_spec.rb +51 -0
- data/spec/services/generic_file_audit_service_spec.rb +85 -0
- data/spec/services/repository_audit_service_spec.rb +18 -0
- data/spec/spec_helper.rb +26 -7
- data/spec/support/fixture_helpers.rb +2 -4
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +0 -4
- data/spec/views/batch/edit.html.erb_spec.rb +17 -7
- data/spec/views/catalog/index.html.erb_spec.rb +8 -6
- data/spec/views/collections/_form.html.erb_spec.rb +4 -2
- data/spec/views/collections/_show_document_list.erb_spec.rb +31 -0
- data/spec/views/dashboard/index_spec.rb +2 -2
- data/spec/views/generic_file/edit.html.erb_spec.rb +20 -6
- data/spec/views/generic_file/show.html.erb_spec.rb +3 -3
- data/spec/views/users/show.html.erb_spec.rb +1 -1
- data/sufia-models/app/actors/sufia/generic_file/actor.rb +8 -10
- data/sufia-models/app/jobs/active_fedora_pid_based_job.rb +2 -3
- data/sufia-models/app/jobs/audit_job.rb +46 -32
- data/sufia-models/app/jobs/batch_update_job.rb +9 -8
- data/sufia-models/app/jobs/import_url_job.rb +2 -2
- data/sufia-models/app/models/batch.rb +11 -12
- data/sufia-models/app/models/checksum_audit_log.rb +12 -10
- data/sufia-models/app/models/concerns/sufia/ability.rb +4 -6
- data/sufia-models/app/models/concerns/sufia/collection.rb +4 -5
- data/sufia-models/app/models/concerns/sufia/generic_file.rb +3 -86
- data/sufia-models/app/models/concerns/sufia/generic_file/batches.rb +29 -0
- data/sufia-models/app/models/concerns/sufia/generic_file/characterization.rb +3 -3
- data/sufia-models/app/models/concerns/sufia/generic_file/content.rb +13 -0
- data/sufia-models/app/models/concerns/sufia/generic_file/derivatives.rb +5 -5
- data/sufia-models/app/models/concerns/sufia/generic_file/export.rb +4 -0
- data/sufia-models/app/models/concerns/sufia/generic_file/full_text_indexing.rb +2 -2
- data/sufia-models/app/models/concerns/sufia/generic_file/indexing.rb +23 -0
- data/sufia-models/app/models/concerns/sufia/generic_file/metadata.rb +80 -11
- data/sufia-models/app/models/concerns/sufia/generic_file/proxy_deposit.rb +12 -3
- data/sufia-models/app/models/concerns/sufia/generic_file/versions.rb +4 -4
- data/sufia-models/app/models/concerns/sufia/generic_file/web_form.rb +14 -6
- data/sufia-models/app/models/concerns/sufia/model_methods.rb +11 -9
- data/sufia-models/app/models/concerns/sufia/user.rb +11 -33
- data/sufia-models/app/models/datastreams/file_content_datastream.rb +1 -1
- data/sufia-models/app/models/datastreams/fits_datastream.rb +1 -1
- data/sufia-models/app/models/file_usage.rb +3 -3
- data/sufia-models/app/models/local_authority.rb +2 -2
- data/sufia-models/app/models/proxy_deposit_request.rb +1 -1
- data/sufia-models/app/services/sufia/generic_file_audit_service.rb +83 -0
- data/sufia-models/app/services/sufia/id_service.rb +5 -5
- data/sufia-models/app/services/sufia/noid.rb +10 -7
- data/sufia-models/app/services/sufia/repository_audit_service.rb +9 -0
- data/sufia-models/lib/generators/sufia/models/cached_stats_generator.rb +47 -3
- data/sufia-models/lib/generators/sufia/models/install_generator.rb +31 -11
- data/sufia-models/lib/generators/sufia/models/proxies_generator.rb +31 -2
- data/sufia-models/lib/generators/sufia/models/templates/config/sufia.rb +10 -0
- data/sufia-models/lib/generators/sufia/models/upgrade400_generator.rb +33 -2
- data/sufia-models/lib/sufia/models/engine.rb +13 -4
- data/sufia-models/lib/sufia/models/file_content/versions.rb +9 -11
- data/sufia-models/lib/sufia/models/stats/user_stat_importer.rb +5 -9
- data/sufia-models/lib/sufia/models/version.rb +1 -1
- data/sufia-models/lib/sufia/permissions/writable.rb +34 -16
- data/sufia-models/sufia-models.gemspec +4 -2
- data/sufia.gemspec +4 -5
- data/tasks/jetty.rake +0 -26
- data/tasks/sufia-dev.rake +14 -2
- metadata +49 -64
- data/LICENSE +0 -15
- data/app/assets/images/orcid.png +0 -0
- data/app/assets/javascripts/sufia/manage_repeating_fields.js +0 -74
- data/app/assets/stylesheets/sufia/_multi_value_fields.css.scss +0 -67
- data/app/inputs/multi_value_input.rb +0 -84
- data/app/views/records/_rights_modal.html.erb +0 -1
- data/config/initializers/simple_form.rb +0 -167
- data/config/initializers/simple_form_bootstrap.rb +0 -137
- data/config/locales/simple_form.en.yml +0 -31
- data/fedora_conf/conf/development/fedora.fcfg +0 -946
- data/fedora_conf/conf/test/fedora.fcfg +0 -946
- data/spec/models/generic_file/reload_on_save_spec.rb +0 -25
- data/spec/models/generic_file_rdf_datastream_spec.rb +0 -12
- data/spec/models/properties_datastream_spec.rb +0 -41
- data/spec/views/generic_file/_permission_form.html.erb_spec.rb +0 -19
- data/sufia-models/app/models/concerns/sufia/generic_file/audit.rb +0 -116
- data/sufia-models/app/models/concerns/sufia/generic_file/reload_on_save.rb +0 -18
- data/sufia-models/app/models/concerns/sufia/properties_datastream_behavior.rb +0 -32
- data/sufia-models/app/models/datastreams/batch_rdf_datastream.rb +0 -6
- data/sufia-models/app/models/datastreams/generic_file_rdf_datastream.rb +0 -69
- data/sufia-models/app/models/datastreams/paranoid_rights_datastream.rb +0 -22
- data/sufia-models/app/models/datastreams/properties_datastream.rb +0 -4
- data/sufia-models/app/models/sufia/orcid_validator.rb +0 -8
- data/sufia-models/lib/generators/sufia/models/abstract_migration_generator.rb +0 -30
- data/sufia-models/lib/generators/sufia/models/orcid_field_generator.rb +0 -19
- data/sufia-models/lib/generators/sufia/models/templates/migrations/add_orcid_to_users.rb +0 -5
- data/sufia-models/lib/generators/sufia/models/user_stats_generator.rb +0 -31
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 66f52aa19e4ce45f68360e5c2dbc9bf9fd16a99b
|
|
4
|
+
data.tar.gz: 0e7ec679161844f502e8fd27db596005b0352d36
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 59957e8d5ebeeec6fc649ad82b802bd03e97e04d7d2a8607ceeff6e2cc46eb6560fa42c437cc55518b8903c9114155839c0589b404018b1a84f1d21baf71fe66
|
|
7
|
+
data.tar.gz: 5009ca0eb029bd3b2caa86fae5b339e5b6a1b4af4b609d42e532595dd42b223010c2927afb5d08517cc78e1cb693ea9029a1af0f3754710c1b49cf6d5c90ff37
|
data/.travis.yml
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
language: ruby
|
|
2
|
-
cache: bundler
|
|
3
|
-
sudo: false
|
|
4
2
|
rvm:
|
|
5
3
|
- 2.1
|
|
4
|
+
- 2.0
|
|
6
5
|
env:
|
|
7
6
|
global:
|
|
8
7
|
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
|
|
9
|
-
matrix:
|
|
10
|
-
- "RAILS_VERSION=4.1.8"
|
|
11
|
-
- "RAILS_VERSION=4.2.0"
|
|
12
|
-
matrix:
|
|
13
|
-
allow_failures:
|
|
14
|
-
- env: "RAILS_VERSION=4.2.0"
|
|
15
8
|
notifications:
|
|
16
9
|
email:
|
|
17
10
|
recipients:
|
data/Gemfile
CHANGED
|
@@ -6,24 +6,15 @@ gemspec
|
|
|
6
6
|
# Required for doing pagination inside an engine. See https://github.com/amatsuda/kaminari/pull/322
|
|
7
7
|
gem 'kaminari', github: 'harai/kaminari', branch: 'route_prefix_prototype'
|
|
8
8
|
gem 'sufia-models', path: './sufia-models'
|
|
9
|
-
gem '
|
|
9
|
+
gem 'sass-rails', '~> 4.0.3'
|
|
10
10
|
|
|
11
11
|
group :development, :test do
|
|
12
12
|
gem "simplecov", require: false
|
|
13
|
-
gem
|
|
14
|
-
end
|
|
13
|
+
gem 'byebug' unless ENV['CI']
|
|
14
|
+
end
|
|
15
15
|
|
|
16
16
|
file = File.expand_path("Gemfile", ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path("../spec/internal", __FILE__))
|
|
17
17
|
if File.exists?(file)
|
|
18
18
|
puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v`
|
|
19
19
|
instance_eval File.read(file)
|
|
20
|
-
else
|
|
21
|
-
gem 'rails', ENV['RAILS_VERSION'] if ENV['RAILS_VERSION']
|
|
22
|
-
|
|
23
|
-
if ENV['RAILS_VERSION'] and ENV['RAILS_VERSION'] !~ /^4.2/
|
|
24
|
-
gem 'sass-rails', "< 5.0"
|
|
25
|
-
else
|
|
26
|
-
gem 'responders', "~> 2.0"
|
|
27
|
-
gem 'sass-rails', ">= 5.0"
|
|
28
|
-
end
|
|
29
20
|
end
|
data/History.md
CHANGED
|
@@ -1,40 +1,5 @@
|
|
|
1
1
|
# History of Sufia releases
|
|
2
2
|
|
|
3
|
-
## 5.0.0
|
|
4
|
-
|
|
5
|
-
* Prevent Sufia from picking up Blacklight version 5.10 [Hector Correa]
|
|
6
|
-
* Update README to be more specific about dependency versions [Michael J. Giarlo]
|
|
7
|
-
* Pulled in code from curate to manage add/remove fields on edit forms. Also story #3978 [Carolyn Cole]
|
|
8
|
-
* Changing the file query to be a solr query for loading the file id, so we do not wait large file content to load. This speed up the runs significantly on systems with large file. [Carolyn Cole]
|
|
9
|
-
* Users controller should not call an undefined method. Fixes #532. [Michael J. Giarlo]
|
|
10
|
-
* Fix problem where batch edit forms weren't expanding. Fixes #820 [Carolyn Cole]
|
|
11
|
-
* Update and rename LICENSE.md to LICENSE per community convention. [Michael J. Giarlo]
|
|
12
|
-
* Brings some of the fixes in fedora-4/master into master. [Michael J. Giarlo]
|
|
13
|
-
* Adds condition to make the version of sass-rails dependent on the value of RAILS_VERSION [Michael J. Giarlo]
|
|
14
|
-
* Merge travis config change to speed up the build [Michael J. Giarlo]
|
|
15
|
-
* Adding the browse view link into the bread crumbs so it shows on both the edit and the stats page. [Carolyn Cole]
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
## 4.3.1
|
|
19
|
-
|
|
20
|
-
* Adds an ORCID field to the user model. [Michael J. Giarlo]
|
|
21
|
-
* Styles count for views and downloads, refs #9672 [Michael Tribone]
|
|
22
|
-
* Merge pull request #787 from projecthydra/update_master_to_bl-5.8 [Justin Coyne]
|
|
23
|
-
* More facets modal defaults to numerical sort [Adam Wead]
|
|
24
|
-
* Upgrade to Blacklight 5.8 [Adam Wead]
|
|
25
|
-
* Adding select2 name look up to permissions form for GenericFile and Batch. [Carolyn Cole]
|
|
26
|
-
* Adding blacklight gallery default views to catalog controller to match with the new installer.
|
|
27
|
-
* Display file stats for user. Feature #9305 [Valerie Maher]
|
|
28
|
-
* Making sure the modal is actually sorted numerically and allow some files to be on the second p
|
|
29
|
-
* Fixing a bug that the home page crashes when a featured work has been destroyed [Carolyn Cole]
|
|
30
|
-
* Fixes button size and alignment issues with metadata and upload forms, refs #9569 [Michael Tribone]
|
|
31
|
-
* Updated dev notes [Valerie Maher]
|
|
32
|
-
* Disable check all instead of making it disappear. User testing indicated this was confusing [Carolyn Cole]
|
|
33
|
-
* Views should not use the invalid Agent schema.org class [Michael J. Giarlo]
|
|
34
|
-
* README should not implicitly suggest an outdated version of Sufia. (Inspired by #719 -- thx, @mistydemeo!) [Michael J. Giarlo]
|
|
35
|
-
|
|
36
|
-
## 4.3.0 - YANKED
|
|
37
|
-
|
|
38
3
|
## 4.2.0
|
|
39
4
|
|
|
40
5
|
* Caches google analytics data in the database so we do not have to retrieve them each time the page is loaded [Carolyn Cole]
|
|
@@ -207,7 +172,6 @@ This release contains bug fixes and css fixes found after the Sufia 4.0 release.
|
|
|
207
172
|
* changing to bootstrap 3 danger from important to get the red background for permissions, and fixing collection detail spacing when there is no description [Carolyn Cole]
|
|
208
173
|
* Upgrade to rspec 3. Fixes #493 [Carolyn Cole]
|
|
209
174
|
* Removed extraneous colons preceding key names. Fixes #516 [kerchner]
|
|
210
|
-
|
|
211
175
|
## 4.0.0.rc1
|
|
212
176
|
|
|
213
177
|
* Use the bootstrap_form helpers (bootstrap_forms is no longer available) [Justin Coyne]
|
data/LICENSE.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Copyright 2012 Penn State University
|
|
2
|
+
Additional copyright may be held by others, as reflected in the commit history.
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
data/README.md
CHANGED
|
@@ -48,8 +48,7 @@ We'd love to accept your contributions. Please see our guide to [contributing t
|
|
|
48
48
|
1. A SQL RDBMS (MySQL, SQLite)
|
|
49
49
|
1. [Redis](http://redis.io/) key-value store
|
|
50
50
|
1. [ImageMagick](http://www.imagemagick.org/)
|
|
51
|
-
1. Ruby
|
|
52
|
-
2. Rails (*latest 4.1 recommended*)
|
|
51
|
+
1. Ruby
|
|
53
52
|
|
|
54
53
|
#### !! Ensure that you have all of the above components installed before you continue. !!
|
|
55
54
|
|
|
@@ -61,15 +60,12 @@ If you have questions or need help, please email [the Hydra community developmen
|
|
|
61
60
|
|
|
62
61
|
### Generate base Rails install
|
|
63
62
|
|
|
64
|
-
```
|
|
65
|
-
gem install rails -v 4.1.8
|
|
66
|
-
rails new my_app
|
|
67
|
-
```
|
|
63
|
+
```rails new my_app```
|
|
68
64
|
|
|
69
65
|
### Add gems to Gemfile
|
|
70
66
|
|
|
71
67
|
```
|
|
72
|
-
gem 'sufia'
|
|
68
|
+
gem 'sufia'
|
|
73
69
|
gem 'kaminari', github: 'harai/kaminari', branch: 'route_prefix_prototype' # required to handle pagination properly in dashboard. See https://github.com/amatsuda/kaminari/pull/322
|
|
74
70
|
```
|
|
75
71
|
|
|
@@ -236,7 +232,7 @@ configure_blacklight do |config|
|
|
|
236
232
|
|
|
237
233
|
# Specify which field to use in the tag cloud on the homepage.
|
|
238
234
|
# To disable the tag cloud, comment out this line.
|
|
239
|
-
config.tag_cloud_field_name = Solrizer.solr_name("
|
|
235
|
+
config.tag_cloud_field_name = Solrizer.solr_name("tag", :facetable)
|
|
240
236
|
end
|
|
241
237
|
```
|
|
242
238
|
|
data/SUFIA_VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
6.0.0.beta1
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
//= require sufia/trophy
|
|
36
36
|
//= require sufia/featured_works
|
|
37
37
|
//= require sufia/batch_select_all
|
|
38
|
-
//= require sufia/
|
|
38
|
+
//= require sufia/multiForm
|
|
39
39
|
//= require sufia/edit_metadata
|
|
40
40
|
//= require sufia/single_use_link
|
|
41
41
|
//= require sufia/audio
|
|
@@ -82,22 +82,6 @@ function notify_update_link() {
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
Blacklight.onLoad(function() {
|
|
85
|
-
// Multi-value fields on forms
|
|
86
|
-
$('body').on('keypress', '.multi-text-field', function(event) {
|
|
87
|
-
var $activeField = $(event.target).parents('.field-wrapper'),
|
|
88
|
-
$activeFieldControls = $activeField.children('.field-controls'),
|
|
89
|
-
$addControl=$activeFieldControls.children('.add'),
|
|
90
|
-
$removeControl=$activeFieldControls.children('.remove');
|
|
91
|
-
|
|
92
|
-
// If user hits the "Enter" key (keyCode 13), it should add another input for the multi-value field.
|
|
93
|
-
// Unless it's a textarea field (since users might want multi-line input in a textarea).
|
|
94
|
-
if (event.keyCode == 13 && !($activeField.context.type == "textarea")) {
|
|
95
|
-
event.preventDefault();
|
|
96
|
-
$addControl.click()
|
|
97
|
-
$removeControl.click()
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
$('.multi_value.form-group').manage_fields();
|
|
101
85
|
|
|
102
86
|
// set up global batch edit options to override the ones in the gem
|
|
103
87
|
window.batch_edits_options = { checked_label: "",unchecked_label: "",progress_label: "",status_label: "",css_class: "batch_toggle"};
|
|
@@ -3,6 +3,17 @@ function batch_edit_init () {
|
|
|
3
3
|
// initialize popover helpers
|
|
4
4
|
$("a[rel=popover]").popover({ html: true });
|
|
5
5
|
|
|
6
|
+
$("tr.expandable").click(function () {
|
|
7
|
+
$(this).next("ul").slideToggle();
|
|
8
|
+
|
|
9
|
+
$(this).find('i.toggle').toggleClass("glyphicon glyphicon-chevron-down");
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
$("tr.expandable_new").click(function () {
|
|
13
|
+
$(this).find('i').toggleClass("glyphicon glyphicon-chevron-down");
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
function deserialize(Params) {
|
|
7
18
|
var Data = Params.split("&");
|
|
8
19
|
var i = Data.length;
|
|
@@ -105,45 +116,31 @@ function batch_edit_init () {
|
|
|
105
116
|
|
|
106
117
|
ajaxManager.run();
|
|
107
118
|
|
|
108
|
-
function formButtons(form_id) {
|
|
109
|
-
return $('#' + form_id + ' .btn')
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
function formFields(form_id) {
|
|
113
|
-
return $('#' + form_id + ' .form-group > *')
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function formRightPanel(form_id) {
|
|
117
|
-
return $('#' + form_id + ' .form-group')
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
function disableForm(form_id) {
|
|
121
|
-
formButtons(form_id).attr("disabled", "disabled");
|
|
122
|
-
formRightPanel(form_id).addClass("loading");
|
|
123
|
-
formFields(form_id).addClass('invisible')
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
function enableForm(form_id) {
|
|
127
|
-
formButtons(form_id).removeAttr("disabled");
|
|
128
|
-
formRightPanel(form_id).removeClass("loading");
|
|
129
|
-
formFields(form_id).removeClass('invisible')
|
|
130
|
-
}
|
|
131
|
-
|
|
132
119
|
function after_ajax(form_id) {
|
|
133
120
|
var key = form_id.replace("form_", "");
|
|
121
|
+
var save_button = "#" + key + "_save";
|
|
122
|
+
var outer_div = "#detail_" + key;
|
|
134
123
|
$("#status_" + key).html("Changes Saved");
|
|
135
|
-
|
|
124
|
+
$(save_button).removeAttr("disabled");
|
|
125
|
+
$(outer_div).removeClass("loading");
|
|
126
|
+
$('#' + form_id).children([".form-group"]).removeClass('hidden')
|
|
136
127
|
}
|
|
137
128
|
|
|
138
129
|
function before_ajax(form_id) {
|
|
139
|
-
|
|
130
|
+
var key = form_id.replace("form_", "");
|
|
131
|
+
var save_button = "#" + key + "_save";
|
|
132
|
+
var outer_div = "#detail_" + key;
|
|
133
|
+
$(save_button).attr("disabled", "disabled");
|
|
134
|
+
$(outer_div).addClass("loading");
|
|
135
|
+
$('#' + form_id).children([".form-group"]).addClass('hidden')
|
|
140
136
|
}
|
|
141
137
|
|
|
138
|
+
|
|
142
139
|
function runSave(e) {
|
|
143
140
|
e.preventDefault();
|
|
144
141
|
var button = $(this);
|
|
145
|
-
var form = button.
|
|
146
|
-
var form_id = form[0].id
|
|
142
|
+
var form = $(button.parent().parent()[0]);
|
|
143
|
+
var form_id = form[0].id
|
|
147
144
|
before_ajax(form_id);
|
|
148
145
|
|
|
149
146
|
ajaxManager.addReq({
|
|
@@ -165,8 +162,26 @@ function batch_edit_init () {
|
|
|
165
162
|
setTimeout(ajaxManager.runNow(), 100);
|
|
166
163
|
}
|
|
167
164
|
|
|
165
|
+
function enable_show_hide_links() {
|
|
166
|
+
// Show/hide field details when clicking on a link with ID "expand_link_XXX".
|
|
167
|
+
// We expect to find an element named detail_XXX in addition to the expand_link_XXX.
|
|
168
|
+
// The "detail_XXX" element has the chevron icon.
|
|
169
|
+
$('.glyphicon-chevron-right-helper').on('click', function() {
|
|
170
|
+
var array = this.id.split("expand_link_");
|
|
171
|
+
if (array.length > 1) {
|
|
172
|
+
var docId = array[1];
|
|
173
|
+
$("#detail_" + docId + " .expanded-details").slideToggle();
|
|
174
|
+
var button = $("#expand_" + docId);
|
|
175
|
+
button.toggleClass('glyphicon-chevron-right glyphicon-chevron-down');
|
|
176
|
+
}
|
|
177
|
+
return false;
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
|
|
168
181
|
$("#permissions_save").click(runSave);
|
|
169
182
|
$(".field-save").click(runSave);
|
|
183
|
+
enable_show_hide_links();
|
|
184
|
+
|
|
170
185
|
}
|
|
171
186
|
|
|
172
187
|
|
|
@@ -58,8 +58,8 @@ Blacklight.onLoad(function() {
|
|
|
58
58
|
for (var i=0; i < autocomplete_vocab.url_var.length; i++) {
|
|
59
59
|
autocomplete_vocab.field_name.push('generic_file_' + autocomplete_vocab.url_var[i]);
|
|
60
60
|
autocomplete_vocab.add_btn_id.push('additional_' + autocomplete_vocab.url_var[i] + '_submit');
|
|
61
|
-
//
|
|
62
|
-
$("
|
|
61
|
+
// autocompletes
|
|
62
|
+
$("#" + autocomplete_vocab.field_name[i])
|
|
63
63
|
// don't navigate away from the field on tab when selecting an item
|
|
64
64
|
.bind( "keydown", function( event ) {
|
|
65
65
|
if ( event.keyCode === $.ui.keyCode.TAB &&
|
|
@@ -72,20 +72,15 @@ Blacklight.onLoad(function() {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
|
|
75
|
-
function setup_autocomplete(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
// attach auto complete for location
|
|
80
|
-
if (class_name == 'generic_file_based_near') {
|
|
81
|
-
$(event.target).find('input[type=text]').autocomplete(get_autocomplete_opts("location"));
|
|
75
|
+
function setup_autocomplete(obj, cloneElem) {
|
|
76
|
+
// should we attach an auto complete based on the input
|
|
77
|
+
if (obj.id == 'additional_based_near_submit') {
|
|
78
|
+
cloneElem.find('input[type=text]').autocomplete(cities_autocomplete_opts);
|
|
82
79
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
$(event.target).find('input[type=text]').autocomplete(get_autocomplete_opts(autocomplete_vocab.url_var[index]));
|
|
80
|
+
else if ( (index = $.inArray(obj.id, autocomplete_vocab.add_btn_id)) != -1 ) {
|
|
81
|
+
cloneElem.find('input[type=text]').autocomplete(get_autocomplete_opts(autocomplete_vocab.url_var[index]));
|
|
86
82
|
}
|
|
87
83
|
}
|
|
88
84
|
|
|
89
|
-
|
|
90
|
-
$('.multi_value.form-group').manage_fields({ add: setup_autocomplete });
|
|
85
|
+
$('form').multiForm({afterAdd: setup_autocomplete});
|
|
91
86
|
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
(function( $ ){
|
|
2
|
+
|
|
3
|
+
$.fn.multiForm = function( options ) {
|
|
4
|
+
|
|
5
|
+
// Create some defaults, extending them with any options that were provided
|
|
6
|
+
var settings = $.extend( { }, options);
|
|
7
|
+
|
|
8
|
+
function addField() {
|
|
9
|
+
count = $(this).closest('.form-group').find('input').size();
|
|
10
|
+
var cloneId = this.id.replace("submit", "clone");
|
|
11
|
+
var newId = this.id.replace("submit", "elements");
|
|
12
|
+
var cloneElem = $('#'+cloneId).clone();
|
|
13
|
+
// change the add button to a remove button
|
|
14
|
+
var plusbttn = cloneElem.find('#'+this.id);
|
|
15
|
+
var sr_hidden = '<span aria-hidden="true"><i class="glyphicon glyphicon-remove"></i></span>';
|
|
16
|
+
var sr_only = '<span class="sr-only">remove this ' + this.name.replace("_", " ") + '</span>';
|
|
17
|
+
var remove_button = sr_hidden + sr_only;
|
|
18
|
+
plusbttn.html(remove_button);
|
|
19
|
+
plusbttn.on('click',removeField);
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
// remove the help tag on subsequent added fields
|
|
23
|
+
cloneElem.find('.formHelp').remove();
|
|
24
|
+
cloneElem.find('.modal-div').remove();
|
|
25
|
+
|
|
26
|
+
//clear out the value for the element being appended
|
|
27
|
+
//so the new element has a blank value
|
|
28
|
+
// Note: there may be more than one input field. Example:
|
|
29
|
+
// creator_name
|
|
30
|
+
// creator_role
|
|
31
|
+
textFields = cloneElem.find('input[type=text]')
|
|
32
|
+
$.each(textFields, function(n, tf) {
|
|
33
|
+
newName = $(tf).attr('name').replace('[0]', '['+count+']');
|
|
34
|
+
$(tf).attr('name', newName).val('').attr("required", false)
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
if (settings.afterAdd) {
|
|
38
|
+
settings.afterAdd(this, cloneElem)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
$('#'+newId).append(cloneElem);
|
|
42
|
+
cloneElem.find('input[type=text]').focus();
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function removeField () {
|
|
47
|
+
// get parent and remove it
|
|
48
|
+
$(this).closest('.input-group').remove();
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return this.each(function() {
|
|
53
|
+
|
|
54
|
+
// Tooltip plugin code here
|
|
55
|
+
/*
|
|
56
|
+
* adds additional metadata elements
|
|
57
|
+
*/
|
|
58
|
+
$('.adder', this).click(addField);
|
|
59
|
+
|
|
60
|
+
$('.remover', this).click(removeField);
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
};
|
|
66
|
+
})( jQuery );
|
|
67
|
+
|
|
@@ -9,9 +9,33 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
Blacklight.onLoad(function() {
|
|
12
|
+
// input for uids - attach function to verify uid
|
|
13
|
+
$('#new_user_name_skel').on('blur', function() {
|
|
14
|
+
// clear out any existing messages
|
|
15
|
+
$('#directory_user_result').html('');
|
|
16
|
+
var un = $('#new_user_name_skel').val();
|
|
17
|
+
var perm = $('#new_user_permission_skel').val();
|
|
18
|
+
if ( $.trim(un).length == 0 ) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
$.ajax( {
|
|
22
|
+
url: "/directory/user/" + un,
|
|
23
|
+
success: function( data ) {
|
|
24
|
+
if (data != null) {
|
|
25
|
+
if (!data.length) {
|
|
26
|
+
$('#directory_user_result').html('User id ('+un+ ') does not exist.');
|
|
27
|
+
$('#new_user_name_skel').select();
|
|
28
|
+
$('#new_user_permission_skel').val('none');
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
$('#new_user_permission_skel').focus();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
12
37
|
|
|
13
|
-
|
|
14
|
-
$("#new_user_name_skel").userSearch();
|
|
38
|
+
});
|
|
15
39
|
|
|
16
40
|
// add button for new user
|
|
17
41
|
$('#add_new_user_skel').on('click', function() {
|
|
@@ -37,14 +61,14 @@ Blacklight.onLoad(function() {
|
|
|
37
61
|
$('#permissions_error').html();
|
|
38
62
|
$('#permissions_error').addClass('hidden');
|
|
39
63
|
|
|
40
|
-
var
|
|
41
|
-
var
|
|
42
|
-
var
|
|
64
|
+
var user_name = $('#new_user_name_skel').val();
|
|
65
|
+
var access = $('#new_user_permission_skel').val();
|
|
66
|
+
var access_label = $('#new_user_permission_skel :selected').text();
|
|
43
67
|
// clear out the elements to add more
|
|
44
68
|
$('#new_user_name_skel').val('');
|
|
45
69
|
$('#new_user_permission_skel').val('none');
|
|
46
70
|
|
|
47
|
-
addPerm(
|
|
71
|
+
addPerm(user_name, access, access_label, 'user');
|
|
48
72
|
return false;
|
|
49
73
|
});
|
|
50
74
|
|
|
@@ -54,9 +78,9 @@ Blacklight.onLoad(function() {
|
|
|
54
78
|
$('#new_group_name_skel').focus();
|
|
55
79
|
return false;
|
|
56
80
|
}
|
|
57
|
-
var
|
|
58
|
-
var
|
|
59
|
-
var
|
|
81
|
+
var group_name = $('#new_group_name_skel').val();
|
|
82
|
+
var access = $('#new_group_permission_skel').val();
|
|
83
|
+
var access_label = $('#new_group_permission_skel :selected').text();
|
|
60
84
|
|
|
61
85
|
if (!is_permission_duplicate($('#new_group_name_skel').val())) {
|
|
62
86
|
$('#permissions_error_text').html("This group already has a permission.");
|
|
@@ -70,7 +94,7 @@ Blacklight.onLoad(function() {
|
|
|
70
94
|
$('#new_group_name_skel').val('');
|
|
71
95
|
$('#new_group_permission_skel').val('none');
|
|
72
96
|
|
|
73
|
-
addPerm(
|
|
97
|
+
addPerm(group_name, access, access_label, 'group');
|
|
74
98
|
return false;
|
|
75
99
|
});
|
|
76
100
|
|
|
@@ -87,50 +111,84 @@ Blacklight.onLoad(function() {
|
|
|
87
111
|
|
|
88
112
|
});
|
|
89
113
|
|
|
90
|
-
function addPerm(
|
|
114
|
+
function addPerm(agent_name, access, access_label, agent_type)
|
|
91
115
|
{
|
|
116
|
+
showPermissionNote();
|
|
117
|
+
|
|
118
|
+
var tr = createPermissionRow(agent_name, access_label);
|
|
119
|
+
addHiddenPermField(tr, agent_type, agent_name, access);
|
|
120
|
+
$('#file_permissions').after(tr);
|
|
121
|
+
tr.effect("highlight", {}, 3000);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function createPermissionRow(agent_name, access_label) {
|
|
92
125
|
var tr = $(document.createElement('tr'));
|
|
93
126
|
var td1 = $(document.createElement('td'));
|
|
94
127
|
var td2 = $(document.createElement('td'));
|
|
95
|
-
var
|
|
96
|
-
|
|
97
|
-
$('#save_perm_note').removeClass('hidden');
|
|
128
|
+
var remove_button = $('<button class="btn close">X</button>');
|
|
98
129
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
td2.html(perm);
|
|
104
|
-
td2.append(remove);
|
|
105
|
-
remove.click(function () {
|
|
130
|
+
td1.html('<label class="control-label">' + agent_name + '</label>');
|
|
131
|
+
td2.html(access_label);
|
|
132
|
+
td2.append(remove_button);
|
|
133
|
+
remove_button.click(function () {
|
|
106
134
|
tr.remove();
|
|
107
135
|
});
|
|
108
136
|
|
|
137
|
+
return tr.append(td1).append(td2);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function addHiddenPermField(element, type, name, access) {
|
|
141
|
+
var prefix = 'generic_file[permissions_attributes][' + nextIndex() + ']';
|
|
109
142
|
$('<input>').attr({
|
|
110
143
|
type: 'hidden',
|
|
111
|
-
name:
|
|
112
|
-
value:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
144
|
+
name: prefix + '[type]',
|
|
145
|
+
value: type
|
|
146
|
+
}).appendTo(element);
|
|
147
|
+
$('<input>').attr({
|
|
148
|
+
type: 'hidden',
|
|
149
|
+
name: prefix + '[name]',
|
|
150
|
+
value: name
|
|
151
|
+
}).appendTo(element);
|
|
152
|
+
$('<input>').attr({
|
|
153
|
+
type: 'hidden',
|
|
154
|
+
name: prefix + '[access]',
|
|
155
|
+
value: access
|
|
156
|
+
}).appendTo(element);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function nextIndex() {
|
|
160
|
+
return $('#file_permissions').parent().children().size() - 1;
|
|
118
161
|
}
|
|
119
162
|
|
|
120
163
|
$('.remove_perm').on('click', function() {
|
|
121
164
|
var top = $(this).parent().parent();
|
|
122
165
|
top.addClass('hidden'); // do not show the block
|
|
123
|
-
top
|
|
124
|
-
|
|
166
|
+
addDestroyField(top);
|
|
167
|
+
showPermissionNote();
|
|
125
168
|
return false;
|
|
126
|
-
|
|
127
169
|
});
|
|
128
170
|
|
|
171
|
+
function showPermissionNote() {
|
|
172
|
+
$('#save_perm_note').removeClass('hidden');
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function addDestroyField(element) {
|
|
176
|
+
$('<input>').attr({
|
|
177
|
+
type: 'hidden',
|
|
178
|
+
name: 'generic_file[permissions_attributes][' + indexOf(element) + '][_destroy]',
|
|
179
|
+
value: 'true'
|
|
180
|
+
}).appendTo(element);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function indexOf(element) {
|
|
184
|
+
return $('#file_permissions').parent().children().index(element) - 1;
|
|
185
|
+
}
|
|
186
|
+
|
|
129
187
|
});
|
|
130
188
|
|
|
131
189
|
// return the files visibility level (institution, open, restricted);
|
|
132
|
-
function get_visibility(){
|
|
133
|
-
return $("input[name='visibility']:checked").val()
|
|
190
|
+
function get_visibility() {
|
|
191
|
+
return $("input[name='visibility']:checked").val();
|
|
134
192
|
}
|
|
135
193
|
|
|
136
194
|
/*
|
|
@@ -138,8 +196,7 @@ function get_visibility(){
|
|
|
138
196
|
* set other users/groups to 'read' (it would be over ruled by the
|
|
139
197
|
* visibility of Open or Institution) so disable the Read option
|
|
140
198
|
*/
|
|
141
|
-
function set_access_levels()
|
|
142
|
-
{
|
|
199
|
+
function set_access_levels() {
|
|
143
200
|
var vis = get_visibility();
|
|
144
201
|
var enabled_disabled = false;
|
|
145
202
|
if (vis == "open" || vis == "psu") {
|