mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 19:17:13 -05:00 
			
		
		
		
	Mobile friendly management tables
This commit is contained in:
		
							parent
							
								
									98ebb095cc
								
							
						
					
					
						commit
						5e10befe28
					
				@ -34,7 +34,7 @@ export class CorrespondentListComponent extends ManagementListComponent<Paperles
 | 
			
		||||
      [
 | 
			
		||||
        {
 | 
			
		||||
          key: 'last_correspondence',
 | 
			
		||||
          name: $localize`Last correspondence`,
 | 
			
		||||
          name: $localize`Last used`,
 | 
			
		||||
          valueFn: (c: PaperlessCorrespondent) => {
 | 
			
		||||
            return this.datePipe.transform(c.last_correspondence)
 | 
			
		||||
          },
 | 
			
		||||
 | 
			
		||||
@ -17,7 +17,7 @@
 | 
			
		||||
  <thead>
 | 
			
		||||
    <tr>
 | 
			
		||||
      <th scope="col" sortable="name" [currentSortField]="sortField" [currentSortReverse]="sortReverse" (sort)="onSort($event)" i18n>Name</th>
 | 
			
		||||
      <th scope="col" sortable="matching_algorithm" [currentSortField]="sortField" [currentSortReverse]="sortReverse" (sort)="onSort($event)" i18n>Matching</th>
 | 
			
		||||
      <th scope="col" class="d-none d-sm-table-cell" sortable="matching_algorithm" [currentSortField]="sortField" [currentSortReverse]="sortReverse" (sort)="onSort($event)" i18n>Matching</th>
 | 
			
		||||
      <th scope="col" sortable="document_count" [currentSortField]="sortField" [currentSortReverse]="sortReverse" (sort)="onSort($event)" i18n>Document count</th>
 | 
			
		||||
      <th scope="col" *ngFor="let column of extraColumns" sortable="{{column.key}}" [currentSortField]="sortField" [currentSortReverse]="sortReverse" (sort)="onSort($event)">{{column.name}}</th>
 | 
			
		||||
      <th scope="col" i18n>Actions</th>
 | 
			
		||||
@ -26,14 +26,28 @@
 | 
			
		||||
  <tbody>
 | 
			
		||||
    <tr *ngFor="let object of data">
 | 
			
		||||
      <td scope="row">{{ object.name }}</td>
 | 
			
		||||
      <td scope="row">{{ getMatching(object) }}</td>
 | 
			
		||||
      <td scope="row" class="d-none d-sm-table-cell">{{ getMatching(object) }}</td>
 | 
			
		||||
      <td scope="row">{{ object.document_count }}</td>
 | 
			
		||||
      <td scope="row" *ngFor="let column of extraColumns">
 | 
			
		||||
        <div *ngIf="column.rendersHtml; else colValue" [innerHtml]="column.valueFn.call(null, object) | safeHtml"></div>
 | 
			
		||||
        <ng-template #colValue>{{ column.valueFn.call(null, object) }}</ng-template>
 | 
			
		||||
      </td>
 | 
			
		||||
      <td scope="row">
 | 
			
		||||
        <div class="btn-group">
 | 
			
		||||
        <div class="btn-group d-block d-sm-none">
 | 
			
		||||
          <div ngbDropdown class="d-inline-block">
 | 
			
		||||
            <button type="button" class="btn btn-link" id="actionsMenuMobile" ngbDropdownToggle>
 | 
			
		||||
              <svg class="toolbaricon" fill="currentColor">
 | 
			
		||||
                <use xlink:href="assets/bootstrap-icons.svg#three-dots-vertical" />
 | 
			
		||||
              </svg>
 | 
			
		||||
            </button>
 | 
			
		||||
            <div ngbDropdownMenu aria-labelledby="actionsMenuMobile">
 | 
			
		||||
              <button (click)="filterDocuments(object)" ngbDropdownItem i18n>Filter Documents</button>
 | 
			
		||||
              <button (click)="openEditDialog(object)" ngbDropdownItem i18n>Edit</button>
 | 
			
		||||
              <button class="text-danger" (click)="openDeleteDialog(object)" ngbDropdownItem i18n>Delete</button>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="btn-group d-none d-sm-block">
 | 
			
		||||
          <button class="btn btn-sm btn-outline-secondary" (click)="filterDocuments(object)">
 | 
			
		||||
            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-funnel" viewBox="0 0 16 16">
 | 
			
		||||
              <path fill-rule="evenodd" d="M1.5 1.5A.5.5 0 0 1 2 1h12a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-.128.334L10 8.692V13.5a.5.5 0 0 1-.342.474l-3 1A.5.5 0 0 1 6 14.5V8.692L1.628 3.834A.5.5 0 0 1 1.5 3.5v-2zm1 .5v1.308l4.372 4.858A.5.5 0 0 1 7 8.5v5.306l2-.666V8.5a.5.5 0 0 1 .128-.334L13.5 3.308V2h-11z"/>
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,4 @@
 | 
			
		||||
// hide caret on mobile dropdown
 | 
			
		||||
.d-block.d-sm-none .dropdown-toggle::after {
 | 
			
		||||
    display: none;
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user