diff --git a/Gemfile b/Gemfile
index 7e7f5879..b0f1414f 100644
--- a/Gemfile
+++ b/Gemfile
@@ -14,9 +14,6 @@ gem 'pg'
# Use Puma as the app server
gem 'puma', '>= 5.0'
-# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
-gem 'turbolinks', '~> 5'
-
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
@@ -116,3 +113,5 @@ gem "local_time", "~> 2.1"
gem "cssbundling-rails", "~> 1.1"
gem "importmap-rails", "~> 1.1"
+
+gem "turbo-rails", "~> 2.0"
diff --git a/Gemfile.lock b/Gemfile.lock
index 7c697003..3afbfa76 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -452,9 +452,9 @@ GEM
thor (1.3.2)
timecop (0.9.10)
timeout (0.4.1)
- turbolinks (5.2.1)
- turbolinks-source (~> 5.2)
- turbolinks-source (5.2.0)
+ turbo-rails (2.0.11)
+ actionpack (>= 6.0.0)
+ railties (>= 6.0.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unf (0.2.0)
@@ -545,7 +545,7 @@ DEPENDENCIES
sprockets-rails
sqlite3 (~> 1.4)
timecop
- turbolinks (~> 5)
+ turbo-rails (~> 2.0)
tzinfo-data
web-console
webdrivers
diff --git a/app/assets/stylesheets/application.sass.scss b/app/assets/stylesheets/application.sass.scss
index 101eedac..ac11754e 100644
--- a/app/assets/stylesheets/application.sass.scss
+++ b/app/assets/stylesheets/application.sass.scss
@@ -1,23 +1,26 @@
// Entrypoint for stylesheet
-@import 'bootstrap-overrides';
-@import 'bootstrap/scss/bootstrap';
-@import 'variables';
-@import 'logo';
-@import 'pod-icons';
-@import 'rails_bootstrap_forms';
-@import 'organizations';
-@import 'streams';
-@import 'files';
+@import "bootstrap-overrides";
+@import "bootstrap/scss/bootstrap";
+@import "variables";
+@import "logo";
+@import "pod-icons";
+@import "rails_bootstrap_forms";
+@import "organizations";
+@import "streams";
+@import "files";
// background image for homepage banner
#hero .bg-image {
width: 100%;
height: 100%;
position: absolute;
- background-image: url('hero.jpg');
+ background-image: url("hero.jpg");
background-size: contain;
- top: 0; bottom: 0; left: 0; right: 0;
- filter:blur(3.5px) brightness(50%) sepia(50%) hue-rotate(160deg);
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ filter: blur(3.5px) brightness(50%) sepia(50%) hue-rotate(160deg);
}
.direct-upload {
@@ -39,7 +42,9 @@
a {
padding-left: 0.5rem;
opacity: 0;
- transition: color .15s ease-in-out,opacity .15s ease-in-out;
+ transition:
+ color 0.15s ease-in-out,
+ opacity 0.15s ease-in-out;
}
&:hover {
a {
@@ -57,7 +62,9 @@
min-width: 50px;
background: $info;
text-align: center;
- transition: width 120ms ease-out, opacity 60ms 60ms ease-in;
+ transition:
+ width 120ms ease-out,
+ opacity 60ms 60ms ease-in;
transform: translate3d(0, 0, 0);
}
@@ -73,7 +80,7 @@
border-color: $danger;
}
-input[type=file][data-direct-upload-url][disabled] {
+input[type="file"][data-direct-upload-url][disabled] {
display: none;
}
@@ -148,10 +155,10 @@ input[type=file][data-direct-upload-url][disabled] {
font-weight: 500;
}
-// turbolinks progress bar: render in a more constrasting color, and prevent
+// turbo progress bar: render in a more constrasting color, and prevent
// layout shift when it appears by absolute-positioning it. see:
// https://github.com/pod4lib/aggregator/issues/658
-.turbolinks-progress-bar {
+.turbo-progress-bar {
position: absolute;
z-index: 1;
top: 0;
diff --git a/app/controllers/allowlisted_jwts_controller.rb b/app/controllers/allowlisted_jwts_controller.rb
index 007854b0..608a1a02 100644
--- a/app/controllers/allowlisted_jwts_controller.rb
+++ b/app/controllers/allowlisted_jwts_controller.rb
@@ -20,7 +20,10 @@ def new; end
def create
respond_to do |format|
if @allowlisted_jwt.save
- format.html { redirect_to organization_allowlisted_jwts_path(@organization), notice: 'Token was successfully created.' }
+ format.html do
+ redirect_to organization_allowlisted_jwts_path(@organization), notice: 'Token was successfully created.',
+ status: :see_other
+ end
format.json { render :show, status: :created, location: [@organization, @allowlisted_jwt] }
else
format.html { render :new }
@@ -35,7 +38,10 @@ def destroy
@allowlisted_jwt.destroy
respond_to do |format|
- format.html { redirect_to organization_allowlisted_jwts_path(@organization), notice: 'Token was successfully destroyed.' }
+ format.html do
+ redirect_to organization_allowlisted_jwts_path(@organization), notice: 'Token was successfully destroyed.',
+ status: :see_other
+ end
format.json { head :no_content }
end
end
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 83e31620..26f3d5b4 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -13,7 +13,7 @@ class ApplicationController < ActionController::Base
rescue_from CanCan::AccessDenied do |exception|
respond_to do |format|
format.json { head :forbidden, content_type: 'text/html' }
- format.html { redirect_to main_app.root_url, notice: exception.message }
+ format.html { redirect_to main_app.root_url, notice: exception.message, status: :see_other }
format.js { head :forbidden, content_type: 'text/html' }
end
end
diff --git a/app/controllers/contact_emails_controller.rb b/app/controllers/contact_emails_controller.rb
index ccdbe2dc..76034be4 100644
--- a/app/controllers/contact_emails_controller.rb
+++ b/app/controllers/contact_emails_controller.rb
@@ -25,7 +25,7 @@ def render_or_redirect_with_flash(**messages)
end
if can? :read, @contact_email.organization
- redirect_to @contact_email.organization
+ redirect_to @contact_email.organization, status: :see_other
else
render 'confirm'
end
diff --git a/app/controllers/organization_users_controller.rb b/app/controllers/organization_users_controller.rb
index 68eedcd4..3e52d9e0 100644
--- a/app/controllers/organization_users_controller.rb
+++ b/app/controllers/organization_users_controller.rb
@@ -15,7 +15,9 @@ def update
@user.add_role(params[:add_role], @organization) if params[:add_role].present?
respond_to do |format|
- format.html { redirect_to organization_users_url(@organization), notice: 'User role was successfully updated.' }
+ format.html do
+ redirect_to organization_users_url(@organization), notice: 'User role was successfully updated.', status: :see_other
+ end
format.json { head :no_content }
end
end
@@ -26,7 +28,9 @@ def destroy
@user.destroy
respond_to do |format|
- format.html { redirect_to organization_users_url(@organization), notice: 'User was successfully removed.' }
+ format.html do
+ redirect_to organization_users_url(@organization), notice: 'User was successfully removed.', status: :see_other
+ end
format.json { head :no_content }
end
end
diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb
index eb80e4e1..a9e9bb77 100644
--- a/app/controllers/organizations_controller.rb
+++ b/app/controllers/organizations_controller.rb
@@ -16,7 +16,7 @@ def index
def show
# make the org homepage for consumer orgs point to their org details default tab
# see https://github.com/pod4lib/aggregator/issues/535#issuecomment-1103234114
- redirect_to organization_users_path(@organization) unless @organization.provider?
+ redirect_to organization_users_path(@organization), status: :see_other unless @organization.provider?
@stream = @organization.default_stream if @organization.provider?
@uploads = @organization.default_stream.uploads.active.order(created_at: :desc).page(params[:page])
@@ -30,7 +30,7 @@ def new
# GET /organizations/1/provider_details
def provider_details
# consumer orgs don't have provider details; redirect to org details instead
- redirect_to organization_details_organization_path(@organization) unless @organization.provider?
+ redirect_to organization_details_organization_path(@organization), status: :see_other unless @organization.provider?
end
# GET /organizations/1/organization_details
@@ -43,7 +43,7 @@ def create
respond_to do |format|
if @organization.save
- format.html { redirect_to @organization, notice: 'Organization was successfully created.' }
+ format.html { redirect_to @organization, notice: 'Organization was successfully created.', status: :see_other }
format.json { render :show, status: :created, location: @organization }
else
format.html { render :new }
@@ -71,7 +71,7 @@ def update
def destroy
@organization.destroy
respond_to do |format|
- format.html { redirect_to organizations_url, notice: 'Organization was successfully destroyed.' }
+ format.html { redirect_to organizations_url, notice: 'Organization was successfully destroyed.', status: :see_other }
format.json { head :no_content }
end
end
diff --git a/app/controllers/site_users_controller.rb b/app/controllers/site_users_controller.rb
index 9ba36985..1df61404 100644
--- a/app/controllers/site_users_controller.rb
+++ b/app/controllers/site_users_controller.rb
@@ -13,7 +13,7 @@ def update
@user.add_role params[:add_role] if params[:add_role].present?
respond_to do |format|
- format.html { redirect_to site_users_url, notice: 'User role was successfully updated.' }
+ format.html { redirect_to site_users_url, notice: 'User role was successfully updated.', status: :see_other }
format.json { head :no_content }
end
end
diff --git a/app/controllers/streams_controller.rb b/app/controllers/streams_controller.rb
index c7d0c841..fdf9a620 100644
--- a/app/controllers/streams_controller.rb
+++ b/app/controllers/streams_controller.rb
@@ -32,7 +32,7 @@ def create
respond_to do |format|
if @stream.save
- format.html { redirect_to [@organization, @stream], notice: 'Stream was successfully created.' }
+ format.html { redirect_to [@organization, @stream], notice: 'Stream was successfully created.', status: :see_other }
format.json { render :show, status: :created, location: [@organization, @stream] }
else
format.html { render :new }
@@ -45,7 +45,7 @@ def destroy
@stream.destroy
respond_to do |format|
- format.html { redirect_to organization_streams_path, notice: 'Stream was successfully destroyed.' }
+ format.html { redirect_to organization_streams_path, notice: 'Stream was successfully destroyed.', status: :see_other }
format.json { head :no_content }
end
end
@@ -63,7 +63,7 @@ def make_default
@stream.make_default
respond_to do |format|
- format.html { redirect_to @organization, notice: 'Stream was successfully updated.' }
+ format.html { redirect_to @organization, notice: 'Stream was successfully updated.', status: :see_other }
format.json { render :show, status: :ok, location: @organization }
end
end
diff --git a/app/controllers/uploads_controller.rb b/app/controllers/uploads_controller.rb
index 7ac0473c..80e0f12b 100644
--- a/app/controllers/uploads_controller.rb
+++ b/app/controllers/uploads_controller.rb
@@ -29,7 +29,7 @@ def new; end
def create
respond_to do |format|
if @upload.save
- format.html { redirect_to [@organization, @upload], notice: 'Upload was successfully created.' }
+ format.html { redirect_to [@organization, @upload], notice: 'Upload was successfully created.', status: :see_other }
format.json { render :show, status: :created, location: [@organization, @upload] }
else
format.html { render :new }
@@ -43,7 +43,7 @@ def create
def update
respond_to do |format|
if @upload.update(upload_params)
- format.html { redirect_to [@organization, @upload], notice: 'Upload was successfully updated.' }
+ format.html { redirect_to [@organization, @upload], notice: 'Upload was successfully updated.', status: :see_other }
format.json { render :show, status: :ok, location: [@organization, @upload] }
else
format.html { render :edit }
@@ -57,7 +57,9 @@ def update
def destroy
@upload.destroy
respond_to do |format|
- format.html { redirect_to organization_uploads_url(@organization), notice: 'Upload was successfully destroyed.' }
+ format.html do
+ redirect_to organization_uploads_url(@organization), notice: 'Upload was successfully destroyed.', status: :see_other
+ end
format.json { head :no_content }
end
end
diff --git a/app/javascript/application.js b/app/javascript/application.js
index cac3ea2f..8f5cf0e1 100644
--- a/app/javascript/application.js
+++ b/app/javascript/application.js
@@ -1,10 +1,7 @@
// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
-import Rails from '@rails/ujs';
-import Turbolinks from 'turbolinks';
import * as ActiveStorage from "@rails/activestorage";
import LocalTime from "local-time"
Rails.start();
-Turbolinks.start();
ActiveStorage.start();
LocalTime.start()
@@ -13,4 +10,5 @@ import 'direct_uploads';
import 'pod_console';
import 'copy_to_clipboard';
import 'organizations';
-import 'tooltips'
\ No newline at end of file
+import 'tooltips'
+import "@hotwired/turbo-rails"
diff --git a/app/javascript/tooltips.js b/app/javascript/tooltips.js
index 3d71f0df..6db63712 100644
--- a/app/javascript/tooltips.js
+++ b/app/javascript/tooltips.js
@@ -1,15 +1,15 @@
import * as bootstrap from 'bootstrap';
// Enable bootstrap tooltips, with localized time content if applicable
-document.addEventListener('turbolinks:load', function() {
+document.addEventListener('turbo:load', function() {
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
- var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
+ var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
// Find any hidden time DOM elements within this tooltip
var times = [].slice.call(tooltipTriggerEl.querySelectorAll('.hidden-tooltip-time[data-localized]'))
var text = ""
// Construct the tooltip text
// See application_helper.js
- times.forEach(function (timeEl) {
+ times.forEach(function (timeEl) {
if (timeEl.classList.contains('default')) {
text = text + ("Default since " + timeEl.innerHTML + "
")
}
diff --git a/app/views/allowlisted_jwts/index.html.erb b/app/views/allowlisted_jwts/index.html.erb
index 58b0d675..d83f0421 100644
--- a/app/views/allowlisted_jwts/index.html.erb
+++ b/app/views/allowlisted_jwts/index.html.erb
@@ -27,7 +27,7 @@