sufia 6.3.0 → 6.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -2
  3. data/.rubocop.yml +10 -0
  4. data/Gemfile +16 -7
  5. data/History.md +43 -0
  6. data/README.md +26 -19
  7. data/SUFIA_VERSION +1 -1
  8. data/app/assets/javascripts/notifications_check.js.erb +46 -0
  9. data/app/assets/javascripts/sufia.js +1 -2
  10. data/app/assets/javascripts/sufia/uploader.js +3 -3
  11. data/app/assets/stylesheets/sufia/_collections.scss +5 -0
  12. data/app/assets/stylesheets/sufia/_dashboard.scss +6 -1
  13. data/app/assets/stylesheets/sufia/_file-listing.scss +44 -6
  14. data/app/assets/stylesheets/sufia/_file-show.scss +4 -0
  15. data/app/assets/stylesheets/sufia/_settings.scss +3 -0
  16. data/app/controllers/api/items_controller.rb +7 -3
  17. data/app/controllers/concerns/sufia/admin/depositor_stats.rb +1 -1
  18. data/app/controllers/concerns/sufia/admin/stats_behavior.rb +6 -76
  19. data/app/controllers/concerns/sufia/batch_controller_behavior.rb +10 -2
  20. data/app/controllers/concerns/sufia/contact_form_controller_behavior.rb +1 -0
  21. data/app/controllers/concerns/sufia/files_controller_behavior.rb +11 -1
  22. data/app/controllers/concerns/sufia/homepage_controller.rb +1 -1
  23. data/app/controllers/concerns/sufia/my_controller_behavior.rb +2 -0
  24. data/app/controllers/concerns/sufia/users_controller_behavior.rb +2 -2
  25. data/app/helpers/generic_file_helper.rb +8 -5
  26. data/app/jobs/content_delete_event_job.rb +16 -11
  27. data/app/jobs/content_deposit_event_job.rb +4 -16
  28. data/app/jobs/content_depositor_change_event_job.rb +32 -20
  29. data/app/jobs/content_event_job.rb +39 -0
  30. data/app/jobs/content_new_version_event_job.rb +4 -16
  31. data/app/jobs/content_restored_version_event_job.rb +6 -19
  32. data/app/jobs/content_update_event_job.rb +4 -16
  33. data/app/jobs/event_job.rb +48 -4
  34. data/app/jobs/user_edit_profile_event_job.rb +4 -17
  35. data/app/jobs/user_follow_event_job.rb +10 -12
  36. data/app/jobs/user_unfollow_event_job.rb +10 -15
  37. data/app/models/concerns/sufia/solr_document_behavior.rb +11 -1
  38. data/app/models/system_stats.rb +108 -0
  39. data/app/presenters/sufia/admin_stats_presenter.rb +49 -0
  40. data/app/views/_controls.html.erb +1 -1
  41. data/app/views/_footer.html.erb +1 -1
  42. data/app/views/_logo.html.erb +1 -3
  43. data/app/views/admin/stats/_date_form.html.erb +8 -0
  44. data/app/views/admin/stats/_deposits.html.erb +2 -10
  45. data/app/views/admin/stats/_files.html.erb +6 -14
  46. data/app/views/admin/stats/_new_users.html.erb +7 -14
  47. data/app/views/admin/stats/_stats_by_date.html.erb +8 -0
  48. data/app/views/admin/stats/_top_data.html.erb +24 -0
  49. data/app/views/admin/stats/index.html.erb +5 -31
  50. data/app/views/collections/_form_for_select_collection.html.erb +5 -4
  51. data/app/views/collections/_show_actions.html.erb +7 -2
  52. data/app/views/collections/_show_document_list_row.html.erb +1 -9
  53. data/app/views/generic_files/_browse_everything.html.erb +3 -0
  54. data/app/views/generic_files/_descriptions.html.erb +1 -1
  55. data/app/views/generic_files/_generic_file.html.erb +1 -1
  56. data/app/views/generic_files/_local_file_import.html.erb +3 -0
  57. data/app/views/generic_files/_show_actions.html.erb +4 -0
  58. data/app/views/generic_files/upload/_form.html.erb +3 -0
  59. data/app/views/generic_files/upload/_to_collection.html.erb +5 -0
  60. data/app/views/homepage/_recent_document.html.erb +1 -7
  61. data/app/views/my/_index_partials/_default_group.html.erb +1 -1
  62. data/app/views/my/_index_partials/_list_collections.html.erb +3 -10
  63. data/app/views/my/_index_partials/_list_files.html.erb +13 -22
  64. data/app/views/my/_sort_and_per_page.html.erb +3 -3
  65. data/app/views/records/edit_fields/_rights.html.erb +2 -1
  66. data/app/views/static/terms.html.erb +1 -1
  67. data/config/locales/sufia.en.yml +13 -0
  68. data/lib/generators/sufia/templates/catalog_controller.rb +2 -2
  69. data/lib/sufia/version.rb +1 -1
  70. data/spec/actors/generic_file/actor_spec.rb +35 -0
  71. data/spec/controllers/admin_stats_controller_spec.rb +53 -23
  72. data/spec/controllers/api/items_controller_spec.rb +47 -41
  73. data/spec/controllers/batch_controller_spec.rb +1 -0
  74. data/spec/controllers/generic_files_controller_spec.rb +35 -1
  75. data/spec/controllers/my/files_controller_spec.rb +5 -0
  76. data/spec/factories/generic_files.rb +3 -0
  77. data/spec/features/collection_spec.rb +91 -0
  78. data/spec/features/contact_form_spec.rb +1 -0
  79. data/spec/forms/collection_edit_form_spec.rb +3 -3
  80. data/spec/forms/generic_file_edit_form_spec.rb +1 -1
  81. data/spec/jobs/create_derivatives_job_spec.rb +6 -0
  82. data/spec/models/file_content_datastream_spec.rb +1 -1
  83. data/spec/models/file_download_stat_spec.rb +4 -4
  84. data/spec/models/file_usage_spec.rb +2 -2
  85. data/spec/models/file_view_stat_spec.rb +4 -4
  86. data/spec/models/generic_file_spec.rb +15 -3
  87. data/spec/models/geo_names_resource_spec.rb +10 -0
  88. data/spec/models/solr_document_spec.rb +28 -0
  89. data/spec/models/system_stats_spec.rb +184 -0
  90. data/spec/models/user_spec.rb +1 -1
  91. data/spec/models/user_usage_stats_spec.rb +1 -1
  92. data/spec/services/generic_file_csv_service_spec.rb +66 -0
  93. data/spec/services/generic_file_indexing_service_spec.rb +35 -0
  94. data/spec/services/lock_manager_spec.rb +12 -0
  95. data/spec/spec_helper.rb +2 -1
  96. data/spec/views/admin/stats/index.html.erb_spec.rb +11 -10
  97. data/spec/views/catalog/sort_and_per_page.html.erb_spec.rb +1 -1
  98. data/spec/views/collections/_form_for_select_collection.html.erb_spec.rb +51 -0
  99. data/spec/views/generic_file/_browse_everything.html.erb_spec.rb +4 -0
  100. data/spec/views/generic_file/edit.html.erb_spec.rb +31 -24
  101. data/spec/views/generic_file/new.html.erb_spec.rb +70 -0
  102. data/spec/views/generic_file/show.html.erb_spec.rb +23 -0
  103. data/sufia.gemspec +3 -2
  104. data/tasks/sufia-dev.rake +2 -0
  105. metadata +42 -9
  106. data/lib/sufia/role_mapper.rb +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e188410a3abce213d0a71c5d20f29852e272845a
4
- data.tar.gz: 83e3218b65097ce2757367f6864f13e0fc3293b3
3
+ metadata.gz: 8d8a1fa7fdbec5a9eaa73924bdb9c7adf05d4719
4
+ data.tar.gz: d557d8cd73484d6fd5ea8f15e167073bb02bb668
5
5
  SHA512:
6
- metadata.gz: 6f0b3722d9e23c720e42d8f2cf9856984e2b7d6408484effce030256dd97314193c7f7b2fcbfbd9bb01c4b1c61f4d141ab80de6c9960f7b6c5b7be846a31abe2
7
- data.tar.gz: fb33d7ec4280f2fc544b9d43599aeaa3671d1ac92b1e208ea2d39bf4b82aa0d97df80c91c2a46a2415e7d367d310d4a85152a1ad704f1db4332cf6fdb2d833de
6
+ metadata.gz: 001e60eba3c4768f171c4ae0d1771c1bba5d2fa9deac895d107ca6a0fa85b7cbb1e084e6fee1e21fd976da8b7f853b3ba2f8bee29ab49482298c94f77cc09766
7
+ data.tar.gz: e0f21e08e467500f4c9fa2579e14004abd2964ebc3b403651cf27c9141cd18080e1d6f2c7fa407aa18daaaeccbd8323937ecee27e97664e9edadfbd9c9acf8d7
data/.gitignore CHANGED
@@ -49,6 +49,7 @@ pkg/
49
49
  spec/dummy/db/*.sqlite3
50
50
  spec/dummy/log/*.log
51
51
  spec/dummy/tmp/
52
+ .internal_test_app/**/*
52
53
 
53
54
  spec/mock_upload_directory
54
55
 
@@ -97,5 +98,3 @@ public/system/
97
98
 
98
99
  ## Sitemap
99
100
  public/sitemap.xml
100
-
101
- ./spec/internal
data/.rubocop.yml CHANGED
@@ -40,6 +40,7 @@ Metrics/ClassLength:
40
40
  - 'lib/generators/sufia/templates/catalog_controller.rb'
41
41
  - 'sufia-models/app/models/datastreams/fits_datastream.rb'
42
42
  - 'sufia-models/app/actors/sufia/generic_file/actor.rb'
43
+ - 'sufia-models/lib/generators/sufia/models/install_generator.rb'
43
44
 
44
45
  Metrics/ModuleLength:
45
46
  Exclude:
@@ -129,6 +130,15 @@ Rails/Date:
129
130
  Rails/TimeZone:
130
131
  Enabled: false
131
132
 
133
+ RSpec/ExampleWording:
134
+ CustomTransform:
135
+ be: is
136
+ have: has
137
+ not: does not
138
+ NOT: does NOT
139
+ IgnoredWords:
140
+ - only
141
+
132
142
  RSpec/FilePath:
133
143
  Enabled: false
134
144
 
data/Gemfile CHANGED
@@ -16,17 +16,26 @@ group :development, :test do
16
16
  gem 'rubocop-rspec', require: false
17
17
  end
18
18
 
19
- file = File.expand_path("Gemfile", ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path("../spec/internal", __FILE__))
19
+ # BEGIN ENGINE_CART BLOCK
20
+ # engine_cart: 0.8.0
21
+ # engine_cart stanza: 0.8.0
22
+ # the below comes from engine_cart, a gem used to test this Rails engine gem in the context of a Rails app.
23
+ file = File.expand_path("Gemfile", ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path(".internal_test_app", File.dirname(__FILE__)))
20
24
  if File.exists?(file)
21
- puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v`
22
- instance_eval File.read(file)
25
+ begin
26
+ eval_gemfile file
27
+ rescue Bundler::GemfileError => e
28
+ Bundler.ui.warn '[EngineCart] Skipping Rails application dependencies:'
29
+ Bundler.ui.warn e.message
30
+ end
23
31
  else
32
+ Bundler.ui.warn "[EngineCart] Unable to find test application dependencies in #{file}, using placeholder dependencies"
24
33
  gem 'rails', ENV['RAILS_VERSION'] if ENV['RAILS_VERSION']
25
-
26
- if ENV['RAILS_VERSION'] and ENV['RAILS_VERSION'] !~ /^4.2/
27
- gem 'sass-rails', "< 5.0"
28
- else
34
+ if ENV['RAILS_VERSION'].nil? || ENV['RAILS_VERSION'] =~ /^4.2/
29
35
  gem 'responders', "~> 2.0"
30
36
  gem 'sass-rails', ">= 5.0"
37
+ else
38
+ gem 'sass-rails', "< 5.0"
31
39
  end
32
40
  end
41
+ # END ENGINE_CART BLOCK
data/History.md CHANGED
@@ -1,5 +1,48 @@
1
1
  # History of Sufia releases
2
2
 
3
+ ## 6.4.0
4
+
5
+ * Remove deprecation warnings [Adam Wead]
6
+ * Update History.md [Michael J. Giarlo]
7
+ * Make geonames username configurable. Closes #1336 [Tonmoy Roy]
8
+ * Install generator should not call generators that duplicate default config values. Fixes #1347 [Michael J. Giarlo]
9
+ * lock collection when uploading files to a collection [E. Lynette Rayle]
10
+ * Pin engine_cart to 0.8 [Justin Coyne]
11
+ * Updates for latest version of rubocop [Justin Coyne]
12
+ * Rubocop fix for Rails/PluralizationGrammar from Hydra Sufia master [mtribone]
13
+ * Fixes the link being wider than the image if the browser window is expanded. In order to just have the link wrap the intrinsic value of the image, switch img-responsive to inline block [mtribone]
14
+ * Linked Project Hydra to projecthydra.org [Dan Kerchner]
15
+ * Refactor BatchUpdateJob and allow overrides [Adam Wead]
16
+ * Updating engine_cart to 0.8.0 [Adam Wead]
17
+ * Refactoring event jobs to remove the continuos copying of code. The base class existed, but had little code. Instead the code was copied from one job to the new one. In addition there seemed to be two types of events, one with a user, and one with a user and a file, so I created a second base class to allow for the two types. [Carolyn Cole]
18
+ * Update the TOC in the README [Michael J. Giarlo]
19
+ * Update background worker documentation in the README [Michael J. Giarlo]
20
+ * Document how to use resque-pool effectively with Sufia. [Nathan Rogers]
21
+ * Pinning to Fedora 4.4 [Adam Wead]
22
+ * Disentangle shared state and fix issue that was revealed by different AF::Base#where behavior in latest AF. [Adam Wead]
23
+ * Clarify Fedora and Solr versions (broadly) in README [Michael J. Giarlo]
24
+ * Allow override of BatchController with customized BatchUpdateJob [Adam Wead]
25
+ * changed overflow behavior for My Files list to make the dropdown stay visible and play nice with firefox, fixes #1291 [studiozut]
26
+ * Correct my prior update to the changelog [Michael J. Giarlo]
27
+ * Update changelog w/ work going into the next 6.x release [Michael J. Giarlo]
28
+ * Split out generator for use during upgrade [Anna Headley]
29
+ * Configure mini_magick to use posix_spawn instead of open3. [Anna Headley]
30
+ * Use the render_visibility_* helpers where possible [Randy Coulman]
31
+ * Use the Rails path helper for the contact form [Randy Coulman]
32
+ * Use sufia.root_path instead of root_path [Randy Coulman]
33
+ * Reformatting the statistics page to only have one date filter form currently there are 3 forms which are entirely independent and the data on the page is only partially filtered. [Carolyn Cole]
34
+ * Adding csv generation service to create csv formatted GenericFiles [Carolyn Cole]
35
+ * Moving admin statistics logic out of the controller. Specifically leaving the admin stats test alone to prove I did not break the original code [Carolyn Cole]
36
+ * upload files into a collection starting from its show page [E. Lynette Rayle]
37
+ * The Arkivo service sends JSON data in the body of the request, not in the params. [Michael J. Giarlo]
38
+ * Add ability to upload to collection during Batch Upload [E. Lynette Rayle]
39
+ * Allows the developer to configure the frequency of the messages pinging the server to check for user notifications. [Hector Correa]
40
+ * Changed input type to select_with_modal_help to match field on batch edit page - and also render rights_modal [kerchner]
41
+ * Increased font size and removed bold type for better legibility and accessibility [mtribone]
42
+ * Reset contact form on success, fixes #1302 [Adam Wead]
43
+ * Pin to hydra-jetty 8.4.0 until projecthydra/active_fedora#883 is sorted out. [Michael J. Giarlo]
44
+ * Fix styling of the Sort/Per-page Bar in Dashboard Probably broken by f50788613ef2a217457cddb2b6da64db833bd563 [Piotr Hebal]
45
+
3
46
  ## 6.3.0
4
47
 
5
48
  * Fix problems with single use download links. [Olli Lyytinen]
data/README.md CHANGED
@@ -4,6 +4,7 @@
4
4
  [![Build Status](https://travis-ci.org/projecthydra/sufia.png?branch=master)](https://travis-ci.org/projecthydra/sufia)
5
5
  [![Dependency Status](https://gemnasium.com/projecthydra/sufia.png)](https://gemnasium.com/projecthydra/sufia)
6
6
  [![Coverage Status](https://coveralls.io/repos/projecthydra/sufia/badge.svg)](https://coveralls.io/r/projecthydra/sufia)
7
+ [![Documentation Status](http://inch-ci.org/github/projecthydra/sufia.svg?branch=master)](http://inch-ci.org/github/projecthydra/sufia)
7
8
  [![Code Climate](https://codeclimate.com/github/projecthydra/sufia/badges/gpa.svg)](https://codeclimate.com/github/projecthydra/sufia)
8
9
  [![Apache 2.0 License](http://img.shields.io/badge/APACHE2-license-blue.svg)](./LICENSE)
9
10
  [![Contribution Guidelines](http://img.shields.io/badge/CONTRIBUTING-Guidelines-blue.svg)](./CONTRIBUTING.md)
@@ -26,6 +27,7 @@
26
27
  * [Database tables and indexes](#database-tables-and-indexes)
27
28
  * [Solr and Fedora](#solr-and-fedora)
28
29
  * [Start background workers](#start-background-workers)
30
+ * [Monitor background workers](#monitor-background-workers)
29
31
  * [Audiovisual transcoding](#audiovisual-transcoding)
30
32
  * [User interface](#user-interface)
31
33
  * [Integration with Dropbox, Box, etc.](#integration-with-dropbox-box-etc)
@@ -35,7 +37,6 @@
35
37
  * [Zotero integration](#zotero-integration)
36
38
  * [Tag Cloud](#tag-cloud)
37
39
  * [Customizing metadata](#customizing-metadata)
38
- * [Proxies and Transfers (Sufia 4.x only)](#proxies-and-transfers-sufia-4x-only)
39
40
  * [Admin Users](#admin-users)
40
41
  * [One time setup for first admin](#one-time-setup-for-first-admin)
41
42
  * [Adding an admin user](#adding-an-admin-user)
@@ -89,7 +90,7 @@ If you have questions or need help, please email [the Hydra community tech list]
89
90
  # Creating a Sufia-based app
90
91
 
91
92
  This document contains instructions specific to setting up an app with __Sufia
92
- v6.3.0__. If you are looking for instructions on installing a different
93
+ v6.4.0__. If you are looking for instructions on installing a different
93
94
  version, be sure to select the appropriate branch or tag from the drop-down
94
95
  menu above.
95
96
 
@@ -97,24 +98,26 @@ menu above.
97
98
 
98
99
  Sufia requires the following software to work:
99
100
 
100
- 1. Solr
101
- 1. [Fedora Commons](http://www.fedora-commons.org/) digital repository
101
+ 1. Solr (tested with Solr 4.x)
102
+ 1. [Fedora 4](http://www.fedora-commons.org/) repository
102
103
  1. A SQL RDBMS (MySQL, PostgreSQL), though **note** that SQLite will be used by default if you're looking to get up and running quickly
103
104
  1. [Redis](http://redis.io/) key-value store
104
105
  1. [ImageMagick](http://www.imagemagick.org/)
105
- 1. [FITS](#characterization)
106
+ 1. [FITS 0.6.2](#characterization)
106
107
 
107
108
  **NOTE: If you do not already have Solr and Fedora instances you can use in your development environment, you may use hydra-jetty (instructions are provided below to get you up and running quickly and with minimal hassle).**
108
109
 
109
110
  ### Characterization
110
111
 
111
- 1. Go to http://projects.iq.harvard.edu/fits/downloads and download a copy of FITS & unpack it somewhere on your machine. You can also install FITS on OSX with homebrew `brew install fits` (you may also have to create a symlink from `fits.sh -> fits` in the next step).
112
+ 1. Go to http://projects.iq.harvard.edu/fits/downloads and download a copy of FITS 0.6.2 & unpack it somewhere on your machine. You can also install FITS on OSX with homebrew `brew install fits` (you may also have to create a symlink from `fits.sh -> fits` in the next step).
112
113
  1. Mark fits.sh as executable (`chmod a+x fits.sh`)
113
114
  1. Run "fits.sh -h" from the command line and see a help message to ensure FITS is properly installed
114
115
  1. Give your Sufia app access to FITS by:
115
116
  1. Adding the full fits.sh path to your PATH (e.g., in your .bash_profile), **OR**
116
117
  1. Changing `config/initializers/sufia.rb` to point to your FITS location: `config.fits_path = "/<your full path>/fits.sh"`
117
118
 
119
+ **NOTE: Sufia is not compatible with later versions of Fits, so be sure you are using the latest 0.6.x version.**
120
+
118
121
  ## Environments
119
122
 
120
123
  Note here that the following commands assume you're setting up Sufia in a development environment (using the Rails built-in development environment). If you're setting up a production or production-like environment, you may wish to tell Rails that by prepending `RAILS_ENV=production` to the commands that follow, e.g., `rails`, `rake`, `bundle`, and so on.
@@ -139,7 +142,7 @@ rails new my_app
139
142
  Add the following lines to your application's Gemfile.
140
143
 
141
144
  ```
142
- gem 'sufia', '6.3.0'
145
+ gem 'sufia', '6.4.0'
143
146
  gem 'kaminari', github: 'jcoyne/kaminari', branch: 'sufia' # required to handle pagination properly in dashboard. See https://github.com/amatsuda/kaminari/pull/322
144
147
  ```
145
148
 
@@ -168,7 +171,7 @@ rake db:migrate
168
171
 
169
172
  ## Solr and Fedora
170
173
 
171
- If you already have instances of Solr and Fedora that you would like to use, you may skip this step. Otherwise feel free to use [hydra-jetty](https://github.com/projecthydra/hydra-jetty), the bundled copy of Jetty, a Java servlet container that is configured to run versions of Solr and Fedora that are known to work with Sufia. Hydra-jetty (since v8.4.0) requires Java 8.
174
+ If you already have instances of Solr and Fedora 4 that you would like to use, you may skip this step. Otherwise feel free to use [hydra-jetty](https://github.com/projecthydra/hydra-jetty), the bundled copy of Jetty, a Java servlet container that is configured to run versions of Solr and Fedora that are known to work with Sufia. Hydra-jetty (since v8.4.0) requires Java 8.
172
175
 
173
176
  The following rake tasks will install hydra-jetty and start up Jetty with Solr and Fedora.
174
177
 
@@ -180,23 +183,31 @@ rake jetty:start
180
183
 
181
184
  ## Start background workers
182
185
 
183
- Sufia uses a queuing system named Resque to manage long-running or slow processes. Resque relies on the [redis](http://redis.io/) key-value store, so [redis](http://redis.io/) must be installed *and running* on your system in order for background workers to pick up jobs.
186
+ Sufia uses a queuing system named Resque to manage long-running or slow processes. Resque relies on the [Redis](http://redis.io/) key-value store, so [Redis](http://redis.io/) must be installed *and running* on your system in order for background workers to pick up jobs.
184
187
 
185
- Unless redis has already been started, you will want to start it up. You can do this either by calling the `redis-server` command, or if you're on certain Linuxes, you can do this via `sudo service redis-server start`.
188
+ Unless Redis has already been started, you will want to start it up. You can do this either by calling the `redis-server` command, or if you're on certain Linuxes, you can do this via `sudo service redis-server start`.
186
189
 
187
- Next you will need to spawn Resque's workers. The following command will run until you stop it, so you may want to do this in a dedicated terminal.
190
+ Next you will need to start up the Resque workers provided by Sufia. The following command will run until you stop it, so you may want to do this in a dedicated terminal.
188
191
 
189
192
  ```
190
- QUEUE=* rake environment resque:work
193
+ RUN_AT_EXIT_HOOKS=true TERM_CHILD=1 QUEUE=* rake environment resque:work
191
194
  ```
192
195
 
193
- Or, if you prefer (e.g., in production-like environments), you may want to set up a `config/resque-pool.yml` -- [here is a simple example](https://github.com/projecthydra/sufia/blob/master/sufia-models/lib/generators/sufia/models/templates/config/resque-pool.yml) -- and run resque-pool which will manage your background workers in a dedicated process.
196
+ Or, if you prefer (e.g., in production-like environments), you may want to set up a `config/resque-pool.yml` file -- [here is a simple example](https://github.com/projecthydra/sufia/blob/master/sufia-models/lib/generators/sufia/models/templates/config/resque-pool.yml) -- and run `resque-pool` (at the root of your rails app) which will manage your background workers in a dedicated process.
194
197
 
195
198
  ```
196
- resque-pool --daemon --environment development start
199
+ RUN_AT_EXIT_HOOKS=true TERM_CHILD=1 bundle exec resque-pool --daemon --environment development start
197
200
  ```
198
201
 
199
- See https://github.com/defunkt/resque for more options. If you do wind up using resque-pool, you might also be interested in a shell script to help manage it. [Here is an example](https://github.com/psu-stewardship/scholarsphere/blob/develop/script/restart_resque.sh) which you can adapt for your needs.
202
+ Occasionally, Resque may not give background jobs a chance to clean up temporary files. The `RUN_AT_EXIT_HOOKS` variable allows Resque to do so. The `TERM_CHILD` variable allows workers to terminate gracefully rather than interrupting currently running workers. For more information on the signals that Resque responds to, see the [resque-pool documentation](https://github.com/nevans/resque-pool#signals).
203
+
204
+ See https://github.com/defunkt/resque for more options. If you use resque-pool, you may also be interested in a shell script to help manage it. [Here is an example](https://github.com/psu-stewardship/scholarsphere/blob/develop/script/restart_resque.sh) which you can adapt for your own needs.
205
+
206
+ ## Monitor background workers
207
+
208
+ Edit config/initializers/resque_admin.rb so that ResqueAdmin#matches? returns a true value for the user/s who should be able to access this page. One fast way to do this is to return current_user.admin? and add an admin? method to your user model which checks for specific emails.
209
+
210
+ Then you can view jobs at the admin/queues route.
200
211
 
201
212
  ## Audiovisual transcoding
202
213
 
@@ -335,10 +346,6 @@ The contents of the cloud are retrieved as JSON from Blacklight's CatalogControl
335
346
 
336
347
  Chances are you will want to customize the default metadata provided by Sufia. Here's [a guide](https://github.com/projecthydra/sufia/wiki/Customizing-Metadata) to help you with that
337
348
 
338
- ## Proxies and Transfers (Sufia 4.x only)
339
-
340
- To add proxies and transfers to your **Sufia 4**-based app, run the 'sufia:models:proxies' generator and then run 'rake db:migrate'. If you're already running Sufia 5 or 6, this is already added and you may skip this step.
341
-
342
349
  ## Admin Users
343
350
 
344
351
  ### One time setup for first admin
data/SUFIA_VERSION CHANGED
@@ -1 +1 @@
1
- 6.3.0
1
+ 6.4.0
@@ -0,0 +1,46 @@
1
+ Blacklight.onLoad(function() {
2
+
3
+ <% if Rails.env.development? %>
4
+
5
+ // During development allow the frequency of the notifications check to
6
+ // be overwritten via query string parameter notification_seconds to
7
+ // prevent cluttering the terminal with (mostly) meaninless messages.
8
+ function queryStringParam(key) {
9
+ var queryString, pairs, i;
10
+ var value = null;
11
+ try {
12
+ queryString = document.location.search.substring(1);
13
+ if (queryString === "") {
14
+ return value; // nothing to do
15
+ }
16
+ pairs = queryString.split("&").map(function(el) {
17
+ var pair = el.split("=");
18
+ return {key: pair[0], value: pair[1]};
19
+ });
20
+ for(i = 0; i < pairs.length; i++) {
21
+ if (pairs[i].key === key) {
22
+ value = pairs[i].value;
23
+ break;
24
+ }
25
+ };
26
+ }
27
+ catch(e) {
28
+ // assume it's a malformed query string.
29
+ value = null;
30
+ }
31
+ return value;
32
+ }
33
+
34
+ function getIntervalSeconds() {
35
+ var seconds = parseInt(queryStringParam("notification_seconds"));
36
+ return seconds || 30;
37
+ }
38
+
39
+ setInterval(notify_update_link, getIntervalSeconds() * 1000);
40
+
41
+ <% else %>
42
+
43
+ setInterval(notify_update_link, 30 * 1000);
44
+
45
+ <% end %>
46
+ });
@@ -28,6 +28,7 @@
28
28
 
29
29
  //= require batch_edit
30
30
  //= require terms_of_service
31
+ //= require notifications_check
31
32
  //
32
33
  //= require sufia/app
33
34
  //= require sufia/fileupload
@@ -87,8 +88,6 @@ Blacklight.onLoad(function() {
87
88
  // set up global batch edit options to override the ones in the gem
88
89
  window.batch_edits_options = { checked_label: "",unchecked_label: "",progress_label: "",status_label: "",css_class: "batch_toggle"};
89
90
 
90
- setInterval(notify_update_link, 30*1000);
91
-
92
91
  // bootstrap alerts are closed this function
93
92
  $(document).on('click', '.alert .close' , function(){
94
93
  $(this).parent().hide();
@@ -59,6 +59,7 @@ var filestoupload =0;
59
59
  $($('#fileupload .files .cancel button')[data.context[0].rowIndex]).click();
60
60
  }
61
61
  var total_sz = parseInt($('#total_upload_size').val()) + data.files[0].size;
62
+ $('#total_upload_size').val( total_sz );
62
63
  // is file size too big
63
64
  if (data.files[0].size > max_file_size) {
64
65
  $($('#fileupload .files .cancel button')[data.context[0].rowIndex]).click();
@@ -69,6 +70,8 @@ var filestoupload =0;
69
70
  else if( total_sz > max_total_file_size) {
70
71
  if (first_file_after_max == '') first_file_after_max = data.files[0].name;
71
72
  $($('#fileupload .files .cancel button')[data.context[0].rowIndex]).click();
73
+ // artificially bump size to max so small files don't sneak in out of order.
74
+ $('#total_upload_size').val( max_total_file_size );
72
75
  $("#errmsg").html("All files selected from " + first_file_after_max + " and after will not be uploaded because your total upload is too big. You may not upload more than " + max_total_file_size_str + " in one upload.");
73
76
  $("#errmsg").fadeIn('slow');
74
77
  }
@@ -78,9 +81,6 @@ var filestoupload =0;
78
81
  $("#errmsg").html("All files selected from " + first_file_after_max + " and after will not be uploaded because your total number of files is too big. You may not upload more than " + max_file_count + " files in one upload.");
79
82
  $("#errmsg").fadeIn('slow');
80
83
  }
81
- else {
82
- $('#total_upload_size').val( parseInt($('#total_upload_size').val()) + data.files[0].size );
83
- }
84
84
  }
85
85
 
86
86
 
@@ -56,6 +56,11 @@
56
56
  margin: 1em 0 0 1em;
57
57
  }
58
58
 
59
+ .actions-controls-collections-line2 {
60
+ display: block;
61
+ margin: .5em 0 0 1em;
62
+ }
63
+
59
64
  .label-default a:link,
60
65
  .label-default a:visited,
61
66
  .label-default a:hover {
@@ -106,10 +106,15 @@ div.heading-tile:hover .glyphicon {
106
106
  margin-bottom: 0;
107
107
  }
108
108
 
109
- .sort-toggle, .batch-toggle {
109
+ .batch-toggle {
110
110
  padding: 1.5em 0 1.5em 1em;
111
111
  }
112
112
 
113
+ .sort-toggle {
114
+ padding: 1.5em 0 0 1em;
115
+ overflow: auto;
116
+ }
117
+
113
118
  .transfer_link {
114
119
  margin-top: 8px;
115
120
  }
@@ -5,11 +5,24 @@ h4 .small {
5
5
  color: $navbar-default-toggle-icon-bar-bg;
6
6
  }
7
7
 
8
- @media screen and (max-width: 767px) {
8
+ @media screen and (max-width: 961px) {
9
+ #documents.table-responsive {
10
+ overflow-x: auto;
11
+ }
9
12
  .table-responsive .open > .dropdown-menu {
10
13
  position: relative;
11
14
  left: -8em;
12
15
  }
16
+ .file-listing-title {
17
+ display: inline-block;
18
+ }
19
+ }
20
+
21
+ @media screen and (min-width: 768px) {
22
+ .file-listing-title {
23
+ display: inline-block;
24
+ padding-top: .65em;
25
+ }
13
26
  }
14
27
 
15
28
  .table-responsive {
@@ -58,6 +71,16 @@ h4 .small {
58
71
  width: 64px;
59
72
  }
60
73
 
74
+ .file-listing-links a:link, .file-listing-links a:visited,
75
+ .part_of_collection a:link, .part_of_collection a:visited {
76
+ color: $blue-default;
77
+ }
78
+
79
+ .file-listing-links a:hover, .part_of_collection a:hover {
80
+ color: $gray-dark;
81
+ text-decoration: underline;
82
+ }
83
+
61
84
  .nav > li > a.accordion-toggle {
62
85
  padding-left: 5px;
63
86
  padding-right: 5px;
@@ -92,9 +115,11 @@ h4 .small {
92
115
  .sorts-dash, .sorts, .expandable_new {
93
116
  cursor: pointer;
94
117
  }
95
- .sort-toggle {
96
- padding: 10px 0 10px 0;
118
+
119
+ .batch-info .sort-toggle {
120
+ height: 5.1em;
97
121
  }
122
+
98
123
  .caret.up {
99
124
  border-top: 0;
100
125
  border-bottom: 4px solid;
@@ -105,6 +130,11 @@ h4 .small {
105
130
  display: none;
106
131
  }
107
132
 
133
+ .visibility-link .label {
134
+ font-size: .85em;
135
+ font-weight: normal;
136
+ }
137
+
108
138
  .visibility-link:hover {
109
139
  text-decoration: none;
110
140
  }
@@ -148,6 +178,10 @@ input#check_all {
148
178
  margin-bottom: 10px;
149
179
  }
150
180
 
181
+ #appliedParams.constraints-container {
182
+ margin-bottom: 0;
183
+ }
184
+
151
185
  #collection-list-container {
152
186
  .collection-list {
153
187
  li {
@@ -162,12 +196,16 @@ input#check_all {
162
196
  }
163
197
 
164
198
  #documents {
165
- .media-body {
166
- padding-top: 12px;
167
- }
168
199
  td {
169
200
  vertical-align: middle;
170
201
  }
202
+ .table-responsive {
203
+ display: inline-block;
204
+ width: 100%;
205
+ }
206
+ .table {
207
+ margin-bottom: 0;
208
+ }
171
209
  }
172
210
 
173
211
  #my_nav {