mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
reuse tags query in docs table
This commit is contained in:
parent
35b6b57506
commit
728bb382ab
@ -1,4 +1,12 @@
|
||||
<%# Usage: render partial: 'content/list/document_table', locals: { content_list: @content, content_type: @content_type_class } %>
|
||||
<%#
|
||||
Usage:
|
||||
render partial: 'content/list/document_table', locals: {
|
||||
content_list: @documents,
|
||||
content_type: Document,
|
||||
folders: @folders.pluck(:title, :id),
|
||||
tags: PageTag.where(page_type: 'Document', page_id: @documents.pluck(:id))
|
||||
}
|
||||
%>
|
||||
|
||||
<% if content_list.any? %>
|
||||
<div class="row">
|
||||
@ -291,7 +299,6 @@
|
||||
<strong><%= number_with_delimiter total_word_count %></strong>
|
||||
<%= 'word'.pluralize(total_word_count) %>
|
||||
</li>
|
||||
<% tags = PageTag.where(page_type: 'Document', page_id: content_list) %>
|
||||
<% if tags.any? %>
|
||||
<li class="clearfix">
|
||||
<br />
|
||||
|
||||
@ -27,7 +27,8 @@
|
||||
render partial: 'content/list/document_table', locals: {
|
||||
content_list: @documents,
|
||||
content_type: Document,
|
||||
folders: @folders.pluck(:title, :id)
|
||||
folders: @folders.pluck(:title, :id),
|
||||
tags: PageTag.where(page_type: 'Document', page_id: @documents.pluck(:id))
|
||||
}
|
||||
%>
|
||||
<%# render partial: 'notice_dismissal/messages/02' %>
|
||||
|
||||
@ -33,7 +33,14 @@
|
||||
<div class="row">
|
||||
<h5>Documents <span class="grey-text"><%= @content.count %></span></h5>
|
||||
<%= render partial: 'content/components/list_filter_bar', locals: { content_type: Document } if @content.any? %>
|
||||
<%= render partial: 'content/list/document_table', locals: { content_list: @content, content_type: Document, folders: @all_folders.pluck(:title, :id) } %>
|
||||
<%=
|
||||
render partial: 'content/list/document_table', locals: {
|
||||
content_list: @content,
|
||||
content_type: Document,
|
||||
folders: @all_folders.pluck(:title, :id),
|
||||
tags: PageTag.where(page_type: 'Document', page_id: @content.pluck(:id))
|
||||
}
|
||||
%>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user