mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	Merge pull request #748 from shamoon/feature/additional-card-info
Additional / organized card info
This commit is contained in:
		| @@ -23,7 +23,6 @@ | ||||
|             {{document.title | documentTitle}} | ||||
|             <app-tag [tag]="t" linkTitle="Filter by tag" i18n-linkTitle *ngFor="let t of document.tags$ | async" class="ml-1" (click)="clickTag.emit(t.id);$event.stopPropagation()" [clickable]="clickTag.observers.length"></app-tag> | ||||
|           </h5> | ||||
|           <h5 class="card-title" *ngIf="document.archive_serial_number">#{{document.archive_serial_number}}</h5> | ||||
|         </div> | ||||
|         <p class="card-text"> | ||||
|           <app-result-highlight *ngIf="getDetailsAsHighlight()" class="result-content" [highlights]="getDetailsAsHighlight()"></app-result-highlight> | ||||
| @@ -62,13 +61,32 @@ | ||||
|             </a> | ||||
|           </div> | ||||
|  | ||||
|           <div *ngIf="searchScore" class="d-flex align-items-center ml-md-auto mt-2 mt-md-0"> | ||||
|             <small class="text-muted" i18n>Score:</small> | ||||
|  | ||||
|             <ngb-progressbar [type]="searchScoreClass" [value]="searchScore" class="search-score-bar mx-2" [max]="1"></ngb-progressbar> | ||||
|           <div class="list-group list-group-horizontal border-0 card-info ml-md-auto mt-2 mt-md-0"> | ||||
|             <div *ngIf="searchScore" class="list-group-item bg-light text-dark p-1 mr-5 border-0 d-flex search-score"> | ||||
|               <small class="text-muted" i18n>Score:</small> | ||||
|               <ngb-progressbar [type]="searchScoreClass" [value]="searchScore" class="search-score-bar mx-2 mt-1" [max]="1"></ngb-progressbar> | ||||
|             </div> | ||||
|             <button *ngIf="document.document_type" type="button" class="list-group-item btn btn-sm bg-light text-dark p-1 border-0 mr-2" title="Filter by document type" | ||||
|              (click)="clickDocumentType.emit(document.document_type);$event.stopPropagation()"> | ||||
|               <svg class="metadata-icon mr-2 text-muted bi bi-file-earmark" viewBox="0 0 16 16" fill="currentColor"> | ||||
|                 <path d="M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5L14 4.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5h-2z"/> | ||||
|               </svg> | ||||
|               <small>{{(document.document_type$ | async)?.name}}</small> | ||||
|             </button> | ||||
|             <div *ngIf="document.archive_serial_number" class="list-group-item mr-2 bg-light text-dark p-1 border-0"> | ||||
|               <svg class="metadata-icon mr-2 text-muted bi bi-upc-scan" viewBox="0 0 16 16" fill="currentColor"> | ||||
|                 <path d="M1.5 1a.5.5 0 0 0-.5.5v3a.5.5 0 0 1-1 0v-3A1.5 1.5 0 0 1 1.5 0h3a.5.5 0 0 1 0 1h-3zM11 .5a.5.5 0 0 1 .5-.5h3A1.5 1.5 0 0 1 16 1.5v3a.5.5 0 0 1-1 0v-3a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 1-.5-.5zM.5 11a.5.5 0 0 1 .5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 1 0 1h-3A1.5 1.5 0 0 1 0 14.5v-3a.5.5 0 0 1 .5-.5zm15 0a.5.5 0 0 1 .5.5v3a1.5 1.5 0 0 1-1.5 1.5h-3a.5.5 0 0 1 0-1h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 1 .5-.5zM3 4.5a.5.5 0 0 1 1 0v7a.5.5 0 0 1-1 0v-7zm2 0a.5.5 0 0 1 1 0v7a.5.5 0 0 1-1 0v-7zm2 0a.5.5 0 0 1 1 0v7a.5.5 0 0 1-1 0v-7zm2 0a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-7zm3 0a.5.5 0 0 1 1 0v7a.5.5 0 0 1-1 0v-7z"/> | ||||
|               </svg> | ||||
|               <small>#{{document.archive_serial_number}}</small> | ||||
|             </div> | ||||
|             <div class="list-group-item bg-light text-dark p-1 border-0" ngbTooltip="Added: {{document.added | customDate:'shortDate'}} Created: {{document.created | customDate:'shortDate'}}"> | ||||
|               <svg class="metadata-icon mr-2 text-muted bi bi-calendar-event" viewBox="0 0 16 16" fill="currentColor"> | ||||
|                 <path d="M11 6.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-1z"/> | ||||
|                 <path d="M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z"/> | ||||
|               </svg> | ||||
|               <small>{{document.created | customDate:'mediumDate'}}</small> | ||||
|             </div> | ||||
|           </div> | ||||
|  | ||||
|           <small class="text-muted" [class.ml-auto]="!searchScore" i18n>Created: {{document.created | customDate}}</small> | ||||
|         </div> | ||||
|  | ||||
|       </div> | ||||
|   | ||||
| @@ -37,3 +37,25 @@ | ||||
| .doc-img-background-selected { | ||||
|   background-color: $primaryFaded; | ||||
| } | ||||
|  | ||||
| .card-info { | ||||
|   line-height: 1; | ||||
|  | ||||
|   button { | ||||
|     line-height: 1; | ||||
|  | ||||
|     &:hover, | ||||
|     &:focus { | ||||
|       background-color: transparent !important; | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   .metadata-icon { | ||||
|     width: 0.8rem; | ||||
|     height: 0.8rem; | ||||
|   } | ||||
|  | ||||
|   .search-score { | ||||
|     padding-top: 0.35rem !important; | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -39,6 +39,9 @@ export class DocumentCardLargeComponent implements OnInit { | ||||
|   @Output() | ||||
|   clickCorrespondent = new EventEmitter<number>() | ||||
|  | ||||
|   @Output() | ||||
|   clickDocumentType = new EventEmitter<number>() | ||||
|  | ||||
|   @Input() | ||||
|   searchScore: number | ||||
|  | ||||
|   | ||||
| @@ -25,13 +25,36 @@ | ||||
|         <ng-container *ngIf="document.correspondent"> | ||||
|           <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}} <span *ngIf="document.archive_serial_number">(#{{document.archive_serial_number}})</span> | ||||
|         {{document.title | documentTitle}} | ||||
|       </p> | ||||
|     </div> | ||||
|     <div class="card-footer"> | ||||
|  | ||||
|       <div class="d-flex justify-content-between align-items-center mx-n2"> | ||||
|         <div class="btn-group"> | ||||
|     <div 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()"> | ||||
|           <svg class="metadata-icon mr-2 text-muted bi bi-file-earmark" viewBox="0 0 16 16" fill="currentColor"> | ||||
|             <path d="M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5L14 4.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5h-2z"/> | ||||
|           </svg> | ||||
|           <small>{{(document.document_type$ | async)?.name}}</small> | ||||
|         </button> | ||||
|         <div class="list-group-item bg-transparent p-0 border-0 d-flex flex-wrap-reverse justify-content-between"> | ||||
|           <div class="pl-0 p-1" placement="top" ngbTooltip="Added: {{document.added | customDate:'mediumDate'}} Created: {{document.created | customDate:'mediumDate'}}"> | ||||
|             <svg class="metadata-icon mr-2 text-muted bi bi-calendar-event" viewBox="0 0 16 16" fill="currentColor"> | ||||
|               <path d="M11 6.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-1z"/> | ||||
|               <path d="M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z"/> | ||||
|             </svg> | ||||
|             <small>{{document.created | customDate:'mediumDate'}}</small> | ||||
|           </div> | ||||
|           <div *ngIf="document.archive_serial_number" class="pl-0 p-1"> | ||||
|             <svg class="metadata-icon mr-2 text-muted bi bi-upc-scan" viewBox="0 0 16 16" fill="currentColor"> | ||||
|               <path d="M1.5 1a.5.5 0 0 0-.5.5v3a.5.5 0 0 1-1 0v-3A1.5 1.5 0 0 1 1.5 0h3a.5.5 0 0 1 0 1h-3zM11 .5a.5.5 0 0 1 .5-.5h3A1.5 1.5 0 0 1 16 1.5v3a.5.5 0 0 1-1 0v-3a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 1-.5-.5zM.5 11a.5.5 0 0 1 .5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 1 0 1h-3A1.5 1.5 0 0 1 0 14.5v-3a.5.5 0 0 1 .5-.5zm15 0a.5.5 0 0 1 .5.5v3a1.5 1.5 0 0 1-1.5 1.5h-3a.5.5 0 0 1 0-1h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 1 .5-.5zM3 4.5a.5.5 0 0 1 1 0v7a.5.5 0 0 1-1 0v-7zm2 0a.5.5 0 0 1 1 0v7a.5.5 0 0 1-1 0v-7zm2 0a.5.5 0 0 1 1 0v7a.5.5 0 0 1-1 0v-7zm2 0a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-7zm3 0a.5.5 0 0 1 1 0v7a.5.5 0 0 1-1 0v-7z"/> | ||||
|             </svg> | ||||
|             <small>#{{document.archive_serial_number}}</small> | ||||
|           </div> | ||||
|         </div> | ||||
|       </div> | ||||
|       <div class="d-flex justify-content-between align-items-center"> | ||||
|         <div class="btn-group w-100"> | ||||
|           <a routerLink="/documents/{{document.id}}" class="btn btn-sm btn-outline-secondary" title="Edit" i18n-title> | ||||
|             <svg width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-pencil" fill="currentColor" xmlns="http://www.w3.org/2000/svg"> | ||||
|               <path fill-rule="evenodd" d="M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5L13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175l-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325z"/> | ||||
| @@ -55,9 +78,7 @@ | ||||
|             </svg> | ||||
|           </a> | ||||
|         </div> | ||||
|         <small class="text-muted pl-1">{{document.created | customDate:'shortDate'}}</small> | ||||
|       </div> | ||||
|  | ||||
|     </div> | ||||
|   </div> | ||||
| </div> | ||||
|   | ||||
| @@ -1,9 +1,13 @@ | ||||
| @import "/src/theme"; | ||||
|  | ||||
| .card-text { | ||||
|   font-size: 90%; | ||||
| } | ||||
|  | ||||
| .doc-img { | ||||
|   object-fit: cover; | ||||
|   object-position: top left; | ||||
|   height: 200px; | ||||
|   height: 175px; | ||||
|   mix-blend-mode: multiply; | ||||
| } | ||||
|  | ||||
| @@ -34,3 +38,31 @@ | ||||
| .doc-img-background-selected { | ||||
|   background-color: $primaryFaded; | ||||
| } | ||||
|  | ||||
| .card-info { | ||||
|   line-height: 1; | ||||
|  | ||||
|   button { | ||||
|     line-height: 1; | ||||
|  | ||||
|     &:hover, | ||||
|     &:focus { | ||||
|       background-color: transparent !important; | ||||
|       color: $primary; | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   .metadata-icon { | ||||
|     width: 0.8rem; | ||||
|     height: 0.8rem; | ||||
|   } | ||||
| } | ||||
|  | ||||
| .card-footer .btn { | ||||
|   padding-top: .10rem; | ||||
| } | ||||
|  | ||||
| ::ng-deep .tooltip-inner { | ||||
|   text-align: left !important; | ||||
|   font-size: 90%; | ||||
| } | ||||
|   | ||||
| @@ -29,6 +29,9 @@ export class DocumentCardSmallComponent implements OnInit { | ||||
|   @Output() | ||||
|   clickCorrespondent = new EventEmitter<number>() | ||||
|  | ||||
|   @Output() | ||||
|   clickDocumentType = new EventEmitter<number>() | ||||
|  | ||||
|   moreTags: number = null | ||||
|  | ||||
|   @ViewChild('popover') popover: NgbPopover | ||||
|   | ||||
| @@ -90,7 +90,7 @@ | ||||
| </div> | ||||
|  | ||||
| <div *ngIf="displayMode == 'largeCards'"> | ||||
|   <app-document-card-large [selected]="list.isSelected(d)" (toggleSelected)="toggleSelected(d, $event)" *ngFor="let d of list.documents; trackBy: trackByDocumentId" [document]="d" [details]="d.content" (clickTag)="clickTag($event)" (clickCorrespondent)="clickCorrespondent($event)"> | ||||
|   <app-document-card-large [selected]="list.isSelected(d)" (toggleSelected)="toggleSelected(d, $event)" *ngFor="let d of list.documents; trackBy: trackByDocumentId" [document]="d" [details]="d.content" (clickTag)="clickTag($event)" (clickCorrespondent)="clickCorrespondent($event)" (clickDocumentType)="clickDocumentType($event)"> | ||||
|   </app-document-card-large> | ||||
| </div> | ||||
|  | ||||
| @@ -170,5 +170,5 @@ | ||||
| </table> | ||||
|  | ||||
| <div class="m-n2 row row-cols-paperless-cards" *ngIf="displayMode == 'smallCards'"> | ||||
|   <app-document-card-small [selected]="list.isSelected(d)" (toggleSelected)="toggleSelected(d, $event)" [document]="d" *ngFor="let d of list.documents; trackBy: trackByDocumentId" (clickTag)="clickTag($event)" (clickCorrespondent)="clickCorrespondent($event)"></app-document-card-small> | ||||
|   <app-document-card-small [selected]="list.isSelected(d)" (toggleSelected)="toggleSelected(d, $event)" [document]="d" *ngFor="let d of list.documents; trackBy: trackByDocumentId" (clickTag)="clickTag($event)" (clickCorrespondent)="clickCorrespondent($event)" (clickDocumentType)="clickDocumentType($event)"></app-document-card-small> | ||||
| </div> | ||||
|   | ||||
| @@ -76,6 +76,10 @@ $border-color-dark-mode: #47494f; | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   .page-item.active .page-link { | ||||
|     background-color: darken($primary-dark-mode, 10%); | ||||
|   } | ||||
|  | ||||
|   .nav-tabs { | ||||
|     border-color: $border-color-dark-mode; | ||||
|  | ||||
| @@ -226,7 +230,7 @@ $border-color-dark-mode: #47494f; | ||||
|   } | ||||
|  | ||||
|   .btn-outline-secondary { | ||||
|     border-color: $text-color-dark-mode; | ||||
|     border-color: darken($text-color-dark-mode, 30%); | ||||
|     color: $text-color-dark-mode; | ||||
|  | ||||
|     &:not(:disabled):not(.disabled):hover { | ||||
| @@ -279,6 +283,10 @@ $border-color-dark-mode: #47494f; | ||||
|     background-color: $bg-dark-mode !important; | ||||
|   } | ||||
|  | ||||
|   .card-footer button:hover { | ||||
|     color: $primary-dark-mode !important; | ||||
|   } | ||||
|  | ||||
|   .form-control:not(.is-invalid):not(.btn), | ||||
|   input:not(.is-invalid), | ||||
|   textarea:not(.is-invalid) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Jonas Winkler
					Jonas Winkler