mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-04 22:16:08 +00:00
Merge pull request #13143 from mkllnk/admin-in-same-tab
Open admin dashboard in same tab by default
This commit is contained in:
@@ -15,4 +15,12 @@ module LinkHelper
|
||||
prefix + url
|
||||
end
|
||||
end
|
||||
|
||||
def new_tab_option
|
||||
if feature?(:open_in_same_tab, spree_current_user)
|
||||
{}
|
||||
else
|
||||
{ target: "_blank" }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
- if admin_user? or enterprise_user?
|
||||
%li
|
||||
%a{href: spree.admin_dashboard_path, target:'_blank'}
|
||||
%a{href: spree.admin_dashboard_path, **new_tab_option}
|
||||
%i.ofn-i_021-tools
|
||||
= t 'label_administration'
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
- if admin_user? or enterprise_user?
|
||||
%li
|
||||
%a{href: spree.admin_dashboard_path, target:'_blank'}
|
||||
%a{href: spree.admin_dashboard_path, **new_tab_option}
|
||||
%i.ofn-i_021-tools
|
||||
= t 'label_admin'
|
||||
|
||||
|
||||
@@ -58,6 +58,9 @@ module OpenFoodNetwork
|
||||
Activated for a user.
|
||||
The user (INRAE researcher) has access to anonymised sales.
|
||||
DESC
|
||||
"open_in_same_tab" => <<~DESC,
|
||||
Open the admin dashboard in the same tab instead of a new tab.
|
||||
DESC
|
||||
}.merge(conditional_features).freeze;
|
||||
|
||||
# Features you would like to be enabled to start with.
|
||||
|
||||
Reference in New Issue
Block a user