Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

Merge branch 'master' into dev

Jonas Winkler421dab786d49
diff --cc requirements.txt
index 818b33a48,f870ae3a6..64201f9d7
mode 100755,100644..100644
--- a/requirements.txt
+++ b/requirements.txt
@@@ -17,33 -18,33 +18,34 @@@ django==2.0.1
djangoql==0.12.3
djangorestframework==3.9.1
docopt==0.6.2
- docutils==0.14
- execnet==1.5.0
+ docutils==0.15.2
+ execnet==1.6.1
factory-boy==2.11.1
- faker==1.0.2
- filelock==3.0.10
+ faker==2.0.0
+ filelock==3.0.12
filemagic==1.6
fuzzywuzzy[speedup]==0.15.0
- gunicorn==19.9.0
+ gunicorn==20.0.4
idna==2.8
imagesize==1.1.0
+ importlib-metadata==0.19
inotify-simple==1.1.8; sys_platform == 'linux'
- jinja2==2.10
+ jinja2==2.10.1
langdetect==1.0.7
+ markupsafe==1.1.1
+ more-itertools==7.2.0
+numpy==1.15.1
- markupsafe==1.1.0
- more-itertools==5.0.0
- packaging==19.0
+ packaging==19.1
pdftotext==2.1.1
pillow==5.4.1
- pluggy==0.8.1
+ pluggy==0.12.0
ply==3.11
- psycopg2==2.7.7
- py==1.7.0
+ psycopg2==2.8.4
+ py==1.8.0
pycodestyle==2.4.0
- pygments==2.3.1
+ pygments==2.4.2
pyocr==0.5.3
- pyparsing==2.3.1
+ pyparsing==2.4.2
pytest-cov==2.6.1
pytest-django==3.4.5
pytest-env==0.6.2
diff --cc src/documents/consumer.py
index 5e95421cc,282b688b1..54979156a
mode 100755,100644..100755
--- a/src/documents/consumer.py
+++ b/src/documents/consumer.py
diff --cc src/documents/models.py
index bd5cf161b,f051e3062..f14f8bd20
mode 100755,100644..100755
--- a/src/documents/models.py
+++ b/src/documents/models.py
@@@ -167,15 -256,14 +169,23 @@@ class Document(models.Model)
added = models.DateTimeField(
default=timezone.now, editable=False, db_index=True)
+ filename = models.FilePathField(
+ max_length=256,
+ editable=False,
+ default=None,
+ null=True,
+ help_text="Current filename in storage"
+ )
+
+ archive_serial_number = models.IntegerField(
+ blank=True,
+ null=True,
+ unique=True,
+ db_index=True,
+ help_text="The position of this document in your physical document "
+ "archive."
+ )
+
class Meta:
ordering = ("correspondent", "title")
diff --cc src/documents/templates/admin/documents/document/change_form.html
index a255006eb,6edcbf2b1..80595a0e2
--- a/src/documents/templates/admin/documents/document/change_form.html
+++ b/src/documents/templates/admin/documents/document/change_form.html
@@@ -12,28 -3,11 +12,32 @@@
{% block content %}
{{ block.super }}
+ <div class="side-preview">
+ <h2>Preview</h2>
+ <object data="/fetch/preview/{{object_id}}"></object>
+ </div>
+{% if file_type in "pdf jpg png" %}
+
+ <div id="change_form_twocolumn_parent">
+ <div id="change_form_form_parent"></div>
+ <div id="change_form_viewer_parent">
+ {% if file_type == "pdf" %}
+ {% include "admin/documents/document/viewers/viewer_pdf.html" %}
+ {% endif %}
+ {% if file_type in "jpg png" %}
+ {% include "admin/documents/document/viewers/viewer_image.html" %}
+ {% endif %}
+ </div>
+ </div>
+
+ <script>
+ django.jQuery("#change_form_form_parent").append(django.jQuery("#document_form"));
+ django.jQuery("#content-main").append(django.jQuery("#change_form_twocolumn_parent"));
+ </script>
+
+{% endif %}
+
{% if next_object %}
<script type="text/javascript">//<![CDATA[
(function($){
diff --cc src/documents/views.py
index 5b819b9ba,aca849c70..f318d9b28
mode 100755,100644..100755
--- a/src/documents/views.py
+++ b/src/documents/views.py
diff --cc src/paperless/urls.py
index b74d821f4,4ab19b06f..d208b3470
mode 100755,100644..100755
--- a/src/paperless/urls.py
+++ b/src/paperless/urls.py