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

@@ -0,0 +1,7 @@
class AccountController < ApplicationController
before_action :require_user_signed_in
def index
@current_section = :account
end
end

View File

@@ -1,4 +1,4 @@
class DonationsController < ApplicationController
class Contributions::DonationsController < ApplicationController
before_action :require_user_signed_in
# GET /donations

View File

@@ -0,0 +1,8 @@
class Contributions::ProjectsController < ApplicationController
before_action :require_user_signed_in
# GET /contributions
def index
@current_section = :contributions
end
end

View File

@@ -1,7 +0,0 @@
class SecurityController < ApplicationController
before_action :require_user_signed_in
def index
@current_section = :security
end
end

View File

@@ -0,0 +1,13 @@
class Settings::AccountController < SettingsController
def index
end
def reset_password
current_user.send_reset_password_instructions
sign_out current_user
msg = "We have sent you an email with a link to reset your password."
redirect_to check_your_email_path, notice: msg
end
end

View File

@@ -0,0 +1,11 @@
class Settings::ProfileController < SettingsController
def index
@user = current_user
end
def update
end
end

View File

@@ -1,13 +1,13 @@
class SettingsController < ApplicationController
before_action :require_user_signed_in
before_action :set_current_section
def index
end
def reset_password
current_user.send_reset_password_instructions
sign_out current_user
msg = "We have sent you an email with a link to reset your password."
redirect_to check_your_email_path, notice: msg
private
def set_current_section
@current_section = :settings
end
end

View File

@@ -0,0 +1,18 @@
class TurboController < ApplicationController
class Responder < ActionController::Responder
def to_turbo_stream
controller.render(options.merge(formats: :html))
rescue ActionView::MissingTemplate => error
if get?
raise error
elsif has_errors? && default_action
render rendering_options.merge(formats: :html, status: :unprocessable_entity)
else
redirect_to navigation_location
end
end
end
self.responder = Responder
respond_to :html, :turbo_stream
end

View File

@@ -0,0 +1,18 @@
class Users::DeviseController < ApplicationController
class Responder < ActionController::Responder
def to_turbo_stream
controller.render(options.merge(formats: :html))
rescue ActionView::MissingTemplate => error
if get?
raise error
elsif has_errors? && default_action
render rendering_options.merge(formats: :html, status: :unprocessable_entity)
else
redirect_to navigation_location
end
end
end
self.responder = Responder
respond_to :html, :turbo_stream
end