mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	Remove the hard-coding of the thumbnail URL
This commit is contained in:
		| @@ -139,19 +139,17 @@ class DocumentAdmin(CommonAdmin): | |||||||
|     created_.short_description = "Created" |     created_.short_description = "Created" | ||||||
|  |  | ||||||
|     def thumbnail(self, obj): |     def thumbnail(self, obj): | ||||||
|         if settings.FORCE_SCRIPT_NAME: |         return self._html_tag( | ||||||
|             src_link = "{}/fetch/thumb/{}".format( |             "a", | ||||||
|                 settings.FORCE_SCRIPT_NAME, obj.id) |             self._html_tag( | ||||||
|         else: |                 "img", | ||||||
|             src_link = "/fetch/thumb/{}".format(obj.id) |                 src=reverse("fetch", kwargs={"kind": "thumb", "pk": obj.pk}), | ||||||
|         png_img = self._html_tag( |                 width=180, | ||||||
|             "img", |                 alt="Thumbnail of {}".format(obj.file_name), | ||||||
|             src=src_link, |                 title=obj.file_name | ||||||
|             width=180, |             ), | ||||||
|             alt="Thumbnail of {}".format(obj.file_name), |             href=obj.download_url | ||||||
|             title=obj.file_name |  | ||||||
|         ) |         ) | ||||||
|         return self._html_tag("a", png_img, href=obj.download_url) |  | ||||||
|     thumbnail.allow_tags = True |     thumbnail.allow_tags = True | ||||||
|  |  | ||||||
|     def tags_(self, obj): |     def tags_(self, obj): | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Daniel Quinn
					Daniel Quinn