mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	Display tags with color pills
This commit is contained in:
		| @@ -10,7 +10,10 @@ | |||||||
|               <path fill-rule="evenodd" d="M10.97 4.97a.75.75 0 0 1 1.071 1.05l-3.992 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425a.236.236 0 0 1 .02-.022z"/> |               <path fill-rule="evenodd" d="M10.97 4.97a.75.75 0 0 1 1.071 1.05l-3.992 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425a.236.236 0 0 1 .02-.022z"/> | ||||||
|             </svg> |             </svg> | ||||||
|           </div> |           </div> | ||||||
|           <div class="mr-1">{{item.name}}</div> |           <div class="mr-1"> | ||||||
|  |             <app-tag *ngIf="display == 'tag'; else displayName" [tag]="item" [clickable]="true" linkTitle="Filter by tag"></app-tag> | ||||||
|  |             <ng-template #displayName>{{item.name}}</ng-template> | ||||||
|  |           </div> | ||||||
|           <div class="badge bg-primary text-light rounded-pill ml-auto">{{item.document_count}}</div> |           <div class="badge bg-primary text-light rounded-pill ml-auto">{{item.document_count}}</div> | ||||||
|         </button> |         </button> | ||||||
|       </ng-container> |       </ng-container> | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; | ||||||
| import { FilterRuleType, FILTER_CORRESPONDENT, FILTER_DOCUMENT_TYPE, FILTER_HAS_TAG, FILTER_TITLE, FILTER_RULE_TYPES } from 'src/app/data/filter-rule-type'; | import { FilterRuleType, FILTER_HAS_TAG, FILTER_RULE_TYPES } from 'src/app/data/filter-rule-type'; | ||||||
| import { ObjectWithId } from 'src/app/data/object-with-id'; | import { ObjectWithId } from 'src/app/data/object-with-id'; | ||||||
|  |  | ||||||
| @Component({ | @Component({ | ||||||
| @@ -21,10 +21,12 @@ export class FilterDropdownComponent implements OnInit { | |||||||
|   itemsActive: ObjectWithId[] = [] |   itemsActive: ObjectWithId[] = [] | ||||||
|   title: string |   title: string | ||||||
|   filterText: string |   filterText: string | ||||||
|  |   display: string | ||||||
|  |  | ||||||
|   ngOnInit(): void { |   ngOnInit(): void { | ||||||
|     let filterRuleType: FilterRuleType = FILTER_RULE_TYPES.find(t => t.id == this.filterRuleTypeID) |     let filterRuleType: FilterRuleType = FILTER_RULE_TYPES.find(t => t.id == this.filterRuleTypeID) | ||||||
|     this.title = filterRuleType.name |     this.title = filterRuleType.name | ||||||
|  |     this.display = filterRuleType.datatype | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   toggleItem(item: ObjectWithId) { |   toggleItem(item: ObjectWithId) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Michael Shamoon
					Michael Shamoon