Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4121876116 | ||
|
|
1f0fea2937 | ||
|
|
92e178cc59 | ||
|
|
dc222cefd4 | ||
|
|
0defa9d0ba | ||
|
|
e3edb02090 | ||
|
|
a32625ca04 | ||
|
|
3c08fa9b33 | ||
|
|
e6526d3fd4 | ||
|
|
bee0867a2a | ||
|
|
1711030cb5 | ||
|
|
7b586e6857 |
@@ -1,9 +1,14 @@
|
|||||||
Changelog
|
Changelog
|
||||||
#########
|
#########
|
||||||
|
|
||||||
|
* 0.3.3
|
||||||
|
* Thumbnails in the UI and a Django-suit -based face-lift courtesy of @ekw!
|
||||||
|
* Timezone, items per page, and default language are now all configurable,
|
||||||
|
also thanks to @ekw.
|
||||||
|
|
||||||
* 0.3.2
|
* 0.3.2
|
||||||
* Fix for #172: defaulting ALLOWED_HOSTS to ``["*"]`` and allowing the user
|
* Fix for `#172`_: defaulting ALLOWED_HOSTS to ``["*"]`` and allowing the
|
||||||
to set her own value via ``PAPERLESS_ALLOWED_HOSTS`` should the need
|
user to set her own value via ``PAPERLESS_ALLOWED_HOSTS`` should the need
|
||||||
arise.
|
arise.
|
||||||
|
|
||||||
* 0.3.1
|
* 0.3.1
|
||||||
@@ -157,3 +162,5 @@ Changelog
|
|||||||
.. _#146: https://github.com/danielquinn/paperless/issues/146
|
.. _#146: https://github.com/danielquinn/paperless/issues/146
|
||||||
.. _#148: https://github.com/danielquinn/paperless/pull/148
|
.. _#148: https://github.com/danielquinn/paperless/pull/148
|
||||||
.. _#150: https://github.com/danielquinn/paperless/pull/150
|
.. _#150: https://github.com/danielquinn/paperless/pull/150
|
||||||
|
.. _#172: https://github.com/danielquinn/paperless/issues/172
|
||||||
|
|
||||||
|
|||||||
@@ -95,8 +95,20 @@ PAPERLESS_SHARED_SECRET=""
|
|||||||
|
|
||||||
# If you're planning on putting Paperless on the open internet, then you
|
# If you're planning on putting Paperless on the open internet, then you
|
||||||
# really should set this value to the domain name you're using. Failing to do
|
# really should set this value to the domain name you're using. Failing to do
|
||||||
# so leaves you open to XSS attacks.
|
# so leaves you open to HTTP host header attacks:
|
||||||
|
# https://docs.djangoproject.com/en/1.10/topics/security/#host-headers-virtual-hosting
|
||||||
|
#
|
||||||
# Just remember that this is a comma-separated list, so "example.com" is fine,
|
# Just remember that this is a comma-separated list, so "example.com" is fine,
|
||||||
# as is "example.com,www.example.com", but NOT " example.com" or "example.com,"
|
# as is "example.com,www.example.com", but NOT " example.com" or "example.com,"
|
||||||
#PAPERLESS_ALLOWED_HOSTS="example.com,www.example.com"
|
#PAPERLESS_ALLOWED_HOSTS="example.com,www.example.com"
|
||||||
|
|
||||||
|
# Override the default UTC time zone here
|
||||||
|
#PAPERLESS_TIME_ZONE=UTC
|
||||||
|
|
||||||
|
# Customize number of list items to show per page
|
||||||
|
#PAPERLESS_LIST_PER_PAGE=50
|
||||||
|
|
||||||
|
# Customize the default language that tesseract will attempt to use when parsing
|
||||||
|
# documents. It should be a 3-letter language code consistent with ISO 639.
|
||||||
|
#PAPERLESS_OCR_LANGUAGE=eng
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ Pillow>=3.1.1
|
|||||||
django-crispy-forms>=1.6.0
|
django-crispy-forms>=1.6.0
|
||||||
django-extensions>=1.6.1
|
django-extensions>=1.6.1
|
||||||
django-filter>=1.0
|
django-filter>=1.0
|
||||||
|
django-suit>=0.2.23
|
||||||
djangorestframework>=3.4.4
|
djangorestframework>=3.4.4
|
||||||
filemagic>=1.6
|
filemagic>=1.6
|
||||||
langdetect>=1.0.5
|
langdetect>=1.0.5
|
||||||
|
|||||||
@@ -53,13 +53,24 @@ class DocumentAdmin(admin.ModelAdmin):
|
|||||||
}
|
}
|
||||||
|
|
||||||
search_fields = ("correspondent__name", "title", "content")
|
search_fields = ("correspondent__name", "title", "content")
|
||||||
list_display = ("created", "correspondent", "title", "tags_", "document")
|
list_display = ("created", "title", "thumbnail", "correspondent", "tags_")
|
||||||
list_filter = ("tags", "correspondent", MonthListFilter)
|
list_filter = ("tags", "correspondent", MonthListFilter)
|
||||||
list_per_page = 25
|
ordering = ["-created", "correspondent"]
|
||||||
|
|
||||||
def created_(self, obj):
|
def created_(self, obj):
|
||||||
return obj.created.date().strftime("%Y-%m-%d")
|
return obj.created.date().strftime("%Y-%m-%d")
|
||||||
|
|
||||||
|
def thumbnail(self, obj):
|
||||||
|
png_img = self._html_tag(
|
||||||
|
"img",
|
||||||
|
src="/fetch/thumb/{}".format(obj.id),
|
||||||
|
width=275,
|
||||||
|
alt="thumbnail",
|
||||||
|
title=obj.file_name
|
||||||
|
)
|
||||||
|
return self._html_tag("a", png_img, href=obj.download_url)
|
||||||
|
thumbnail.allow_tags = True
|
||||||
|
|
||||||
def tags_(self, obj):
|
def tags_(self, obj):
|
||||||
r = ""
|
r = ""
|
||||||
for tag in obj.tags.all():
|
for tag in obj.tags.all():
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ LOGIN_URL = '/admin/login'
|
|||||||
ALLOWED_HOSTS = ["*"]
|
ALLOWED_HOSTS = ["*"]
|
||||||
|
|
||||||
_allowed_hosts = os.getenv("PAPERLESS_ALLOWED_HOSTS")
|
_allowed_hosts = os.getenv("PAPERLESS_ALLOWED_HOSTS")
|
||||||
if allowed_hosts:
|
if _allowed_hosts:
|
||||||
ALLOWED_HOSTS = _allowed_hosts.split(",")
|
ALLOWED_HOSTS = _allowed_hosts.split(",")
|
||||||
|
|
||||||
# Tap paperless.conf if it's available
|
# Tap paperless.conf if it's available
|
||||||
@@ -44,6 +44,7 @@ if os.path.exists("/etc/paperless.conf"):
|
|||||||
|
|
||||||
INSTALLED_APPS = [
|
INSTALLED_APPS = [
|
||||||
|
|
||||||
|
'suit',
|
||||||
'django.contrib.admin',
|
'django.contrib.admin',
|
||||||
'django.contrib.auth',
|
'django.contrib.auth',
|
||||||
'django.contrib.contenttypes',
|
'django.contrib.contenttypes',
|
||||||
@@ -60,6 +61,22 @@ INSTALLED_APPS = [
|
|||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
SUIT_CONFIG = {
|
||||||
|
'ADMIN_NAME': 'Paperless',
|
||||||
|
'SEARCH_URL': '',
|
||||||
|
'LIST_PER_PAGE': int(os.getenv("PAPERLESS_LIST_PER_PAGE", 25)),
|
||||||
|
'HEADER_DATE_FORMAT': 'D m-d-Y',
|
||||||
|
'MENU': (
|
||||||
|
'sites',
|
||||||
|
{
|
||||||
|
'app': 'documents',
|
||||||
|
'label': 'Paperless',
|
||||||
|
'icon': 'icon-file',
|
||||||
|
'models': ('Document', 'Tag', 'Correspondent', 'log')
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
MIDDLEWARE_CLASSES = [
|
MIDDLEWARE_CLASSES = [
|
||||||
'django.middleware.security.SecurityMiddleware',
|
'django.middleware.security.SecurityMiddleware',
|
||||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||||
@@ -141,7 +158,7 @@ AUTH_PASSWORD_VALIDATORS = [
|
|||||||
|
|
||||||
LANGUAGE_CODE = 'en-us'
|
LANGUAGE_CODE = 'en-us'
|
||||||
|
|
||||||
TIME_ZONE = 'UTC'
|
TIME_ZONE = os.getenv("PAPERLESS_TIME_ZONE", "UTC")
|
||||||
|
|
||||||
USE_I18N = True
|
USE_I18N = True
|
||||||
|
|
||||||
@@ -187,7 +204,7 @@ LOGGING = {
|
|||||||
|
|
||||||
# The default language that tesseract will attempt to use when parsing
|
# The default language that tesseract will attempt to use when parsing
|
||||||
# documents. It should be a 3-letter language code consistent with ISO 639.
|
# documents. It should be a 3-letter language code consistent with ISO 639.
|
||||||
OCR_LANGUAGE = "eng"
|
OCR_LANGUAGE = os.getenv("PAPERLESS_OCR_LANGUAGE", "eng")
|
||||||
|
|
||||||
# The amount of threads to use for OCR
|
# The amount of threads to use for OCR
|
||||||
OCR_THREADS = os.getenv("PAPERLESS_OCR_THREADS")
|
OCR_THREADS = os.getenv("PAPERLESS_OCR_THREADS")
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
__version__ = (0, 3, 2)
|
__version__ = (0, 3, 3)
|
||||||
|
|||||||
Reference in New Issue
Block a user