Compare commits
107
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
27ba139810 | ||
|
|
27ff38b79e | ||
|
|
b89b51b121 | ||
|
|
1b31388232 | ||
|
|
8256e73f04 | ||
|
|
fc4e59ec00 | ||
|
|
428e00ba23 | ||
|
|
2ccbb08c3f | ||
|
|
eefc026a17 | ||
|
|
d89022a280 | ||
|
|
93bd24c9d2 | ||
|
|
197aec2945 | ||
|
|
e16d58cff5 | ||
|
|
92667009be | ||
|
|
c93657f40e | ||
|
|
16658f5939 | ||
|
|
ec0af59596 | ||
|
|
9e1f9d6d9d | ||
|
|
e652b927ce | ||
|
|
5a97f3f94b | ||
|
|
d521d7733b | ||
|
|
99bde7b613 | ||
|
|
cc5b7eb4e3 | ||
|
|
2b4a0efef8 | ||
|
|
9502917df6 | ||
|
|
6f3c72ef9a | ||
|
|
3915149ea1 | ||
|
|
f07fb6e1b3 | ||
|
|
e328c439ff | ||
|
|
caa9a340a4 | ||
|
|
b07537aa9a | ||
|
|
8e35e6c726 | ||
|
|
05a43a05a4 | ||
|
|
846a997323 | ||
|
|
e0231a4638 | ||
|
|
b4db388d58 | ||
|
|
e957d9aa53 | ||
|
|
72031824bf | ||
|
|
ae60fc8c2b | ||
|
|
cc3c7ad481 | ||
|
|
484edce5ab | ||
|
|
66aee1446c | ||
|
|
971392345b | ||
|
|
c5ae3377bd | ||
|
|
4ddd031976 | ||
|
|
c18180f344 | ||
|
|
c07bbcb33f | ||
|
|
142c2ac9ff | ||
|
|
88bf679fd9 | ||
|
|
a5de83fe7f | ||
|
|
63b4c33fb9 | ||
|
|
e0a1ba56dd | ||
|
|
aaa913f204 | ||
|
|
cf5747f0bd | ||
|
|
7df9e1f532 | ||
|
|
38d8b34ab4 | ||
|
|
24d07fcc17 | ||
|
|
14116c85e7 | ||
|
|
20b95fb506 | ||
|
|
3c25595fc2 | ||
|
|
af1034f84b | ||
|
|
cfc0925e04 | ||
|
|
746c03c198 | ||
|
|
baae3c2701 | ||
|
|
d88cd05857 | ||
|
|
73c80c3f7a | ||
|
|
35f9989255 | ||
|
|
33ddd033f2 | ||
|
|
b8fabb623e | ||
|
|
37c0fa4fab | ||
|
|
86ca37909b | ||
|
|
ce19525758 | ||
|
|
bb872ab56f | ||
|
|
ea342831da | ||
|
|
8d0ac690fb | ||
|
|
e0f14941e8 | ||
|
|
7cbb50565c | ||
|
|
274df28f39 | ||
|
|
4a6160869c | ||
|
|
87d969f44c | ||
|
|
7746ab4522 | ||
|
|
58cb42b44a | ||
|
|
8e330fc97a | ||
|
|
6a3ad77950 | ||
|
|
3d56621253 | ||
|
|
9e6cb1b868 | ||
|
|
321fad0564 | ||
|
|
eb7b767e35 | ||
|
|
98b26b8e16 | ||
|
|
176d1fa2eb | ||
|
|
072134366c | ||
|
|
afd92af168 | ||
|
|
2d61698509 | ||
|
|
5e286798d5 | ||
|
|
b7a825301a | ||
|
|
02da012603 | ||
|
|
4d99e72a0e | ||
|
|
26c0568b1e | ||
|
|
aa4d9782b7 | ||
|
|
43ccf6682c | ||
|
|
5e096bc8ce | ||
|
|
1e131f0217 | ||
|
|
321869edb0 | ||
|
|
c6e8faa718 | ||
|
|
6696c4d7a5 | ||
|
|
88254bdb79 | ||
|
|
4cc6bf889e |
No files matched your search
+3
-1
@@ -36,11 +36,13 @@ RUN apt-get update \
|
||||
&& echo "deb http://deb.debian.org/debian bullseye main" > /etc/apt/sources.list.d/bullseye.list \
|
||||
&& apt-get update \
|
||||
&& apt-get -y --no-install-recommends install \
|
||||
# fixes sudo / gosu issues
|
||||
libseccomp2 \
|
||||
# Mime type detection
|
||||
file \
|
||||
libmagic-dev \
|
||||
media-types \
|
||||
# OCRmyPDF dependencies
|
||||
# OCRmyPDF dependencies
|
||||
liblept5 \
|
||||
qpdf \
|
||||
tesseract-ocr \
|
||||
|
||||
+11
-17
@@ -460,6 +460,7 @@ Install Paperless using ansible
|
||||
.. note::
|
||||
|
||||
This role currently only supports Debian 10 Buster and Ubuntu 20.04 Focal or later as target hosts.
|
||||
Additionally, only i386 or amd64 based hosts are supported right now, i.e. installation on arm hosts will fail.
|
||||
|
||||
1. Install ansible 2.7+ on the management node.
|
||||
This may be the target host paperless-ng is being installed on or any remote host which can access the target host.
|
||||
@@ -485,29 +486,22 @@ Install Paperless using ansible
|
||||
|
||||
ansible -m ping YourAnsibleTargetHostGoesHere
|
||||
|
||||
2. Clone the repository of paperless-ng:
|
||||
2. Install the latest tag of the ansible role using ansible-galaxy
|
||||
|
||||
.. code:: sh
|
||||
|
||||
git clone https://github.com/jonaswinkler/paperless-ng
|
||||
ansible-galaxy install git+https://github.com/jonaswinkler/paperless-ng.git,ng-1.4.2
|
||||
|
||||
Checkout the latest release tag:
|
||||
|
||||
.. code:: sh
|
||||
|
||||
cd paperless-ng
|
||||
git checkout ng-1.0.0
|
||||
|
||||
3. Create an ansible ``playbook.yml`` in the paperless-ng root directory:
|
||||
3. Create an ansible ``playbook.yml`` in a directory of your choice:
|
||||
|
||||
.. code:: yaml
|
||||
|
||||
- hosts: YourAnsibleTargetHostGoesHere
|
||||
become: yes
|
||||
vars_files:
|
||||
- ansible/vars.yml
|
||||
- vars/paperless-ng.yml
|
||||
roles:
|
||||
- ansible
|
||||
- paperless-ng
|
||||
|
||||
Optional: If you also want to use PostgreSQL on the target system, install and add (for example) the `geerlingguy.postgresql <https://github.com/geerlingguy/ansible-role-postgresql>`_ role:
|
||||
|
||||
@@ -520,10 +514,10 @@ Install Paperless using ansible
|
||||
- hosts: YourAnsibleTargetHostGoesHere
|
||||
become: yes
|
||||
vars_files:
|
||||
- ansible/vars.yml
|
||||
- vars/paperless-ng.yml
|
||||
roles:
|
||||
- geerlingguy.postgresql
|
||||
- ansible
|
||||
- paperless-ng
|
||||
|
||||
Optional: If you also want to use a reverse proxy on the target system, install and add (for example) the `geerlingguy.nginx <https://github.com/geerlingguy/ansible-role-nginx>`_ role:
|
||||
|
||||
@@ -536,13 +530,13 @@ Install Paperless using ansible
|
||||
- hosts: YourAnsibleTargetHostGoesHere
|
||||
become: yes
|
||||
vars_files:
|
||||
- ansible/vars.yml
|
||||
- vars/paperless-ng.yml
|
||||
roles:
|
||||
- geerlingguy.postgresql
|
||||
- ansible
|
||||
- paperless-ng
|
||||
- geerlingguy.nginx
|
||||
|
||||
4. Create ``ansible/vars.yml`` to configure your ansible deployment:
|
||||
4. Create ``vars/paperless-ng.yml`` to configure your ansible deployment:
|
||||
|
||||
.. code:: yaml
|
||||
|
||||
|
||||
+2
-1
@@ -26,7 +26,8 @@
|
||||
"ro-RO": "src/locale/messages.ro_RO.xlf",
|
||||
"ru-RU": "src/locale/messages.ru_RU.xlf",
|
||||
"es-ES": "src/locale/messages.es_ES.xlf",
|
||||
"pl-PL": "src/locale/messages.pl_PL.xlf"
|
||||
"pl-PL": "src/locale/messages.pl_PL.xlf",
|
||||
"sv-SE": "src/locale/messages.sv_SE.xlf"
|
||||
}
|
||||
},
|
||||
"architect": {
|
||||
|
||||
+8
-1
@@ -1731,11 +1731,18 @@
|
||||
<context context-type="linenumber">101</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="499386805970351976" datatype="html">
|
||||
<source>Swedish</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">102</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="4912706592792948707" datatype="html">
|
||||
<source>ISO 8601</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">106</context>
|
||||
<context context-type="linenumber">107</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="2119857572761283468" datatype="html">
|
||||
|
||||
Generated
+15
@@ -8361,6 +8361,21 @@
|
||||
"tslib": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"ngx-drag-drop": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ngx-drag-drop/-/ngx-drag-drop-2.0.0.tgz",
|
||||
"integrity": "sha512-t+4/eiC8zaXKqU1ruNfFEfGs1GpMNwpffD0baopvZFKjQHCb5rhNqFilJ54wO4T0OwGp4/RnsVhlcxe1mX6UJg==",
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"tslib": {
|
||||
"version": "1.14.1",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
|
||||
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"ngx-file-drop": {
|
||||
"version": "10.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ngx-file-drop/-/ngx-file-drop-10.0.0.tgz",
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
"ng2-pdf-viewer": "^6.3.2",
|
||||
"ngx-color": "^6.2.0",
|
||||
"ngx-cookie-service": "^10.1.1",
|
||||
"ngx-drag-drop": "^2.0.0",
|
||||
"ngx-file-drop": "^10.0.0",
|
||||
"ngx-infinite-scroll": "^9.1.0",
|
||||
"rxjs": "~6.6.0",
|
||||
|
||||
@@ -11,12 +11,14 @@ import { SettingsComponent } from './components/manage/settings/settings.compone
|
||||
import { TagListComponent } from './components/manage/tag-list/tag-list.component';
|
||||
import { NotFoundComponent } from './components/not-found/not-found.component';
|
||||
import {DocumentAsnComponent} from "./components/document-asn/document-asn.component";
|
||||
import { SplitMergeComponent } from './components/split-merge/split-merge.component';
|
||||
|
||||
const routes: Routes = [
|
||||
{path: '', redirectTo: 'dashboard', pathMatch: 'full'},
|
||||
{path: '', component: AppFrameComponent, children: [
|
||||
{path: 'dashboard', component: DashboardComponent },
|
||||
{path: 'documents', component: DocumentListComponent },
|
||||
{path: 'split_merge', component: SplitMergeComponent },
|
||||
{path: 'view/:id', component: DocumentListComponent },
|
||||
{path: 'documents/:id', component: DocumentDetailComponent },
|
||||
{path: 'asn/:id', component: DocumentAsnComponent },
|
||||
|
||||
@@ -33,6 +33,7 @@ import { DocumentCardSmallComponent } from './components/document-list/document-
|
||||
import { BulkEditorComponent } from './components/document-list/bulk-editor/bulk-editor.component';
|
||||
import { NgxFileDropModule } from 'ngx-file-drop';
|
||||
import { TextComponent } from './components/common/input/text/text.component';
|
||||
import { InputDebounceComponent } from './components/common/input/debounce/input-debounce.component';
|
||||
import { SelectComponent } from './components/common/input/select/select.component';
|
||||
import { CheckComponent } from './components/common/input/check/check.component';
|
||||
import { SaveViewConfigDialogComponent } from './components/document-list/save-view-config-dialog/save-view-config-dialog.component';
|
||||
@@ -64,6 +65,10 @@ import { ApiVersionInterceptor } from './interceptors/api-version.interceptor';
|
||||
import { ColorSliderModule } from 'ngx-color/slider';
|
||||
import { ColorComponent } from './components/common/input/color/color.component';
|
||||
import { DocumentAsnComponent } from './components/document-asn/document-asn.component';
|
||||
import { SplitMergeComponent } from './components/split-merge/split-merge.component';
|
||||
import { DndModule } from 'ngx-drag-drop';
|
||||
import { DocumentChooserComponent } from './components/common/document-chooser/document-chooser.component';
|
||||
import { PageChooserComponent } from './components/common/page-chooser/page-chooser.component';
|
||||
|
||||
import localeFr from '@angular/common/locales/fr';
|
||||
import localeNl from '@angular/common/locales/nl';
|
||||
@@ -75,6 +80,7 @@ import localeRo from '@angular/common/locales/ro';
|
||||
import localeRu from '@angular/common/locales/ru';
|
||||
import localeEs from '@angular/common/locales/es';
|
||||
import localePl from '@angular/common/locales/pl';
|
||||
import localeSv from '@angular/common/locales/sv';
|
||||
|
||||
|
||||
registerLocaleData(localeFr)
|
||||
@@ -88,6 +94,7 @@ registerLocaleData(localeRo)
|
||||
registerLocaleData(localeRu)
|
||||
registerLocaleData(localeEs)
|
||||
registerLocaleData(localePl)
|
||||
registerLocaleData(localeSv)
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
@@ -117,6 +124,7 @@ registerLocaleData(localePl)
|
||||
DocumentCardSmallComponent,
|
||||
BulkEditorComponent,
|
||||
TextComponent,
|
||||
InputDebounceComponent,
|
||||
SelectComponent,
|
||||
CheckComponent,
|
||||
SaveViewConfigDialogComponent,
|
||||
@@ -138,7 +146,10 @@ registerLocaleData(localePl)
|
||||
CustomDatePipe,
|
||||
DateComponent,
|
||||
ColorComponent,
|
||||
DocumentAsnComponent
|
||||
DocumentAsnComponent,
|
||||
SplitMergeComponent,
|
||||
DocumentChooserComponent,
|
||||
PageChooserComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
@@ -151,7 +162,8 @@ registerLocaleData(localePl)
|
||||
InfiniteScrollModule,
|
||||
PdfViewerModule,
|
||||
NgSelectModule,
|
||||
ColorSliderModule
|
||||
ColorSliderModule,
|
||||
DndModule
|
||||
],
|
||||
providers: [
|
||||
DatePipe,
|
||||
|
||||
@@ -68,6 +68,13 @@
|
||||
</svg> <ng-container i18n>Documents</ng-container>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item" *ngIf="splitMergeToolVisible">
|
||||
<a class="nav-link" routerLink="split_merge" routerLinkActive="active" (click)="closeMenu()">
|
||||
<svg class="sidebaricon" fill="currentColor">
|
||||
<use xlink:href="assets/bootstrap-icons.svg#scissors"/>
|
||||
</svg> <ng-container i18n>Split & merge</ng-container>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h6 class="sidebar-heading px-3 mt-4 mb-1 text-muted" *ngIf='savedViewService.sidebarViews.length > 0'>
|
||||
|
||||
@@ -12,6 +12,7 @@ import { DocumentDetailComponent } from '../document-detail/document-detail.comp
|
||||
import { Meta } from '@angular/platform-browser';
|
||||
import { DocumentListViewService } from 'src/app/services/document-list-view.service';
|
||||
import { FILTER_FULLTEXT_QUERY } from 'src/app/data/filter-rule-type';
|
||||
import { SplitMergeService } from 'src/app/services/split-merge.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-app-frame',
|
||||
@@ -27,7 +28,8 @@ export class AppFrameComponent implements OnInit {
|
||||
private searchService: SearchService,
|
||||
public savedViewService: SavedViewService,
|
||||
private list: DocumentListViewService,
|
||||
private meta: Meta
|
||||
private meta: Meta,
|
||||
private splitMergeService: SplitMergeService
|
||||
) {
|
||||
|
||||
}
|
||||
@@ -106,6 +108,10 @@ export class AppFrameComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
get splitMergeToolVisible() {
|
||||
return this.splitMergeService.hasDocuments()
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="modal-basic-title" i18n>Choose Documents</h4>
|
||||
<button type="button" class="close" aria-label="Close" (click)="cancelClicked()">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="m-n2 row row-cols-paperless-cards">
|
||||
<app-document-card-small [simpleCard]="true" [selected]="list.isSelected(d)" (toggleSelected)="toggleSelected(d, $event)" [document]="d" *ngFor="let d of list.documents"></app-document-card-small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline-danger" (click)="cancelClicked()" i18n>Cancel</button>
|
||||
<button type="button" class="btn btn-outline-primary" [disabled]="list.selected.size == 0" (click)="confirmClicked.emit()" i18n>Add Selected</button>
|
||||
</div>
|
||||
@@ -0,0 +1,28 @@
|
||||
@import "/src/theme";
|
||||
|
||||
.modal-body {
|
||||
max-height: 70vh;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
$paperless-card-breakpoints: (
|
||||
0: 2, // xs
|
||||
768px: 3, //md
|
||||
992px: 4, //lg
|
||||
1200px: 5, //xl
|
||||
1400px: 6, // xxl
|
||||
1600px: 7,
|
||||
1800px: 8,
|
||||
2000px: 9
|
||||
);
|
||||
|
||||
.row-cols-paperless-cards {
|
||||
@each $width, $n_cols in $paperless-card-breakpoints {
|
||||
@media(min-width: $width) {
|
||||
> * {
|
||||
flex: 0 0 auto;
|
||||
width: 100% / $n_cols;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { DocumentChooserComponent } from './document-chooser.component';
|
||||
|
||||
describe('DocumentChooserComponent', () => {
|
||||
let component: DocumentChooserComponent;
|
||||
let fixture: ComponentFixture<DocumentChooserComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ DocumentChooserComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(DocumentChooserComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,36 @@
|
||||
import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';
|
||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { PaperlessDocument } from 'src/app/data/paperless-document';
|
||||
import { DocumentListViewService } from 'src/app/services/document-list-view.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-document-chooser',
|
||||
templateUrl: './document-chooser.component.html',
|
||||
styleUrls: ['./document-chooser.component.scss']
|
||||
})
|
||||
export class DocumentChooserComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
public activeModal: NgbActiveModal,
|
||||
public list: DocumentListViewService
|
||||
) { }
|
||||
|
||||
@Output()
|
||||
public confirmClicked = new EventEmitter()
|
||||
|
||||
ngOnInit(): void {
|
||||
this.list.selectNone()
|
||||
this.list.activateSavedView(null)
|
||||
this.list.reload()
|
||||
}
|
||||
|
||||
cancelClicked() {
|
||||
this.list.selectNone()
|
||||
this.activeModal.close()
|
||||
}
|
||||
|
||||
toggleSelected(d: PaperlessDocument, event: MouseEvent): void {
|
||||
if (!event.shiftKey) this.list.toggleSelected(d)
|
||||
else this.list.selectRangeTo(d)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
<input type="text" [class]="cssClasses" [placeholder]="placeholder" [(ngModel)]="inputValue" (keyup)="keyUp($event)" />
|
||||
<span *ngIf="allowClear && inputValue?.length > 0" class="clear-wrapper" title="Clear all" (click)="clear()"><span aria-hidden="true" class="clear">×</span></span>
|
||||
@@ -0,0 +1,23 @@
|
||||
.clear-wrapper {
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
right: 5px;
|
||||
user-select: none;
|
||||
width: 17px;
|
||||
color: #999;
|
||||
|
||||
.clear {
|
||||
display: inline-block;
|
||||
font-size: 18px;
|
||||
line-height: 1;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
&:hover .clear {
|
||||
color: #D0021B;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { InputDebounceComponent } from './text.component';
|
||||
|
||||
describe('InputDebounceComponent', () => {
|
||||
let component: InputDebounceComponent;
|
||||
let fixture: ComponentFixture<InputDebounceComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ InputDebounceComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(InputDebounceComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,66 @@
|
||||
import { Component, Input, Output, ElementRef, EventEmitter } from '@angular/core';
|
||||
import { fromEvent } from 'rxjs';
|
||||
import { map, debounceTime, distinctUntilChanged } from 'rxjs/operators';
|
||||
|
||||
@Component({
|
||||
selector: 'app-input-debounce',
|
||||
templateUrl: './input-debounce.component.html',
|
||||
styleUrls: ['./input-debounce.component.scss']
|
||||
})
|
||||
export class InputDebounceComponent {
|
||||
|
||||
@Input()
|
||||
placeholder: string
|
||||
|
||||
@Input()
|
||||
delay: number = 500
|
||||
|
||||
@Input()
|
||||
classes: string
|
||||
|
||||
@Input()
|
||||
allowClear: boolean = true
|
||||
|
||||
@Input()
|
||||
set pattern(regexStr: string) {
|
||||
this._pattern = new RegExp(regexStr)
|
||||
}
|
||||
|
||||
_pattern: RegExp
|
||||
|
||||
@Output()
|
||||
value: EventEmitter<string> = new EventEmitter<string>()
|
||||
|
||||
@Input()
|
||||
inputValue: string;
|
||||
|
||||
constructor(private elementRef: ElementRef) {
|
||||
fromEvent(elementRef.nativeElement, 'keyup').pipe(
|
||||
map(() => this.inputValue),
|
||||
debounceTime(this.delay),
|
||||
distinctUntilChanged()
|
||||
).subscribe(input =>
|
||||
this.value.emit(input)
|
||||
);
|
||||
}
|
||||
|
||||
keyUp(event: any) {
|
||||
if (!this._pattern) return
|
||||
if (event.key.length == 1 && !this._pattern.test(event.key)) { // e.g. dont do for backspace
|
||||
// invalid character, prevent input
|
||||
event.preventDefault()
|
||||
event.stopImmediatePropagation()
|
||||
this.inputValue = this.inputValue.slice(this.inputValue.length, 1)
|
||||
}
|
||||
}
|
||||
|
||||
get cssClasses(): string {
|
||||
return 'form-control ' + this.classes
|
||||
}
|
||||
|
||||
clear() {
|
||||
this.inputValue = ''
|
||||
this.value.emit(this.inputValue)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="modal-basic-title">{{title}}: {{document.title}}</h4>
|
||||
<button type="button" class="close" aria-label="Close" (click)="cancelClicked()">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<pdf-viewer class="page-chooser-viewer" [class.splitting]="splitting" [src]="previewUrl" [original-size]="false" [zoom]=".25" [autoresize]="true" [show-borders]="true" [show-all]="true" [render-text-mode]="2" (page-rendered)="afterPageRendered($event)" (after-load-complete)="pdfLoaded($event)"></pdf-viewer>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline-danger" (click)="cancelClicked()" i18n>Cancel</button>
|
||||
<button type="button" class="btn btn-outline-primary" (click)="confirmClicked()" [disabled]="pages.length == 0">{{title}}</button>
|
||||
</div>
|
||||
@@ -0,0 +1,89 @@
|
||||
@import "src/theme";
|
||||
|
||||
.modal-body {
|
||||
max-height: 70vh;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
::ng-deep .page-chooser-viewer {
|
||||
min-height: 400px;
|
||||
width: 100%;
|
||||
|
||||
.pdfViewer {
|
||||
display: flex !important;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
|
||||
.page:not(.disabled) {
|
||||
margin: 2px 3% 2rem !important;
|
||||
cursor: pointer;
|
||||
|
||||
.textLayer {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
.textLayer {
|
||||
background-color: $primary !important;
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&:not(.splitting) {
|
||||
.pdfViewer {
|
||||
.page.selected {
|
||||
&::after {
|
||||
position: absolute;
|
||||
top: 0.5rem;
|
||||
left: 0.5rem;
|
||||
display: block;
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
border-radius: 0.25rem;
|
||||
content: "";
|
||||
background: $primary no-repeat 50%/50% 50%;
|
||||
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/%3e%3c/svg%3e");
|
||||
}
|
||||
|
||||
.textLayer {
|
||||
background-color: $primary !important;
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.splitting {
|
||||
.pdfViewer {
|
||||
.page:not(:last-child).selected::after,
|
||||
.page:not(:last-child):not(.disabled):hover::after {
|
||||
background-color: $primary;
|
||||
width: 2rem;
|
||||
height: 100%;
|
||||
content: "Split Here";
|
||||
color: #abb2bf; // dark mode text color
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: -2rem;
|
||||
writing-mode: vertical-lr;
|
||||
padding: 0.5rem;
|
||||
text-align: center;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.1rem;
|
||||
font-size: 80%;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.page.disabled {
|
||||
.canvasWrapper,
|
||||
.textLayer {
|
||||
opacity: 0.25;
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { PageChooserComponent } from './page-chooser.component';
|
||||
|
||||
describe('PageChooserComponent', () => {
|
||||
let component: PageChooserComponent;
|
||||
let fixture: ComponentFixture<PageChooserComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ PageChooserComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(PageChooserComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,90 @@
|
||||
import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';
|
||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { PaperlessDocument, PaperlessDocumentPart } from 'src/app/data/paperless-document';
|
||||
import { DocumentService } from 'src/app/services/rest/document.service';
|
||||
import { PDFDocumentProxy } from 'ng2-pdf-viewer';
|
||||
|
||||
@Component({
|
||||
selector: 'app-page-chooser',
|
||||
templateUrl: './page-chooser.component.html',
|
||||
styleUrls: ['./page-chooser.component.scss']
|
||||
})
|
||||
export class PageChooserComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
public activeModal: NgbActiveModal,
|
||||
private documentService: DocumentService
|
||||
) { }
|
||||
|
||||
get previewUrl(): string {
|
||||
return this.documentService.getPreviewUrl(this.document.id)
|
||||
}
|
||||
|
||||
@Input()
|
||||
document: PaperlessDocument
|
||||
|
||||
@Input()
|
||||
splitting: boolean = false
|
||||
|
||||
public pages: number[]
|
||||
|
||||
public enabledPages: number[]
|
||||
|
||||
private nPages: number
|
||||
|
||||
@Output()
|
||||
public confirmPages = new EventEmitter<number[]>()
|
||||
|
||||
get title(): string {
|
||||
return this.splitting ? 'Select Split' : 'Select Pages'
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.pages = (this.document as PaperlessDocumentPart).pages
|
||||
if (this.splitting && this.pages?.length) this.enabledPages = this.pages.concat([])
|
||||
if (!this.pages) this.pages = []
|
||||
}
|
||||
|
||||
cancelClicked() {
|
||||
this.activeModal.close()
|
||||
}
|
||||
|
||||
confirmClicked() {
|
||||
if (this.splitting) {
|
||||
// we need pages as the full range since we wont know length of document later
|
||||
const startPage = this.pages.pop()
|
||||
for (let page = startPage + 1; page <= this.nPages; page++) {
|
||||
if (!this.enabledPages || (this.enabledPages && this.enabledPages.indexOf(page) !== -1)) this.pages.push(page)
|
||||
}
|
||||
}
|
||||
this.confirmPages.emit(this.pages.sort((a, b) => { return a - b }))
|
||||
}
|
||||
|
||||
pdfLoaded(pdf: PDFDocumentProxy) {
|
||||
this.nPages = pdf.numPages
|
||||
}
|
||||
|
||||
public afterPageRendered(pageRenderedEvent: any) {
|
||||
const pageView = pageRenderedEvent.source /* as PDFPageView */
|
||||
const div = pageView.div as HTMLDivElement
|
||||
if (this.splitting && this.enabledPages?.length) {
|
||||
div.classList.toggle('disabled', this.enabledPages.indexOf(parseInt(div.dataset.pageNumber)) == -1)
|
||||
} else {
|
||||
div.classList.toggle('selected', this.pages.indexOf(parseInt(div.dataset.pageNumber)) !== -1)
|
||||
}
|
||||
div.onclick = () => {
|
||||
let pageNum: number = parseInt(div.dataset.pageNumber)
|
||||
if (this.splitting) { // only select 1 page
|
||||
if (pageNum == this.nPages || (this.enabledPages?.length && pageNum == Math.max(...this.enabledPages))) return
|
||||
this.pages = [pageNum]
|
||||
div.parentNode.childNodes.forEach(pageEl => {
|
||||
(pageEl as Element).classList.toggle('selected', false)
|
||||
})
|
||||
div.classList.toggle('selected', true)
|
||||
} else {
|
||||
this.pages.indexOf(pageNum) !== -1 ? this.pages.splice(this.pages.indexOf(pageNum), 1) : this.pages.push(pageNum)
|
||||
div.classList.toggle('selected', this.pages.indexOf(pageNum) !== -1)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-5
@@ -4,11 +4,6 @@ form {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.alert-heading {
|
||||
font-size: 80%;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.alerts-hidden {
|
||||
.btn {
|
||||
line-height: 1;
|
||||
|
||||
@@ -38,6 +38,12 @@
|
||||
</svg> <span class="d-none d-lg-inline" i18n>More like this</span>
|
||||
</button>
|
||||
|
||||
<button type="button" class="btn btn-sm btn-outline-primary mr-2" (click)="splitMerge()">
|
||||
<svg class="buttonicon" fill="currentColor">
|
||||
<use xlink:href="assets/bootstrap-icons.svg#scissors" />
|
||||
</svg> <span class="d-none d-lg-inline" i18n>Add to split/merge</span>
|
||||
</button>
|
||||
|
||||
<button type="button" class="btn btn-sm btn-outline-primary" (click)="close()">
|
||||
<svg class="buttonicon" fill="currentColor">
|
||||
<use xlink:href="assets/bootstrap-icons.svg#x" />
|
||||
@@ -139,7 +145,7 @@
|
||||
<pdf-viewer [src]="previewUrl" [original-size]="false" [show-borders]="true" [show-all]="true" [(page)]="previewCurrentPage" [render-text-mode]="2" (after-load-complete)="pdfPreviewLoaded($event)"></pdf-viewer>
|
||||
</div>
|
||||
<ng-template #nativePdfViewer>
|
||||
<object [data]="previewUrl | safe" type="application/pdf" class="preview-sticky" width="100%"></object>
|
||||
<object [data]="previewUrl | safe" class="preview-sticky" width="100%"></object>
|
||||
</ng-template>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="getContentType() == 'text/plain'">
|
||||
|
||||
@@ -21,6 +21,7 @@ import { TextComponent } from '../common/input/text/text.component';
|
||||
import { SettingsService, SETTINGS_KEYS } from 'src/app/services/settings.service';
|
||||
import { PaperlessDocumentSuggestions } from 'src/app/data/paperless-document-suggestions';
|
||||
import { FILTER_FULLTEXT_MORELIKE } from 'src/app/data/filter-rule-type';
|
||||
import { SplitMergeService } from 'src/app/services/split-merge.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-document-detail',
|
||||
@@ -76,7 +77,8 @@ export class DocumentDetailComponent implements OnInit {
|
||||
private documentListViewService: DocumentListViewService,
|
||||
private documentTitlePipe: DocumentTitlePipe,
|
||||
private toastService: ToastService,
|
||||
private settings: SettingsService) { }
|
||||
private settings: SettingsService,
|
||||
private splitMergeService: SplitMergeService) { }
|
||||
|
||||
get useNativePdfViewer(): boolean {
|
||||
return this.settings.get(SETTINGS_KEYS.USE_NATIVE_PDF_VIEWER)
|
||||
@@ -225,6 +227,11 @@ export class DocumentDetailComponent implements OnInit {
|
||||
this.documentListViewService.quickFilter([{rule_type: FILTER_FULLTEXT_MORELIKE, value: this.documentId.toString()}])
|
||||
}
|
||||
|
||||
splitMerge() {
|
||||
this.splitMergeService.addDocument(this.document)
|
||||
this.router.navigate(["split_merge"])
|
||||
}
|
||||
|
||||
hasNext() {
|
||||
return this.documentListViewService.hasNext(this.documentId)
|
||||
}
|
||||
|
||||
@@ -56,6 +56,12 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto ml-auto mb-2 mb-xl-0 d-flex">
|
||||
<button type="button" class="btn btn-sm btn-outline-primary mr-2" (click)="addToSplitMerge()">
|
||||
<svg class="buttonicon" fill="currentColor">
|
||||
<use xlink:href="assets/bootstrap-icons.svg#scissors" />
|
||||
</svg> <span class="d-none d-lg-inline" i18n>Add to split/merge</span>
|
||||
</button>
|
||||
|
||||
<div class="btn-group btn-group-sm mr-2">
|
||||
<button type="button" class="btn btn-outline-primary btn-sm" (click)="downloadSelected()">
|
||||
<svg width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { Component, EventEmitter, Output } from '@angular/core';
|
||||
import { PaperlessTag } from 'src/app/data/paperless-tag';
|
||||
import { PaperlessCorrespondent } from 'src/app/data/paperless-correspondent';
|
||||
import { PaperlessDocumentType } from 'src/app/data/paperless-document-type';
|
||||
@@ -16,6 +16,8 @@ import { MatchingModel } from 'src/app/data/matching-model';
|
||||
import { SettingsService, SETTINGS_KEYS } from 'src/app/services/settings.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { saveAs } from 'file-saver';
|
||||
import { SplitMergeService } from 'src/app/services/split-merge.service';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'app-bulk-editor',
|
||||
@@ -41,7 +43,9 @@ export class BulkEditorComponent {
|
||||
private modalService: NgbModal,
|
||||
private openDocumentService: OpenDocumentsService,
|
||||
private settings: SettingsService,
|
||||
private toastService: ToastService
|
||||
private toastService: ToastService,
|
||||
private splitMergeService: SplitMergeService,
|
||||
private router: Router
|
||||
) { }
|
||||
|
||||
applyOnClose: boolean = this.settings.get(SETTINGS_KEYS.BULK_EDIT_APPLY_ON_CLOSE)
|
||||
@@ -214,4 +218,9 @@ export class BulkEditorComponent {
|
||||
saveAs(result, 'documents.zip');
|
||||
})
|
||||
}
|
||||
|
||||
addToSplitMerge() {
|
||||
this.splitMergeService.addDocuments(this.list.selectedDocuments)
|
||||
this.router.navigate(["split_merge"])
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="top: 0; right: 0; font-size: large" class="text-right position-absolute mr-1">
|
||||
<div *ngIf="!simpleCard" style="top: 0; right: 0; font-size: large" class="text-right position-absolute mr-1">
|
||||
<div *ngFor="let t of getTagsLimited$() | async">
|
||||
<app-tag [tag]="t" (click)="clickTag.emit(t.id);$event.stopPropagation()" [clickable]="true" linkTitle="Filter by tag" i18n-linkTitle></app-tag>
|
||||
</div>
|
||||
@@ -22,13 +22,13 @@
|
||||
|
||||
<div class="card-body p-2">
|
||||
<p class="card-text">
|
||||
<ng-container *ngIf="document.correspondent">
|
||||
<ng-container *ngIf="document.correspondent && !simpleCard">
|
||||
<a [routerLink]="" title="Filter by correspondent" i18n-title (click)="clickCorrespondent.emit(document.correspondent);$event.stopPropagation()" class="font-weight-bold">{{(document.correspondent$ | async)?.name}}</a>:
|
||||
</ng-container>
|
||||
{{document.title | documentTitle}}
|
||||
</p>
|
||||
</div>
|
||||
<div class="card-footer pt-0 pb-2 px-2">
|
||||
<div *ngIf="!simpleCard" class="card-footer pt-0 pb-2 px-2">
|
||||
<div class="list-group list-group-flush border-0 pt-1 pb-2 card-info">
|
||||
<button *ngIf="document.document_type" type="button" class="list-group-item list-group-item-action bg-transparent pl-0 p-1 border-0" title="Filter by document type"
|
||||
(click)="clickDocumentType.emit(document.document_type);$event.stopPropagation()">
|
||||
|
||||
+7
-4
@@ -17,12 +17,15 @@ export class DocumentCardSmallComponent implements OnInit {
|
||||
@Input()
|
||||
selected = false
|
||||
|
||||
@Output()
|
||||
toggleSelected = new EventEmitter()
|
||||
|
||||
@Input()
|
||||
document: PaperlessDocument
|
||||
|
||||
@Input()
|
||||
simpleCard: boolean = false
|
||||
|
||||
@Output()
|
||||
toggleSelected = new EventEmitter()
|
||||
|
||||
@Output()
|
||||
clickTag = new EventEmitter<number>()
|
||||
|
||||
@@ -93,6 +96,6 @@ export class DocumentCardSmallComponent implements OnInit {
|
||||
}
|
||||
|
||||
mouseLeaveCard() {
|
||||
this.popover.close()
|
||||
this.popover?.close()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
<app-page-header i18n-title title="Split & Merge Editor">
|
||||
<div class="btn-group mt-2 mt-sm-0">
|
||||
<button class="btn btn-sm btn-outline-primary" i18n-title title="Add Documents" (click)="chooseDocuments()">
|
||||
<svg width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor">
|
||||
<use xlink:href="assets/bootstrap-icons.svg#plus-circle" />
|
||||
</svg> <ng-container i18n>Add Documents</ng-container>
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group ml-2 mt-2 mt-sm-0">
|
||||
<button type="button" class="btn btn-sm btn-outline-primary"
|
||||
[popoverTitle]="optionsTitle" [autoClose]="'outside'" [ngbPopover]="optionsPopoverBody" popoverClass="shadow" #optionsPopover="ngbPopover">
|
||||
<svg width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor">
|
||||
<use xlink:href="assets/bootstrap-icons.svg#gear" />
|
||||
</svg> <ng-container i18n>Options</ng-container>
|
||||
</button>
|
||||
<ng-template #optionsTitle>
|
||||
<ng-container i18n>Options</ng-container>
|
||||
<button type="button" class="close" aria-label="Close" (click)="optionsPopover.close()">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</ng-template>
|
||||
<ng-template #optionsPopoverBody>
|
||||
<div class="form-group row text-dark">
|
||||
<label for="source_options" class="col-sm-3 col-form-label pt-0" i18n>Delete source documents</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="custom-control custom-switch">
|
||||
<input type="checkbox" class="custom-control-input" id="source_options-delete" [(ngModel)]="delete_source_documents">
|
||||
<label class="custom-control-label" for="source_options-delete" [class.text-danger]="delete_source_documents"><ng-container i18n>Delete</ng-container><br/><small [class.text-muted]="!delete_source_documents" i18n>Source documents will be immediately deleted.</small></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group mt-4 row text-dark">
|
||||
<label for="metadata_options" class="col-sm-3 col-form-label pt-0" i18n>Output document metadata</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="custom-control custom-radio">
|
||||
<input type="radio" id="metadata_setting-copy" name="metadata_setting" class="custom-control-input" [value]="splitMergeMetadata.COPY_FIRST" [(ngModel)]="metadata_setting">
|
||||
<label class="custom-control-label" for="metadata_setting-copy"><ng-container i18n>First document</ng-container><br/><small class="text-muted" i18n>Metadata will be copied from first document.</small></label>
|
||||
</div>
|
||||
<div class="custom-control custom-radio">
|
||||
<input type="radio" id="metadata_setting-redo" name="metadata_setting" class="custom-control-input" [value]="splitMergeMetadata.REDO" [(ngModel)]="metadata_setting">
|
||||
<label class="custom-control-label" for="metadata_setting-redo"><ng-container i18n>Redo</ng-container><br/><small class="text-muted" i18n>Metadata detection will be re-run on new document.</small></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
</div>
|
||||
|
||||
<div class="btn-group ml-2 mr-2 mr-sm-5 mt-2 mt-sm-0">
|
||||
<button class="btn btn-sm btn-outline-primary" i18n-title title="Save" (click)="save()" [disabled]="splitMergeService.getDocuments().length < 1">
|
||||
<svg width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor">
|
||||
<use xlink:href="assets/bootstrap-icons.svg#check-circle" />
|
||||
</svg> <ng-container i18n>Save</ng-container>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="btn-group ml-sm-5 mt-2 mt-sm-0">
|
||||
<button class="btn btn-sm btn-outline-danger" i18n-title title="Cancel" (click)="cancel()">
|
||||
<svg width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor">
|
||||
<use xlink:href="assets/bootstrap-icons.svg#slash-circle" />
|
||||
</svg> <ng-container i18n>Cancel</ng-container>
|
||||
</button>
|
||||
</div>
|
||||
</app-page-header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-lg-5">
|
||||
<div class="h-100" dndDropzone (dndDrop)="onDrop($event, documents)">
|
||||
<div class="spacer bg-primary" dndPlaceholderRef>
|
||||
</div>
|
||||
<div *ngFor="let d of documents; let i = index" class="card w-100 mb-3" [class.separator-card]="d.is_separator" [dndDraggable]="d" dndEffectAllowed="move" (dndMoved)="onDragged(d, documents)">
|
||||
<ng-container *ngIf="d.is_separator">
|
||||
<div class="separator"></div>
|
||||
<h6 class="text-muted small font-weight-bold d-inline-block py-2 px-3 mb-0 mx-auto bg-body" i18n>Document End</h6>
|
||||
<button class="btn btn-sm btn-danger" title="Remove" (click)="removeDocument(d, i)">
|
||||
<svg width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor">
|
||||
<use xlink:href="assets/bootstrap-icons.svg#trash" />
|
||||
</svg>
|
||||
</button>
|
||||
</ng-container>
|
||||
<div *ngIf="!d.is_separator" class="row no-gutters">
|
||||
<div class="col-md-3 bg-light d-flex handle" dndHandle>
|
||||
<svg width="2em" height="100%" viewBox="0 0 16 16" fill="currentColor" class="mx-auto">
|
||||
<use xlink:href="assets/bootstrap-icons.svg#grip-horizontal" />
|
||||
</svg>
|
||||
<div class="doc-thumb" [style.background-image]="'url(' + getThumbUrl(d.id) + ')'"></div>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="card-body p-3">
|
||||
<h6 class="card-title mb-2">{{d.title}}</h6>
|
||||
<div class="card-actions">
|
||||
<div class="btn-toolbar btn-toolbar-sm justify-content-between w-100">
|
||||
<button class="btn btn-sm btn-outline-danger flex-fill" i18n-title title="Remove" (click)="removeDocument(d, i)">
|
||||
<svg width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor">
|
||||
<use xlink:href="assets/bootstrap-icons.svg#trash" />
|
||||
</svg><span class="d-none d-xl-inline"> <ng-container i18n>Remove</ng-container></span>
|
||||
</button>
|
||||
<button class="btn btn-sm btn-outline-primary ml-3 flex-fill" i18n-title title="Split" (click)="chooseSplit(d, i)">
|
||||
<svg width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor">
|
||||
<use xlink:href="assets/bootstrap-icons.svg#scissors" />
|
||||
</svg><span class="d-none d-xl-inline"> <ng-container i18n>Split</ng-container></span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="input-group input-group-sm w-100 mt-3">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text"><ng-container i18n>Pages</ng-container>:</div>
|
||||
</div>
|
||||
<app-input-debounce delay="500" classes="form-control-sm" placeholder="All" ngbTooltip="e.g. 1-3,5" pattern="[0-9\,\-]" [inputValue]="formatPages(d.pages)" (value)="pagesFieldChange($event, d, i)"></app-input-debounce>
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-primary" type="button" i18n-title title="Select Pages" (click)="choosePages(d, i)">
|
||||
<svg width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor">
|
||||
<use xlink:href="assets/bootstrap-icons.svg#pencil" />
|
||||
</svg><span class="d-none d-xl-inline"> <ng-container i18n>Select Pages</ng-container></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 col-lg-7">
|
||||
<ngb-alert *ngIf="error" type="danger" class="mt-2 mb-0" [dismissible]="false">
|
||||
<h6 class="alert-heading" i18n>An error occurred during operation</h6>
|
||||
<p class="mb-0 pb-1" i18n>Please check document settings and parts.</p>
|
||||
<p class="mb-0 pb-1 small"><ng-container i18n>Message</ng-container>: <span class="font-italic">{{error}}</span></p>
|
||||
</ngb-alert>
|
||||
<ng-container *ngIf="!error && previewUrls.length > 1">
|
||||
<ul ngbNav #previewNav="ngbNav" class="nav-tabs">
|
||||
<li *ngFor="let previewUrl of previewUrls; let j = index" [ngbNavItem]="j">
|
||||
<a class="bg-light" ngbNavLink><ng-container i18n>Document</ng-container> {{j + 1}}</a>
|
||||
<ng-template ngbNavContent>
|
||||
<div class="preview-container px-2 tabbed text-center bg-light">
|
||||
<ng-container [ngTemplateOutlet]="previewHeader" [ngTemplateOutletContext]="{ $implicit: j }"></ng-container>
|
||||
<pdf-viewer [src]="previewUrl" [original-size]="false" [show-borders]="true" [show-all]="true" [render-text-mode]="2" [(page)]="previewCurrentPages[j]" (after-load-complete)="pdfPreviewLoaded($event, j)" (page-rendered)="pdfPageRendered($event, j)"></pdf-viewer>
|
||||
</div>
|
||||
</ng-template>
|
||||
</li>
|
||||
</ul>
|
||||
<div [ngbNavOutlet]="previewNav"></div>
|
||||
</ng-container>
|
||||
<div *ngIf="!error && previewUrls.length <= 1" class="preview-container px-2 text-center bg-light">
|
||||
<ng-container [ngTemplateOutlet]="previewHeader" [ngTemplateOutletContext]="{ $implicit: 0 }"></ng-container>
|
||||
<pdf-viewer *ngIf="previewUrls.length > 0" [src]="previewUrls[0]" [original-size]="false" [show-borders]="true" [show-all]="true" [render-text-mode]="2" [(page)]="previewCurrentPages[0]" (after-load-complete)="pdfPreviewLoaded($event, 0)" (page-rendered)="pdfPageRendered($event, 0)"></pdf-viewer>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ng-template #previewHeader let-index>
|
||||
<div class="d-flex mt-2 p-2 w-100 justify-space-between">
|
||||
<h6 class="text-muted mt-1" [class.mx-auto]="previewNumPages[index] == undefined" [class.mr-auto]="previewNumPages[index] !== undefined" i18n>Preview</h6>
|
||||
<div *ngIf="previewNumPages[index] !== undefined" class="input-group input-group-sm w-auto">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text" i18n>Page</div>
|
||||
</div>
|
||||
<input class="form-control flex-grow-0 w-auto" type="number" min="1" [max]="previewNumPages[index]" [(ngModel)]="previewCurrentPages[index]" />
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text" i18n>of {{previewNumPages[index]}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="loading" class="spinner-border" role="status">
|
||||
<span class="sr-only" i18n>Loading...</span>
|
||||
</div>
|
||||
</ng-template>
|
||||
@@ -0,0 +1,116 @@
|
||||
@import "/src/theme";
|
||||
|
||||
.card {
|
||||
.handle {
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
.doc-thumb {
|
||||
background-position: top center;
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
min-height: 5rem;
|
||||
height: 100%;
|
||||
width: 70%;
|
||||
}
|
||||
|
||||
&.separator-card {
|
||||
border: none;
|
||||
background: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
.spacer {
|
||||
min-height: 0.25rem;
|
||||
width: 100%;
|
||||
margin: 1rem;
|
||||
}
|
||||
|
||||
.preview-container {
|
||||
height: calc(100vh - 170px);
|
||||
overflow: hidden;
|
||||
|
||||
&.tabbed {
|
||||
height: calc(100vh - 200px);
|
||||
}
|
||||
|
||||
.spinner-border {
|
||||
margin-top: 40%;
|
||||
}
|
||||
}
|
||||
|
||||
.split-document-preview ::ng-deep .ng2-pdf-viewer-container {
|
||||
width: 1px !important;
|
||||
height: 1px !important;
|
||||
overflow: hidden !important;
|
||||
}
|
||||
|
||||
::ng-deep .document-selector {
|
||||
width: 80vw;
|
||||
min-width: 50vw;
|
||||
}
|
||||
|
||||
button span {
|
||||
margin-left: 0.15rem;
|
||||
}
|
||||
|
||||
app-input-debounce {
|
||||
flex: 1 1;
|
||||
position: relative;
|
||||
|
||||
::ng-deep .form-control {
|
||||
border-radius: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.nav-link.bg-light {
|
||||
border-bottom-color: #f8f9fa;
|
||||
|
||||
&:not(.active) {
|
||||
background-color: #fff !important;
|
||||
border-bottom-color: #dee2e6;
|
||||
}
|
||||
}
|
||||
|
||||
.separator-card {
|
||||
.separator {
|
||||
border: 0;
|
||||
height: 20px;
|
||||
opacity: 0.5;
|
||||
background-color: transparent !important;
|
||||
background-image: url("data:image/svg+xml;utf8, <svg viewBox='0 0 200 110' xmlns='http://www.w3.org/2000/svg'><path d='M -15 110 L100 10 L215 110' fill='none' stroke='%23000000' stroke-width='1' vector-effect='non-scaling-stroke'/></svg>");
|
||||
background-position: bottom left;
|
||||
background-size: 2% auto;
|
||||
background-repeat: repeat-x;
|
||||
}
|
||||
|
||||
h6 {
|
||||
text-transform: uppercase;
|
||||
text-align: center;
|
||||
letter-spacing: 0.1em;
|
||||
margin-top: -20px !important;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
button {
|
||||
transition: all 0.3s ease;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
&:hover button {
|
||||
opacity: 1;
|
||||
pointer-events: all;
|
||||
}
|
||||
}
|
||||
|
||||
::ng-deep .popover {
|
||||
min-width: 30rem;
|
||||
|
||||
.close {
|
||||
line-height: 0.7;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { SplitMergeComponent } from './split-merge.component';
|
||||
|
||||
describe('SplitMergeComponent', () => {
|
||||
let component: SplitMergeComponent;
|
||||
let fixture: ComponentFixture<SplitMergeComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ SplitMergeComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(SplitMergeComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,212 @@
|
||||
import { Component, OnInit, OnDestroy } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { SplitMergeMetadata } from 'src/app/data/split-merge-request';
|
||||
import { SplitMergeService } from 'src/app/services/split-merge.service';
|
||||
import { DocumentService } from 'src/app/services/rest/document.service';
|
||||
import { DocumentListViewService } from 'src/app/services/document-list-view.service';
|
||||
import { PaperlessDocument, PaperlessDocumentPart } from 'src/app/data/paperless-document';
|
||||
import { DndDropEvent } from 'ngx-drag-drop';
|
||||
import { Subject, Subscription } from 'rxjs';
|
||||
import { debounceTime } from 'rxjs/operators';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { DocumentChooserComponent } from 'src/app/components/common/document-chooser/document-chooser.component'
|
||||
import { PageChooserComponent } from 'src/app/components/common/page-chooser/page-chooser.component'
|
||||
import { PDFDocumentProxy } from 'ng2-pdf-viewer';
|
||||
|
||||
@Component({
|
||||
selector: 'app-split-merge',
|
||||
templateUrl: './split-merge.component.html',
|
||||
styleUrls: ['./split-merge.component.scss']
|
||||
})
|
||||
export class SplitMergeComponent implements OnInit, OnDestroy {
|
||||
|
||||
public loading: boolean = false
|
||||
|
||||
public previewUrls: string[] = []
|
||||
public previewNumPages: number[] = []
|
||||
public previewCurrentPages: number[] = []
|
||||
|
||||
public delete_source_documents: boolean = false
|
||||
|
||||
public metadata_setting: SplitMergeMetadata = SplitMergeMetadata.COPY_FIRST
|
||||
|
||||
private previewDebounce$ = new Subject()
|
||||
|
||||
private previewSub: Subscription
|
||||
|
||||
public error: string
|
||||
|
||||
constructor(
|
||||
public splitMergeService: SplitMergeService,
|
||||
private documentService: DocumentService,
|
||||
private list: DocumentListViewService,
|
||||
private router: Router,
|
||||
private modalService: NgbModal
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.previewSub = this.previewDebounce$.pipe(
|
||||
debounceTime(400)
|
||||
).subscribe(() => {
|
||||
if (this.splitMergeService.hasDocuments()) {
|
||||
this.save(true)
|
||||
} else {
|
||||
this.previewUrls = []
|
||||
this.error = undefined
|
||||
}
|
||||
})
|
||||
this.previewDebounce$.next()
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.previewDebounce$.complete()
|
||||
}
|
||||
|
||||
get documents(): PaperlessDocument[] {
|
||||
return this.splitMergeService.getDocuments()
|
||||
}
|
||||
|
||||
getThumbUrl(documentId: number) {
|
||||
return this.documentService.getThumbUrl(documentId)
|
||||
}
|
||||
|
||||
get splitMergeMetadata() {
|
||||
return SplitMergeMetadata
|
||||
}
|
||||
|
||||
chooseDocuments() {
|
||||
let modal = this.modalService.open(DocumentChooserComponent, { backdrop: 'static', size: 'xl' })
|
||||
modal.componentInstance.confirmClicked.subscribe(() => {
|
||||
modal.componentInstance.buttonsEnabled = false
|
||||
this.splitMergeService.addDocuments(this.list.selectedDocuments)
|
||||
this.list.selectNone()
|
||||
modal.close()
|
||||
this.previewDebounce$.next()
|
||||
})
|
||||
}
|
||||
|
||||
onDragged(document: PaperlessDocument, documents: PaperlessDocument[]) {
|
||||
const index = this.documents.indexOf(document)
|
||||
this.documents.splice(index, 1)
|
||||
}
|
||||
|
||||
onDrop(event: DndDropEvent, documents: PaperlessDocument[]) {
|
||||
let index = event.index
|
||||
if (typeof index === "undefined") {
|
||||
index = this.documents.length
|
||||
}
|
||||
this.documents.splice(index, 0, event.data)
|
||||
this.previewDebounce$.next()
|
||||
}
|
||||
|
||||
cancel() {
|
||||
this.splitMergeService.clear()
|
||||
this.router.navigate([""])
|
||||
}
|
||||
|
||||
save(preview: boolean = false) {
|
||||
this.loading = true
|
||||
this.previewUrls = []
|
||||
this.splitMergeService.executeSplitMerge(preview, this.delete_source_documents, this.metadata_setting).subscribe(
|
||||
result => {
|
||||
this.loading = false
|
||||
this.error = undefined
|
||||
if (preview) {
|
||||
this.previewUrls = result.map(r => this.splitMergeService.getPreviewUrl(r))
|
||||
} else {
|
||||
this.splitMergeService.clear()
|
||||
this.router.navigate([""])
|
||||
}
|
||||
},
|
||||
error => {
|
||||
this.error = error
|
||||
this.loading = false
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
removeDocument(d: PaperlessDocument, index: number) {
|
||||
this.splitMergeService.removeDocument(d, index)
|
||||
this.previewNumPages[index] = this.previewCurrentPages[index] = undefined
|
||||
this.previewDebounce$.next()
|
||||
}
|
||||
|
||||
choosePages(d: PaperlessDocument, index: number) {
|
||||
let modal = this.modalService.open(PageChooserComponent, { backdrop: 'static', size: 'lg' })
|
||||
modal.componentInstance.document = d
|
||||
modal.componentInstance.confirmPages.subscribe((pages) => {
|
||||
this.splitMergeService.setDocumentPages(d, index, pages)
|
||||
modal.componentInstance.buttonsEnabled = false
|
||||
modal.close()
|
||||
this.previewDebounce$.next()
|
||||
})
|
||||
}
|
||||
|
||||
chooseSplit(d: PaperlessDocument, index: number) {
|
||||
let modal = this.modalService.open(PageChooserComponent, { backdrop: 'static', size: 'lg' })
|
||||
modal.componentInstance.document = d
|
||||
const enabledPages = (d as PaperlessDocumentPart).pages
|
||||
modal.componentInstance.splitting = true
|
||||
modal.componentInstance.confirmPages.subscribe((pages) => {
|
||||
this.splitMergeService.splitDocument(d, index, pages, enabledPages)
|
||||
modal.componentInstance.buttonsEnabled = false
|
||||
modal.close()
|
||||
this.previewDebounce$.next()
|
||||
})
|
||||
}
|
||||
|
||||
pagesFieldChange(pageStr: string, d: PaperlessDocument, index: number) {
|
||||
let pages = pageStr.split(',').map(p => {
|
||||
if (p.indexOf('-') !== -1) {
|
||||
const minmax = p.split('-')
|
||||
let range = []
|
||||
for (let i = parseInt(minmax[0]); i <= parseInt(minmax[1]); i++) {
|
||||
range.push(i)
|
||||
}
|
||||
return range
|
||||
} else if (p.length > 0) {
|
||||
return parseInt(p)
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
})
|
||||
pages = [].concat.apply([], pages) // e.g. flat()
|
||||
pages = pages.filter(page => page !== null)
|
||||
this.splitMergeService.setDocumentPages(d, index, pages as number[])
|
||||
this.previewDebounce$.next()
|
||||
}
|
||||
|
||||
formatPages(pages: number[]): string {
|
||||
let pageStrings = []
|
||||
let rangeStart, rangeEnd
|
||||
|
||||
pages?.forEach(page => {
|
||||
if (rangeStart == undefined) {
|
||||
rangeStart = page
|
||||
} else if (page - rangeStart == 1) {
|
||||
rangeEnd = page
|
||||
} else if (rangeEnd !== undefined && page - rangeEnd == 1) {
|
||||
rangeEnd = page
|
||||
} else {
|
||||
pageStrings.push(rangeEnd !== undefined ? rangeStart + '-' + rangeEnd : rangeStart)
|
||||
rangeStart = page
|
||||
rangeEnd = undefined
|
||||
}
|
||||
})
|
||||
|
||||
if (rangeEnd !== undefined) {
|
||||
pageStrings.push(rangeStart + '-' + rangeEnd)
|
||||
} else if (rangeStart !== undefined) {
|
||||
pageStrings.push(rangeStart)
|
||||
}
|
||||
return pageStrings.join(',')
|
||||
}
|
||||
|
||||
pdfPreviewLoaded(pdf: PDFDocumentProxy, index: number) {
|
||||
this.previewNumPages[index] = pdf.numPages
|
||||
}
|
||||
|
||||
pdfPageRendered(event: any, index) { // CustomEvent is es6
|
||||
if (event.pageNumber > 0 && this.previewCurrentPages[index] == undefined) this.previewCurrentPages[index] = 1
|
||||
}
|
||||
}
|
||||
@@ -52,3 +52,11 @@ export interface PaperlessDocument extends ObjectWithId {
|
||||
__search_hit__?: SearchHit
|
||||
|
||||
}
|
||||
|
||||
export interface PaperlessDocumentPart extends PaperlessDocument {
|
||||
pages: number[]
|
||||
}
|
||||
|
||||
export interface PaperlessDocumentSeparator extends PaperlessDocument {
|
||||
is_separator: boolean
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
export enum SplitMergeMetadata {
|
||||
|
||||
REDO = "redo",
|
||||
|
||||
COPY_FIRST = "copy_first"
|
||||
|
||||
}
|
||||
|
||||
export interface SplitMergePlanDocumentPart {
|
||||
|
||||
document: number,
|
||||
|
||||
pages?: string
|
||||
|
||||
}
|
||||
|
||||
export type SplitMergePlan = SplitMergePlanDocumentPart[][]
|
||||
|
||||
export interface SplitMergeRequest {
|
||||
|
||||
split_merge_plan: SplitMergePlan
|
||||
|
||||
delete_source: boolean
|
||||
|
||||
metadata: SplitMergeMetadata
|
||||
|
||||
preview: boolean
|
||||
|
||||
}
|
||||
@@ -189,6 +189,10 @@ export class DocumentListViewService {
|
||||
return this.activeListViewState.selected
|
||||
}
|
||||
|
||||
get selectedDocuments(): PaperlessDocument[] {
|
||||
return this.activeListViewState.documents.filter(d => this.activeListViewState.selected.has(d.id))
|
||||
}
|
||||
|
||||
setSort(field: string, reverse: boolean) {
|
||||
this.activeListViewState.sortField = field
|
||||
this.activeListViewState.sortReverse = reverse
|
||||
|
||||
@@ -98,7 +98,8 @@ export class SettingsService {
|
||||
{code: "ro-ro", name: $localize`Romanian`, englishName: "Romanian", dateInputFormat: "dd.mm.yyyy"},
|
||||
{code: "ru-ru", name: $localize`Russian`, englishName: "Russian", dateInputFormat: "dd.mm.yyyy"},
|
||||
{code: "es-es", name: $localize`Spanish`, englishName: "Spanish", dateInputFormat: "dd/mm/yyyy"},
|
||||
{code: "pl-pl", name: $localize`Polish`, englishName: "Polish", dateInputFormat: "dd.mm.yyyy"}
|
||||
{code: "pl-pl", name: $localize`Polish`, englishName: "Polish", dateInputFormat: "dd.mm.yyyy"},
|
||||
{code: "sv-se", name: $localize`Swedish`, englishName: "Swedish", dateInputFormat: "yyyy-mm-dd"}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { SplitMergeService } from './split-merge.service';
|
||||
|
||||
describe('SplitMergeService', () => {
|
||||
let service: SplitMergeService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(SplitMergeService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,103 @@
|
||||
import { HttpClient, HttpErrorResponse } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable, throwError } from 'rxjs';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { PaperlessDocument, PaperlessDocumentPart, PaperlessDocumentSeparator } from '../data/paperless-document';
|
||||
import { SplitMergeMetadata, SplitMergeRequest } from '../data/split-merge-request';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SplitMergeService {
|
||||
|
||||
// this also needs to incorporate pages, if we want to support that.
|
||||
private documents: PaperlessDocument[] = []
|
||||
|
||||
constructor(private http: HttpClient) { }
|
||||
|
||||
addDocument(document: PaperlessDocument, atIndex?: number) {
|
||||
if (atIndex !== undefined) this.documents.splice(atIndex, 0, document)
|
||||
else this.documents.push(document)
|
||||
}
|
||||
|
||||
addDocuments(documents: PaperlessDocument[]) {
|
||||
this.documents = this.documents.concat(documents)
|
||||
}
|
||||
|
||||
removeDocument(document: PaperlessDocument, atIndex?: number) {
|
||||
if (!atIndex) atIndex = this.documents.indexOf(document)
|
||||
this.documents.splice(atIndex, 1)
|
||||
this.sanitizeStartEndSeparators()
|
||||
}
|
||||
|
||||
getDocuments() {
|
||||
return this.documents
|
||||
}
|
||||
|
||||
hasDocuments(): boolean {
|
||||
return this.documents.length > 0
|
||||
}
|
||||
|
||||
clear() {
|
||||
this.documents = []
|
||||
}
|
||||
|
||||
setDocumentPages(d: PaperlessDocument, index: number, pages: number[]) {
|
||||
(this.documents[index] as PaperlessDocumentPart).pages = pages.length > 0 ? pages : null
|
||||
}
|
||||
|
||||
splitDocument(d: PaperlessDocument, index: number, secondPages: number[], enabledPages?: number[]) {
|
||||
const firstPages = []
|
||||
for (let page = 1; page < secondPages[0]; page++) {
|
||||
if (!enabledPages || (enabledPages?.length && enabledPages.indexOf(page) !== -1)) firstPages.push(page)
|
||||
}
|
||||
(this.documents[index] as PaperlessDocumentPart).pages = firstPages
|
||||
this.documents.splice(index + 1, 0, { is_separator: true } as PaperlessDocumentSeparator)
|
||||
let d2 = { ...d } as PaperlessDocumentPart
|
||||
d2.pages = secondPages
|
||||
this.documents.splice(index + 2, 0, d2)
|
||||
}
|
||||
|
||||
sanitizeStartEndSeparators() {
|
||||
if (this.documents.length > 0 && (this.documents[this.documents.length - 1] as PaperlessDocumentSeparator).is_separator) {
|
||||
this.documents.pop()
|
||||
} else if (this.documents.length > 0 && (this.documents[0] as PaperlessDocumentSeparator).is_separator) {
|
||||
this.documents.shift()
|
||||
}
|
||||
}
|
||||
|
||||
executeSplitMerge(preview: boolean, delete_source: boolean, metadata: SplitMergeMetadata): Observable<string[]> {
|
||||
this.sanitizeStartEndSeparators()
|
||||
let currentDocument = []
|
||||
let split_merge_plan = [currentDocument]
|
||||
this.documents.forEach(d => {
|
||||
if ((d as PaperlessDocumentSeparator).is_separator) {
|
||||
currentDocument = []
|
||||
split_merge_plan.push(currentDocument)
|
||||
} else {
|
||||
currentDocument.push({document: d.id, pages: (d as PaperlessDocumentPart).pages?.join(',')})
|
||||
}
|
||||
})
|
||||
|
||||
let request: SplitMergeRequest = {
|
||||
delete_source: delete_source,
|
||||
preview: preview,
|
||||
metadata: metadata,
|
||||
split_merge_plan: split_merge_plan
|
||||
}
|
||||
return this.http.post<string[]>(`${environment.apiBaseUrl}split_merge/`, request).pipe(
|
||||
catchError(this.handleError)
|
||||
)
|
||||
}
|
||||
|
||||
handleError(error: HttpErrorResponse) {
|
||||
console.log('API split_merge result error:', error)
|
||||
return throwError(error.message)
|
||||
}
|
||||
|
||||
getPreviewUrl(previewKey: string) {
|
||||
return `${environment.apiBaseUrl}split_merge/${previewKey}/`
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1977,11 +1977,19 @@
|
||||
</context-group>
|
||||
<target state="needs-translation">Polish</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="499386805970351976" datatype="html">
|
||||
<source>Swedish</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">102</context>
|
||||
</context-group>
|
||||
<target state="needs-translation">Swedish</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="4912706592792948707" datatype="html">
|
||||
<source>ISO 8601</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">106</context>
|
||||
<context context-type="linenumber">107</context>
|
||||
</context-group>
|
||||
<target state="needs-translation">ISO 8601</target>
|
||||
</trans-unit>
|
||||
|
||||
@@ -1977,11 +1977,19 @@
|
||||
</context-group>
|
||||
<target state="translated">Polnisch</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="499386805970351976" datatype="html">
|
||||
<source>Swedish</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">102</context>
|
||||
</context-group>
|
||||
<target state="translated">Schwedisch</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="4912706592792948707" datatype="html">
|
||||
<source>ISO 8601</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">106</context>
|
||||
<context context-type="linenumber">107</context>
|
||||
</context-group>
|
||||
<target state="translated">ISO 8601</target>
|
||||
</trans-unit>
|
||||
|
||||
@@ -1233,7 +1233,7 @@
|
||||
<context context-type="sourcefile">src/app/components/document-list/filter-editor/filter-editor.component.ts</context>
|
||||
<context context-type="linenumber">91</context>
|
||||
</context-group>
|
||||
<target state="needs-translation">Advanced search</target>
|
||||
<target state="translated">Advanced search</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="2649431021108393503" datatype="html">
|
||||
<source>More like</source>
|
||||
@@ -1241,7 +1241,7 @@
|
||||
<context context-type="sourcefile">src/app/components/document-list/filter-editor/filter-editor.component.ts</context>
|
||||
<context context-type="linenumber">94</context>
|
||||
</context-group>
|
||||
<target state="needs-translation">More like</target>
|
||||
<target state="translated">More like</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="02d184c288f567825a1fcbf83bcd3099a10853d5" datatype="html">
|
||||
<source>Filter tags</source>
|
||||
@@ -1386,7 +1386,7 @@
|
||||
<context context-type="sourcefile">src/app/components/document-list/document-card-small/document-card-small.component.html</context>
|
||||
<context context-type="linenumber">43</context>
|
||||
</context-group>
|
||||
<target state="needs-translation">Created: <x id="INTERPOLATION" equiv-text="{{ document.created | customDate}}"/></target>
|
||||
<target state="translated">Created: <x id="INTERPOLATION" equiv-text="{{ document.created | customDate}}"/></target>
|
||||
</trans-unit>
|
||||
<trans-unit id="0f5d856cb63c69fde44fbfc653ec0655f9040865" datatype="html">
|
||||
<source>Added: <x id="INTERPOLATION" equiv-text="{{ document.added | customDate}}"/></source>
|
||||
@@ -1394,7 +1394,7 @@
|
||||
<context context-type="sourcefile">src/app/components/document-list/document-card-small/document-card-small.component.html</context>
|
||||
<context context-type="linenumber">44</context>
|
||||
</context-group>
|
||||
<target state="needs-translation">Added: <x id="INTERPOLATION" equiv-text="{{ document.added | customDate}}"/></target>
|
||||
<target state="translated">Added: <x id="INTERPOLATION" equiv-text="{{ document.added | customDate}}"/></target>
|
||||
</trans-unit>
|
||||
<trans-unit id="a205126adef6251fc63305f1a6228d07bc2795a8" datatype="html">
|
||||
<source>Modified: <x id="INTERPOLATION" equiv-text="{{ document.modified | customDate}}"/></source>
|
||||
@@ -1402,7 +1402,7 @@
|
||||
<context context-type="sourcefile">src/app/components/document-list/document-card-small/document-card-small.component.html</context>
|
||||
<context context-type="linenumber">45</context>
|
||||
</context-group>
|
||||
<target state="needs-translation">Modified: <x id="INTERPOLATION" equiv-text="{{ document.modified | customDate}}"/></target>
|
||||
<target state="translated">Modified: <x id="INTERPOLATION" equiv-text="{{ document.modified | customDate}}"/></target>
|
||||
</trans-unit>
|
||||
<trans-unit id="7985804062689412812" datatype="html">
|
||||
<source>Error executing bulk operation: <x id="PH" equiv-text="JSON.stringify(error.error)"/></source>
|
||||
@@ -1855,7 +1855,7 @@
|
||||
<context context-type="sourcefile">src/app/components/document-asn/document-asn.component.html</context>
|
||||
<context context-type="linenumber">1</context>
|
||||
</context-group>
|
||||
<target state="needs-translation">Searching document with asn <x id="INTERPOLATION" equiv-text="{{asn}}"/></target>
|
||||
<target state="translated">Searching document with asn <x id="INTERPOLATION" equiv-text="{{asn}}"/></target>
|
||||
</trans-unit>
|
||||
<trans-unit id="2807800733729323332" datatype="html">
|
||||
<source>Yes</source>
|
||||
@@ -1975,13 +1975,21 @@
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">101</context>
|
||||
</context-group>
|
||||
<target state="needs-translation">Polish</target>
|
||||
<target state="translated">Polish</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="499386805970351976" datatype="html">
|
||||
<source>Swedish</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">102</context>
|
||||
</context-group>
|
||||
<target state="needs-translation">Swedish</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="4912706592792948707" datatype="html">
|
||||
<source>ISO 8601</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">106</context>
|
||||
<context context-type="linenumber">107</context>
|
||||
</context-group>
|
||||
<target state="translated">ISO 8601</target>
|
||||
</trans-unit>
|
||||
|
||||
@@ -1977,11 +1977,19 @@
|
||||
</context-group>
|
||||
<target state="needs-translation">Polish</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="499386805970351976" datatype="html">
|
||||
<source>Swedish</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">102</context>
|
||||
</context-group>
|
||||
<target state="needs-translation">Swedish</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="4912706592792948707" datatype="html">
|
||||
<source>ISO 8601</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">106</context>
|
||||
<context context-type="linenumber">107</context>
|
||||
</context-group>
|
||||
<target state="translated">ISO 8601</target>
|
||||
</trans-unit>
|
||||
|
||||
@@ -1977,11 +1977,19 @@
|
||||
</context-group>
|
||||
<target state="translated">Polonais</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="499386805970351976" datatype="html">
|
||||
<source>Swedish</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">102</context>
|
||||
</context-group>
|
||||
<target state="translated">Suédois</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="4912706592792948707" datatype="html">
|
||||
<source>ISO 8601</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">106</context>
|
||||
<context context-type="linenumber">107</context>
|
||||
</context-group>
|
||||
<target state="translated">ISO 8601</target>
|
||||
</trans-unit>
|
||||
|
||||
@@ -1977,11 +1977,19 @@
|
||||
</context-group>
|
||||
<target state="needs-translation">Polish</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="499386805970351976" datatype="html">
|
||||
<source>Swedish</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">102</context>
|
||||
</context-group>
|
||||
<target state="needs-translation">Swedish</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="4912706592792948707" datatype="html">
|
||||
<source>ISO 8601</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">106</context>
|
||||
<context context-type="linenumber">107</context>
|
||||
</context-group>
|
||||
<target state="needs-translation">ISO 8601</target>
|
||||
</trans-unit>
|
||||
|
||||
@@ -1977,11 +1977,19 @@
|
||||
</context-group>
|
||||
<target state="translated">Polacco</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="499386805970351976" datatype="html">
|
||||
<source>Swedish</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">102</context>
|
||||
</context-group>
|
||||
<target state="translated">Svedese</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="4912706592792948707" datatype="html">
|
||||
<source>ISO 8601</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">106</context>
|
||||
<context context-type="linenumber">107</context>
|
||||
</context-group>
|
||||
<target state="translated">ISO 8601</target>
|
||||
</trans-unit>
|
||||
|
||||
@@ -1977,11 +1977,19 @@
|
||||
</context-group>
|
||||
<target state="translated">Pools</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="499386805970351976" datatype="html">
|
||||
<source>Swedish</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">102</context>
|
||||
</context-group>
|
||||
<target state="needs-translation">Swedish</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="4912706592792948707" datatype="html">
|
||||
<source>ISO 8601</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">106</context>
|
||||
<context context-type="linenumber">107</context>
|
||||
</context-group>
|
||||
<target state="translated">ISO 8601</target>
|
||||
</trans-unit>
|
||||
|
||||
@@ -1977,11 +1977,19 @@
|
||||
</context-group>
|
||||
<target state="translated">Polski</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="499386805970351976" datatype="html">
|
||||
<source>Swedish</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">102</context>
|
||||
</context-group>
|
||||
<target state="needs-translation">Swedish</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="4912706592792948707" datatype="html">
|
||||
<source>ISO 8601</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">106</context>
|
||||
<context context-type="linenumber">107</context>
|
||||
</context-group>
|
||||
<target state="translated">ISO 8601</target>
|
||||
</trans-unit>
|
||||
|
||||
@@ -1977,11 +1977,19 @@
|
||||
</context-group>
|
||||
<target state="needs-translation">Polish</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="499386805970351976" datatype="html">
|
||||
<source>Swedish</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">102</context>
|
||||
</context-group>
|
||||
<target state="needs-translation">Swedish</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="4912706592792948707" datatype="html">
|
||||
<source>ISO 8601</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">106</context>
|
||||
<context context-type="linenumber">107</context>
|
||||
</context-group>
|
||||
<target state="translated">ISO 8601</target>
|
||||
</trans-unit>
|
||||
|
||||
@@ -1977,11 +1977,19 @@
|
||||
</context-group>
|
||||
<target state="translated">Polaco</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="499386805970351976" datatype="html">
|
||||
<source>Swedish</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">102</context>
|
||||
</context-group>
|
||||
<target state="translated">Sueco</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="4912706592792948707" datatype="html">
|
||||
<source>ISO 8601</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">106</context>
|
||||
<context context-type="linenumber">107</context>
|
||||
</context-group>
|
||||
<target state="translated">ISO 8601</target>
|
||||
</trans-unit>
|
||||
|
||||
@@ -1233,7 +1233,7 @@
|
||||
<context context-type="sourcefile">src/app/components/document-list/filter-editor/filter-editor.component.ts</context>
|
||||
<context context-type="linenumber">91</context>
|
||||
</context-group>
|
||||
<target state="needs-translation">Advanced search</target>
|
||||
<target state="translated">Căutare avansată</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="2649431021108393503" datatype="html">
|
||||
<source>More like</source>
|
||||
@@ -1241,7 +1241,7 @@
|
||||
<context context-type="sourcefile">src/app/components/document-list/filter-editor/filter-editor.component.ts</context>
|
||||
<context context-type="linenumber">94</context>
|
||||
</context-group>
|
||||
<target state="needs-translation">More like</target>
|
||||
<target state="translated">Asemănătoare</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="02d184c288f567825a1fcbf83bcd3099a10853d5" datatype="html">
|
||||
<source>Filter tags</source>
|
||||
@@ -1386,7 +1386,7 @@
|
||||
<context context-type="sourcefile">src/app/components/document-list/document-card-small/document-card-small.component.html</context>
|
||||
<context context-type="linenumber">43</context>
|
||||
</context-group>
|
||||
<target state="needs-translation">Created: <x id="INTERPOLATION" equiv-text="{{ document.created | customDate}}"/></target>
|
||||
<target state="translated">S-a creat: <x id="INTERPOLATION" equiv-text="{{ document.created | customDate}}"/></target>
|
||||
</trans-unit>
|
||||
<trans-unit id="0f5d856cb63c69fde44fbfc653ec0655f9040865" datatype="html">
|
||||
<source>Added: <x id="INTERPOLATION" equiv-text="{{ document.added | customDate}}"/></source>
|
||||
@@ -1394,7 +1394,7 @@
|
||||
<context context-type="sourcefile">src/app/components/document-list/document-card-small/document-card-small.component.html</context>
|
||||
<context context-type="linenumber">44</context>
|
||||
</context-group>
|
||||
<target state="needs-translation">Added: <x id="INTERPOLATION" equiv-text="{{ document.added | customDate}}"/></target>
|
||||
<target state="translated">S-a adăugat: <x id="INTERPOLATION" equiv-text="{{ document.added | customDate}}"/></target>
|
||||
</trans-unit>
|
||||
<trans-unit id="a205126adef6251fc63305f1a6228d07bc2795a8" datatype="html">
|
||||
<source>Modified: <x id="INTERPOLATION" equiv-text="{{ document.modified | customDate}}"/></source>
|
||||
@@ -1402,7 +1402,7 @@
|
||||
<context context-type="sourcefile">src/app/components/document-list/document-card-small/document-card-small.component.html</context>
|
||||
<context context-type="linenumber">45</context>
|
||||
</context-group>
|
||||
<target state="needs-translation">Modified: <x id="INTERPOLATION" equiv-text="{{ document.modified | customDate}}"/></target>
|
||||
<target state="translated">S-a modificat: <x id="INTERPOLATION" equiv-text="{{ document.modified | customDate}}"/></target>
|
||||
</trans-unit>
|
||||
<trans-unit id="7985804062689412812" datatype="html">
|
||||
<source>Error executing bulk operation: <x id="PH" equiv-text="JSON.stringify(error.error)"/></source>
|
||||
@@ -1855,7 +1855,7 @@
|
||||
<context context-type="sourcefile">src/app/components/document-asn/document-asn.component.html</context>
|
||||
<context context-type="linenumber">1</context>
|
||||
</context-group>
|
||||
<target state="needs-translation">Searching document with asn <x id="INTERPOLATION" equiv-text="{{asn}}"/></target>
|
||||
<target state="translated">Se caută documentul cu asn <x id="INTERPOLATION" equiv-text="{{asn}}"/></target>
|
||||
</trans-unit>
|
||||
<trans-unit id="2807800733729323332" datatype="html">
|
||||
<source>Yes</source>
|
||||
@@ -1975,13 +1975,21 @@
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">101</context>
|
||||
</context-group>
|
||||
<target state="needs-translation">Polish</target>
|
||||
<target state="translated">Poloneză</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="499386805970351976" datatype="html">
|
||||
<source>Swedish</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">102</context>
|
||||
</context-group>
|
||||
<target state="translated">Suedeză</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="4912706592792948707" datatype="html">
|
||||
<source>ISO 8601</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">106</context>
|
||||
<context context-type="linenumber">107</context>
|
||||
</context-group>
|
||||
<target state="translated">ISO 8601</target>
|
||||
</trans-unit>
|
||||
|
||||
@@ -1977,11 +1977,19 @@
|
||||
</context-group>
|
||||
<target state="needs-translation">Polish</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="499386805970351976" datatype="html">
|
||||
<source>Swedish</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">102</context>
|
||||
</context-group>
|
||||
<target state="needs-translation">Swedish</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="4912706592792948707" datatype="html">
|
||||
<source>ISO 8601</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">106</context>
|
||||
<context context-type="linenumber">107</context>
|
||||
</context-group>
|
||||
<target state="translated">ISO 8601</target>
|
||||
</trans-unit>
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1977,11 +1977,19 @@
|
||||
</context-group>
|
||||
<target>crwdns3442:0crwdne3442:0</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="499386805970351976" datatype="html">
|
||||
<source>Swedish</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">102</context>
|
||||
</context-group>
|
||||
<target>crwdns3446:0crwdne3446:0</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="4912706592792948707" datatype="html">
|
||||
<source>ISO 8601</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">106</context>
|
||||
<context context-type="linenumber">107</context>
|
||||
</context-group>
|
||||
<target>crwdns3322:0crwdne3322:0</target>
|
||||
</trans-unit>
|
||||
|
||||
@@ -1977,11 +1977,19 @@
|
||||
</context-group>
|
||||
<target state="needs-translation">Polish</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="499386805970351976" datatype="html">
|
||||
<source>Swedish</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">102</context>
|
||||
</context-group>
|
||||
<target state="needs-translation">Swedish</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="4912706592792948707" datatype="html">
|
||||
<source>ISO 8601</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">src/app/services/settings.service.ts</context>
|
||||
<context context-type="linenumber">106</context>
|
||||
<context context-type="linenumber">107</context>
|
||||
</context-group>
|
||||
<target state="needs-translation">ISO 8601</target>
|
||||
</trans-unit>
|
||||
|
||||
@@ -9,3 +9,8 @@ $theme-colors: (
|
||||
.bg-body {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.alert-heading {
|
||||
font-size: 80%;
|
||||
font-weight: bold;
|
||||
}
|
||||
@@ -94,6 +94,23 @@ $border-color-dark-mode: #47494f;
|
||||
color: $text-color-dark-mode !important;
|
||||
}
|
||||
}
|
||||
|
||||
.nav-link.bg-light {
|
||||
border-bottom-color: $border-color-dark-mode !important;
|
||||
|
||||
&:not(.active) {
|
||||
background-color: $bg-dark-mode !important;
|
||||
|
||||
&:hover {
|
||||
background-color: $bg-dark-mode !important;
|
||||
}
|
||||
}
|
||||
|
||||
&.active {
|
||||
background-color: $bg-light-dark-mode !important;
|
||||
border-bottom-color: $bg-light-dark-mode !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
@@ -424,6 +441,10 @@ $border-color-dark-mode: #47494f;
|
||||
.ngb-dp-month {
|
||||
background-color: $bg-light-dark-mode;
|
||||
}
|
||||
|
||||
app-split-merge .separator {
|
||||
filter: invert(1);
|
||||
}
|
||||
}
|
||||
|
||||
body.color-scheme-dark {
|
||||
|
||||
@@ -74,6 +74,7 @@ class Consumer(LoggingMixin):
|
||||
self.path = None
|
||||
self.filename = None
|
||||
self.override_title = None
|
||||
self.override_date = None
|
||||
self.override_correspondent_id = None
|
||||
self.override_tag_ids = None
|
||||
self.override_document_type_id = None
|
||||
@@ -167,6 +168,7 @@ class Consumer(LoggingMixin):
|
||||
path,
|
||||
override_filename=None,
|
||||
override_title=None,
|
||||
override_date=None,
|
||||
override_correspondent_id=None,
|
||||
override_document_type_id=None,
|
||||
override_tag_ids=None,
|
||||
@@ -178,6 +180,7 @@ class Consumer(LoggingMixin):
|
||||
self.path = path
|
||||
self.filename = override_filename or os.path.basename(path)
|
||||
self.override_title = override_title
|
||||
self.override_date = override_date
|
||||
self.override_correspondent_id = override_correspondent_id
|
||||
self.override_document_type_id = override_document_type_id
|
||||
self.override_tag_ids = override_tag_ids
|
||||
@@ -399,6 +402,9 @@ class Consumer(LoggingMixin):
|
||||
for tag_id in self.override_tag_ids:
|
||||
document.tags.add(Tag.objects.get(pk=tag_id))
|
||||
|
||||
if self.override_date:
|
||||
document.created = self.override_date
|
||||
|
||||
def _write(self, storage_type, source, target):
|
||||
with open(source, "rb") as read_file:
|
||||
with open(target, "wb") as write_file:
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
import tempfile
|
||||
|
||||
from django_q.tasks import async_task
|
||||
|
||||
from documents import tasks
|
||||
from documents.consumer import ConsumerError
|
||||
from documents.models import Document
|
||||
|
||||
from pikepdf import Pdf
|
||||
|
||||
|
||||
logger = logging.getLogger("paperless.merge")
|
||||
|
||||
|
||||
class MergeError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class PdfCache:
|
||||
|
||||
def __init__(self):
|
||||
self.cache = dict()
|
||||
|
||||
def open_from_document(self, document: Document):
|
||||
if document.pk in self.cache:
|
||||
return self.cache[document.pk]
|
||||
|
||||
if document.mime_type == 'application/pdf':
|
||||
filename = document.source_path
|
||||
elif document.has_archive_version:
|
||||
filename = document.archive_path
|
||||
else:
|
||||
raise MergeError(f"Document {document.pk} does not have a PDF.")
|
||||
|
||||
if not os.path.exists(filename):
|
||||
raise MergeError(f"{filename} does not exist.")
|
||||
|
||||
pdf = Pdf.open(filename)
|
||||
self.cache[document.pk] = pdf
|
||||
|
||||
return pdf
|
||||
|
||||
def close_all(self):
|
||||
for pk in self.cache:
|
||||
self.cache[pk].close()
|
||||
|
||||
self.cache.clear()
|
||||
|
||||
|
||||
def parse_page_list(page_list: str):
|
||||
|
||||
if not page_list:
|
||||
return []
|
||||
|
||||
result = []
|
||||
|
||||
re_simple = re.compile(r"^\d+$")
|
||||
re_range = re.compile(r"^(\d+)-(\d+)$")
|
||||
|
||||
for page_list_part in page_list.split(","):
|
||||
match_simple = re_simple.match(page_list_part)
|
||||
match_range = re_range.match(page_list_part)
|
||||
if match_simple:
|
||||
result.append(int(page_list_part))
|
||||
elif match_range:
|
||||
first = int(match_range.group(1))
|
||||
last = int(match_range.group(2))
|
||||
if first <= last:
|
||||
result.extend(range(first, last+1))
|
||||
else:
|
||||
result.extend(reversed(range(last, first+1)))
|
||||
else:
|
||||
raise MergeError(f"Invalid page range: {page_list}")
|
||||
|
||||
return result
|
||||
|
||||
|
||||
def consume_many_files(kwargs_list, delete_document_ids=None):
|
||||
new_document_ids = []
|
||||
|
||||
try:
|
||||
for kwargs in kwargs_list:
|
||||
new_document_ids.append(tasks.consume_file(**kwargs))
|
||||
|
||||
except ConsumerError:
|
||||
# in case something goes wrong, delete all previously created documents
|
||||
for document_id in new_document_ids:
|
||||
Document.objects.get(id=document_id).delete()
|
||||
raise
|
||||
else:
|
||||
# If everything goes well, optionally delete source documents
|
||||
if delete_document_ids:
|
||||
for document_id in delete_document_ids:
|
||||
Document.objects.get(id=document_id).delete()
|
||||
|
||||
|
||||
def copy_pdf_metadata(source: Pdf, target: Pdf):
|
||||
with source.open_metadata() as source_meta:
|
||||
with target.open_metadata() as target_meta:
|
||||
for k in source_meta:
|
||||
try:
|
||||
target_meta[k] = source_meta[k]
|
||||
except TypeError:
|
||||
# TODO: https://github.com/pikepdf/pikepdf/issues/188
|
||||
logger.warning(f"Could not copy metadata {k} while "
|
||||
f"merging documents", exc_info=True)
|
||||
|
||||
|
||||
def copy_document_metadata(document: Document, consume_task):
|
||||
if document.correspondent:
|
||||
consume_task["override_correspondent_id"] = document.correspondent.id
|
||||
if document.document_type:
|
||||
consume_task["override_document_type_id"] = document.document_type.id
|
||||
if document.tags.count() > 0:
|
||||
consume_task["override_tag_ids"] = [
|
||||
tag.id for tag in document.tags.all()
|
||||
]
|
||||
|
||||
consume_task['override_date'] = document.created
|
||||
|
||||
|
||||
def execute_split_merge_plan(plan,
|
||||
tempdir: str,
|
||||
metadata: str = "redo",
|
||||
delete_source: bool = False,
|
||||
preview: bool = True):
|
||||
|
||||
consume_tasks = []
|
||||
cache = PdfCache()
|
||||
source_documents = set()
|
||||
|
||||
try:
|
||||
for target_doc_spec in plan:
|
||||
# create a new document from documents in target_doc_spec
|
||||
|
||||
target_pdf: Pdf = None
|
||||
try:
|
||||
target_pdf = Pdf.new()
|
||||
target_pdf_filename = tempfile.NamedTemporaryFile(
|
||||
prefix="merge_", suffix="_pdf", dir=tempdir).name
|
||||
version = target_pdf.pdf_version
|
||||
consume_task = {"path": target_pdf_filename}
|
||||
|
||||
for (i, source_doc_spec) in enumerate(target_doc_spec):
|
||||
source_document_id = source_doc_spec['document']
|
||||
source_documents.add(source_document_id)
|
||||
|
||||
if 'pages' in source_doc_spec:
|
||||
pages = parse_page_list(source_doc_spec['pages'])
|
||||
else:
|
||||
pages = None
|
||||
|
||||
try:
|
||||
source_document: Document = Document.objects.get(
|
||||
id=source_document_id)
|
||||
except Document.DoesNotExist:
|
||||
raise MergeError(
|
||||
f"Document {source_document_id} does not exist.")
|
||||
|
||||
source_pdf: Pdf = cache.open_from_document(source_document)
|
||||
version = max(version, source_pdf.pdf_version)
|
||||
|
||||
if i == 0:
|
||||
# first source document for this target
|
||||
consume_task["override_title"] = source_document.title
|
||||
copy_pdf_metadata(source_pdf, target_pdf)
|
||||
if metadata == "copy_first":
|
||||
copy_document_metadata(
|
||||
source_document, consume_task)
|
||||
|
||||
if pages is not None:
|
||||
for page in pages:
|
||||
if page > len(source_pdf.pages) or page < 1:
|
||||
raise MergeError(
|
||||
f"Page {page} is out of range.")
|
||||
target_pdf.pages.append(source_pdf.pages[page - 1])
|
||||
else:
|
||||
target_pdf.pages.extend(source_pdf.pages)
|
||||
|
||||
target_pdf.remove_unreferenced_resources()
|
||||
target_pdf.save(target_pdf_filename, min_version=version)
|
||||
target_pdf.close()
|
||||
|
||||
consume_tasks.append(consume_task)
|
||||
finally:
|
||||
if target_pdf is not None:
|
||||
target_pdf.close()
|
||||
finally:
|
||||
cache.close_all()
|
||||
|
||||
if not preview:
|
||||
async_task(
|
||||
"documents.merge.consume_many_files",
|
||||
kwargs_list=consume_tasks,
|
||||
delete_document_ids=list(source_documents) if delete_source else None # NOQA: E501
|
||||
)
|
||||
|
||||
return [t["path"] for t in consume_tasks]
|
||||
@@ -494,3 +494,94 @@ class BulkDownloadSerializer(DocumentListSerializer):
|
||||
"bzip2": zipfile.ZIP_BZIP2,
|
||||
"lzma": zipfile.ZIP_LZMA
|
||||
}[compression]
|
||||
|
||||
|
||||
class DocumentSplitMergePlanSerializer(serializers.Serializer):
|
||||
"""
|
||||
A split/merge plan describes how a set of documents should be transformed
|
||||
into a new set of documents.
|
||||
|
||||
split_merge_plan is a list. The split and merge tool will create a new
|
||||
document for each element in that list. Each item in split_merge_plan
|
||||
is by itself a list that lists document IDs and pages to take from this
|
||||
document.
|
||||
|
||||
Example:
|
||||
|
||||
split_merge_plan = [
|
||||
[
|
||||
{
|
||||
"document": 1,
|
||||
"pages": "1-3"
|
||||
},
|
||||
{
|
||||
"document": 2,
|
||||
},
|
||||
{
|
||||
"document": 1,
|
||||
"pages": "4"
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"document": 1,
|
||||
"pages": "6,5"
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
This will split document 1 into two documents. The first document contains
|
||||
pages 1 to 4, the second document contains pages 5 and 6 in reverse.
|
||||
Additionally, all pages from document 2 are inserted into the first
|
||||
document between pages 3 and 4.
|
||||
|
||||
If delete_source is true, the split and merge tool will delete the source
|
||||
files in the plan after all resulting documents have been added
|
||||
successfully to paperless.
|
||||
|
||||
metadata selects how to assign new metadata to the created documents.
|
||||
With 'redo', paperless will run the matching algorithms on the resulting
|
||||
document again. With 'copy_first', each document created by the merge plan
|
||||
will keep the metadata of the first document used to create that new
|
||||
document.
|
||||
|
||||
If preview is true, the split and merge tool will execute the split and
|
||||
merge plan without modifying any data in paperless. The previews are
|
||||
temporarily made available for download. If preview is true,
|
||||
delete_source and metadata is ignored.
|
||||
|
||||
"""
|
||||
|
||||
split_merge_plan = serializers.ListField(
|
||||
required=True,
|
||||
min_length=1,
|
||||
child=serializers.ListField(
|
||||
required=True,
|
||||
min_length=1,
|
||||
child=serializers.DictField()
|
||||
)
|
||||
)
|
||||
|
||||
delete_source = serializers.BooleanField(default=False)
|
||||
|
||||
metadata = serializers.ChoiceField(
|
||||
choices=("redo", "copy_first"),
|
||||
default="copy_first"
|
||||
)
|
||||
|
||||
preview = serializers.BooleanField(default=True)
|
||||
|
||||
def validate_split_merge_plan(self, split_merge_plan):
|
||||
for target_doc in split_merge_plan:
|
||||
for source_doc in target_doc:
|
||||
if "document" not in source_doc:
|
||||
raise serializers.ValidationError(
|
||||
'"document" is required'
|
||||
)
|
||||
try:
|
||||
Document.objects.get(id=source_doc["document"])
|
||||
except Document.DoesNotExist:
|
||||
raise serializers.ValidationError(
|
||||
f"document {source_doc['document']} does not exist"
|
||||
)
|
||||
return split_merge_plan
|
||||
@@ -42,3 +42,58 @@ body {
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
/*
|
||||
From theme_dark.scss
|
||||
$primary-dark-mode: #45973a;
|
||||
$danger-dark-mode: #b71631;
|
||||
$bg-dark-mode: #161618;
|
||||
$bg-dark-mode-accent: #21262d;
|
||||
$bg-light-dark-mode: #1c1c1f;
|
||||
$text-color-dark-mode: #abb2bf;
|
||||
$border-color-dark-mode: #47494f;
|
||||
*/
|
||||
body {
|
||||
background-color: #161618 !important;
|
||||
color: #abb2bf;
|
||||
}
|
||||
|
||||
svg.logo .text {
|
||||
fill: #abb2bf!important;
|
||||
}
|
||||
|
||||
.form-control:not(.is-invalid):not(.btn) {
|
||||
border-color: #47494f;
|
||||
}
|
||||
|
||||
.form-control:not(.btn) {
|
||||
background-color: #161618;
|
||||
color: #abb2bf;
|
||||
}
|
||||
|
||||
.form-control:not(.btn)::placeholder {
|
||||
color: #abb2bf;
|
||||
}
|
||||
|
||||
.form-control:not(.btn):focus {
|
||||
background-color: #1c1c1f !important;
|
||||
color: #8e97a9 !important;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
color: #fff;
|
||||
background-color: #17541f;
|
||||
border-color: #17541f;
|
||||
}
|
||||
|
||||
.btn-primary:hover, .btn-primary:focus {
|
||||
background-color: #0f3614;
|
||||
border-color: #0c2c10;
|
||||
}
|
||||
|
||||
.btn-primary:not(:disabled):not(.disabled):active {
|
||||
background-color: #0c2c10;
|
||||
border-color: #09220d;
|
||||
}
|
||||
}
|
||||
@@ -66,6 +66,7 @@ def train_classifier():
|
||||
def consume_file(path,
|
||||
override_filename=None,
|
||||
override_title=None,
|
||||
override_date=None,
|
||||
override_correspondent_id=None,
|
||||
override_document_type_id=None,
|
||||
override_tag_ids=None,
|
||||
@@ -75,6 +76,7 @@ def consume_file(path,
|
||||
path,
|
||||
override_filename=override_filename,
|
||||
override_title=override_title,
|
||||
override_date=override_date,
|
||||
override_correspondent_id=override_correspondent_id,
|
||||
override_document_type_id=override_document_type_id,
|
||||
override_tag_ids=override_tag_ids,
|
||||
@@ -82,9 +84,7 @@ def consume_file(path,
|
||||
)
|
||||
|
||||
if document:
|
||||
return "Success. New document id {} created".format(
|
||||
document.pk
|
||||
)
|
||||
return document.pk
|
||||
else:
|
||||
raise ConsumerError("Unknown error: Returned document was null, but "
|
||||
"no error message was given.")
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
<meta name="username" content="{{username}}">
|
||||
<meta name="full_name" content="{{full_name}}">
|
||||
<meta name="cookie_prefix" content="{{cookie_prefix}}">
|
||||
<meta name="robots" content="noindex,nofollow">
|
||||
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||
<link rel="manifest" href="{% static webmanifest %}">
|
||||
<link rel="stylesheet" href="{% static styles_css %}">
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
|
||||
<meta name="generator" content="Jekyll v4.1.1">
|
||||
<meta name="robots" content="noindex,nofollow">
|
||||
<title>{% translate "Paperless-ng signed out" %}</title>
|
||||
|
||||
<!-- Bootstrap core CSS -->
|
||||
@@ -37,7 +38,10 @@
|
||||
|
||||
<body class="text-center">
|
||||
<div class="form-signin">
|
||||
<img class="mb-4" src="{% static 'frontend/en-US/assets/logo.svg' %}" alt="" width="300">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2897.4 896.64" width="300" class="logo mb-4">
|
||||
<path class="leaf" d="M730.71,0C616.3,266.24,66.21,299.25,242.24,728.31c2.2,5.5-40.71,63.81-69.31,112.22-6.6-24.21-14.3-50.61-13.2-52.81C302.75,618.29,57.41,522.58,44.21,384-17.4,494-39.4,686.5,146.53,797.62c1.1,0,9.9,41.81,14.3,62.71-4.4,8.8-8.8,17.6-11,24.2-4.4,11,28.6,9.91,28.6,12.11,3.3-1.1,81.41-138.63,83.61-139.73C704.31,655.7,782.42,257.44,730.71,0ZM105.82,544.58C145.43,580.89,211.44,692,155.33,756.91,168.53,727.21,172.93,660.1,105.82,544.58ZM269.74,670C200.43,506.08,404,325.65,505.18,280.54,298.35,465.37,263.14,602.89,269.74,670Z" transform="translate(0)" style="fill:#17541f"/>
|
||||
<path class="text" style="fill:#000" d="M1169.27,231.44q.7,17.06.71,38.73t-.71,38a112,112,0,0,1-6.76,38A100.16,100.16,0,0,1,1142.25,380a93.87,93.87,0,0,1-33.76,23.46q-20.25,8.54-46.56,8.53h-36.25V597.5q0,9.94,2.85,14.57c1.89,3.08,3.79,4.86,5.68,5.33a10.54,10.54,0,0,0,9.24,0v18.48h-86V617.4q5.68,2.13,8.53,0,3.56-.71,7.1-5.33t3.56-14.57V166q0-10.66-3.56-15.28t-7.1-6q-2.85-1.42-8.53,0V127.66h104.48q26.31,0,46.56,8.53a93.75,93.75,0,0,1,33.76,23.46,101,101,0,0,1,20.26,33.4A111.05,111.05,0,0,1,1169.27,231.44ZM1118.8,215.8q0-18.48-6-32t-14.22-21.32a74.68,74.68,0,0,0-17.06-12.44q-8.88-4.62-15.28-4.62h-40.52V392.79h40.52q6.39,0,15.28-3.56t17.06-12.44a86,86,0,0,0,14.22-21.67q6-12.8,6-32Zm337.63,389.52a27.35,27.35,0,0,1-2.85,11.72,40.58,40.58,0,0,1-8.17,11.38,54.8,54.8,0,0,1-13.5,9.59,40.07,40.07,0,0,1-18.84,4.27,60,60,0,0,1-30.57-7.82q-13.5-7.82-18.48-20.61a56.12,56.12,0,0,1-6.39-16.35q-9.24,19.18-28.08,32a72.42,72.42,0,0,1-41.58,12.8q-28.44,0-49.76-20.61-12.07-10.67-19.9-27.73t-9.24-39.09q-.71-2.13-.71-8.53v-.71a124.43,124.43,0,0,1,4.26-25.23,113.22,113.22,0,0,1,11-26.3,149.46,149.46,0,0,1,17.77-24.88,128.6,128.6,0,0,1,22.39-20.26,17.39,17.39,0,0,0,4.62-3.2,28.53,28.53,0,0,1,5.33-3.91l2.13-1.06,2.14-1.07q12.8-7.81,22.39-14.22t17.41-12.08a97.25,97.25,0,0,0,8.53-6.4c2.84-2.37,5.93-4.73,9.24-7.1a79.43,79.43,0,0,0,12.09-10,36.51,36.51,0,0,0,8.53-13.5q4.26-7.11,4.26-17.06a67.74,67.74,0,0,0-2.13-17.77,49.09,49.09,0,0,0-14.57-27q-11.73-11.37-26-14.93a38.26,38.26,0,0,0-12.08-2.13q-19.9,0-34.12,7.11-9.24,4.26-13.51,9.59t-4.62,10a10.73,10.73,0,0,0,1.78,7.46,12.91,12.91,0,0,0,5.69,4.26,6,6,0,0,0,1.78.71,6.28,6.28,0,0,1,1.77.72,32.21,32.21,0,0,1,15.28,12.43,34,34,0,0,1,6,19.55,32.78,32.78,0,0,1-32.7,32.7,33.53,33.53,0,0,1-24.17-9.6,30.94,30.94,0,0,1-10-23.1,106.83,106.83,0,0,1,3.2-25.23,84.65,84.65,0,0,1,9.6-23.81q13.5-19.91,32.34-28.79a96.24,96.24,0,0,1,41.58-8.89,93.82,93.82,0,0,1,33.76,6.4,96.18,96.18,0,0,1,29.86,18.13,103.38,103.38,0,0,1,22,28.07q8.88,16.35,8.88,37.68v209q0,12.79.36,16.7t.36,5.34h0q0,9.24,5.68,14.92a18.45,18.45,0,0,0,13.51,5.69q9.24,0,14.92-5.33a20.62,20.62,0,0,0,6.4-13.86Zm-111.6-17.77a52.58,52.58,0,0,0,6.76-21.33q1.07-11.37,1.06-21.32V413.4a63.92,63.92,0,0,1-6,5.33,74,74,0,0,0-6.75,6q-20.62,14.93-35.19,27.37a164.06,164.06,0,0,0-24.52,25.59,113,113,0,0,0-15.64,28.07,121,121,0,0,0-7.11,34.12v10.67q.72,27,14.58,42.29t39.44,15.28a38.56,38.56,0,0,0,20.62-5.69q9.24-6.39,12.79-14.92Zm244.52-304.23q40.51.72,64.68,24.53t24.17,75.7V542.77q0,51.88-24.17,75.34T1589.35,643h-2.13a80.27,80.27,0,0,1-22-2.84h-.71a.63.63,0,0,1-.71-.71,91.74,91.74,0,0,1-28.43-15.64l-6.76-6.76-5.33-7.46v118q0,10,2.85,14.58c1.89,3.08,3.79,5.09,5.68,6a10.54,10.54,0,0,0,9.24,0V766h-86V748.19q5.68,2.13,8.53,0,3.56-1.43,6.75-6t3.2-14.58V326.68q0-9.94-3.2-14.57t-6.75-6q-2.85-1.43-8.53,0V289h68.23v27.72a68.68,68.68,0,0,1,12.09-14.21,75.62,75.62,0,0,1,28.43-15.64.63.63,0,0,1,.71-.71h.71a90.55,90.55,0,0,1,22-2.85Zm35.54,84.59v-.71q-.72-36.26-8.89-51.18t-26.65-16.35a63.12,63.12,0,0,0-24.17,3.2,48,48,0,0,0-19.9,13.15q-8.54,9.24-14.22,24.88t-7.82,37V548.45q2.13,22,7.82,37.32t14.22,24.17a53.23,53.23,0,0,0,19.9,13.15,58.92,58.92,0,0,0,24.17,3.55q18.48-1.42,26.65-16.35t8.89-51.18V367.91Zm179.83-84.59a105.36,105.36,0,0,1,33.41,5.69,86.38,86.38,0,0,1,30.56,17.77,88.06,88.06,0,0,1,21.68,30.57q8.18,18.48,8.18,44.06v90.28H1757.1V544.9q0,44.07,15.28,62.9t38,18.13a113.94,113.94,0,0,0,26.65-4.62,54.83,54.83,0,0,0,22.75-13.15q9.59-9.24,16-26.3t6.4-44.78h16.35V547a153.56,153.56,0,0,1-4.27,36.61A72,72,0,0,1,1852,634.1q-16.71,7.47-40.87,8.18a102.25,102.25,0,0,1-34.83-6.4,96,96,0,0,1-32-19.19,108.91,108.91,0,0,1-23.45-30.21q-9.24-17.41-9.25-39.45v-16.7s-.11-9.12-.35-27.37-.36-29.5-.36-33.76-.11-16-.35-35.19-.36-29.49-.36-30.92v-21q0-25.59,8.89-44.43t22-30.56A90.72,90.72,0,0,1,1771,289.37a98.55,98.55,0,0,1,33.76-6.05Zm46.2,169.89V397.05q0-27-3.55-45.13t-9.6-29.15q-6-11-14.57-15.28a42.36,42.36,0,0,0-19.19-4.26q-22.76,0-34.48,19.9t-11.72,73.92v56.16Zm279.35-113.73a42.31,42.31,0,0,0,.71,5.68,17.92,17.92,0,0,1,0,7.11q-.72,14.93-10.31,24.52a33,33,0,0,1-46.91-.35,33.52,33.52,0,0,1-9.6-24.17q0-17.76,13.51-27a8.33,8.33,0,0,0,1.77-1.06l1.07-1.07a16.22,16.22,0,0,0,6.4-10.31q1.41-6.75-8.53-11.73a26.26,26.26,0,0,0-12.8-3.55q-21.32-1.43-37.67,12.8t-22,49.75V597.5q0,9.94,2.84,14.57t5.69,5.33a10.54,10.54,0,0,0,9.24,0v18.48h-86V617.4q5.68,2.13,8.53,0,3.55-.71,7.11-5.33t3.55-14.57V326.68q0-9.94-3.55-14.57t-7.11-6q-2.85-1.43-8.53,0V288.3h68.24v29.14q5-7.81,9.95-14.57a48.44,48.44,0,0,1,11.72-11.37,59.79,59.79,0,0,1,15.64-7.46q8.89-2.85,22.39-2.85,20.61,0,38.39,14.93t26.3,43.36Zm95.95,258q0,9.94,3.2,14.57c2.13,3.08,4.15,4.86,6,5.33q3.55,2.13,9.24,0v18.48h-86V617.4q5.68,2.13,10,0,2.13-.71,5.69-5.33t3.55-14.57V166.75q0-10.65-3.55-15.28a28.82,28.82,0,0,0-5.69-6q-4.26-2.13-10,0V128.37h67.52V597.5Zm154.25-314.18a105.25,105.25,0,0,1,33.4,5.69,86.33,86.33,0,0,1,30.57,17.77,88.19,88.19,0,0,1,21.68,30.57q8.18,18.48,8.17,44.06v90.28H2332.84V544.9q0,44.07,15.29,62.9t38,18.13a113.93,113.93,0,Line truncated
|
||||
</svg>
|
||||
<p>{% translate "You have been successfully logged out. Bye!" %}</p>
|
||||
<a href="/">{% translate "Sign in again" %}</a>
|
||||
</div>
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
|
||||
<meta name="generator" content="Jekyll v4.1.1">
|
||||
<meta name="robots" content="noindex,nofollow">
|
||||
|
||||
<title>{% translate "Paperless-ng sign in" %}</title>
|
||||
|
||||
<!-- Bootstrap core CSS -->
|
||||
@@ -38,7 +40,10 @@
|
||||
<body class="text-center">
|
||||
<form class="form-signin" method="post">
|
||||
{% csrf_token %}
|
||||
<img class="mb-4" src="{% static 'frontend/en-US/assets/logo.svg' %}" alt="" width="300">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2897.4 896.64" width="300" class="logo mb-4">
|
||||
<path class="leaf" d="M730.71,0C616.3,266.24,66.21,299.25,242.24,728.31c2.2,5.5-40.71,63.81-69.31,112.22-6.6-24.21-14.3-50.61-13.2-52.81C302.75,618.29,57.41,522.58,44.21,384-17.4,494-39.4,686.5,146.53,797.62c1.1,0,9.9,41.81,14.3,62.71-4.4,8.8-8.8,17.6-11,24.2-4.4,11,28.6,9.91,28.6,12.11,3.3-1.1,81.41-138.63,83.61-139.73C704.31,655.7,782.42,257.44,730.71,0ZM105.82,544.58C145.43,580.89,211.44,692,155.33,756.91,168.53,727.21,172.93,660.1,105.82,544.58ZM269.74,670C200.43,506.08,404,325.65,505.18,280.54,298.35,465.37,263.14,602.89,269.74,670Z" transform="translate(0)" style="fill:#17541f"/>
|
||||
<path class="text" style="fill:#000" d="M1169.27,231.44q.7,17.06.71,38.73t-.71,38a112,112,0,0,1-6.76,38A100.16,100.16,0,0,1,1142.25,380a93.87,93.87,0,0,1-33.76,23.46q-20.25,8.54-46.56,8.53h-36.25V597.5q0,9.94,2.85,14.57c1.89,3.08,3.79,4.86,5.68,5.33a10.54,10.54,0,0,0,9.24,0v18.48h-86V617.4q5.68,2.13,8.53,0,3.56-.71,7.1-5.33t3.56-14.57V166q0-10.66-3.56-15.28t-7.1-6q-2.85-1.42-8.53,0V127.66h104.48q26.31,0,46.56,8.53a93.75,93.75,0,0,1,33.76,23.46,101,101,0,0,1,20.26,33.4A111.05,111.05,0,0,1,1169.27,231.44ZM1118.8,215.8q0-18.48-6-32t-14.22-21.32a74.68,74.68,0,0,0-17.06-12.44q-8.88-4.62-15.28-4.62h-40.52V392.79h40.52q6.39,0,15.28-3.56t17.06-12.44a86,86,0,0,0,14.22-21.67q6-12.8,6-32Zm337.63,389.52a27.35,27.35,0,0,1-2.85,11.72,40.58,40.58,0,0,1-8.17,11.38,54.8,54.8,0,0,1-13.5,9.59,40.07,40.07,0,0,1-18.84,4.27,60,60,0,0,1-30.57-7.82q-13.5-7.82-18.48-20.61a56.12,56.12,0,0,1-6.39-16.35q-9.24,19.18-28.08,32a72.42,72.42,0,0,1-41.58,12.8q-28.44,0-49.76-20.61-12.07-10.67-19.9-27.73t-9.24-39.09q-.71-2.13-.71-8.53v-.71a124.43,124.43,0,0,1,4.26-25.23,113.22,113.22,0,0,1,11-26.3,149.46,149.46,0,0,1,17.77-24.88,128.6,128.6,0,0,1,22.39-20.26,17.39,17.39,0,0,0,4.62-3.2,28.53,28.53,0,0,1,5.33-3.91l2.13-1.06,2.14-1.07q12.8-7.81,22.39-14.22t17.41-12.08a97.25,97.25,0,0,0,8.53-6.4c2.84-2.37,5.93-4.73,9.24-7.1a79.43,79.43,0,0,0,12.09-10,36.51,36.51,0,0,0,8.53-13.5q4.26-7.11,4.26-17.06a67.74,67.74,0,0,0-2.13-17.77,49.09,49.09,0,0,0-14.57-27q-11.73-11.37-26-14.93a38.26,38.26,0,0,0-12.08-2.13q-19.9,0-34.12,7.11-9.24,4.26-13.51,9.59t-4.62,10a10.73,10.73,0,0,0,1.78,7.46,12.91,12.91,0,0,0,5.69,4.26,6,6,0,0,0,1.78.71,6.28,6.28,0,0,1,1.77.72,32.21,32.21,0,0,1,15.28,12.43,34,34,0,0,1,6,19.55,32.78,32.78,0,0,1-32.7,32.7,33.53,33.53,0,0,1-24.17-9.6,30.94,30.94,0,0,1-10-23.1,106.83,106.83,0,0,1,3.2-25.23,84.65,84.65,0,0,1,9.6-23.81q13.5-19.91,32.34-28.79a96.24,96.24,0,0,1,41.58-8.89,93.82,93.82,0,0,1,33.76,6.4,96.18,96.18,0,0,1,29.86,18.13,103.38,103.38,0,0,1,22,28.07q8.88,16.35,8.88,37.68v209q0,12.79.36,16.7t.36,5.34h0q0,9.24,5.68,14.92a18.45,18.45,0,0,0,13.51,5.69q9.24,0,14.92-5.33a20.62,20.62,0,0,0,6.4-13.86Zm-111.6-17.77a52.58,52.58,0,0,0,6.76-21.33q1.07-11.37,1.06-21.32V413.4a63.92,63.92,0,0,1-6,5.33,74,74,0,0,0-6.75,6q-20.62,14.93-35.19,27.37a164.06,164.06,0,0,0-24.52,25.59,113,113,0,0,0-15.64,28.07,121,121,0,0,0-7.11,34.12v10.67q.72,27,14.58,42.29t39.44,15.28a38.56,38.56,0,0,0,20.62-5.69q9.24-6.39,12.79-14.92Zm244.52-304.23q40.51.72,64.68,24.53t24.17,75.7V542.77q0,51.88-24.17,75.34T1589.35,643h-2.13a80.27,80.27,0,0,1-22-2.84h-.71a.63.63,0,0,1-.71-.71,91.74,91.74,0,0,1-28.43-15.64l-6.76-6.76-5.33-7.46v118q0,10,2.85,14.58c1.89,3.08,3.79,5.09,5.68,6a10.54,10.54,0,0,0,9.24,0V766h-86V748.19q5.68,2.13,8.53,0,3.56-1.43,6.75-6t3.2-14.58V326.68q0-9.94-3.2-14.57t-6.75-6q-2.85-1.43-8.53,0V289h68.23v27.72a68.68,68.68,0,0,1,12.09-14.21,75.62,75.62,0,0,1,28.43-15.64.63.63,0,0,1,.71-.71h.71a90.55,90.55,0,0,1,22-2.85Zm35.54,84.59v-.71q-.72-36.26-8.89-51.18t-26.65-16.35a63.12,63.12,0,0,0-24.17,3.2,48,48,0,0,0-19.9,13.15q-8.54,9.24-14.22,24.88t-7.82,37V548.45q2.13,22,7.82,37.32t14.22,24.17a53.23,53.23,0,0,0,19.9,13.15,58.92,58.92,0,0,0,24.17,3.55q18.48-1.42,26.65-16.35t8.89-51.18V367.91Zm179.83-84.59a105.36,105.36,0,0,1,33.41,5.69,86.38,86.38,0,0,1,30.56,17.77,88.06,88.06,0,0,1,21.68,30.57q8.18,18.48,8.18,44.06v90.28H1757.1V544.9q0,44.07,15.28,62.9t38,18.13a113.94,113.94,0,0,0,26.65-4.62,54.83,54.83,0,0,0,22.75-13.15q9.59-9.24,16-26.3t6.4-44.78h16.35V547a153.56,153.56,0,0,1-4.27,36.61A72,72,0,0,1,1852,634.1q-16.71,7.47-40.87,8.18a102.25,102.25,0,0,1-34.83-6.4,96,96,0,0,1-32-19.19,108.91,108.91,0,0,1-23.45-30.21q-9.24-17.41-9.25-39.45v-16.7s-.11-9.12-.35-27.37-.36-29.5-.36-33.76-.11-16-.35-35.19-.36-29.49-.36-30.92v-21q0-25.59,8.89-44.43t22-30.56A90.72,90.72,0,0,1,1771,289.37a98.55,98.55,0,0,1,33.76-6.05Zm46.2,169.89V397.05q0-27-3.55-45.13t-9.6-29.15q-6-11-14.57-15.28a42.36,42.36,0,0,0-19.19-4.26q-22.76,0-34.48,19.9t-11.72,73.92v56.16Zm279.35-113.73a42.31,42.31,0,0,0,.71,5.68,17.92,17.92,0,0,1,0,7.11q-.72,14.93-10.31,24.52a33,33,0,0,1-46.91-.35,33.52,33.52,0,0,1-9.6-24.17q0-17.76,13.51-27a8.33,8.33,0,0,0,1.77-1.06l1.07-1.07a16.22,16.22,0,0,0,6.4-10.31q1.41-6.75-8.53-11.73a26.26,26.26,0,0,0-12.8-3.55q-21.32-1.43-37.67,12.8t-22,49.75V597.5q0,9.94,2.84,14.57t5.69,5.33a10.54,10.54,0,0,0,9.24,0v18.48h-86V617.4q5.68,2.13,8.53,0,3.55-.71,7.11-5.33t3.55-14.57V326.68q0-9.94-3.55-14.57t-7.11-6q-2.85-1.43-8.53,0V288.3h68.24v29.14q5-7.81,9.95-14.57a48.44,48.44,0,0,1,11.72-11.37,59.79,59.79,0,0,1,15.64-7.46q8.89-2.85,22.39-2.85,20.61,0,38.39,14.93t26.3,43.36Zm95.95,258q0,9.94,3.2,14.57c2.13,3.08,4.15,4.86,6,5.33q3.55,2.13,9.24,0v18.48h-86V617.4q5.68,2.13,10,0,2.13-.71,5.69-5.33t3.55-14.57V166.75q0-10.65-3.55-15.28a28.82,28.82,0,0,0-5.69-6q-4.26-2.13-10,0V128.37h67.52V597.5Zm154.25-314.18a105.25,105.25,0,0,1,33.4,5.69,86.33,86.33,0,0,1,30.57,17.77,88.19,88.19,0,0,1,21.68,30.57q8.18,18.48,8.17,44.06v90.28H2332.84V544.9q0,44.07,15.29,62.9t38,18.13a113.93,113.93,0,Line truncated
|
||||
</svg>
|
||||
<p>{% translate "Please sign in." %}</p>
|
||||
{% if form.errors %}
|
||||
<div class="alert alert-danger" role="alert">
|
||||
|
||||
@@ -11,6 +11,7 @@ import pytest
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import User
|
||||
from django.test import override_settings
|
||||
from pikepdf import Pdf
|
||||
from rest_framework.test import APITestCase
|
||||
from whoosh.writing import AsyncWriter
|
||||
|
||||
@@ -1372,6 +1373,75 @@ class TestBulkDownload(DirectoriesMixin, APITestCase):
|
||||
"compression": "lzma"
|
||||
}), content_type='application/json')
|
||||
|
||||
|
||||
class TestSplitMerge(DirectoriesMixin, APITestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(TestSplitMerge, self).setUp()
|
||||
|
||||
user = User.objects.create_superuser(username="temp_admin")
|
||||
self.client.force_login(user=user)
|
||||
|
||||
self.doc1 = Document.objects.create(title="document A", filename="docA.pdf", mime_type="application/pdf", checksum="A")
|
||||
self.doc2 = Document.objects.create(title="document B", filename="docB.jpg", mime_type="image/jpeg", checksum="B", archive_filename="docB.pdf", archive_checksum="D")
|
||||
self.doc3 = Document.objects.create(title="document C", filename="docC.jpg", mime_type="image/jpeg", checksum="C")
|
||||
|
||||
shutil.copy(os.path.join(os.path.dirname(__file__), "samples", "simple.pdf"), self.doc1.source_path)
|
||||
shutil.copy(os.path.join(os.path.dirname(__file__), "samples", "simple.jpg"), self.doc2.source_path)
|
||||
shutil.copy(os.path.join(os.path.dirname(__file__), "samples", "simple.pdf"), self.doc2.archive_path)
|
||||
shutil.copy(os.path.join(os.path.dirname(__file__), "samples", "simple.jpg"), self.doc3.source_path)
|
||||
|
||||
@mock.patch("documents.merge.async_task")
|
||||
def test_merge(self, m):
|
||||
result = self.client.post("/api/split_merge/", json.dumps({
|
||||
"split_merge_plan": [
|
||||
[{"document": self.doc1.pk}, {"document": self.doc2.pk}]
|
||||
],
|
||||
"preview": False
|
||||
}), content_type="application/json")
|
||||
self.assertEqual(result.status_code, 200)
|
||||
m.assert_called_once()
|
||||
args, kwargs = m.call_args
|
||||
self.assertEqual(kwargs["delete_document_ids"], None)
|
||||
|
||||
self.assertEqual(len(result.data), 1)
|
||||
preview_key = result.data[0]
|
||||
|
||||
preview_response = self.client.get(f"/api/split_merge/{preview_key}/")
|
||||
self.assertEqual(200, preview_response.status_code)
|
||||
|
||||
pdf: Pdf = Pdf.open(io.BytesIO(preview_response.content))
|
||||
|
||||
self.assertEqual(2, len(pdf.pages))
|
||||
|
||||
pdf.close()
|
||||
|
||||
@mock.patch("documents.merge.async_task")
|
||||
def test_merge_delete_source(self, m):
|
||||
result = self.client.post("/api/split_merge/", json.dumps({
|
||||
"split_merge_plan": [
|
||||
[{"document": self.doc1.pk}, {"document": self.doc2.pk}]
|
||||
],
|
||||
"preview": False,
|
||||
"delete_source": True
|
||||
}), content_type="application/json")
|
||||
self.assertEqual(result.status_code, 200)
|
||||
m.assert_called_once()
|
||||
args, kwargs = m.call_args
|
||||
self.assertCountEqual(kwargs["delete_document_ids"], [self.doc1.pk, self.doc2.pk])
|
||||
|
||||
@mock.patch("documents.merge.async_task")
|
||||
def test_merge_invalid_doc(self, m):
|
||||
result = self.client.post("/api/split_merge/", json.dumps({
|
||||
"split_merge_plan": [
|
||||
[{"document": self.doc1.pk}, {"document": self.doc3.pk}]
|
||||
],
|
||||
"preview": False
|
||||
}), content_type="application/json")
|
||||
self.assertEqual(result.status_code, 400)
|
||||
m.assert_not_called()
|
||||
|
||||
|
||||
class TestApiAuth(APITestCase):
|
||||
|
||||
def test_auth_required(self):
|
||||
@@ -1396,6 +1466,7 @@ class TestApiAuth(APITestCase):
|
||||
self.assertEqual(self.client.get("/api/documents/bulk_edit/").status_code, 401)
|
||||
self.assertEqual(self.client.get("/api/documents/bulk_download/").status_code, 401)
|
||||
self.assertEqual(self.client.get("/api/documents/selection_data/").status_code, 401)
|
||||
self.assertEqual(self.client.get("/api/split_merge/").status_code, 401)
|
||||
|
||||
def test_api_version_no_auth(self):
|
||||
|
||||
|
||||
@@ -0,0 +1,313 @@
|
||||
import datetime
|
||||
import hashlib
|
||||
import os
|
||||
import shutil
|
||||
import tempfile
|
||||
import uuid
|
||||
from contextlib import contextmanager
|
||||
from unittest import mock
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
from django.conf import settings
|
||||
from django.test import TestCase, override_settings
|
||||
from django.utils import timezone
|
||||
|
||||
from documents.consumer import ConsumerError
|
||||
from documents.merge import PdfCache, MergeError, execute_split_merge_plan, consume_many_files, parse_page_list
|
||||
from documents.models import Document, Correspondent, Tag, DocumentType
|
||||
from documents.tests.utils import DirectoriesMixin
|
||||
|
||||
|
||||
class TestPdfCache(DirectoriesMixin, TestCase):
|
||||
|
||||
def setUp(self) -> None:
|
||||
super(TestPdfCache, self).setUp()
|
||||
self.cache = PdfCache()
|
||||
|
||||
def test_open_no_pdf(self):
|
||||
doc = Document.objects.create(mime_type="image/jpeg")
|
||||
self.assertRaisesMessage(MergeError, "does not have a PDF.", self.cache.open_from_document, doc)
|
||||
|
||||
def test_open_original_pdf(self):
|
||||
doc = Document.objects.create(mime_type="application/pdf", filename="test.pdf")
|
||||
shutil.copy(os.path.join(os.path.dirname(__file__), "samples", "simple.pdf"), doc.source_path)
|
||||
self.cache.open_from_document(doc)
|
||||
self.assertIn(doc.pk, self.cache.cache)
|
||||
|
||||
def test_document_does_not_exist(self):
|
||||
doc = Document.objects.create(mime_type="application/pdf", filename="test.pdf")
|
||||
self.assertRaisesMessage(MergeError, "does not exist.", self.cache.open_from_document, doc)
|
||||
|
||||
def test_open_archive_pdf(self):
|
||||
doc = Document.objects.create(mime_type="image/jpef", archive_checksum="B", archive_filename="test.pdf")
|
||||
shutil.copy(os.path.join(os.path.dirname(__file__), "samples", "simple.pdf"), doc.archive_path)
|
||||
self.cache.open_from_document(doc)
|
||||
self.assertIn(doc.pk, self.cache.cache)
|
||||
|
||||
@mock.patch("documents.merge.Pdf.open")
|
||||
def test_cached(self, pdf_open: MagicMock):
|
||||
pdf_open.return_value = "the_pdf"
|
||||
doc = Document.objects.create(mime_type="application/pdf", filename="test.pdf")
|
||||
shutil.copy(os.path.join(os.path.dirname(__file__), "samples", "simple.pdf"), doc.source_path)
|
||||
self.assertEqual(self.cache.open_from_document(doc), "the_pdf")
|
||||
pdf_open.assert_called_once()
|
||||
self.assertIn(doc.pk, self.cache.cache)
|
||||
|
||||
pdf_open.reset_mock()
|
||||
self.assertEqual(self.cache.open_from_document(doc), "the_pdf")
|
||||
pdf_open.assert_not_called()
|
||||
|
||||
def test_close(self):
|
||||
self.test_open_original_pdf()
|
||||
|
||||
self.assertEqual(len(self.cache.cache), 1)
|
||||
|
||||
self.cache.close_all()
|
||||
|
||||
self.assertEqual(len(self.cache.cache), 0)
|
||||
|
||||
|
||||
class TestParsePageList(TestCase):
|
||||
|
||||
def test_ranges(self):
|
||||
self.assertListEqual(parse_page_list(""), [])
|
||||
self.assertListEqual(parse_page_list(None), [])
|
||||
self.assertListEqual(parse_page_list("1,2,3"), [1, 2, 3])
|
||||
self.assertListEqual(parse_page_list("1,3,2"), [1, 3, 2])
|
||||
self.assertListEqual(parse_page_list("1-3,5"), [1, 2, 3, 5])
|
||||
self.assertListEqual(parse_page_list("1-1,1,2-2,2,6-6,6"), [1, 1, 2, 2, 6, 6])
|
||||
self.assertListEqual(parse_page_list("5-3,1"), [5, 4, 3, 1])
|
||||
|
||||
def test_error(self):
|
||||
self.assertRaises(MergeError, parse_page_list, "as")
|
||||
self.assertRaises(MergeError, parse_page_list, "1--2")
|
||||
self.assertRaises(MergeError, parse_page_list, "1,2,3,")
|
||||
self.assertRaises(MergeError, parse_page_list, "1-8,1-a")
|
||||
self.assertRaises(MergeError, parse_page_list, "8,1-,8")
|
||||
self.assertRaises(MergeError, parse_page_list, "1,,2")
|
||||
|
||||
|
||||
class FakePdf:
|
||||
|
||||
def __init__(self):
|
||||
self.pages = list()
|
||||
|
||||
def remove_unreferenced_resources(self):
|
||||
pass
|
||||
|
||||
def close(self):
|
||||
pass
|
||||
|
||||
def save(self, filename, min_version=None):
|
||||
with open(filename, "w") as f:
|
||||
f.write(" ".join(self.pages))
|
||||
|
||||
@property
|
||||
def pdf_version(self):
|
||||
return 0
|
||||
|
||||
@contextmanager
|
||||
def open_metadata(self):
|
||||
yield dict()
|
||||
|
||||
|
||||
def fake_open(self, document):
|
||||
pdf = FakePdf()
|
||||
pdf.pages = document.content.split(" ")
|
||||
return pdf
|
||||
|
||||
|
||||
@mock.patch("documents.merge.Pdf.new", lambda: FakePdf())
|
||||
@mock.patch("documents.merge.PdfCache.open_from_document", fake_open)
|
||||
class TestExecuteSplitMergePlan(DirectoriesMixin, TestCase):
|
||||
|
||||
def setUp(self) -> None:
|
||||
super(TestExecuteSplitMergePlan, self).setUp()
|
||||
self.tempdir = os.path.join(settings.SCRATCH_DIR, "split_merge")
|
||||
os.makedirs(self.tempdir, exist_ok=True)
|
||||
|
||||
def _verify_results(self, files, expected_content):
|
||||
self.assertEqual(len(files), len(expected_content))
|
||||
for (file, content) in zip(files, expected_content):
|
||||
with open(file) as f:
|
||||
self.assertEqual(f.read(), content)
|
||||
|
||||
def test_delete_page(self):
|
||||
doc1 = Document.objects.create(content="A B C")
|
||||
result = execute_split_merge_plan(
|
||||
plan=[
|
||||
[{"document": doc1.pk, "pages": "1,3"}]
|
||||
],
|
||||
tempdir=self.tempdir,
|
||||
)
|
||||
self._verify_results(result, ["A C"])
|
||||
|
||||
def test_split(self):
|
||||
doc1 = Document.objects.create(content="A B C")
|
||||
result = execute_split_merge_plan(
|
||||
plan=[
|
||||
[{"document": doc1.pk, "pages": "1,2"}],
|
||||
[{"document": doc1.pk, "pages": "3"}],
|
||||
],
|
||||
tempdir=self.tempdir,
|
||||
)
|
||||
self._verify_results(result, ["A B", "C"])
|
||||
|
||||
def test_merge(self):
|
||||
doc1 = Document.objects.create(content="A B C", checksum="A")
|
||||
doc2 = Document.objects.create(content="D E", checksum="B")
|
||||
result = execute_split_merge_plan(
|
||||
plan=[
|
||||
[{"document": doc2.pk}, {"document": doc1.pk}],
|
||||
],
|
||||
tempdir=self.tempdir,
|
||||
)
|
||||
self._verify_results(result, ["D E A B C"])
|
||||
|
||||
def test_partial_merge_reorder(self):
|
||||
doc1 = Document.objects.create(content="A B C", checksum="A")
|
||||
doc2 = Document.objects.create(content="D E", checksum="B")
|
||||
result = execute_split_merge_plan(
|
||||
plan=[
|
||||
[{"document": doc1.pk, "pages": "3,1"}, {"document": doc2.pk, "pages": "2"}],
|
||||
],
|
||||
tempdir=self.tempdir,
|
||||
)
|
||||
self._verify_results(result, ["C A E"])
|
||||
|
||||
def test_document_does_not_exist(self):
|
||||
self.assertRaisesMessage(
|
||||
MergeError,
|
||||
"Document 3456 does not exist.",
|
||||
execute_split_merge_plan,
|
||||
plan=[[{"document": 3456}]],
|
||||
tempdir=self.tempdir,
|
||||
)
|
||||
|
||||
def test_page_out_of_range(self):
|
||||
doc1 = Document.objects.create(content="A B C")
|
||||
self.assertRaisesMessage(
|
||||
MergeError,
|
||||
"Page 4 is out of range.",
|
||||
execute_split_merge_plan,
|
||||
plan=[[{"document": doc1.pk, "pages": "4"}]],
|
||||
tempdir=self.tempdir,
|
||||
)
|
||||
|
||||
@mock.patch("documents.merge.async_task")
|
||||
def test_no_preview(self, async_task: MagicMock):
|
||||
doc1 = Document.objects.create(content="A B C", checksum="A")
|
||||
doc2 = Document.objects.create(content="D E", checksum="B")
|
||||
result = execute_split_merge_plan(
|
||||
plan=[
|
||||
[{"document": doc2.pk}, {"document": doc1.pk}],
|
||||
],
|
||||
tempdir=self.tempdir,
|
||||
preview=False,
|
||||
delete_source=False
|
||||
)
|
||||
async_task.assert_called_once()
|
||||
args, kwargs = async_task.call_args
|
||||
self.assertListEqual(kwargs['kwargs_list'], [{"path": result[0], "override_title": ""}])
|
||||
self.assertIsNone(kwargs['delete_document_ids'])
|
||||
|
||||
@mock.patch("documents.merge.async_task")
|
||||
def test_no_preview_delete_source(self, async_task: MagicMock):
|
||||
doc1 = Document.objects.create(content="A B C", checksum="A")
|
||||
doc2 = Document.objects.create(content="D E", checksum="B")
|
||||
result = execute_split_merge_plan(
|
||||
plan=[
|
||||
[{"document": doc2.pk}, {"document": doc1.pk}],
|
||||
],
|
||||
tempdir=self.tempdir,
|
||||
preview=False,
|
||||
delete_source=True
|
||||
)
|
||||
async_task.assert_called_once()
|
||||
args, kwargs = async_task.call_args
|
||||
self.assertCountEqual(kwargs['delete_document_ids'], [doc1.pk, doc2.pk])
|
||||
|
||||
@mock.patch("documents.merge.async_task")
|
||||
@override_settings(TIME_ZONE="UTC")
|
||||
def test_metadata_copy_first(self, async_task: MagicMock):
|
||||
c1 = Correspondent.objects.create(name="c1")
|
||||
c2 = Correspondent.objects.create(name="c2")
|
||||
t1 = Tag.objects.create(name="t1")
|
||||
t2 = Tag.objects.create(name="t2")
|
||||
dt1 = DocumentType.objects.create(name="dt1")
|
||||
dt2 = DocumentType.objects.create(name="dt2")
|
||||
doc1 = Document.objects.create(content="A B C", checksum="A", title="titleA", correspondent=c1, document_type=dt1, created=timezone.datetime(2020, 12, 1, 0, 0, 0))
|
||||
doc1.tags.add(t1)
|
||||
doc2 = Document.objects.create(content="D E", checksum="B", title="titleB", correspondent=c2, document_type=dt2, created=timezone.datetime(2020, 2, 20, 0, 0, 0))
|
||||
doc2.tags.add(t2)
|
||||
|
||||
result = execute_split_merge_plan(
|
||||
plan=[
|
||||
[{"document": doc2.pk}, {"document": doc1.pk}],
|
||||
],
|
||||
tempdir=self.tempdir,
|
||||
preview=False,
|
||||
metadata="copy_first",
|
||||
)
|
||||
async_task.assert_called_once()
|
||||
args, kwargs = async_task.call_args
|
||||
self.assertEqual(1, len(kwargs['kwargs_list']))
|
||||
|
||||
kwargs = kwargs['kwargs_list'][0]
|
||||
self.assertEqual(kwargs["override_title"], "titleB")
|
||||
self.assertEqual(kwargs["override_correspondent_id"], c2.pk)
|
||||
self.assertEqual(kwargs["override_tag_ids"], [t2.pk])
|
||||
self.assertEqual(kwargs["override_document_type_id"], dt2.pk)
|
||||
self.assertEqual(kwargs["override_date"], timezone.make_aware(datetime.datetime(2020, 2, 20, 0, 0, 0)))
|
||||
|
||||
|
||||
def fake_consume_file(fail, *args, **kwargs):
|
||||
if fail:
|
||||
raise ConsumerError()
|
||||
return Document.objects.create(checksum=str(Document.objects.count())).pk
|
||||
|
||||
|
||||
class TestConsumeManyFiles(DirectoriesMixin, TestCase):
|
||||
|
||||
@mock.patch("documents.merge.tasks.consume_file")
|
||||
def test_success(self, consume_file: MagicMock):
|
||||
consume_file.side_effect = fake_consume_file
|
||||
consume_many_files([{"fail": False}, {"fail": False}])
|
||||
self.assertEqual(consume_file.call_count, 2)
|
||||
self.assertEqual(Document.objects.count(), 2)
|
||||
|
||||
@mock.patch("documents.merge.tasks.consume_file")
|
||||
def test_fail(self, consume_file: MagicMock):
|
||||
consume_file.side_effect = fake_consume_file
|
||||
self.assertRaises(
|
||||
ConsumerError,
|
||||
consume_many_files,
|
||||
[{"fail": False}, {"fail": True}, {"fail": False}]
|
||||
)
|
||||
self.assertEqual(consume_file.call_count, 2)
|
||||
self.assertEqual(Document.objects.count(), 0)
|
||||
|
||||
@mock.patch("documents.merge.tasks.consume_file")
|
||||
def test_success_delete_source(self, consume_file: MagicMock):
|
||||
doc_id = Document.objects.create().id
|
||||
self.assertTrue(Document.objects.filter(id=doc_id).exists())
|
||||
consume_file.side_effect = fake_consume_file
|
||||
consume_many_files([{"fail": False}, {"fail": False}], delete_document_ids=[doc_id])
|
||||
self.assertEqual(consume_file.call_count, 2)
|
||||
self.assertEqual(Document.objects.count(), 2)
|
||||
self.assertFalse(Document.objects.filter(id=doc_id).exists())
|
||||
|
||||
@mock.patch("documents.merge.tasks.consume_file")
|
||||
def test_fail_no_delete_source(self, consume_file: MagicMock):
|
||||
doc_id = Document.objects.create().id
|
||||
self.assertTrue(Document.objects.filter(id=doc_id).exists())
|
||||
consume_file.side_effect = fake_consume_file
|
||||
self.assertRaises(
|
||||
ConsumerError,
|
||||
consume_many_files,
|
||||
[{"fail": False}, {"fail": True}],
|
||||
delete_document_ids=[doc_id]
|
||||
)
|
||||
self.assertEqual(consume_file.call_count, 2)
|
||||
self.assertEqual(Document.objects.count(), 1)
|
||||
self.assertTrue(Document.objects.filter(id=doc_id).exists())
|
||||
+54
-2
@@ -6,6 +6,7 @@ import zipfile
|
||||
from datetime import datetime
|
||||
from time import mktime
|
||||
|
||||
import pathvalidate
|
||||
from django.conf import settings
|
||||
from django.db.models import Count, Max, Case, When, IntegerField
|
||||
from django.db.models.functions import Lower
|
||||
@@ -57,9 +58,10 @@ from .serialisers import (
|
||||
DocumentTypeSerializer,
|
||||
PostDocumentSerializer,
|
||||
SavedViewSerializer,
|
||||
BulkEditSerializer,
|
||||
DocumentListSerializer,
|
||||
BulkDownloadSerializer
|
||||
BulkDownloadSerializer,
|
||||
BulkEditSerializer,
|
||||
DocumentSplitMergePlanSerializer
|
||||
)
|
||||
|
||||
|
||||
@@ -624,3 +626,53 @@ class BulkDownloadView(GenericAPIView):
|
||||
"attachment", "documents.zip")
|
||||
|
||||
return response
|
||||
|
||||
|
||||
class DocumentSplitMergeViewSet(GenericViewSet):
|
||||
|
||||
permission_classes = (IsAuthenticated,)
|
||||
serializer_class = DocumentSplitMergePlanSerializer
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super(DocumentSplitMergeViewSet, self).__init__(**kwargs)
|
||||
self.tempdir = os.path.join(settings.SCRATCH_DIR, "split-merge")
|
||||
os.makedirs(self.tempdir, exist_ok=True)
|
||||
|
||||
def get_queryset(self):
|
||||
return os.listdir(self.tempdir)
|
||||
|
||||
def retrieve(self, request, pk, *args, **kwargs):
|
||||
filename = os.path.join(
|
||||
self.tempdir, pathvalidate.sanitize_filename(pk))
|
||||
if not os.path.isfile(filename):
|
||||
raise Http404()
|
||||
|
||||
with open(filename, "rb") as f:
|
||||
return HttpResponse(f, content_type="application/pdf")
|
||||
|
||||
def list(self, request, *args, **kwargs):
|
||||
return Response(self.get_queryset())
|
||||
|
||||
def create(self, request, *args, **kwargs):
|
||||
serializer = self.get_serializer(data=request.data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
|
||||
from .merge import execute_split_merge_plan, MergeError
|
||||
|
||||
split_merge_plan = serializer.validated_data.get("split_merge_plan")
|
||||
preview = serializer.validated_data.get("preview")
|
||||
delete_source = serializer.validated_data.get("delete_source")
|
||||
metadata = serializer.validated_data.get("metadata")
|
||||
try:
|
||||
pdf_files = execute_split_merge_plan(
|
||||
plan=split_merge_plan,
|
||||
preview=preview,
|
||||
delete_source=delete_source,
|
||||
metadata=metadata,
|
||||
tempdir=self.tempdir
|
||||
)
|
||||
except MergeError:
|
||||
logger.exception("Error during merge")
|
||||
return HttpResponseBadRequest()
|
||||
|
||||
return Response([os.path.basename(file) for file in pdf_files])
|
||||
@@ -2,8 +2,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: paperless-ng\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-04-17 13:41+0200\n"
|
||||
"PO-Revision-Date: 2021-04-17 11:47\n"
|
||||
"POT-Creation-Date: 2021-05-04 15:00+0000\n"
|
||||
"PO-Revision-Date: 2021-05-04 21:52\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Czech\n"
|
||||
"Language: cs_CZ\n"
|
||||
@@ -412,54 +412,58 @@ msgstr "Heslo"
|
||||
msgid "Sign in"
|
||||
msgstr "Přihlásit se"
|
||||
|
||||
#: paperless/settings.py:298
|
||||
#: paperless/settings.py:300
|
||||
msgid "English (US)"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:299
|
||||
#: paperless/settings.py:301
|
||||
msgid "English (GB)"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:300
|
||||
#: paperless/settings.py:302
|
||||
msgid "German"
|
||||
msgstr "Němčina"
|
||||
|
||||
#: paperless/settings.py:301
|
||||
#: paperless/settings.py:303
|
||||
msgid "Dutch"
|
||||
msgstr "Holandština"
|
||||
|
||||
#: paperless/settings.py:302
|
||||
#: paperless/settings.py:304
|
||||
msgid "French"
|
||||
msgstr "Francouzština"
|
||||
|
||||
#: paperless/settings.py:303
|
||||
#: paperless/settings.py:305
|
||||
msgid "Portuguese (Brazil)"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:304
|
||||
#: paperless/settings.py:306
|
||||
msgid "Portuguese"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:305
|
||||
#: paperless/settings.py:307
|
||||
msgid "Italian"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:306
|
||||
#: paperless/settings.py:308
|
||||
msgid "Romanian"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:307
|
||||
#: paperless/settings.py:309
|
||||
msgid "Russian"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:308
|
||||
#: paperless/settings.py:310
|
||||
msgid "Spanish"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:309
|
||||
#: paperless/settings.py:311
|
||||
msgid "Polish"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:312
|
||||
msgid "Swedish"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/urls.py:113
|
||||
msgid "Paperless-ng administration"
|
||||
msgstr "Správa Paperless-ng"
|
||||
|
||||
@@ -2,8 +2,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: paperless-ng\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-04-17 13:41+0200\n"
|
||||
"PO-Revision-Date: 2021-04-17 19:51\n"
|
||||
"POT-Creation-Date: 2021-05-04 15:00+0000\n"
|
||||
"PO-Revision-Date: 2021-05-04 23:04\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: German\n"
|
||||
"Language: de_DE\n"
|
||||
@@ -412,54 +412,58 @@ msgstr "Kennwort"
|
||||
msgid "Sign in"
|
||||
msgstr "Anmelden"
|
||||
|
||||
#: paperless/settings.py:298
|
||||
#: paperless/settings.py:300
|
||||
msgid "English (US)"
|
||||
msgstr "Englisch (US)"
|
||||
|
||||
#: paperless/settings.py:299
|
||||
#: paperless/settings.py:301
|
||||
msgid "English (GB)"
|
||||
msgstr "Englisch (UK)"
|
||||
|
||||
#: paperless/settings.py:300
|
||||
#: paperless/settings.py:302
|
||||
msgid "German"
|
||||
msgstr "Deutsch"
|
||||
|
||||
#: paperless/settings.py:301
|
||||
#: paperless/settings.py:303
|
||||
msgid "Dutch"
|
||||
msgstr "Niederländisch"
|
||||
|
||||
#: paperless/settings.py:302
|
||||
#: paperless/settings.py:304
|
||||
msgid "French"
|
||||
msgstr "Französisch"
|
||||
|
||||
#: paperless/settings.py:303
|
||||
#: paperless/settings.py:305
|
||||
msgid "Portuguese (Brazil)"
|
||||
msgstr "Portugiesisch (Brasilien)"
|
||||
|
||||
#: paperless/settings.py:304
|
||||
#: paperless/settings.py:306
|
||||
msgid "Portuguese"
|
||||
msgstr "Portugiesisch"
|
||||
|
||||
#: paperless/settings.py:305
|
||||
#: paperless/settings.py:307
|
||||
msgid "Italian"
|
||||
msgstr "Italienisch"
|
||||
|
||||
#: paperless/settings.py:306
|
||||
#: paperless/settings.py:308
|
||||
msgid "Romanian"
|
||||
msgstr "Rumänisch"
|
||||
|
||||
#: paperless/settings.py:307
|
||||
#: paperless/settings.py:309
|
||||
msgid "Russian"
|
||||
msgstr "Russisch"
|
||||
|
||||
#: paperless/settings.py:308
|
||||
#: paperless/settings.py:310
|
||||
msgid "Spanish"
|
||||
msgstr "Spanisch"
|
||||
|
||||
#: paperless/settings.py:309
|
||||
#: paperless/settings.py:311
|
||||
msgid "Polish"
|
||||
msgstr "Polnisch"
|
||||
|
||||
#: paperless/settings.py:312
|
||||
msgid "Swedish"
|
||||
msgstr "Schwedisch"
|
||||
|
||||
#: paperless/urls.py:113
|
||||
msgid "Paperless-ng administration"
|
||||
msgstr "Paperless-ng Administration"
|
||||
|
||||
@@ -2,8 +2,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: paperless-ng\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-04-17 13:41+0200\n"
|
||||
"PO-Revision-Date: 2021-04-17 11:47\n"
|
||||
"POT-Creation-Date: 2021-05-04 15:00+0000\n"
|
||||
"PO-Revision-Date: 2021-05-04 21:51\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: English, United Kingdom\n"
|
||||
"Language: en_GB\n"
|
||||
@@ -336,11 +336,11 @@ msgstr "title or content contains"
|
||||
|
||||
#: documents/models.py:393
|
||||
msgid "fulltext query"
|
||||
msgstr ""
|
||||
msgstr "fulltext query"
|
||||
|
||||
#: documents/models.py:394
|
||||
msgid "more like this"
|
||||
msgstr ""
|
||||
msgstr "more like this"
|
||||
|
||||
#: documents/models.py:405
|
||||
msgid "rule type"
|
||||
@@ -412,52 +412,56 @@ msgstr "Password"
|
||||
msgid "Sign in"
|
||||
msgstr "Sign in"
|
||||
|
||||
#: paperless/settings.py:298
|
||||
#: paperless/settings.py:300
|
||||
msgid "English (US)"
|
||||
msgstr "English (US)"
|
||||
|
||||
#: paperless/settings.py:299
|
||||
#: paperless/settings.py:301
|
||||
msgid "English (GB)"
|
||||
msgstr "English (GB)"
|
||||
|
||||
#: paperless/settings.py:300
|
||||
#: paperless/settings.py:302
|
||||
msgid "German"
|
||||
msgstr "German"
|
||||
|
||||
#: paperless/settings.py:301
|
||||
#: paperless/settings.py:303
|
||||
msgid "Dutch"
|
||||
msgstr "Dutch"
|
||||
|
||||
#: paperless/settings.py:302
|
||||
#: paperless/settings.py:304
|
||||
msgid "French"
|
||||
msgstr "French"
|
||||
|
||||
#: paperless/settings.py:303
|
||||
#: paperless/settings.py:305
|
||||
msgid "Portuguese (Brazil)"
|
||||
msgstr "Portuguese (Brazil)"
|
||||
|
||||
#: paperless/settings.py:304
|
||||
#: paperless/settings.py:306
|
||||
msgid "Portuguese"
|
||||
msgstr "Portuguese"
|
||||
|
||||
#: paperless/settings.py:305
|
||||
#: paperless/settings.py:307
|
||||
msgid "Italian"
|
||||
msgstr "Italian"
|
||||
|
||||
#: paperless/settings.py:306
|
||||
#: paperless/settings.py:308
|
||||
msgid "Romanian"
|
||||
msgstr "Romanian"
|
||||
|
||||
#: paperless/settings.py:307
|
||||
#: paperless/settings.py:309
|
||||
msgid "Russian"
|
||||
msgstr "Russian"
|
||||
|
||||
#: paperless/settings.py:308
|
||||
#: paperless/settings.py:310
|
||||
msgid "Spanish"
|
||||
msgstr "Spanish"
|
||||
|
||||
#: paperless/settings.py:309
|
||||
#: paperless/settings.py:311
|
||||
msgid "Polish"
|
||||
msgstr "Polish"
|
||||
|
||||
#: paperless/settings.py:312
|
||||
msgid "Swedish"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/urls.py:113
|
||||
|
||||
@@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-04-17 13:41+0200\n"
|
||||
"POT-Creation-Date: 2021-05-04 15:00+0000\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@@ -416,54 +416,58 @@ msgstr ""
|
||||
msgid "Sign in"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:298
|
||||
#: paperless/settings.py:300
|
||||
msgid "English (US)"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:299
|
||||
#: paperless/settings.py:301
|
||||
msgid "English (GB)"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:300
|
||||
#: paperless/settings.py:302
|
||||
msgid "German"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:301
|
||||
#: paperless/settings.py:303
|
||||
msgid "Dutch"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:302
|
||||
#: paperless/settings.py:304
|
||||
msgid "French"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:303
|
||||
#: paperless/settings.py:305
|
||||
msgid "Portuguese (Brazil)"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:304
|
||||
#: paperless/settings.py:306
|
||||
msgid "Portuguese"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:305
|
||||
#: paperless/settings.py:307
|
||||
msgid "Italian"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:306
|
||||
#: paperless/settings.py:308
|
||||
msgid "Romanian"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:307
|
||||
#: paperless/settings.py:309
|
||||
msgid "Russian"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:308
|
||||
#: paperless/settings.py:310
|
||||
msgid "Spanish"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:309
|
||||
#: paperless/settings.py:311
|
||||
msgid "Polish"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:312
|
||||
msgid "Swedish"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/urls.py:113
|
||||
msgid "Paperless-ng administration"
|
||||
msgstr ""
|
||||
|
||||
@@ -2,8 +2,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: paperless-ng\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-04-17 13:41+0200\n"
|
||||
"PO-Revision-Date: 2021-04-17 11:47\n"
|
||||
"POT-Creation-Date: 2021-05-04 15:00+0000\n"
|
||||
"PO-Revision-Date: 2021-05-04 21:52\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Spanish\n"
|
||||
"Language: es_ES\n"
|
||||
@@ -412,54 +412,58 @@ msgstr "Contraseña"
|
||||
msgid "Sign in"
|
||||
msgstr "Iniciar sesión"
|
||||
|
||||
#: paperless/settings.py:298
|
||||
#: paperless/settings.py:300
|
||||
msgid "English (US)"
|
||||
msgstr "Inglés (US)"
|
||||
|
||||
#: paperless/settings.py:299
|
||||
#: paperless/settings.py:301
|
||||
msgid "English (GB)"
|
||||
msgstr "Inglés (Gran Bretaña)"
|
||||
|
||||
#: paperless/settings.py:300
|
||||
#: paperless/settings.py:302
|
||||
msgid "German"
|
||||
msgstr "Alemán"
|
||||
|
||||
#: paperless/settings.py:301
|
||||
#: paperless/settings.py:303
|
||||
msgid "Dutch"
|
||||
msgstr "Alemán"
|
||||
|
||||
#: paperless/settings.py:302
|
||||
#: paperless/settings.py:304
|
||||
msgid "French"
|
||||
msgstr "Francés"
|
||||
|
||||
#: paperless/settings.py:303
|
||||
#: paperless/settings.py:305
|
||||
msgid "Portuguese (Brazil)"
|
||||
msgstr "Portugués (Brasil)"
|
||||
|
||||
#: paperless/settings.py:304
|
||||
#: paperless/settings.py:306
|
||||
msgid "Portuguese"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:305
|
||||
#: paperless/settings.py:307
|
||||
msgid "Italian"
|
||||
msgstr "Italiano"
|
||||
|
||||
#: paperless/settings.py:306
|
||||
#: paperless/settings.py:308
|
||||
msgid "Romanian"
|
||||
msgstr "Rumano"
|
||||
|
||||
#: paperless/settings.py:307
|
||||
#: paperless/settings.py:309
|
||||
msgid "Russian"
|
||||
msgstr "Ruso"
|
||||
|
||||
#: paperless/settings.py:308
|
||||
#: paperless/settings.py:310
|
||||
msgid "Spanish"
|
||||
msgstr "Español"
|
||||
|
||||
#: paperless/settings.py:309
|
||||
#: paperless/settings.py:311
|
||||
msgid "Polish"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:312
|
||||
msgid "Swedish"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/urls.py:113
|
||||
msgid "Paperless-ng administration"
|
||||
msgstr "Paperless-ng Administración"
|
||||
|
||||
@@ -2,8 +2,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: paperless-ng\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-04-17 13:41+0200\n"
|
||||
"PO-Revision-Date: 2021-04-17 13:47\n"
|
||||
"POT-Creation-Date: 2021-05-04 15:00+0000\n"
|
||||
"PO-Revision-Date: 2021-05-05 15:10\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: French\n"
|
||||
"Language: fr_FR\n"
|
||||
@@ -412,54 +412,58 @@ msgstr "Mot de passe"
|
||||
msgid "Sign in"
|
||||
msgstr "S'identifier"
|
||||
|
||||
#: paperless/settings.py:298
|
||||
#: paperless/settings.py:300
|
||||
msgid "English (US)"
|
||||
msgstr "Anglais (US)"
|
||||
|
||||
#: paperless/settings.py:299
|
||||
#: paperless/settings.py:301
|
||||
msgid "English (GB)"
|
||||
msgstr "Anglais (GB)"
|
||||
|
||||
#: paperless/settings.py:300
|
||||
#: paperless/settings.py:302
|
||||
msgid "German"
|
||||
msgstr "Allemand"
|
||||
|
||||
#: paperless/settings.py:301
|
||||
#: paperless/settings.py:303
|
||||
msgid "Dutch"
|
||||
msgstr "Néerlandais"
|
||||
|
||||
#: paperless/settings.py:302
|
||||
#: paperless/settings.py:304
|
||||
msgid "French"
|
||||
msgstr "Français"
|
||||
|
||||
#: paperless/settings.py:303
|
||||
#: paperless/settings.py:305
|
||||
msgid "Portuguese (Brazil)"
|
||||
msgstr "Portugais (Brésil)"
|
||||
|
||||
#: paperless/settings.py:304
|
||||
#: paperless/settings.py:306
|
||||
msgid "Portuguese"
|
||||
msgstr "Portugais"
|
||||
|
||||
#: paperless/settings.py:305
|
||||
#: paperless/settings.py:307
|
||||
msgid "Italian"
|
||||
msgstr "Italien"
|
||||
|
||||
#: paperless/settings.py:306
|
||||
#: paperless/settings.py:308
|
||||
msgid "Romanian"
|
||||
msgstr "Roumain"
|
||||
|
||||
#: paperless/settings.py:307
|
||||
#: paperless/settings.py:309
|
||||
msgid "Russian"
|
||||
msgstr "Russe"
|
||||
|
||||
#: paperless/settings.py:308
|
||||
#: paperless/settings.py:310
|
||||
msgid "Spanish"
|
||||
msgstr "Espagnol"
|
||||
|
||||
#: paperless/settings.py:309
|
||||
#: paperless/settings.py:311
|
||||
msgid "Polish"
|
||||
msgstr "Polonais"
|
||||
|
||||
#: paperless/settings.py:312
|
||||
msgid "Swedish"
|
||||
msgstr "Suédois"
|
||||
|
||||
#: paperless/urls.py:113
|
||||
msgid "Paperless-ng administration"
|
||||
msgstr "Administration de Paperless-ng"
|
||||
|
||||
@@ -2,8 +2,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: paperless-ng\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-04-17 13:41+0200\n"
|
||||
"PO-Revision-Date: 2021-04-17 11:47\n"
|
||||
"POT-Creation-Date: 2021-05-04 15:00+0000\n"
|
||||
"PO-Revision-Date: 2021-05-04 21:52\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Hungarian\n"
|
||||
"Language: hu_HU\n"
|
||||
@@ -412,54 +412,58 @@ msgstr ""
|
||||
msgid "Sign in"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:298
|
||||
#: paperless/settings.py:300
|
||||
msgid "English (US)"
|
||||
msgstr "Angol (US)"
|
||||
|
||||
#: paperless/settings.py:299
|
||||
#: paperless/settings.py:301
|
||||
msgid "English (GB)"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:300
|
||||
#: paperless/settings.py:302
|
||||
msgid "German"
|
||||
msgstr "Német"
|
||||
|
||||
#: paperless/settings.py:301
|
||||
#: paperless/settings.py:303
|
||||
msgid "Dutch"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:302
|
||||
#: paperless/settings.py:304
|
||||
msgid "French"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:303
|
||||
#: paperless/settings.py:305
|
||||
msgid "Portuguese (Brazil)"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:304
|
||||
#: paperless/settings.py:306
|
||||
msgid "Portuguese"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:305
|
||||
#: paperless/settings.py:307
|
||||
msgid "Italian"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:306
|
||||
#: paperless/settings.py:308
|
||||
msgid "Romanian"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:307
|
||||
#: paperless/settings.py:309
|
||||
msgid "Russian"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:308
|
||||
#: paperless/settings.py:310
|
||||
msgid "Spanish"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:309
|
||||
#: paperless/settings.py:311
|
||||
msgid "Polish"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:312
|
||||
msgid "Swedish"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/urls.py:113
|
||||
msgid "Paperless-ng administration"
|
||||
msgstr ""
|
||||
|
||||
@@ -2,8 +2,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: paperless-ng\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-04-17 13:41+0200\n"
|
||||
"PO-Revision-Date: 2021-04-17 18:50\n"
|
||||
"POT-Creation-Date: 2021-05-04 15:00+0000\n"
|
||||
"PO-Revision-Date: 2021-05-05 08:19\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Italian\n"
|
||||
"Language: it_IT\n"
|
||||
@@ -412,54 +412,58 @@ msgstr "Password"
|
||||
msgid "Sign in"
|
||||
msgstr "Accedi"
|
||||
|
||||
#: paperless/settings.py:298
|
||||
#: paperless/settings.py:300
|
||||
msgid "English (US)"
|
||||
msgstr "Inglese (US)"
|
||||
|
||||
#: paperless/settings.py:299
|
||||
#: paperless/settings.py:301
|
||||
msgid "English (GB)"
|
||||
msgstr "Inglese (GB)"
|
||||
|
||||
#: paperless/settings.py:300
|
||||
#: paperless/settings.py:302
|
||||
msgid "German"
|
||||
msgstr "Tedesco"
|
||||
|
||||
#: paperless/settings.py:301
|
||||
#: paperless/settings.py:303
|
||||
msgid "Dutch"
|
||||
msgstr "Olandese"
|
||||
|
||||
#: paperless/settings.py:302
|
||||
#: paperless/settings.py:304
|
||||
msgid "French"
|
||||
msgstr "Francese"
|
||||
|
||||
#: paperless/settings.py:303
|
||||
#: paperless/settings.py:305
|
||||
msgid "Portuguese (Brazil)"
|
||||
msgstr "Portoghese (Brasile)"
|
||||
|
||||
#: paperless/settings.py:304
|
||||
#: paperless/settings.py:306
|
||||
msgid "Portuguese"
|
||||
msgstr "Portoghese"
|
||||
|
||||
#: paperless/settings.py:305
|
||||
#: paperless/settings.py:307
|
||||
msgid "Italian"
|
||||
msgstr "Italiano"
|
||||
|
||||
#: paperless/settings.py:306
|
||||
#: paperless/settings.py:308
|
||||
msgid "Romanian"
|
||||
msgstr "Rumeno"
|
||||
|
||||
#: paperless/settings.py:307
|
||||
#: paperless/settings.py:309
|
||||
msgid "Russian"
|
||||
msgstr "Russo"
|
||||
|
||||
#: paperless/settings.py:308
|
||||
#: paperless/settings.py:310
|
||||
msgid "Spanish"
|
||||
msgstr "Spagnolo"
|
||||
|
||||
#: paperless/settings.py:309
|
||||
#: paperless/settings.py:311
|
||||
msgid "Polish"
|
||||
msgstr "Polacco"
|
||||
|
||||
#: paperless/settings.py:312
|
||||
msgid "Swedish"
|
||||
msgstr "Svedese"
|
||||
|
||||
#: paperless/urls.py:113
|
||||
msgid "Paperless-ng administration"
|
||||
msgstr "Amministrazione di Paperless-ng"
|
||||
|
||||
@@ -2,8 +2,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: paperless-ng\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-04-17 13:41+0200\n"
|
||||
"PO-Revision-Date: 2021-04-18 13:19\n"
|
||||
"POT-Creation-Date: 2021-05-04 15:00+0000\n"
|
||||
"PO-Revision-Date: 2021-05-04 21:51\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Dutch\n"
|
||||
"Language: nl_NL\n"
|
||||
@@ -412,54 +412,58 @@ msgstr "Wachtwoord"
|
||||
msgid "Sign in"
|
||||
msgstr "Aanmelden"
|
||||
|
||||
#: paperless/settings.py:298
|
||||
#: paperless/settings.py:300
|
||||
msgid "English (US)"
|
||||
msgstr "Engels (US)"
|
||||
|
||||
#: paperless/settings.py:299
|
||||
#: paperless/settings.py:301
|
||||
msgid "English (GB)"
|
||||
msgstr "Engels (Brits)"
|
||||
|
||||
#: paperless/settings.py:300
|
||||
#: paperless/settings.py:302
|
||||
msgid "German"
|
||||
msgstr "Duits"
|
||||
|
||||
#: paperless/settings.py:301
|
||||
#: paperless/settings.py:303
|
||||
msgid "Dutch"
|
||||
msgstr "Nederlands"
|
||||
|
||||
#: paperless/settings.py:302
|
||||
#: paperless/settings.py:304
|
||||
msgid "French"
|
||||
msgstr "Frans"
|
||||
|
||||
#: paperless/settings.py:303
|
||||
#: paperless/settings.py:305
|
||||
msgid "Portuguese (Brazil)"
|
||||
msgstr "Portugees (Brazilië)"
|
||||
|
||||
#: paperless/settings.py:304
|
||||
#: paperless/settings.py:306
|
||||
msgid "Portuguese"
|
||||
msgstr "Portugees"
|
||||
|
||||
#: paperless/settings.py:305
|
||||
#: paperless/settings.py:307
|
||||
msgid "Italian"
|
||||
msgstr "Italiaans"
|
||||
|
||||
#: paperless/settings.py:306
|
||||
#: paperless/settings.py:308
|
||||
msgid "Romanian"
|
||||
msgstr "Roemeens"
|
||||
|
||||
#: paperless/settings.py:307
|
||||
#: paperless/settings.py:309
|
||||
msgid "Russian"
|
||||
msgstr "Russisch"
|
||||
|
||||
#: paperless/settings.py:308
|
||||
#: paperless/settings.py:310
|
||||
msgid "Spanish"
|
||||
msgstr "Spaans"
|
||||
|
||||
#: paperless/settings.py:309
|
||||
#: paperless/settings.py:311
|
||||
msgid "Polish"
|
||||
msgstr "Pools"
|
||||
|
||||
#: paperless/settings.py:312
|
||||
msgid "Swedish"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/urls.py:113
|
||||
msgid "Paperless-ng administration"
|
||||
msgstr "Paperless-ng administratie"
|
||||
|
||||
@@ -2,8 +2,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: paperless-ng\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-04-17 13:41+0200\n"
|
||||
"PO-Revision-Date: 2021-04-17 14:46\n"
|
||||
"POT-Creation-Date: 2021-05-04 15:00+0000\n"
|
||||
"PO-Revision-Date: 2021-05-04 21:51\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Polish\n"
|
||||
"Language: pl_PL\n"
|
||||
@@ -412,54 +412,58 @@ msgstr "Hasło"
|
||||
msgid "Sign in"
|
||||
msgstr "Zaloguj się"
|
||||
|
||||
#: paperless/settings.py:298
|
||||
#: paperless/settings.py:300
|
||||
msgid "English (US)"
|
||||
msgstr "Angielski (USA)"
|
||||
|
||||
#: paperless/settings.py:299
|
||||
#: paperless/settings.py:301
|
||||
msgid "English (GB)"
|
||||
msgstr "Angielski (Wielka Brytania)"
|
||||
|
||||
#: paperless/settings.py:300
|
||||
#: paperless/settings.py:302
|
||||
msgid "German"
|
||||
msgstr "Niemiecki"
|
||||
|
||||
#: paperless/settings.py:301
|
||||
#: paperless/settings.py:303
|
||||
msgid "Dutch"
|
||||
msgstr "Holenderski"
|
||||
|
||||
#: paperless/settings.py:302
|
||||
#: paperless/settings.py:304
|
||||
msgid "French"
|
||||
msgstr "Francuski"
|
||||
|
||||
#: paperless/settings.py:303
|
||||
#: paperless/settings.py:305
|
||||
msgid "Portuguese (Brazil)"
|
||||
msgstr "Portugalski (Brazylia)"
|
||||
|
||||
#: paperless/settings.py:304
|
||||
#: paperless/settings.py:306
|
||||
msgid "Portuguese"
|
||||
msgstr "Portugalski"
|
||||
|
||||
#: paperless/settings.py:305
|
||||
#: paperless/settings.py:307
|
||||
msgid "Italian"
|
||||
msgstr "Włoski"
|
||||
|
||||
#: paperless/settings.py:306
|
||||
#: paperless/settings.py:308
|
||||
msgid "Romanian"
|
||||
msgstr "Rumuński"
|
||||
|
||||
#: paperless/settings.py:307
|
||||
#: paperless/settings.py:309
|
||||
msgid "Russian"
|
||||
msgstr "Rosyjski"
|
||||
|
||||
#: paperless/settings.py:308
|
||||
#: paperless/settings.py:310
|
||||
msgid "Spanish"
|
||||
msgstr "Hiszpański"
|
||||
|
||||
#: paperless/settings.py:309
|
||||
#: paperless/settings.py:311
|
||||
msgid "Polish"
|
||||
msgstr "Polski"
|
||||
|
||||
#: paperless/settings.py:312
|
||||
msgid "Swedish"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/urls.py:113
|
||||
msgid "Paperless-ng administration"
|
||||
msgstr "Administracja Paperless-ng"
|
||||
|
||||
@@ -2,8 +2,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: paperless-ng\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-04-17 13:41+0200\n"
|
||||
"PO-Revision-Date: 2021-04-17 11:47\n"
|
||||
"POT-Creation-Date: 2021-05-04 15:00+0000\n"
|
||||
"PO-Revision-Date: 2021-05-04 21:51\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Portuguese, Brazilian\n"
|
||||
"Language: pt_BR\n"
|
||||
@@ -412,54 +412,58 @@ msgstr "Senha"
|
||||
msgid "Sign in"
|
||||
msgstr "Entrar"
|
||||
|
||||
#: paperless/settings.py:298
|
||||
#: paperless/settings.py:300
|
||||
msgid "English (US)"
|
||||
msgstr "Inglês (EUA)"
|
||||
|
||||
#: paperless/settings.py:299
|
||||
#: paperless/settings.py:301
|
||||
msgid "English (GB)"
|
||||
msgstr "Inglês (GB)"
|
||||
|
||||
#: paperless/settings.py:300
|
||||
#: paperless/settings.py:302
|
||||
msgid "German"
|
||||
msgstr "Alemão"
|
||||
|
||||
#: paperless/settings.py:301
|
||||
#: paperless/settings.py:303
|
||||
msgid "Dutch"
|
||||
msgstr "Holandês"
|
||||
|
||||
#: paperless/settings.py:302
|
||||
#: paperless/settings.py:304
|
||||
msgid "French"
|
||||
msgstr "Francês"
|
||||
|
||||
#: paperless/settings.py:303
|
||||
#: paperless/settings.py:305
|
||||
msgid "Portuguese (Brazil)"
|
||||
msgstr "Português (Brasil)"
|
||||
|
||||
#: paperless/settings.py:304
|
||||
#: paperless/settings.py:306
|
||||
msgid "Portuguese"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:305
|
||||
#: paperless/settings.py:307
|
||||
msgid "Italian"
|
||||
msgstr "Italiano"
|
||||
|
||||
#: paperless/settings.py:306
|
||||
#: paperless/settings.py:308
|
||||
msgid "Romanian"
|
||||
msgstr "Romeno"
|
||||
|
||||
#: paperless/settings.py:307
|
||||
#: paperless/settings.py:309
|
||||
msgid "Russian"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:308
|
||||
#: paperless/settings.py:310
|
||||
msgid "Spanish"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:309
|
||||
#: paperless/settings.py:311
|
||||
msgid "Polish"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:312
|
||||
msgid "Swedish"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/urls.py:113
|
||||
msgid "Paperless-ng administration"
|
||||
msgstr "Administração do Paperless-ng"
|
||||
|
||||
@@ -2,8 +2,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: paperless-ng\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-04-17 13:41+0200\n"
|
||||
"PO-Revision-Date: 2021-04-17 21:56\n"
|
||||
"POT-Creation-Date: 2021-05-04 15:00+0000\n"
|
||||
"PO-Revision-Date: 2021-05-05 18:07\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Portuguese\n"
|
||||
"Language: pt_PT\n"
|
||||
@@ -412,54 +412,58 @@ msgstr "Palavra-passe"
|
||||
msgid "Sign in"
|
||||
msgstr "Iniciar sessão"
|
||||
|
||||
#: paperless/settings.py:298
|
||||
#: paperless/settings.py:300
|
||||
msgid "English (US)"
|
||||
msgstr "Inglês (EUA)"
|
||||
|
||||
#: paperless/settings.py:299
|
||||
#: paperless/settings.py:301
|
||||
msgid "English (GB)"
|
||||
msgstr "English (GB)"
|
||||
|
||||
#: paperless/settings.py:300
|
||||
#: paperless/settings.py:302
|
||||
msgid "German"
|
||||
msgstr "Deutsch"
|
||||
|
||||
#: paperless/settings.py:301
|
||||
#: paperless/settings.py:303
|
||||
msgid "Dutch"
|
||||
msgstr "Nederlandse"
|
||||
|
||||
#: paperless/settings.py:302
|
||||
#: paperless/settings.py:304
|
||||
msgid "French"
|
||||
msgstr "Français"
|
||||
|
||||
#: paperless/settings.py:303
|
||||
#: paperless/settings.py:305
|
||||
msgid "Portuguese (Brazil)"
|
||||
msgstr "Português (Brasil)"
|
||||
|
||||
#: paperless/settings.py:304
|
||||
#: paperless/settings.py:306
|
||||
msgid "Portuguese"
|
||||
msgstr "Português"
|
||||
|
||||
#: paperless/settings.py:305
|
||||
#: paperless/settings.py:307
|
||||
msgid "Italian"
|
||||
msgstr "Italiano"
|
||||
|
||||
#: paperless/settings.py:306
|
||||
#: paperless/settings.py:308
|
||||
msgid "Romanian"
|
||||
msgstr "Romeno"
|
||||
|
||||
#: paperless/settings.py:307
|
||||
#: paperless/settings.py:309
|
||||
msgid "Russian"
|
||||
msgstr "Russo"
|
||||
|
||||
#: paperless/settings.py:308
|
||||
#: paperless/settings.py:310
|
||||
msgid "Spanish"
|
||||
msgstr "Espanhol"
|
||||
|
||||
#: paperless/settings.py:309
|
||||
#: paperless/settings.py:311
|
||||
msgid "Polish"
|
||||
msgstr "Polaco"
|
||||
|
||||
#: paperless/settings.py:312
|
||||
msgid "Swedish"
|
||||
msgstr "Sueco"
|
||||
|
||||
#: paperless/urls.py:113
|
||||
msgid "Paperless-ng administration"
|
||||
msgstr "Administração do Paperless-ng"
|
||||
|
||||
@@ -2,8 +2,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: paperless-ng\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-04-17 13:41+0200\n"
|
||||
"PO-Revision-Date: 2021-04-17 11:46\n"
|
||||
"POT-Creation-Date: 2021-05-04 15:00+0000\n"
|
||||
"PO-Revision-Date: 2021-05-04 23:04\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Romanian\n"
|
||||
"Language: ro_RO\n"
|
||||
@@ -336,11 +336,11 @@ msgstr "titlul sau conținutul conține"
|
||||
|
||||
#: documents/models.py:393
|
||||
msgid "fulltext query"
|
||||
msgstr ""
|
||||
msgstr "query fulltext"
|
||||
|
||||
#: documents/models.py:394
|
||||
msgid "more like this"
|
||||
msgstr ""
|
||||
msgstr "mai multe ca aceasta"
|
||||
|
||||
#: documents/models.py:405
|
||||
msgid "rule type"
|
||||
@@ -412,53 +412,57 @@ msgstr "Parolă"
|
||||
msgid "Sign in"
|
||||
msgstr "Conectare"
|
||||
|
||||
#: paperless/settings.py:298
|
||||
#: paperless/settings.py:300
|
||||
msgid "English (US)"
|
||||
msgstr "Engleză (Americană)"
|
||||
|
||||
#: paperless/settings.py:299
|
||||
#: paperless/settings.py:301
|
||||
msgid "English (GB)"
|
||||
msgstr "Engleză (Britanică)"
|
||||
|
||||
#: paperless/settings.py:300
|
||||
#: paperless/settings.py:302
|
||||
msgid "German"
|
||||
msgstr "Germană"
|
||||
|
||||
#: paperless/settings.py:301
|
||||
#: paperless/settings.py:303
|
||||
msgid "Dutch"
|
||||
msgstr "Olandeză"
|
||||
|
||||
#: paperless/settings.py:302
|
||||
#: paperless/settings.py:304
|
||||
msgid "French"
|
||||
msgstr "Franceză"
|
||||
|
||||
#: paperless/settings.py:303
|
||||
#: paperless/settings.py:305
|
||||
msgid "Portuguese (Brazil)"
|
||||
msgstr "Portugheză (Brazilia)"
|
||||
|
||||
#: paperless/settings.py:304
|
||||
#: paperless/settings.py:306
|
||||
msgid "Portuguese"
|
||||
msgstr "Portugheză"
|
||||
|
||||
#: paperless/settings.py:305
|
||||
#: paperless/settings.py:307
|
||||
msgid "Italian"
|
||||
msgstr "Italiană"
|
||||
|
||||
#: paperless/settings.py:306
|
||||
#: paperless/settings.py:308
|
||||
msgid "Romanian"
|
||||
msgstr "Română"
|
||||
|
||||
#: paperless/settings.py:307
|
||||
#: paperless/settings.py:309
|
||||
msgid "Russian"
|
||||
msgstr "Rusă"
|
||||
|
||||
#: paperless/settings.py:308
|
||||
#: paperless/settings.py:310
|
||||
msgid "Spanish"
|
||||
msgstr "Spaniolă"
|
||||
|
||||
#: paperless/settings.py:309
|
||||
#: paperless/settings.py:311
|
||||
msgid "Polish"
|
||||
msgstr ""
|
||||
msgstr "Poloneză"
|
||||
|
||||
#: paperless/settings.py:312
|
||||
msgid "Swedish"
|
||||
msgstr "Suedeză"
|
||||
|
||||
#: paperless/urls.py:113
|
||||
msgid "Paperless-ng administration"
|
||||
|
||||
@@ -2,8 +2,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: paperless-ng\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-04-17 13:41+0200\n"
|
||||
"PO-Revision-Date: 2021-04-17 11:47\n"
|
||||
"POT-Creation-Date: 2021-05-04 15:00+0000\n"
|
||||
"PO-Revision-Date: 2021-05-04 21:51\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Russian\n"
|
||||
"Language: ru_RU\n"
|
||||
@@ -412,54 +412,58 @@ msgstr "Пароль"
|
||||
msgid "Sign in"
|
||||
msgstr "Вход"
|
||||
|
||||
#: paperless/settings.py:298
|
||||
#: paperless/settings.py:300
|
||||
msgid "English (US)"
|
||||
msgstr "Английский (США)"
|
||||
|
||||
#: paperless/settings.py:299
|
||||
#: paperless/settings.py:301
|
||||
msgid "English (GB)"
|
||||
msgstr "Английский (Великобритании)"
|
||||
|
||||
#: paperless/settings.py:300
|
||||
#: paperless/settings.py:302
|
||||
msgid "German"
|
||||
msgstr "Немецкий"
|
||||
|
||||
#: paperless/settings.py:301
|
||||
#: paperless/settings.py:303
|
||||
msgid "Dutch"
|
||||
msgstr "Датский"
|
||||
|
||||
#: paperless/settings.py:302
|
||||
#: paperless/settings.py:304
|
||||
msgid "French"
|
||||
msgstr "Французский"
|
||||
|
||||
#: paperless/settings.py:303
|
||||
#: paperless/settings.py:305
|
||||
msgid "Portuguese (Brazil)"
|
||||
msgstr "Portuguese (Brazil)"
|
||||
|
||||
#: paperless/settings.py:304
|
||||
#: paperless/settings.py:306
|
||||
msgid "Portuguese"
|
||||
msgstr "Португальский"
|
||||
|
||||
#: paperless/settings.py:305
|
||||
#: paperless/settings.py:307
|
||||
msgid "Italian"
|
||||
msgstr "Italian"
|
||||
|
||||
#: paperless/settings.py:306
|
||||
#: paperless/settings.py:308
|
||||
msgid "Romanian"
|
||||
msgstr "Romanian"
|
||||
|
||||
#: paperless/settings.py:307
|
||||
#: paperless/settings.py:309
|
||||
msgid "Russian"
|
||||
msgstr "Русский"
|
||||
|
||||
#: paperless/settings.py:308
|
||||
#: paperless/settings.py:310
|
||||
msgid "Spanish"
|
||||
msgstr "Испанский"
|
||||
|
||||
#: paperless/settings.py:309
|
||||
#: paperless/settings.py:311
|
||||
msgid "Polish"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:312
|
||||
msgid "Swedish"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/urls.py:113
|
||||
msgid "Paperless-ng administration"
|
||||
msgstr "Администрирование Paperless-ng"
|
||||
|
||||
@@ -0,0 +1,678 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: paperless-ng\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-05-04 15:00+0000\n"
|
||||
"PO-Revision-Date: 2021-05-04 21:52\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Swedish\n"
|
||||
"Language: sv_SE\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Crowdin-Project: paperless-ng\n"
|
||||
"X-Crowdin-Project-ID: 434940\n"
|
||||
"X-Crowdin-Language: sv-SE\n"
|
||||
"X-Crowdin-File: /dev/src/locale/en_US/LC_MESSAGES/django.po\n"
|
||||
"X-Crowdin-File-ID: 54\n"
|
||||
|
||||
#: documents/apps.py:10
|
||||
msgid "Documents"
|
||||
msgstr "Dokument"
|
||||
|
||||
#: documents/models.py:32
|
||||
msgid "Any word"
|
||||
msgstr "Valfritt ord"
|
||||
|
||||
#: documents/models.py:33
|
||||
msgid "All words"
|
||||
msgstr "Alla ord"
|
||||
|
||||
#: documents/models.py:34
|
||||
msgid "Exact match"
|
||||
msgstr "Exakt matchning"
|
||||
|
||||
#: documents/models.py:35
|
||||
msgid "Regular expression"
|
||||
msgstr "Reguljära uttryck"
|
||||
|
||||
#: documents/models.py:36
|
||||
msgid "Fuzzy word"
|
||||
msgstr "Fuzzy word"
|
||||
|
||||
#: documents/models.py:37
|
||||
msgid "Automatic"
|
||||
msgstr "Automatisk"
|
||||
|
||||
#: documents/models.py:41 documents/models.py:350 paperless_mail/models.py:25
|
||||
#: paperless_mail/models.py:109
|
||||
msgid "name"
|
||||
msgstr "namn"
|
||||
|
||||
#: documents/models.py:45
|
||||
msgid "match"
|
||||
msgstr "träff"
|
||||
|
||||
#: documents/models.py:49
|
||||
msgid "matching algorithm"
|
||||
msgstr "matchande algoritm"
|
||||
|
||||
#: documents/models.py:55
|
||||
msgid "is insensitive"
|
||||
msgstr "är ej skiftlägeskänsligt"
|
||||
|
||||
#: documents/models.py:74 documents/models.py:120
|
||||
msgid "correspondent"
|
||||
msgstr "korrespondent"
|
||||
|
||||
#: documents/models.py:75
|
||||
msgid "correspondents"
|
||||
msgstr "korrespondenter"
|
||||
|
||||
#: documents/models.py:81
|
||||
msgid "color"
|
||||
msgstr "färg"
|
||||
|
||||
#: documents/models.py:87
|
||||
msgid "is inbox tag"
|
||||
msgstr "är inkorgstagg"
|
||||
|
||||
#: documents/models.py:89
|
||||
msgid "Marks this tag as an inbox tag: All newly consumed documents will be tagged with inbox tags."
|
||||
msgstr "Markerar denna tagg som en inkorgstagg: Alla nyligen konsumerade dokument kommer att taggas med inkorgstaggar."
|
||||
|
||||
#: documents/models.py:94
|
||||
msgid "tag"
|
||||
msgstr "tagg"
|
||||
|
||||
#: documents/models.py:95 documents/models.py:151
|
||||
msgid "tags"
|
||||
msgstr "taggar"
|
||||
|
||||
#: documents/models.py:101 documents/models.py:133
|
||||
msgid "document type"
|
||||
msgstr "dokumenttyp"
|
||||
|
||||
#: documents/models.py:102
|
||||
msgid "document types"
|
||||
msgstr "dokumenttyper"
|
||||
|
||||
#: documents/models.py:110
|
||||
msgid "Unencrypted"
|
||||
msgstr "Okrypterad"
|
||||
|
||||
#: documents/models.py:111
|
||||
msgid "Encrypted with GNU Privacy Guard"
|
||||
msgstr "Krypterad med GNU Privacy Guard"
|
||||
|
||||
#: documents/models.py:124
|
||||
msgid "title"
|
||||
msgstr "titel"
|
||||
|
||||
#: documents/models.py:137
|
||||
msgid "content"
|
||||
msgstr "innehåll"
|
||||
|
||||
#: documents/models.py:139
|
||||
msgid "The raw, text-only data of the document. This field is primarily used for searching."
|
||||
msgstr "Dokumentets råa, enbart text data. Detta fält används främst för sökning."
|
||||
|
||||
#: documents/models.py:144
|
||||
msgid "mime type"
|
||||
msgstr "MIME-typ"
|
||||
|
||||
#: documents/models.py:155
|
||||
msgid "checksum"
|
||||
msgstr "kontrollsumma"
|
||||
|
||||
#: documents/models.py:159
|
||||
msgid "The checksum of the original document."
|
||||
msgstr "Kontrollsumman för originaldokumentet."
|
||||
|
||||
#: documents/models.py:163
|
||||
msgid "archive checksum"
|
||||
msgstr "arkivera kontrollsumma"
|
||||
|
||||
#: documents/models.py:168
|
||||
msgid "The checksum of the archived document."
|
||||
msgstr "Kontrollsumman för arkiverat dokument."
|
||||
|
||||
#: documents/models.py:172 documents/models.py:328
|
||||
msgid "created"
|
||||
msgstr "skapad"
|
||||
|
||||
#: documents/models.py:176
|
||||
msgid "modified"
|
||||
msgstr "ändrad"
|
||||
|
||||
#: documents/models.py:180
|
||||
msgid "storage type"
|
||||
msgstr "Lagringstyp"
|
||||
|
||||
#: documents/models.py:188
|
||||
msgid "added"
|
||||
msgstr "tillagd"
|
||||
|
||||
#: documents/models.py:192
|
||||
msgid "filename"
|
||||
msgstr "filnamn"
|
||||
|
||||
#: documents/models.py:198
|
||||
msgid "Current filename in storage"
|
||||
msgstr "Nuvarande filnamn i lagring"
|
||||
|
||||
#: documents/models.py:202
|
||||
msgid "archive filename"
|
||||
msgstr "arkivfilnamn"
|
||||
|
||||
#: documents/models.py:208
|
||||
msgid "Current archive filename in storage"
|
||||
msgstr "Nuvarande arkivfilnamn i lagring"
|
||||
|
||||
#: documents/models.py:212
|
||||
msgid "archive serial number"
|
||||
msgstr "arkivets serienummer"
|
||||
|
||||
#: documents/models.py:217
|
||||
msgid "The position of this document in your physical document archive."
|
||||
msgstr "Placeringen av detta dokument i ditt fysiska dokumentarkiv."
|
||||
|
||||
#: documents/models.py:223
|
||||
msgid "document"
|
||||
msgstr "dokument"
|
||||
|
||||
#: documents/models.py:224
|
||||
msgid "documents"
|
||||
msgstr "dokument"
|
||||
|
||||
#: documents/models.py:311
|
||||
msgid "debug"
|
||||
msgstr "felsök"
|
||||
|
||||
#: documents/models.py:312
|
||||
msgid "information"
|
||||
msgstr "information"
|
||||
|
||||
#: documents/models.py:313
|
||||
msgid "warning"
|
||||
msgstr "varning"
|
||||
|
||||
#: documents/models.py:314
|
||||
msgid "error"
|
||||
msgstr "fel"
|
||||
|
||||
#: documents/models.py:315
|
||||
msgid "critical"
|
||||
msgstr "kritisk"
|
||||
|
||||
#: documents/models.py:319
|
||||
msgid "group"
|
||||
msgstr "grupp"
|
||||
|
||||
#: documents/models.py:322
|
||||
msgid "message"
|
||||
msgstr "meddelande"
|
||||
|
||||
#: documents/models.py:325
|
||||
msgid "level"
|
||||
msgstr "nivå"
|
||||
|
||||
#: documents/models.py:332
|
||||
msgid "log"
|
||||
msgstr "logg"
|
||||
|
||||
#: documents/models.py:333
|
||||
msgid "logs"
|
||||
msgstr "loggar"
|
||||
|
||||
#: documents/models.py:344 documents/models.py:401
|
||||
msgid "saved view"
|
||||
msgstr "sparad vy"
|
||||
|
||||
#: documents/models.py:345
|
||||
msgid "saved views"
|
||||
msgstr "sparade vyer"
|
||||
|
||||
#: documents/models.py:348
|
||||
msgid "user"
|
||||
msgstr "användare"
|
||||
|
||||
#: documents/models.py:354
|
||||
msgid "show on dashboard"
|
||||
msgstr "visa på instrumentpanelen"
|
||||
|
||||
#: documents/models.py:357
|
||||
msgid "show in sidebar"
|
||||
msgstr "visa i sidofältet"
|
||||
|
||||
#: documents/models.py:361
|
||||
msgid "sort field"
|
||||
msgstr "sortera fält"
|
||||
|
||||
#: documents/models.py:367
|
||||
msgid "sort reverse"
|
||||
msgstr "sortera omvänd"
|
||||
|
||||
#: documents/models.py:373
|
||||
msgid "title contains"
|
||||
msgstr "titel innehåller"
|
||||
|
||||
#: documents/models.py:374
|
||||
msgid "content contains"
|
||||
msgstr "innehåll innehåller"
|
||||
|
||||
#: documents/models.py:375
|
||||
msgid "ASN is"
|
||||
msgstr "ASN är"
|
||||
|
||||
#: documents/models.py:376
|
||||
msgid "correspondent is"
|
||||
msgstr "korrespondent är"
|
||||
|
||||
#: documents/models.py:377
|
||||
msgid "document type is"
|
||||
msgstr "dokumenttyp är"
|
||||
|
||||
#: documents/models.py:378
|
||||
msgid "is in inbox"
|
||||
msgstr "är i inkorgen"
|
||||
|
||||
#: documents/models.py:379
|
||||
msgid "has tag"
|
||||
msgstr "har tagg"
|
||||
|
||||
#: documents/models.py:380
|
||||
msgid "has any tag"
|
||||
msgstr "har någon tagg"
|
||||
|
||||
#: documents/models.py:381
|
||||
msgid "created before"
|
||||
msgstr "skapad före"
|
||||
|
||||
#: documents/models.py:382
|
||||
msgid "created after"
|
||||
msgstr "skapad efter"
|
||||
|
||||
#: documents/models.py:383
|
||||
msgid "created year is"
|
||||
msgstr "skapat år är"
|
||||
|
||||
#: documents/models.py:384
|
||||
msgid "created month is"
|
||||
msgstr "skapad månad är"
|
||||
|
||||
#: documents/models.py:385
|
||||
msgid "created day is"
|
||||
msgstr "skapad dag är"
|
||||
|
||||
#: documents/models.py:386
|
||||
msgid "added before"
|
||||
msgstr "tillagd före"
|
||||
|
||||
#: documents/models.py:387
|
||||
msgid "added after"
|
||||
msgstr "tillagd efter"
|
||||
|
||||
#: documents/models.py:388
|
||||
msgid "modified before"
|
||||
msgstr "ändrad före"
|
||||
|
||||
#: documents/models.py:389
|
||||
msgid "modified after"
|
||||
msgstr "ändrad efter"
|
||||
|
||||
#: documents/models.py:390
|
||||
msgid "does not have tag"
|
||||
msgstr "har inte tagg"
|
||||
|
||||
#: documents/models.py:391
|
||||
msgid "does not have ASN"
|
||||
msgstr "har inte ASN"
|
||||
|
||||
#: documents/models.py:392
|
||||
msgid "title or content contains"
|
||||
msgstr "titeln eller innehållet innehåller"
|
||||
|
||||
#: documents/models.py:393
|
||||
msgid "fulltext query"
|
||||
msgstr "fulltextfråga"
|
||||
|
||||
#: documents/models.py:394
|
||||
msgid "more like this"
|
||||
msgstr "mer som detta"
|
||||
|
||||
#: documents/models.py:405
|
||||
msgid "rule type"
|
||||
msgstr "regeltyp"
|
||||
|
||||
#: documents/models.py:409
|
||||
msgid "value"
|
||||
msgstr "värde"
|
||||
|
||||
#: documents/models.py:415
|
||||
msgid "filter rule"
|
||||
msgstr "filtrera regel"
|
||||
|
||||
#: documents/models.py:416
|
||||
msgid "filter rules"
|
||||
msgstr "filtrera regler"
|
||||
|
||||
#: documents/serialisers.py:53
|
||||
#, python-format
|
||||
msgid "Invalid regular expression: %(error)s"
|
||||
msgstr "Ogiltigt reguljärt uttryck: %(error)s"
|
||||
|
||||
#: documents/serialisers.py:177
|
||||
msgid "Invalid color."
|
||||
msgstr "Ogiltig färg."
|
||||
|
||||
#: documents/serialisers.py:451
|
||||
#, python-format
|
||||
msgid "File type %(type)s not supported"
|
||||
msgstr "Filtypen %(type)s stöds inte"
|
||||
|
||||
#: documents/templates/index.html:21
|
||||
msgid "Paperless-ng is loading..."
|
||||
msgstr "Paperless-ng laddas..."
|
||||
|
||||
#: documents/templates/registration/logged_out.html:13
|
||||
msgid "Paperless-ng signed out"
|
||||
msgstr "Paperless-ng utloggad"
|
||||
|
||||
#: documents/templates/registration/logged_out.html:41
|
||||
msgid "You have been successfully logged out. Bye!"
|
||||
msgstr "Du är nu utloggad!"
|
||||
|
||||
#: documents/templates/registration/logged_out.html:42
|
||||
msgid "Sign in again"
|
||||
msgstr "Logga in igen"
|
||||
|
||||
#: documents/templates/registration/login.html:13
|
||||
msgid "Paperless-ng sign in"
|
||||
msgstr "Paperless-ng inloggning"
|
||||
|
||||
#: documents/templates/registration/login.html:42
|
||||
msgid "Please sign in."
|
||||
msgstr "Vänligen logga in."
|
||||
|
||||
#: documents/templates/registration/login.html:45
|
||||
msgid "Your username and password didn't match. Please try again."
|
||||
msgstr "Ditt användarnamn och lösenord stämde inte. Försök igen."
|
||||
|
||||
#: documents/templates/registration/login.html:48
|
||||
msgid "Username"
|
||||
msgstr "Användarnamn"
|
||||
|
||||
#: documents/templates/registration/login.html:49
|
||||
msgid "Password"
|
||||
msgstr "Lösenord"
|
||||
|
||||
#: documents/templates/registration/login.html:54
|
||||
msgid "Sign in"
|
||||
msgstr "Logga in"
|
||||
|
||||
#: paperless/settings.py:300
|
||||
msgid "English (US)"
|
||||
msgstr "Engelska (USA)"
|
||||
|
||||
#: paperless/settings.py:301
|
||||
msgid "English (GB)"
|
||||
msgstr "Engelska (GB)"
|
||||
|
||||
#: paperless/settings.py:302
|
||||
msgid "German"
|
||||
msgstr "Tyska"
|
||||
|
||||
#: paperless/settings.py:303
|
||||
msgid "Dutch"
|
||||
msgstr "Holländska"
|
||||
|
||||
#: paperless/settings.py:304
|
||||
msgid "French"
|
||||
msgstr "Franska"
|
||||
|
||||
#: paperless/settings.py:305
|
||||
msgid "Portuguese (Brazil)"
|
||||
msgstr "Portugisiska (Brasilien)"
|
||||
|
||||
#: paperless/settings.py:306
|
||||
msgid "Portuguese"
|
||||
msgstr "Portugisiska"
|
||||
|
||||
#: paperless/settings.py:307
|
||||
msgid "Italian"
|
||||
msgstr "Italienska"
|
||||
|
||||
#: paperless/settings.py:308
|
||||
msgid "Romanian"
|
||||
msgstr "Rumänska"
|
||||
|
||||
#: paperless/settings.py:309
|
||||
msgid "Russian"
|
||||
msgstr "Ryska"
|
||||
|
||||
#: paperless/settings.py:310
|
||||
msgid "Spanish"
|
||||
msgstr "Spanska"
|
||||
|
||||
#: paperless/settings.py:311
|
||||
msgid "Polish"
|
||||
msgstr "Polska"
|
||||
|
||||
#: paperless/settings.py:312
|
||||
msgid "Swedish"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/urls.py:113
|
||||
msgid "Paperless-ng administration"
|
||||
msgstr "Paperless-ng administration"
|
||||
|
||||
#: paperless_mail/admin.py:25
|
||||
msgid "Filter"
|
||||
msgstr "Filter"
|
||||
|
||||
#: paperless_mail/admin.py:27
|
||||
msgid "Paperless will only process mails that match ALL of the filters given below."
|
||||
msgstr "Paperless kommer endast att behandla e-postmeddelanden som matchar ALLA filter som anges nedan."
|
||||
|
||||
#: paperless_mail/admin.py:37
|
||||
msgid "Actions"
|
||||
msgstr "Åtgärder"
|
||||
|
||||
#: paperless_mail/admin.py:39
|
||||
msgid "The action applied to the mail. This action is only performed when documents were consumed from the mail. Mails without attachments will remain entirely untouched."
|
||||
msgstr "Åtgärden tillämpas på e-postmeddelandet. Denna åtgärd utförs endast när dokument konsumerades från e-postmeddelandet. E-post utan bilagor kommer att förbli helt orörda."
|
||||
|
||||
#: paperless_mail/admin.py:46
|
||||
msgid "Metadata"
|
||||
msgstr "Metadata"
|
||||
|
||||
#: paperless_mail/admin.py:48
|
||||
msgid "Assign metadata to documents consumed from this rule automatically. If you do not assign tags, types or correspondents here, paperless will still process all matching rules that you have defined."
|
||||
msgstr "Tilldela metadata till dokument som konsumeras från denna regel automatiskt. Om du inte tilldelar taggar, typer eller korrespondenter här kommer paperless fortfarande att behandla alla matchande regler som du har definierat."
|
||||
|
||||
#: paperless_mail/apps.py:9
|
||||
msgid "Paperless mail"
|
||||
msgstr "Paperless e-post"
|
||||
|
||||
#: paperless_mail/models.py:11
|
||||
msgid "mail account"
|
||||
msgstr "e-postkonto"
|
||||
|
||||
#: paperless_mail/models.py:12
|
||||
msgid "mail accounts"
|
||||
msgstr "e-postkonton"
|
||||
|
||||
#: paperless_mail/models.py:19
|
||||
msgid "No encryption"
|
||||
msgstr "Ingen kryptering"
|
||||
|
||||
#: paperless_mail/models.py:20
|
||||
msgid "Use SSL"
|
||||
msgstr "Använd SSL"
|
||||
|
||||
#: paperless_mail/models.py:21
|
||||
msgid "Use STARTTLS"
|
||||
msgstr "Använd STARTTLS"
|
||||
|
||||
#: paperless_mail/models.py:29
|
||||
msgid "IMAP server"
|
||||
msgstr "IMAP-server"
|
||||
|
||||
#: paperless_mail/models.py:33
|
||||
msgid "IMAP port"
|
||||
msgstr "IMAP port"
|
||||
|
||||
#: paperless_mail/models.py:36
|
||||
msgid "This is usually 143 for unencrypted and STARTTLS connections, and 993 for SSL connections."
|
||||
msgstr "Detta är vanligtvis 143 för okrypterade och STARTTLS-anslutningar, och 993 för SSL-anslutningar."
|
||||
|
||||
#: paperless_mail/models.py:40
|
||||
msgid "IMAP security"
|
||||
msgstr "IMAP säkerhet"
|
||||
|
||||
#: paperless_mail/models.py:46
|
||||
msgid "username"
|
||||
msgstr "användarnamn"
|
||||
|
||||
#: paperless_mail/models.py:50
|
||||
msgid "password"
|
||||
msgstr "lösenord"
|
||||
|
||||
#: paperless_mail/models.py:60
|
||||
msgid "mail rule"
|
||||
msgstr "e-postregel"
|
||||
|
||||
#: paperless_mail/models.py:61
|
||||
msgid "mail rules"
|
||||
msgstr "e-postregler"
|
||||
|
||||
#: paperless_mail/models.py:67
|
||||
msgid "Only process attachments."
|
||||
msgstr "Behandla endast bilagor."
|
||||
|
||||
#: paperless_mail/models.py:68
|
||||
msgid "Process all files, including 'inline' attachments."
|
||||
msgstr "Behandla alla filer, inklusive \"inline\" bilagor."
|
||||
|
||||
#: paperless_mail/models.py:78
|
||||
msgid "Mark as read, don't process read mails"
|
||||
msgstr "Markera som läst, bearbeta inte lästa meddelanden"
|
||||
|
||||
#: paperless_mail/models.py:79
|
||||
msgid "Flag the mail, don't process flagged mails"
|
||||
msgstr "Flagga mailet, bearbeta inte flaggade mail"
|
||||
|
||||
#: paperless_mail/models.py:80
|
||||
msgid "Move to specified folder"
|
||||
msgstr "Flytta till angiven mapp"
|
||||
|
||||
#: paperless_mail/models.py:81
|
||||
msgid "Delete"
|
||||
msgstr "Radera"
|
||||
|
||||
#: paperless_mail/models.py:88
|
||||
msgid "Use subject as title"
|
||||
msgstr "Använd ämne som titel"
|
||||
|
||||
#: paperless_mail/models.py:89
|
||||
msgid "Use attachment filename as title"
|
||||
msgstr "Använd bilagans filnamn som titel"
|
||||
|
||||
#: paperless_mail/models.py:99
|
||||
msgid "Do not assign a correspondent"
|
||||
msgstr "Tilldela inte en korrespondent"
|
||||
|
||||
#: paperless_mail/models.py:101
|
||||
msgid "Use mail address"
|
||||
msgstr "Använd e-postadress"
|
||||
|
||||
#: paperless_mail/models.py:103
|
||||
msgid "Use name (or mail address if not available)"
|
||||
msgstr "Använd namn (eller e-postadress om inte tillgängligt)"
|
||||
|
||||
#: paperless_mail/models.py:105
|
||||
msgid "Use correspondent selected below"
|
||||
msgstr "Använd korrespondent som valts nedan"
|
||||
|
||||
#: paperless_mail/models.py:113
|
||||
msgid "order"
|
||||
msgstr "ordning"
|
||||
|
||||
#: paperless_mail/models.py:120
|
||||
msgid "account"
|
||||
msgstr "konto"
|
||||
|
||||
#: paperless_mail/models.py:124
|
||||
msgid "folder"
|
||||
msgstr "mapp"
|
||||
|
||||
#: paperless_mail/models.py:128
|
||||
msgid "filter from"
|
||||
msgstr "filtrera från"
|
||||
|
||||
#: paperless_mail/models.py:131
|
||||
msgid "filter subject"
|
||||
msgstr "filtrera ämne"
|
||||
|
||||
#: paperless_mail/models.py:134
|
||||
msgid "filter body"
|
||||
msgstr "filtrera kropp"
|
||||
|
||||
#: paperless_mail/models.py:138
|
||||
msgid "filter attachment filename"
|
||||
msgstr "filtrera filnamn för bilaga"
|
||||
|
||||
#: paperless_mail/models.py:140
|
||||
msgid "Only consume documents which entirely match this filename if specified. Wildcards such as *.pdf or *invoice* are allowed. Case insensitive."
|
||||
msgstr "Konsumera endast dokument som helt och hållet matchar detta filnamn om det anges. Wildcards som *.pdf eller *faktura* är tillåtna. Ej skiftlägeskänsliga."
|
||||
|
||||
#: paperless_mail/models.py:146
|
||||
msgid "maximum age"
|
||||
msgstr "maximal ålder"
|
||||
|
||||
#: paperless_mail/models.py:148
|
||||
msgid "Specified in days."
|
||||
msgstr "Anges i dagar."
|
||||
|
||||
#: paperless_mail/models.py:151
|
||||
msgid "attachment type"
|
||||
msgstr "typ av bilaga"
|
||||
|
||||
#: paperless_mail/models.py:154
|
||||
msgid "Inline attachments include embedded images, so it's best to combine this option with a filename filter."
|
||||
msgstr "Bifogade bilagor inkluderar inbäddade bilder, så det är bäst att kombinera detta alternativ med ett filnamnsfilter."
|
||||
|
||||
#: paperless_mail/models.py:159
|
||||
msgid "action"
|
||||
msgstr "åtgärd"
|
||||
|
||||
#: paperless_mail/models.py:165
|
||||
msgid "action parameter"
|
||||
msgstr "åtgärdsparameter"
|
||||
|
||||
#: paperless_mail/models.py:167
|
||||
msgid "Additional parameter for the action selected above, i.e., the target folder of the move to folder action."
|
||||
msgstr "Ytterligare parameter för åtgärden som valts ovan, dvs målmappen för flytta till mapp-åtgärden."
|
||||
|
||||
#: paperless_mail/models.py:173
|
||||
msgid "assign title from"
|
||||
msgstr "tilldela titel från"
|
||||
|
||||
#: paperless_mail/models.py:183
|
||||
msgid "assign this tag"
|
||||
msgstr "tilldela denna tagg"
|
||||
|
||||
#: paperless_mail/models.py:191
|
||||
msgid "assign this document type"
|
||||
msgstr "tilldela den här dokumenttypen"
|
||||
|
||||
#: paperless_mail/models.py:195
|
||||
msgid "assign correspondent from"
|
||||
msgstr "tilldela korrespondent från"
|
||||
|
||||
#: paperless_mail/models.py:205
|
||||
msgid "assign this correspondent"
|
||||
msgstr "tilldela denna korrespondent"
|
||||
|
||||
@@ -2,8 +2,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: paperless-ng\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-04-17 13:41+0200\n"
|
||||
"PO-Revision-Date: 2021-04-17 11:46\n"
|
||||
"POT-Creation-Date: 2021-05-04 15:00+0000\n"
|
||||
"PO-Revision-Date: 2021-05-04 21:51\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Xhosa\n"
|
||||
"Language: xh_ZA\n"
|
||||
@@ -412,54 +412,58 @@ msgstr "crwdns2712:0crwdne2712:0"
|
||||
msgid "Sign in"
|
||||
msgstr "crwdns2714:0crwdne2714:0"
|
||||
|
||||
#: paperless/settings.py:298
|
||||
#: paperless/settings.py:300
|
||||
msgid "English (US)"
|
||||
msgstr "crwdns2716:0crwdne2716:0"
|
||||
|
||||
#: paperless/settings.py:299
|
||||
#: paperless/settings.py:301
|
||||
msgid "English (GB)"
|
||||
msgstr "crwdns2718:0crwdne2718:0"
|
||||
|
||||
#: paperless/settings.py:300
|
||||
#: paperless/settings.py:302
|
||||
msgid "German"
|
||||
msgstr "crwdns2720:0crwdne2720:0"
|
||||
|
||||
#: paperless/settings.py:301
|
||||
#: paperless/settings.py:303
|
||||
msgid "Dutch"
|
||||
msgstr "crwdns2722:0crwdne2722:0"
|
||||
|
||||
#: paperless/settings.py:302
|
||||
#: paperless/settings.py:304
|
||||
msgid "French"
|
||||
msgstr "crwdns2724:0crwdne2724:0"
|
||||
|
||||
#: paperless/settings.py:303
|
||||
#: paperless/settings.py:305
|
||||
msgid "Portuguese (Brazil)"
|
||||
msgstr "crwdns2726:0crwdne2726:0"
|
||||
|
||||
#: paperless/settings.py:304
|
||||
#: paperless/settings.py:306
|
||||
msgid "Portuguese"
|
||||
msgstr "crwdns3424:0crwdne3424:0"
|
||||
|
||||
#: paperless/settings.py:305
|
||||
#: paperless/settings.py:307
|
||||
msgid "Italian"
|
||||
msgstr "crwdns2728:0crwdne2728:0"
|
||||
|
||||
#: paperless/settings.py:306
|
||||
#: paperless/settings.py:308
|
||||
msgid "Romanian"
|
||||
msgstr "crwdns2730:0crwdne2730:0"
|
||||
|
||||
#: paperless/settings.py:307
|
||||
#: paperless/settings.py:309
|
||||
msgid "Russian"
|
||||
msgstr "crwdns3414:0crwdne3414:0"
|
||||
|
||||
#: paperless/settings.py:308
|
||||
#: paperless/settings.py:310
|
||||
msgid "Spanish"
|
||||
msgstr "crwdns3420:0crwdne3420:0"
|
||||
|
||||
#: paperless/settings.py:309
|
||||
#: paperless/settings.py:311
|
||||
msgid "Polish"
|
||||
msgstr "crwdns3444:0crwdne3444:0"
|
||||
|
||||
#: paperless/settings.py:312
|
||||
msgid "Swedish"
|
||||
msgstr "crwdns3448:0crwdne3448:0"
|
||||
|
||||
#: paperless/urls.py:113
|
||||
msgid "Paperless-ng administration"
|
||||
msgstr "crwdns2732:0crwdne2732:0"
|
||||
|
||||
@@ -2,8 +2,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: paperless-ng\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-04-17 13:41+0200\n"
|
||||
"PO-Revision-Date: 2021-04-17 11:47\n"
|
||||
"POT-Creation-Date: 2021-05-04 15:00+0000\n"
|
||||
"PO-Revision-Date: 2021-05-04 21:51\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Chinese Simplified\n"
|
||||
"Language: zh_CN\n"
|
||||
@@ -412,54 +412,58 @@ msgstr ""
|
||||
msgid "Sign in"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:298
|
||||
#: paperless/settings.py:300
|
||||
msgid "English (US)"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:299
|
||||
#: paperless/settings.py:301
|
||||
msgid "English (GB)"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:300
|
||||
#: paperless/settings.py:302
|
||||
msgid "German"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:301
|
||||
#: paperless/settings.py:303
|
||||
msgid "Dutch"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:302
|
||||
#: paperless/settings.py:304
|
||||
msgid "French"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:303
|
||||
#: paperless/settings.py:305
|
||||
msgid "Portuguese (Brazil)"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:304
|
||||
#: paperless/settings.py:306
|
||||
msgid "Portuguese"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:305
|
||||
#: paperless/settings.py:307
|
||||
msgid "Italian"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:306
|
||||
#: paperless/settings.py:308
|
||||
msgid "Romanian"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:307
|
||||
#: paperless/settings.py:309
|
||||
msgid "Russian"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:308
|
||||
#: paperless/settings.py:310
|
||||
msgid "Spanish"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:309
|
||||
#: paperless/settings.py:311
|
||||
msgid "Polish"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/settings.py:312
|
||||
msgid "Swedish"
|
||||
msgstr ""
|
||||
|
||||
#: paperless/urls.py:113
|
||||
msgid "Paperless-ng administration"
|
||||
msgstr ""
|
||||
|
||||
@@ -308,7 +308,8 @@ LANGUAGES = [
|
||||
("ro-ro", _("Romanian")),
|
||||
("ru-ru", _("Russian")),
|
||||
("es-es", _("Spanish")),
|
||||
("pl-pl", _("Polish"))
|
||||
("pl-pl", _("Polish")),
|
||||
("sv-se", _("Swedish")),
|
||||
]
|
||||
|
||||
LOCALE_PATHS = [
|
||||
|
||||
@@ -23,7 +23,8 @@ from documents.views import (
|
||||
SavedViewViewSet,
|
||||
BulkEditView,
|
||||
SelectionDataView,
|
||||
BulkDownloadView
|
||||
BulkDownloadView,
|
||||
DocumentSplitMergeViewSet
|
||||
)
|
||||
from paperless.views import FaviconView
|
||||
|
||||
@@ -35,6 +36,9 @@ api_router.register(r"logs", LogViewSet, basename="logs")
|
||||
api_router.register(r"tags", TagViewSet)
|
||||
api_router.register(r"saved_views", SavedViewViewSet)
|
||||
|
||||
api_router.register(
|
||||
r"split_merge", DocumentSplitMergeViewSet, basename="split_merge")
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
re_path(r"^api/", include([
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
def get_parser(*args, **kwargs):
|
||||
from .parsers import TikaDocumentParser
|
||||
|
||||
@@ -20,5 +19,6 @@ def tika_consumer_declaration(sender, **kwargs):
|
||||
"application/vnd.oasis.opendocument.presentation": ".odp",
|
||||
"application/vnd.oasis.opendocument.spreadsheet": ".ods",
|
||||
"application/vnd.oasis.opendocument.text": ".odt",
|
||||
"text/rtf": ".rtf",
|
||||
},
|
||||
}
|
||||
Reference in new issue
Block a user