A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
still not happy with the document list table, but it has clickable tags and correspondents #54
jonaswinklerab41a708e909
diff --git a/src-ui/src/app/components/document-list/document-list.component.html b/src-ui/src/app/components/document-list/document-list.component.htmlindex 8bd5b1a55..cc682b8e3 100644--- a/src-ui/src/app/components/document-list/document-list.component.html+++ b/src-ui/src/app/components/document-list/document-list.component.html@@ -84,7 +84,7 @@</app-document-card-large></div>-<table class="table table-hover table-sm border shadow" *ngIf="displayMode == 'details'">+<table class="table table-sm border shadow" *ngIf="displayMode == 'details'"><thead><th class="d-none d-lg-table-cell">ASN</th><th class="d-none d-md-table-cell">Correspondent</th>@@ -94,13 +94,30 @@<th class="d-none d-xl-table-cell">Added</th></thead><tbody>- <tr *ngFor="let d of list.documents" routerLink="/documents/{{d.id}}">- <td class="d-none d-lg-table-cell">{{d.archive_serial_number}}</td>- <td class="d-none d-md-table-cell">{{d.correspondent ? d.correspondent.name : ''}}</td>- <td>{{d.title}}<app-tag [tag]="t" *ngFor="let t of d.tags" class="ml-1"></app-tag></td>- <td class="d-none d-xl-table-cell">{{d.document_type ? d.document_type.name : ''}}</td>- <td>{{d.created | date}}</td>- <td class="d-none d-xl-table-cell">{{d.added | date}}</td>+ <tr *ngFor="let d of list.documents">+ <td class="d-none d-lg-table-cell">+ {{d.archive_serial_number}}+ </td>+ <td class="d-none d-md-table-cell">+ <ng-container *ngIf="d.correspondent">+ <a [routerLink]="" (click)="filterByCorrespondent(d.correspondent)" title="Filter by correspondent">{{d.correspondent.name}}</a>+ </ng-container>+ </td>+ <td>+ <a routerLink="/documents/{{d.id}}" title="Edit document">{{d.title}}</a>+ <app-tag [tag]="t" *ngFor="let t of d.tags" class="ml-1" clickable="true" linkTitle="Filter by tag" (click)="filterByTag(t)"></app-tag>+ </td>+ <td class="d-none d-xl-table-cell">+ <ng-container *ngIf="d.document_type">+ <a [routerLink]="" (click)="filterByDocumentType(d.document_type)" title="Filter by document type">{{d.document_type.name}}</a>+ </ng-container>+ </td>+ <td>+ {{d.created | date}}+ </td>+ <td class="d-none d-xl-table-cell">+ {{d.added | date}}+ </td></tr></tbody></table>diff --git a/src-ui/src/app/components/document-list/document-list.component.ts b/src-ui/src/app/components/document-list/document-list.component.tsindex 774e83a07..08f94c2ee 100644--- a/src-ui/src/app/components/document-list/document-list.component.ts+++ b/src-ui/src/app/components/document-list/document-list.component.ts@@ -2,8 +2,9 @@ import { Component, OnInit } from '@angular/core';import { ActivatedRoute } from '@angular/router';import { NgbModal } from '@ng-bootstrap/ng-bootstrap';import { cloneFilterRules, FilterRule } from 'src/app/data/filter-rule';-import { FILTER_CORRESPONDENT, FILTER_HAS_TAG, FILTER_RULE_TYPES } from 'src/app/data/filter-rule-type';+import { FILTER_CORRESPONDENT, FILTER_DOCUMENT_TYPE, FILTER_HAS_TAG, FILTER_RULE_TYPES } from 'src/app/data/filter-rule-type';import { PaperlessCorrespondent } from 'src/app/data/paperless-correspondent';+import { PaperlessDocumentType } from 'src/app/data/paperless-document-type';import { PaperlessTag } from 'src/app/data/paperless-tag';import { SavedViewConfig } from 'src/app/data/saved-view-config';import { DocumentListViewService } from 'src/app/services/document-list-view.service';@@ -109,4 +110,14 @@ export class DocumentListComponent implements OnInit {this.applyFilterRules()}+ filterByDocumentType(dt: PaperlessDocumentType) {+ let existing_rule = this.filterRules.find(rule => rule.type.id == FILTER_DOCUMENT_TYPE)+ if (existing_rule) {+ existing_rule.value = dt.id+ } else {+ this.filterRules.push({type: FILTER_RULE_TYPES.find(t => t.id == FILTER_DOCUMENT_TYPE), value: dt.id})+ }+ this.applyFilterRules()+ }+}