mirror of
https://github.com/docusealco/docuseal
synced 2026-11-06 23:12:33 -05:00
adjust native
This commit is contained in:
1 parent
6f31bd7af8
commit
66758d45bc
21 files changed
+379
-64
No files matched your search
@@ -13,7 +13,7 @@ class ApplicationController < ActionController::Base
|
||||
before_action :maybe_redirect_to_setup, unless: :signed_in?
|
||||
before_action :authenticate_user!, unless: :devise_controller?
|
||||
|
||||
before_action :set_csp, if: -> { request.get? && !request.headers['HTTP_X_TURBO'] && !turbo_infinite_scroll? }
|
||||
before_action :set_csp, if: -> { request.get? && !request.headers['HTTP_X_TURBO_REQUEST_ID'] && !turbo_infinite_scroll? }
|
||||
|
||||
helper_method :button_title,
|
||||
:current_account,
|
||||
|
||||
@@ -110,16 +110,16 @@ class TemplatesDashboardController < ApplicationController
|
||||
|
||||
pinned_count = (show_default_in_grid ? 1 : 0) + (show_shared_in_grid ? 1 : 0)
|
||||
|
||||
pagy = Pagy::Offset.new(count: folders_count + pinned_count,
|
||||
page: show_inline_folders ? 1 : [params[:page].to_s.to_i, 1].max,
|
||||
limit: FOLDERS_PER_PAGE,
|
||||
raise_range_error: true)
|
||||
pagy, = pagy(template_folders, count: folders_count + pinned_count,
|
||||
page: show_inline_folders ? 1 : [params[:page].to_s.to_i, 1].max,
|
||||
limit: FOLDERS_PER_PAGE,
|
||||
raise_range_error: true)
|
||||
|
||||
show_default_folder = show_default_in_grid && pagy.page == 1
|
||||
show_shared_folder = show_shared_in_grid && pagy.page == 1
|
||||
|
||||
folder_offset = pagy.page == 1 ? 0 : pagy.offset - pinned_count
|
||||
folder_limit = pagy.page == 1 ? FOLDERS_PER_PAGE - pinned_count : FOLDERS_PER_PAGE
|
||||
folder_limit = pagy.page == 1 ? pagy.limit - pinned_count : pagy.limit
|
||||
|
||||
template_folders = template_folders.offset(folder_offset).limit(folder_limit)
|
||||
|
||||
|
||||
@@ -10,22 +10,12 @@ class TestingAccountsController < ApplicationController
|
||||
|
||||
impersonate_user(Accounts.find_or_create_testing_user(true_user.account))
|
||||
|
||||
redirect_after_toggle
|
||||
redirect_back(fallback_location: root_path)
|
||||
end
|
||||
|
||||
def destroy
|
||||
stop_impersonating_user
|
||||
|
||||
redirect_after_toggle
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def redirect_after_toggle
|
||||
if turbo_native_app?
|
||||
redirect_to root_path
|
||||
else
|
||||
redirect_back(fallback_location: root_path)
|
||||
end
|
||||
redirect_back(fallback_location: root_path)
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user