From 514035398f6ec2a592cb616317f2c0e2fc792d1e Mon Sep 17 00:00:00 2001 From: Robin Karlsson Date: Wed, 27 Sep 2023 12:47:59 +0300 Subject: [PATCH 1/3] Add icons for remote favorite paths --- apps/dashboard/app/apps/ood_app.rb | 2 +- apps/dashboard/app/views/files/_favorites.html.erb | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/dashboard/app/apps/ood_app.rb b/apps/dashboard/app/apps/ood_app.rb index c2622fc9dc..2492cac1c9 100644 --- a/apps/dashboard/app/apps/ood_app.rb +++ b/apps/dashboard/app/apps/ood_app.rb @@ -99,7 +99,7 @@ def links subtitle: favorite_path.title ? favorite_path.path.to_s : nil, description: manifest.description, url: OodAppkit::Urls::Files.new(base_url: url).url(path: favorite_path.path.to_s, fs: favorite_path.filesystem), - icon_uri: "fas://folder", + icon_uri: favorite_path.remote? ? "fas://cloud" : "fas://folder", caption: caption, new_tab: open_in_new_window?, tile: tile diff --git a/apps/dashboard/app/views/files/_favorites.html.erb b/apps/dashboard/app/views/files/_favorites.html.erb index 9fe71344e2..7cea2c13cd 100755 --- a/apps/dashboard/app/views/files/_favorites.html.erb +++ b/apps/dashboard/app/views/files/_favorites.html.erb @@ -5,7 +5,12 @@ From e887f212b3592c55d0fa3a2ad1854eb732175336 Mon Sep 17 00:00:00 2001 From: Robin Karlsson Date: Thu, 28 Sep 2023 14:21:31 +0300 Subject: [PATCH 2/3] Add helper method for favorite path icon Use folder icon for normal favorite paths, which previously had no icon. --- apps/dashboard/app/apps/favorite_path.rb | 5 +++++ apps/dashboard/app/apps/ood_app.rb | 2 +- apps/dashboard/app/views/files/_favorites.html.erb | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/dashboard/app/apps/favorite_path.rb b/apps/dashboard/app/apps/favorite_path.rb index 088398e6ca..772c71e29e 100644 --- a/apps/dashboard/app/apps/favorite_path.rb +++ b/apps/dashboard/app/apps/favorite_path.rb @@ -16,6 +16,11 @@ def remote? filesystem != "fs" end + # FontAwesome icon to use for links + def icon + remote? ? 'cloud' : 'folder' + end + def to_s path.to_s end diff --git a/apps/dashboard/app/apps/ood_app.rb b/apps/dashboard/app/apps/ood_app.rb index 2492cac1c9..c99388e488 100644 --- a/apps/dashboard/app/apps/ood_app.rb +++ b/apps/dashboard/app/apps/ood_app.rb @@ -99,7 +99,7 @@ def links subtitle: favorite_path.title ? favorite_path.path.to_s : nil, description: manifest.description, url: OodAppkit::Urls::Files.new(base_url: url).url(path: favorite_path.path.to_s, fs: favorite_path.filesystem), - icon_uri: favorite_path.remote? ? "fas://cloud" : "fas://folder", + icon_uri: "fas://#{favorite_path.icon}", caption: caption, new_tab: open_in_new_window?, tile: tile diff --git a/apps/dashboard/app/views/files/_favorites.html.erb b/apps/dashboard/app/views/files/_favorites.html.erb index 7cea2c13cd..a4b078e0fd 100755 --- a/apps/dashboard/app/views/files/_favorites.html.erb +++ b/apps/dashboard/app/views/files/_favorites.html.erb @@ -7,7 +7,7 @@ <% OodFilesApp.new.favorite_paths.each do |p| %> From 0583809c30fc64c2eaa571d2a61359f7dcfaa186 Mon Sep 17 00:00:00 2001 From: Robin Karlsson Date: Thu, 28 Sep 2023 14:27:28 +0300 Subject: [PATCH 3/3] Add icon for Home Directory link --- apps/dashboard/app/views/files/_favorites.html.erb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/dashboard/app/views/files/_favorites.html.erb b/apps/dashboard/app/views/files/_favorites.html.erb index a4b078e0fd..4d819fe422 100755 --- a/apps/dashboard/app/views/files/_favorites.html.erb +++ b/apps/dashboard/app/views/files/_favorites.html.erb @@ -3,7 +3,12 @@