Skip to content

Commit 457992e

Browse files
Move items from main nav to settings page
1 parent 344e557 commit 457992e

File tree

2 files changed

+33
-19
lines changed

2 files changed

+33
-19
lines changed

app/views/home/settings.html.haml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,31 @@
2626
= setting_card title: pluralize(@policies_count, "Policy"), href: policies_path, icon: 'icon-outline-sharing-request xx-large' do |c|
2727
- c.body do
2828
Share test results with health organization
29+
30+
- if has_access_to_users_index?
31+
-# Devise clears the controller param for users index
32+
= setting_card title: "Users", href: users_path, icon: 'icon-outline-user xx-large' do |c|
33+
- c.body do
34+
Manage users on your team
35+
36+
.row.center
37+
- if has_access_to_devices_index?
38+
= setting_card title: "Devices", href: devices_path, icon: 'icon-outline-device xx-large' do |c|
39+
- c.body do
40+
Manage test devices in your inventory
41+
42+
- if has_access?(Device, Policy::Actions::SUPPORT_DEVICE)
43+
= setting_card title: "Device Logs", href: device_messages_path, icon: 'icon-outline-report xx-large' do |c|
44+
- c.body do
45+
Investigate device logs
46+
47+
- if has_access_to_device_models_index?
48+
= setting_card title: "Device Models", href: device_models_path, icon: 'icon-outline-model xx-large' do |c|
49+
- c.body do
50+
Configure device models
51+
52+
.row.center
53+
- if has_access_to_sites_index?
54+
= setting_card title: "Sites", href: sites_path, icon: 'icon-outline-site xx-large' do |c|
55+
- c.body do
56+
Manage sites of your institution

app/views/shared/_header_nav.haml

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,11 @@
3232
- if has_access_to_test_results_index?
3333
%li{:class => ["test_results", "encounters"].include?(params[:controller]) && "active"}
3434
= link_to "Tests", test_results_path
35-
- if has_access_to_sites_index?
36-
%li{:class => params[:controller] == "sites" && "active"}
37-
= link_to "Sites", sites_path
38-
- if has_access_to_devices_index?
39-
%li{:class => params[:controller] == "devices" && "active"}
40-
= link_to "Devices", devices_path
41-
- if has_access?(Device, Policy::Actions::SUPPORT_DEVICE)
42-
%li{:class => params[:controller] == "device_messages" && "active"}
43-
= link_to "Logs", device_messages_path
44-
- if has_access_to_device_models_index?
45-
%li{:class => params[:controller] == "device_models" && "active"}
46-
= link_to "Models", device_models_path
47-
- if has_access_to_users_index?
48-
-# Devise clears the controller param for users index
49-
%li{:class => (params[:controller] == "users" || !params[:controller]) && "active"}
50-
= link_to "Users", users_path
51-
- if has_access_to_settings?
52-
%li{:class => (["roles", "policies", "alerts", "incidents", "alert_messages"].include?(params[:controller]) || params[:action] == "settings") && "active"}
53-
= link_to "Settings", settings_path
35+
36+
- if has_access_to_settings?
37+
= link_to settings_path do
38+
.icon-gray-light.medium{title: "Settings"}
39+
= '<svg xmlns="http://www.w3.org/2000/svg" style="width: 0.9em;" aria-hidden="true" viewBox="0 0 24 24"><path fill="currentColor" d="M12 15.5A3.5 3.5 0 0 1 8.5 12A3.5 3.5 0 0 1 12 8.5a3.5 3.5 0 0 1 3.5 3.5a3.5 3.5 0 0 1-3.5 3.5m7.43-2.53c.04-.32.07-.64.07-.97c0-.33-.03-.66-.07-1l2.11-1.63c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.31-.61-.22l-2.49 1c-.52-.39-1.06-.73-1.69-.98l-.37-2.65A.506.506 0 0 0 14 2h-4c-.25 0-.46.18-.5.42l-.37 2.65c-.63.25-1.17.59-1.69.98l-2.49-1c-.22-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64L4.57 11c-.04.34-.07.67-.07 1c0 .33.03.65.07.97l-2.11 1.66c-.19.15-.25.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1.01c.52.4 1.06.74 1.69.99l.37 2.65c.04.24.25.42.5.42h4c.25 0 .46-.18.5-.42l.37-2.65c.63-.26 1.17-.59 1.69-.99l2.49 1.01c.22.08.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.66Z"/></svg>'.html_safe
5440

5541
.user{:tabindex => "0"}
5642
- if current_user

0 commit comments

Comments
 (0)