]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Mobile friendly management tables
authorMichael Shamoon <4887959+shamoon@users.noreply.github.com>
Tue, 3 May 2022 20:00:42 +0000 (13:00 -0700)
committerMichael Shamoon <4887959+shamoon@users.noreply.github.com>
Tue, 3 May 2022 20:00:42 +0000 (13:00 -0700)
src-ui/src/app/components/manage/correspondent-list/correspondent-list.component.ts
src-ui/src/app/components/manage/management-list/management-list.component.html
src-ui/src/app/components/manage/management-list/management-list.component.scss

index 4887f5e34dedee8b4140e9fbfbb862f4707628f1..dd0d8ed0606535aa2170a9eef1408bc5da4317f2 100644 (file)
@@ -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)
           },
index c9c9d60d34b403a293edd23ab2b7b33bed76640a..761e340eb10bb5a614180d2bf71da90be37e8674 100644 (file)
@@ -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>
   <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"/>
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..dfdd204330e1b4ef8f9e4daf70003f480c4902d4 100644 (file)
@@ -0,0 +1,4 @@
+// hide caret on mobile dropdown
+.d-block.d-sm-none .dropdown-toggle::after {
+    display: none;
+}