Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cloud icons for remote favorite paths #3076

Merged
merged 3 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions apps/dashboard/app/apps/favorite_path.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/app/apps/ood_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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: "fas://#{favorite_path.icon}",
caption: caption,
new_tab: open_in_new_window?,
tile: tile
Expand Down
14 changes: 12 additions & 2 deletions apps/dashboard/app/views/files/_favorites.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,19 @@

<nav>
<ul id="favorites" class="nav nav-pills flex-column">
<li role="presentation" class="nav-item"><%= link_to 'Home Directory', files_path(Dir.home), class: "nav-link d bg-light" %></li>
<li role="presentation" class="nav-item">
<%= link_to files_path(Dir.home), class: "nav-link d bg-light" do %>
<%= fa_icon "home", classes: '' %>
Home Directory
<% end %>
</li>
<% OodFilesApp.new.favorite_paths.each do |p| %>
<li class="nav-item"><%= link_to p.title || p.path.to_s, files_path(p.filesystem, p.path.to_s), class: "nav-link d bg-light" %>
<li class="nav-item">
<%= link_to files_path(p.filesystem, p.path.to_s), class: "nav-link d bg-light" do %>
<%= fa_icon p.icon, classes: '' %>
<%= p.title || p.path.to_s %>
<% end %>
</li>
<% end %>
</ul>
</nav>
Loading