Merge pull request 'Various front-end improvements and bugfixes' (#78) from feature/frontend_improvements into master
All checks were successful
continuous-integration/drone/push Build is passing

Reviewed-on: #78
Reviewed-by: galfert <garret.alfert@gmail.com>
Reviewed-by: bumi <bumi@noreply.kosmos.org>
This commit was merged in pull request #78.
This commit is contained in:
2023-01-25 04:16:55 +00:00
43 changed files with 475 additions and 116 deletions

View File

@@ -3,6 +3,21 @@ require 'digest'
require 'securerandom'
# frozen_string_literal: true
# Create custom failure for turbo
class TurboFailureApp < Devise::FailureApp
def respond
if request_format == :turbo_stream
redirect
else
super
end
end
def skip_format?
%w(html turbo_stream */*).include? request_format.to_s
end
end
# Assuming you have not yet modified this file, each configuration option below
# is set to its default value. Note that some are commented out while others
# are not: uncommented lines are intended to protect your configuration from
@@ -44,6 +59,7 @@ Devise.setup do |config|
# ==> Controller configuration
# Configure the parent class to the devise controllers.
# config.parent_controller = 'DeviseController'
config.parent_controller = 'TurboController'
# ==> Mailer Configuration
# Configure the e-mail address which will be shown in Devise::Mailer,
@@ -289,6 +305,7 @@ Devise.setup do |config|
#
# The "*/*" below is required to match Internet Explorer requests.
# config.navigational_formats = ['*/*', :html]
config.navigational_formats = ['*/*', :html, :turbo_stream]
# The default HTTP method used to sign out a resource. Default is :delete.
config.sign_out_via = :get
@@ -302,10 +319,11 @@ Devise.setup do |config|
# If you want to use other strategies, that are not supported by Devise, or
# change the failure app, you can configure them inside the config.warden block.
#
# config.warden do |manager|
# manager.intercept_401 = false
# manager.default_strategies(scope: :user).unshift :some_external_strategy
# end
config.warden do |manager|
manager.failure_app = TurboFailureApp
# manager.intercept_401 = false
# manager.default_strategies(scope: :user).unshift :some_external_strategy
end
# ==> Mountable engine configurations
# When using Devise inside an engine, let's call it `MyEngine`, and this engine

View File

@@ -10,15 +10,21 @@ Rails.application.routes.draw do
match 'signup/:step', to: 'signup#steps', as: :signup_steps, via: [:get, :post]
post 'signup_validate', to: 'signup#validate'
get 'settings', to: 'settings#index'
post 'settings_reset_password', to: 'settings#reset_password'
namespace :settings do
get 'profile', to: 'profile#index'
post 'profile', to: 'profile#update'
get 'account', to: 'account#index'
post 'reset_password', to: 'account#reset_password'
end
get 'security', to: 'security#index'
namespace :contributions do
root to: 'donations#index'
get 'projects', to: 'projects#index'
resources :donations, only: ['index']
end
resources :invitations, only: ['index', 'show', 'create', 'destroy']
resources :donations
get 'wallet', to: 'wallet#index'
get 'wallet/transactions', to: 'wallet#transactions'