mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	Merge pull request #2 from shamoon/pdf-viewer-mobile-improvements
Pdf viewer mobile improvements
This commit is contained in:
		| @@ -62,7 +62,7 @@ If you want to see paperless-ng in action, [more screenshots are available in th | |||||||
|  |  | ||||||
| # Getting started | # Getting started | ||||||
|  |  | ||||||
| The recommended way to deploy paperless is docker-compose. The files in the /docker/hub directory are configured to pull the image from Docker Hub. | The recommended way to deploy paperless is docker-compose. The files in the /docker/compose directory are configured to pull the image from Docker Hub. | ||||||
|  |  | ||||||
| Read the [documentation](https://paperless-ng.readthedocs.io/en/latest/setup.html#installation) on how to get started. | Read the [documentation](https://paperless-ng.readthedocs.io/en/latest/setup.html#installation) on how to get started. | ||||||
|  |  | ||||||
|   | |||||||
| @@ -329,7 +329,7 @@ | |||||||
|     - regexp: PAPERLESS_TIKA_ENDPOINT |     - regexp: PAPERLESS_TIKA_ENDPOINT | ||||||
|       line: "PAPERLESS_TIKA_ENDPOINT={{ paperlessng_tika_endpoint }}" |       line: "PAPERLESS_TIKA_ENDPOINT={{ paperlessng_tika_endpoint }}" | ||||||
|     - regexp: PAPERLESS_TIKA_GOTENBERG_ENDPOINT |     - regexp: PAPERLESS_TIKA_GOTENBERG_ENDPOINT | ||||||
|       line: "PAPERLESS_TIKA_GOTENBERG_ENDPOINT={{ paperlessng_tika_endpoint }}" |       line: "PAPERLESS_TIKA_GOTENBERG_ENDPOINT={{ paperlessng_tika_gotenberg_endpoint }}" | ||||||
|     # Software tweaks |     # Software tweaks | ||||||
|     - regexp: PAPERLESS_TIME_ZONE |     - regexp: PAPERLESS_TIME_ZONE | ||||||
|       line: "PAPERLESS_TIME_ZONE={{ paperlessng_time_zone }}" |       line: "PAPERLESS_TIME_ZONE={{ paperlessng_time_zone }}" | ||||||
|   | |||||||
| @@ -233,6 +233,13 @@ PAPERLESS_HTTP_REMOTE_USER_HEADER_NAME=<str> | |||||||
|  |  | ||||||
|     Defaults to `HTTP_REMOTE_USER`. |     Defaults to `HTTP_REMOTE_USER`. | ||||||
|  |  | ||||||
|  | PAPERLESS_LOGOUT_REDIRECT_URL=<str> | ||||||
|  |     URL to redirect the user to after a logout. This can be used together with | ||||||
|  |     `PAPERLESS_ENABLE_HTTP_REMOTE_USER` to redirect the user back to the SSO | ||||||
|  |     application's logout page. | ||||||
|  |  | ||||||
|  |     Defaults to None, which disables this feature. | ||||||
|  |  | ||||||
| .. _configuration-ocr: | .. _configuration-ocr: | ||||||
|  |  | ||||||
| OCR settings | OCR settings | ||||||
|   | |||||||
| @@ -171,6 +171,24 @@ Install Paperless from Docker Hub | |||||||
|  |  | ||||||
|     Don't change the part after the colon or paperless wont find your documents. |     Don't change the part after the colon or paperless wont find your documents. | ||||||
|  |  | ||||||
|  |     You may also need to change the default port that the webserver will use | ||||||
|  |     from the default (8000): | ||||||
|  |  | ||||||
|  |      .. code:: | ||||||
|  |  | ||||||
|  |         ports: | ||||||
|  |           - 8000:8000 | ||||||
|  |  | ||||||
|  |     Replace the part BEFORE the colon with a port of your choice: | ||||||
|  |  | ||||||
|  |      .. code:: | ||||||
|  |  | ||||||
|  |         ports: | ||||||
|  |           - 8010:8000 | ||||||
|  |  | ||||||
|  |     Don't change the part after the colon or edit other lines that refer to | ||||||
|  |     port 8000. Modifying the part before the colon will map requests on another | ||||||
|  |     port to the webserver running on the default port. | ||||||
|  |  | ||||||
| 5.  Modify ``docker-compose.env``, following the comments in the file. The | 5.  Modify ``docker-compose.env``, following the comments in the file. The | ||||||
|     most important change is to set ``USERMAP_UID`` and ``USERMAP_GID`` |     most important change is to set ``USERMAP_UID`` and ``USERMAP_GID`` | ||||||
|   | |||||||
| @@ -123,6 +123,15 @@ | |||||||
|  |  | ||||||
|                     </ng-template> |                     </ng-template> | ||||||
|                 </li> |                 </li> | ||||||
|  |  | ||||||
|  |                 <li [ngbNavItem]="4" class="d-md-none"> | ||||||
|  |                   <a ngbNavLink>Preview</a> | ||||||
|  |                   <ng-template ngbNavContent *ngIf="pdfPreview.offsetParent == undefined"> | ||||||
|  |                     <div class="pdf-viewer-container" *ngIf="getContentType() == 'application/pdf'"> | ||||||
|  |                       <pdf-viewer [src]="previewUrl" [original-size]="false" [show-borders]="true"></pdf-viewer> | ||||||
|  |                     </div> | ||||||
|  |                   </ng-template> | ||||||
|  |                 </li> | ||||||
|             </ul> |             </ul> | ||||||
|  |  | ||||||
|             <div [ngbNavOutlet]="nav" class="mt-2"></div> |             <div [ngbNavOutlet]="nav" class="mt-2"></div> | ||||||
| @@ -133,7 +142,7 @@ | |||||||
|         </form> |         </form> | ||||||
|     </div> |     </div> | ||||||
|  |  | ||||||
|     <div class="col-md-6 col-xl-8 mb-3"> |     <div class="col-md-6 col-xl-8 mb-3 d-none d-md-block" #pdfPreview> | ||||||
|         <ng-container *ngIf="getContentType() == 'application/pdf'"> |         <ng-container *ngIf="getContentType() == 'application/pdf'"> | ||||||
|             <div class="preview-sticky pdf-viewer-container" *ngIf="!useNativePdfViewer ; else nativePdfViewer"> |             <div class="preview-sticky pdf-viewer-container" *ngIf="!useNativePdfViewer ; else nativePdfViewer"> | ||||||
|                 <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> |                 <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> | ||||||
|   | |||||||
| @@ -1,7 +1,7 @@ | |||||||
| import { Component, OnInit, ViewChild } from '@angular/core'; | import { Component, OnInit, ViewChild, ElementRef } from '@angular/core'; | ||||||
| import { FormControl, FormGroup } from '@angular/forms'; | import { FormControl, FormGroup } from '@angular/forms'; | ||||||
| import { ActivatedRoute, Router } from '@angular/router'; | import { ActivatedRoute, Router } from '@angular/router'; | ||||||
| import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; | import { NgbModal, NgbNav } from '@ng-bootstrap/ng-bootstrap'; | ||||||
| import { PaperlessCorrespondent } from 'src/app/data/paperless-correspondent'; | import { PaperlessCorrespondent } from 'src/app/data/paperless-correspondent'; | ||||||
| import { PaperlessDocument } from 'src/app/data/paperless-document'; | import { PaperlessDocument } from 'src/app/data/paperless-document'; | ||||||
| import { PaperlessDocumentMetadata } from 'src/app/data/paperless-document-metadata'; | import { PaperlessDocumentMetadata } from 'src/app/data/paperless-document-metadata'; | ||||||
| @@ -65,6 +65,15 @@ export class DocumentDetailComponent implements OnInit { | |||||||
|   previewCurrentPage: number = 1 |   previewCurrentPage: number = 1 | ||||||
|   previewNumPages: number = 1 |   previewNumPages: number = 1 | ||||||
|  |  | ||||||
|  |   @ViewChild('nav') nav: NgbNav | ||||||
|  |   @ViewChild('pdfPreview') set pdfPreview(element) { | ||||||
|  |     // this gets called when compontent added or removed from DOM | ||||||
|  |     if (element && element.nativeElement.offsetParent !== null) { // its visible | ||||||
|  |  | ||||||
|  |       setTimeout(()=> this.nav?.select(1)); | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  |  | ||||||
|   constructor( |   constructor( | ||||||
|     private documentsService: DocumentService, |     private documentsService: DocumentService, | ||||||
|     private route: ActivatedRoute, |     private route: ActivatedRoute, | ||||||
|   | |||||||
| @@ -144,6 +144,7 @@ ROOT_URLCONF = 'paperless.urls' | |||||||
| FORCE_SCRIPT_NAME = os.getenv("PAPERLESS_FORCE_SCRIPT_NAME") | FORCE_SCRIPT_NAME = os.getenv("PAPERLESS_FORCE_SCRIPT_NAME") | ||||||
| BASE_URL = (FORCE_SCRIPT_NAME or "") + "/" | BASE_URL = (FORCE_SCRIPT_NAME or "") + "/" | ||||||
| LOGIN_URL = BASE_URL + "accounts/login/" | LOGIN_URL = BASE_URL + "accounts/login/" | ||||||
|  | LOGOUT_REDIRECT_URL = os.getenv("PAPERLESS_LOGOUT_REDIRECT_URL") | ||||||
|  |  | ||||||
| WSGI_APPLICATION = 'paperless.wsgi.application' | WSGI_APPLICATION = 'paperless.wsgi.application' | ||||||
| ASGI_APPLICATION = "paperless.asgi.application" | ASGI_APPLICATION = "paperless.asgi.application" | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Michael Shamoon
					Michael Shamoon