1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-25 08:09:43 +02:00

document list: show by selected space/category

This commit is contained in:
Harvey Kandola 2017-09-26 16:30:16 +01:00
parent 2cee83d570
commit 5481de4e1c
21 changed files with 342 additions and 157 deletions

View file

@ -1,22 +1,24 @@
<div class="documents-list">
{{#each documents key="id" as |document|}}
<div id="document-{{document.id}}">
<div class="document-item {{if document.selected "selected-card"}}">
{{#link-to 'document.index' folder.id folder.slug document.id document.slug class="link"}}
<div class="title">{{ document.name }}</div>
<div class="snippet">{{ document.excerpt }}</div>
<div class="chips">{{folder/document-tags documentTags=document.tags}}</div>
{{/link-to}}
{{#if session.authenticated}}
<div class="checkbox" {{action 'selectDocument' document.id}}>
{{#if document.selected}}
<i class="material-icons">check_box</i>
{{else}}
<i class="material-icons">check_box_outline_blank</i>
{{/if}}
</div>
{{/if}}
{{#if (gt documents.length 0)}}
<div class="documents-list">
{{#each documents key="id" as |document|}}
<div id="document-{{document.id}}">
<div class="document-item {{if document.selected "selected-card"}}">
{{#link-to 'document.index' folder.id folder.slug document.id document.slug class="link"}}
<div class="title">{{ document.name }}</div>
<div class="snippet">{{ document.excerpt }}</div>
<div class="chips">{{folder/document-tags documentTags=document.tags}}</div>
{{/link-to}}
{{#if session.authenticated}}
<div class="checkbox" {{action 'selectDocument' document.id}}>
{{#if document.selected}}
<i class="material-icons">check_box</i>
{{else}}
<i class="material-icons">check_box_outline_blank</i>
{{/if}}
</div>
{{/if}}
</div>
</div>
</div>
{{/each}}
</div>
{{/each}}
</div>
{{/if}}

View file

@ -1,12 +1,15 @@
<div class="pull-left width-80">
{{#unless editMode}}
<div class="folder-heading {{if permissions.spaceOwner 'cursor-pointer'}}" onclick={{if permissions.spaceOwner (action 'toggleEdit')}}>
<h1 class="folder-title">{{folder.name}}</h1>
<div class="space-heading {{if permissions.spaceOwner 'cursor-pointer'}}" onclick={{if permissions.spaceOwner (action 'toggleEdit')}}>
<h1 class="space-name">{{folder.name}}</h1>
<div class="space-summary">
This space contains {{documents.length}} {{if (eq rootDocCount.length 1) 'document' 'documents'}} across {{categories.length}} {{if (eq categories.length 1) 'category' 'categories'}}
</div>
</div>
{{else}}
<form {{action "onSave" on="submit"}}>
<div class="edit-folder-heading">
<div class="input-inline input-transparent edit-folder-title">
<div class="edit-space-heading">
<div class="input-inline input-transparent edit-space-name">
{{focus-input id="folder-name" type="text" value=folderName class=(if hasNameError 'error-inline') placeholder="Name" autocomplete="off"}}
</div>
<div>

View file

@ -1,17 +1,36 @@
{{folder/space-heading folder=folder permissions=permissions}}
<div class="margin-bottom-20">
{{folder/space-heading folder=folder permissions=permissions documents=documents categories=categories}}
{{folder/space-toolbar folders=folders folder=folder
permissions=permissions hasSelectedDocuments=hasSelectedDocuments
onDeleteDocument=(action 'onDeleteDocument') onMoveDocument=(action 'onMoveDocument')
onDeleteSpace=(action 'onDeleteSpace') onStartDocument=(action 'onStartDocument')}}
<div class="margin-bottom-20 clearfix" />
{{folder/space-toolbar folders=folders folder=folder
permissions=permissions hasSelectedDocuments=hasSelectedDocuments
onDeleteDocument=(action 'onDeleteDocument') onMoveDocument=(action 'onMoveDocument')
onDeleteSpace=(action 'onDeleteSpace') onStartDocument=(action 'onStartDocument')}}
</div>
<div class="clearfix" />
{{#if showStartDocument}}
{{folder/start-document folder=folder templates=templates permissions=permissions
onImport=(action 'onImport') onHideStartDocument=(action 'onHideStartDocument')}}
{{else}}
{{folder/documents-list documents=documents folders=folders folder=folder
{{#if (gt categories.length 0)}}
<div class="category-filter">
{{#if (gt rootDocCount 0)}}
<div class="regular-button button-white {{if (eq folder.id selectedCategory) 'selected'}}" id="uncategorized-button" data-tooltip="Documents without category" data-tooltip-position="top center" {{action 'onDocumentFilter' 'space' folder.id}}>
{{folder.name}} ({{rootDocCount}})
</div>
{{/if}}
{{#each categories as |cat index|}}
<div class="button-gap"/>
<div class="regular-button button-white {{if (eq cat.id selectedCategory) 'selected'}}" {{action 'onDocumentFilter' 'category' cat.id}}>
{{cat.category}} ({{cat.docCount}})
</div>
{{/each}}
</div>
{{/if}}
{{folder/documents-list documents=filteredDocs folders=folders folder=folder
templates=templates permissions=permissions selectedDocuments=(mut selectedDocuments)
onImport=(action 'onImport')}}
{{/if}}