mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-11 10:00:48 -05:00
selection for small cards
This commit is contained in:
parent
2374506a20
commit
7906d8fef1
@ -1,12 +1,12 @@
|
|||||||
<div class="col p-2 h-100 document-card" style="width: 16rem;">
|
<div class="col p-2 h-100 document-card" style="width: 16rem;">
|
||||||
<div class="card h-100 shadow-sm">
|
<div class="card h-100 shadow-sm" [class.card-selected]="selected">
|
||||||
<div class="border-bottom">
|
<div class="border-bottom" [class.doc-img-background-selected]="selected">
|
||||||
<img class="card-img doc-img" [src]="getThumbUrl()">
|
<img class="card-img doc-img" [src]="getThumbUrl()" (click)="selected = !selected">
|
||||||
|
|
||||||
<div style="top: 0; left: 0" class="position-absolute border-right border-bottom bg-light p-1" [class.document-card-check]="!selected">
|
<div style="top: 0; left: 0" class="position-absolute border-right border-bottom bg-light p-1" [class.document-card-check]="!selected">
|
||||||
<div class="custom-control custom-checkbox">
|
<div class="custom-control custom-checkbox">
|
||||||
<input type="checkbox" class="custom-control-input" id="smallCardCheck{{document.id}}" [(ngModel)]="selected">
|
<input type="checkbox" class="custom-control-input" id="smallCardCheck{{document.id}}" [checked]="selected" (change)="selected = $event.target.checked">
|
||||||
<label class="custom-control-label" for="smallCardCheck{{document.id}}">L</label>
|
<label class="custom-control-label" for="smallCardCheck{{document.id}}"></label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
|
@import "/src/theme";
|
||||||
|
|
||||||
.doc-img {
|
.doc-img {
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
object-position: top;
|
object-position: top;
|
||||||
height: 200px;
|
height: 200px;
|
||||||
|
mix-blend-mode: multiply;
|
||||||
}
|
}
|
||||||
|
|
||||||
.document-card-check {
|
.document-card-check {
|
||||||
@ -11,3 +14,11 @@
|
|||||||
.document-card:hover .document-card-check {
|
.document-card:hover .document-card-check {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.card-selected {
|
||||||
|
border-color: $primary;
|
||||||
|
}
|
||||||
|
|
||||||
|
.doc-img-background-selected {
|
||||||
|
background-color: $primaryFaded;
|
||||||
|
}
|
@ -13,7 +13,20 @@ export class DocumentCardSmallComponent implements OnInit {
|
|||||||
|
|
||||||
constructor(private documentService: DocumentService) { }
|
constructor(private documentService: DocumentService) { }
|
||||||
|
|
||||||
selected = false
|
_selected = false
|
||||||
|
|
||||||
|
get selected() {
|
||||||
|
return this._selected
|
||||||
|
}
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
set selected(value: boolean) {
|
||||||
|
this._selected = value
|
||||||
|
this.selectedChange.emit(value)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Output()
|
||||||
|
selectedChange = new EventEmitter<boolean>()
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
document: PaperlessDocument
|
document: PaperlessDocument
|
||||||
|
@ -155,5 +155,5 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class=" m-n2 row" *ngIf="displayMode == 'smallCards'">
|
<div class=" m-n2 row" *ngIf="displayMode == 'smallCards'">
|
||||||
<app-document-card-small [document]="d" *ngFor="let d of list.documents" (clickTag)="filterByTag($event)" (clickCorrespondent)="filterByCorrespondent($event)"></app-document-card-small>
|
<app-document-card-small [selected]="list.isSelected(d)" (selectedChange)="list.setSelected(d, $event)" [document]="d" *ngFor="let d of list.documents" (clickTag)="filterByTag($event)" (clickCorrespondent)="filterByCorrespondent($event)"></app-document-card-small>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
$paperless-green: #17541f;
|
$paperless-green: #17541f;
|
||||||
$primary: #17541f;
|
$primary: #17541f;
|
||||||
|
$primaryFaded: #d1ddd2;
|
||||||
|
|
||||||
$theme-colors: (
|
$theme-colors: (
|
||||||
"primary": $primary
|
"primary": $primary
|
||||||
|
Loading…
x
Reference in New Issue
Block a user