more polish

This commit is contained in:
Andrew Brown 2021-06-30 20:51:19 -07:00
parent 8abeb228bb
commit a86d3ff07a
4 changed files with 7 additions and 3 deletions

View File

@ -19,7 +19,7 @@ class DocumentsController < ApplicationController
def index
@page_title = "My documents"
@recent_documents = current_user.linkable_documents.order('updated_at DESC').limit(6).to_a
@documents = current_user.linkable_documents.where(folder_id: nil).order('favorite DESC, title ASC, updated_at DESC').to_a
@documents = current_user.linkable_documents.order('favorite DESC, title ASC, updated_at DESC').to_a
@folders = current_user.folders.where(context: 'Document', parent_folder_id: nil)
if params.key?(:favorite_only)

View File

@ -13,4 +13,8 @@ class Folder < ApplicationRecord
def self.icon
'folder'
end
def to_param
self.id.to_s + '-' + PageTagService.slug_for(self.title)
end
end

View File

@ -21,7 +21,7 @@
<%= render partial: 'folders/list', locals: { folders: @folders } %>
<div class="row">
<h5>Documents</h5>
<h5>All Documents (<%= @documents.count %>)</h5>
<%= render partial: 'content/components/list_filter_bar', locals: { content_type: Document } %>
<%= render partial: 'content/list/document_table', locals: { content_list: @documents, content_type: Document } %>
<%# render partial: 'notice_dismissal/messages/02' %>

View File

@ -8,7 +8,7 @@
<% end %>
</div>
<h5>Folders</h5>
<h5>Folders (<%= folders.count %>)</h5>
</div>
<% folders.each do |folder| %>
<div class="col s12 m3 l2">