mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-04 03:27:12 -05:00 
			
		
		
		
	Additional metadata for small cards
This commit is contained in:
		
							parent
							
								
									9b7bc16b3e
								
							
						
					
					
						commit
						d264df1504
					
				@ -25,13 +25,35 @@
 | 
				
			|||||||
        <ng-container *ngIf="document.correspondent">
 | 
					        <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>:
 | 
					          <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>
 | 
					        </ng-container>
 | 
				
			||||||
        {{document.title | documentTitle}} <span *ngIf="document.archive_serial_number">(#{{document.archive_serial_number}})</span>
 | 
					        {{document.title | documentTitle}}
 | 
				
			||||||
      </p>
 | 
					      </p>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <div class="card-footer">
 | 
					    <div class="card-footer pt-0 pb-2 px-2">
 | 
				
			||||||
 | 
					      <div class="list-group list-group-flush border-0 pt-0 pb-2 card-metadata">
 | 
				
			||||||
      <div class="d-flex justify-content-between align-items-center mx-n2">
 | 
					        <button *ngIf="document.document_type" type="button" class="list-group-item list-group-item-action text-left pl-0 p-1 border-0"
 | 
				
			||||||
        <div class="btn-group">
 | 
					          placement="left" ngbTooltip="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>
 | 
				
			||||||
 | 
					        <button *ngIf="document.archive_serial_number" type="button" disabled="disabled" class="list-group-item list-group-item-action text-left pl-0 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>
 | 
				
			||||||
 | 
					        </button>
 | 
				
			||||||
 | 
					        <button type="button" class="list-group-item list-group-item-action text-left pl-0 p-1 border-0" placement="left" 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:'shortDate'}}</small>
 | 
				
			||||||
 | 
					        </button>
 | 
				
			||||||
 | 
					      </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>
 | 
					          <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">
 | 
					            <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"/>
 | 
					              <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 +77,7 @@
 | 
				
			|||||||
            </svg>
 | 
					            </svg>
 | 
				
			||||||
          </a>
 | 
					          </a>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        <small class="text-muted pl-1">{{document.created | customDate:'shortDate'}}</small>
 | 
					      </div>
 | 
				
			||||||
      </div>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
</div>
 | 
					</div>
 | 
				
			||||||
 | 
				
			|||||||
@ -1,9 +1,13 @@
 | 
				
			|||||||
@import "/src/theme";
 | 
					@import "/src/theme";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.card-text {
 | 
				
			||||||
 | 
					  font-size: 90%;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.doc-img {
 | 
					.doc-img {
 | 
				
			||||||
  object-fit: cover;
 | 
					  object-fit: cover;
 | 
				
			||||||
  object-position: top left;
 | 
					  object-position: top left;
 | 
				
			||||||
  height: 200px;
 | 
					  height: 190px;
 | 
				
			||||||
  mix-blend-mode: multiply;
 | 
					  mix-blend-mode: multiply;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -34,3 +38,24 @@
 | 
				
			|||||||
.doc-img-background-selected {
 | 
					.doc-img-background-selected {
 | 
				
			||||||
  background-color: $primaryFaded;
 | 
					  background-color: $primaryFaded;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.card-metadata {
 | 
				
			||||||
 | 
					  line-height: 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  .btn {
 | 
				
			||||||
 | 
					    line-height: 1;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  .metadata-icon {
 | 
				
			||||||
 | 
					    width: 0.8rem;
 | 
				
			||||||
 | 
					    height: 0.8rem;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.card-footer .btn {
 | 
				
			||||||
 | 
					  padding-top: .10rem;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					::ng-deep .tooltip-inner {
 | 
				
			||||||
 | 
					  text-align: left !important;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -29,6 +29,9 @@ export class DocumentCardSmallComponent implements OnInit {
 | 
				
			|||||||
  @Output()
 | 
					  @Output()
 | 
				
			||||||
  clickCorrespondent = new EventEmitter<number>()
 | 
					  clickCorrespondent = new EventEmitter<number>()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @Output()
 | 
				
			||||||
 | 
					  clickDocumentType = new EventEmitter<number>()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  moreTags: number = null
 | 
					  moreTags: number = null
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @ViewChild('popover') popover: NgbPopover
 | 
					  @ViewChild('popover') popover: NgbPopover
 | 
				
			||||||
 | 
				
			|||||||
@ -170,5 +170,5 @@
 | 
				
			|||||||
</table>
 | 
					</table>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<div class="m-n2 row row-cols-paperless-cards" *ngIf="displayMode == 'smallCards'">
 | 
					<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>
 | 
					</div>
 | 
				
			||||||
 | 
				
			|||||||
@ -226,7 +226,7 @@ $border-color-dark-mode: #47494f;
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  .btn-outline-secondary {
 | 
					  .btn-outline-secondary {
 | 
				
			||||||
    border-color: $text-color-dark-mode;
 | 
					    border-color: darken($text-color-dark-mode, 30%);
 | 
				
			||||||
    color: $text-color-dark-mode;
 | 
					    color: $text-color-dark-mode;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    &:not(:disabled):not(.disabled):hover {
 | 
					    &:not(:disabled):not(.disabled):hover {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user