scinote-web/app/views/shared/sidebar/_projects_tree_branch.html.erb

31 lines
1.3 KiB
Text
Raw Normal View History

<% records.each do |record| %>
<% if record[:project] %>
<li class="sidebar-leaf">
<% if record[:project].archived? %>
<%= link_to record[:project].name, project_url(record[:project], view_mode: :archived), title: record[:project].name, class: 'sidebar-link' %>
<% else %>
<%= link_to record[:project].name, project_url(record[:project]), title: record[:project].name, class: 'sidebar-link' %>
<% end %>
</li>
<% else %>
<li class="sidebar-leaf">
2021-07-23 17:56:28 +08:00
<% unless record[:children].blank? %>
<i class="fas fa-caret-right toggle-branch collapsed"></i>
<% end %>
<%= link_to project_folder_path(record[:folder]),
class: "sidebar-link project-folder-link folder #{'selected' if current_folder == record[:folder]}",
title: record[:folder].name,
data: {
sidebar_url: sidebar_team_path(current_team, project_folder_id: record[:folder].id),
projects_cards_url: project_folder_cards_url(record[:folder])
} do %>
2023-06-08 14:33:37 +08:00
<i class="sn-icon sn-icon-projects"></i>
<%= record[:folder].name %>
<% end%>
<ul class="sidebar-branch">
<%= render partial: 'shared/sidebar/projects_tree_branch.html.erb', locals: { records: record[:children] } %>
</ul>
</li>
<% end %>
<% end %>