From 0cae9994aa231ca1965f01840e18149faaa78e2d Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 26 Jul 2019 03:02:10 -0500 Subject: [PATCH] time to sleep --- app/controllers/documents_controller.rb | 4 +++ .../components/_smart_sidebar.html.erb | 36 ++++++++++--------- tomorrow.txt | 9 +++++ 3 files changed, 32 insertions(+), 17 deletions(-) create mode 100644 tomorrow.txt diff --git a/app/controllers/documents_controller.rb b/app/controllers/documents_controller.rb index 350f4671..0ee3f614 100644 --- a/app/controllers/documents_controller.rb +++ b/app/controllers/documents_controller.rb @@ -26,6 +26,10 @@ class DocumentsController < ApplicationController .includes(:entity) .order('entity_type asc') + @navbar_actions.unshift({ + label: 'Edit this document', + href: edit_document_path(@document) + }) @navbar_actions.unshift({ label: (@document.name || 'Untitled document'), href: document_path(@document) diff --git a/app/views/documents/components/_smart_sidebar.html.erb b/app/views/documents/components/_smart_sidebar.html.erb index fa2c516b..9803e5d2 100644 --- a/app/views/documents/components/_smart_sidebar.html.erb +++ b/app/views/documents/components/_smart_sidebar.html.erb @@ -98,22 +98,24 @@ <% end %> -
-
-
Quick reference
- <% @linked_entities.each do |entity| %> - <% entity_class = entity.entity_type.constantize %> - <% linked_entity = entity.entity %> - <% next unless linked_entity.present? %> +<% if @linked_entities.any? %> +
+
+
Quick reference
+ <% @linked_entities.each do |entity| %> + <% entity_class = entity.entity_type.constantize %> + <% linked_entity = entity.entity %> + <% next unless linked_entity.present? %> - - - <%= entity_class.icon %> - - <%= entity.linked_name_if_possible %> - - <% end %> + + + <%= entity_class.icon %> + + <%= entity.linked_name_if_possible %> + + <% end %> +
-
+<% end %> \ No newline at end of file diff --git a/tomorrow.txt b/tomorrow.txt new file mode 100644 index 00000000..8c6b9596 --- /dev/null +++ b/tomorrow.txt @@ -0,0 +1,9 @@ +Still to do: +- [ ] Auto-create document entities when @mentioning + - hmm, tie DE to doc instead of DA? +- [ ] Optimize serializer wrt linked fields (!!!) +- [ ] Optimize serializer wrt multiple pages (!!!) +- [ ] Gallery in quick reference +- [ ] Random image in quick reference header +- [ ] Add a manual "Add quick reference" link+modal on doc#edit list +- [ ] Enable copy/paste from quick reference \ No newline at end of file