From 8abeb228bbc8f0fe4dd711355340afe11799bc25 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Wed, 30 Jun 2021 18:47:04 -0700 Subject: [PATCH] add folder navigation to docs sidenav --- app/views/layouts/_document_sidenav.html.erb | 28 ++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/_document_sidenav.html.erb b/app/views/layouts/_document_sidenav.html.erb index 5ecdc0f5..dde531f9 100644 --- a/app/views/layouts/_document_sidenav.html.erb +++ b/app/views/layouts/_document_sidenav.html.erb @@ -43,10 +43,10 @@
  • <%= link_to folder, class: 'waves-effect' do %> <%= Folder.icon %> - View <%= folder.title %> + <%= folder.title %> <% end %>
  • - <% Document.where(folder_id: folder.id).where.not(id: @document.id).each do |document| %> + <% Document.where(folder_id: folder.id).where.not(id: @document.id).order('updated_at DESC').each do |document| %>
  • <%= link_to edit_document_path(document), class: 'waves-effect tooltipped', data: { tooltip: "Last edited #{time_ago_in_words document.updated_at} ago", position: 'right' } do %> @@ -61,6 +61,30 @@
  • <% end %> + <% + other_folders = current_user.folders.where(context: 'Document').where.not(id: @document.folder_id).order('title ASC') + if other_folders.any? + %> +
  • + + Other folders + chevron_right + +
    +
      + <% other_folders.each do |folder| %> +
    • + <%= link_to folder, class: 'waves-effect' do %> + <%= Folder.icon %> + <%= folder.title %> + <% end %> +
    • + <% end %> +
    +
    +
  • + <% end %> +
  • Recent documents