scinote-web/app/views/shared/sidebar/_projects_tree_branch.html.erb
2023-06-21 14:38:32 +02:00

30 lines
1.3 KiB
Text

<% 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">
<% unless record[:children].blank? %>
<i class="sn-icon sn-icon-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 %>
<i class="sn-icon sn-icon-folder"></i>
<%= record[:folder].name %>
<% end%>
<ul class="sidebar-branch">
<%= render partial: 'shared/sidebar/projects_tree_branch', locals: { records: record[:children] } %>
</ul>
</li>
<% end %>
<% end %>