diff --git a/Gemfile b/Gemfile
index f94db48e..9aa9ef10 100644
--- a/Gemfile
+++ b/Gemfile
@@ -81,6 +81,7 @@ gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
#
##############################################################################
gem "autoprefixer-rails"
+gem "popper_js"
gem "bootstrap-sass"
gem "jquery-rails"
gem "ckeditor"
@@ -107,6 +108,8 @@ gem "sequel", "5.52.0"
group :development, :test do
gem "byebug"
gem "standard"
+ # parser should be >= the current Ruby version to avoid warnings
+ gem "parser", ">= 3.1.6"
gem "pry"
gem "pry-byebug", ">= 3.9.0"
gem "sqlite3"
diff --git a/Gemfile.lock b/Gemfile.lock
index d581ba1e..950e5cda 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -226,8 +226,10 @@ GEM
version_gem (~> 1.1)
orm_adapter (0.5.0)
parallel (1.22.1)
- parser (3.1.2.1)
+ parser (3.3.4.0)
ast (~> 2.4.1)
+ racc
+ popper_js (2.11.8)
pry (0.14.1)
coderay (~> 1.1)
method_source (~> 1.0)
@@ -282,8 +284,8 @@ GEM
rb-inotify (0.10.1)
ffi (~> 1.0)
regexp_parser (2.6.0)
- rexml (3.2.8)
- strscan (>= 3.0.9)
+ rexml (3.3.2)
+ strscan
rubocop (1.35.1)
json (~> 2.3)
parallel (~> 1.10)
@@ -411,6 +413,8 @@ DEPENDENCIES
net-imap
net-pop
net-smtp
+ parser (>= 3.1.6)
+ popper_js
pry
pry-byebug (>= 3.9.0)
puma (~> 5.6)
diff --git a/README.md b/README.md
index f84476e3..339c214e 100644
--- a/README.md
+++ b/README.md
@@ -10,14 +10,14 @@
```
$ git clone https://github.com/hathitrust/otis.git
$ cd otis
-$ docker-compose build
-$ docker-compose run web bundle install
+$ docker compose build
+$ docker compose run --rm web bundle install
```
### 2. Trying it out
```
-docker-compose up -d web
+docker compose up -d web
```
Development mode uses mysql via Docker with generated data from the `db:seed`
@@ -32,24 +32,24 @@ administrative power.
### 3. Running tests
```
-docker-compose run test
+docker compose run --rm test
```
To enable W3C HTML validation of OTIS pages, use the following.
These tests are not run by default since they rely on an external service.
```
-docker-compose run -e W3C_VALIDATION=1 test
+docker compose run --rm -e W3C_VALIDATION=1 test
```
To run a single test class use an invocation along these lines:
```
-docker-compose run test bundle exec ruby -I test test/controllers/ht_users_controller_test.rb
+docker compose run --rm test bundle exec ruby -I test test/controllers/ht_users_controller_test.rb
```
System tests, as usual, are not run by default.
```
-docker-compose run system-test
+docker compose run --rm system-test
```
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
index 5afc70f2..be276fbb 100644
--- a/app/assets/javascripts/application.js
+++ b/app/assets/javascripts/application.js
@@ -11,6 +11,7 @@
// about supported directives.
//
//= require jquery3
+//= require popper
//= require bootstrap
//= require rails-ujs
//= require activestorage
diff --git a/app/controllers/ht_institutions_controller.rb b/app/controllers/ht_institutions_controller.rb
index 963d6cc9..2dffe0a3 100755
--- a/app/controllers/ht_institutions_controller.rb
+++ b/app/controllers/ht_institutions_controller.rb
@@ -38,7 +38,10 @@ def index
@other_institutions = HTInstitution.other.order("name").map { |i| presenter i }
respond_to do |format|
format.html
- format.csv { send_data institutions_csv }
+ format.csv do
+ file_name = (params[:file_name] || "ht_institutions") + ".csv"
+ send_data institutions_csv, filename: file_name
+ end
end
end
diff --git a/app/controllers/ht_users_controller.rb b/app/controllers/ht_users_controller.rb
index 211cf5b4..5ee7d36d 100755
--- a/app/controllers/ht_users_controller.rb
+++ b/app/controllers/ht_users_controller.rb
@@ -13,7 +13,10 @@ def index
@all_users = users.map { |u| presenter u }
respond_to do |format|
format.html
- format.csv { send_data users_csv }
+ format.csv do
+ file_name = (params[:file_name] || "ht_users") + ".csv"
+ send_data users_csv, filename: file_name
+ end
end
end
@@ -65,6 +68,9 @@ def users_csv
CSV.generate do |csv|
csv << @all_users.first.csv_cols
@all_users.each do |user|
+ if params[:role_filter]&.include?(user.role)
+ next
+ end
csv << user.csv_vals
end
end
diff --git a/app/views/ht_institutions/index.html.erb b/app/views/ht_institutions/index.html.erb
index d23a7a19..e9501d37 100644
--- a/app/views/ht_institutions/index.html.erb
+++ b/app/views/ht_institutions/index.html.erb
@@ -2,6 +2,9 @@
<% fields = HTInstitutionPresenter::INDEX_FIELDS %>
+ <%= link_to t(".download_csv"), ht_institutions_url(format: :csv), class: 'btn btn-info' %>
+
+