Browse Source

Admin patients - grid/details views

Vijayakrishnan 3 years ago
parent
commit
edf8c7ab18
2 changed files with 55 additions and 2 deletions
  1. 41 0
      public/css/style.css
  2. 14 2
      resources/views/app/admin/patients-table-extended.blade.php

+ 41 - 0
public/css/style.css

@@ -2685,4 +2685,45 @@ body.stag-scrollbar-scrolling .stag-scrollbar[stag-h-scrollbar] .stag-scrollbar-
 }
 }
 .conditions-tree .condition-children {
 .conditions-tree .condition-children {
     overflow: hidden;
     overflow: hidden;
+}
+table.stag-compact-grid>tbody>tr>td {
+    white-space: nowrap;
+    max-height: 1rem !important;
+    overflow: hidden !important;
+}
+table.stag-compact-grid>tbody>tr>td>ul>li {
+    display: none;
+}
+table.stag-compact-grid>tbody>tr>td ul>li:nth-child(1) {
+    display: block;
+    margin-left: 0 !important;
+}
+table.stag-compact-grid>tbody>tr>td .alert {
+    padding: 0;
+    margin: 0;
+}
+table.stag-compact-grid>tbody>tr>td table>thead,
+table.stag-compact-grid>tbody>tr>td table>tbody tr{
+    display: none;
+}
+table.stag-compact-grid>tbody>tr>td table>tbody tr:nth-child(1) {
+    display: table-row;
+}
+table.stag-compact-grid>tbody>tr>td {
+    border-left: 1px solid #ddd;
+}
+table.stag-compact-grid>tbody>tr>td:first-child {
+    border-left: 0;
+}
+table tr td [if-details-view] {
+    display: block;
+}
+table tr td [if-grid-view] {
+    display: none;
+}
+table.stag-compact-grid>tbody>tr>td [if-details-view] {
+    display: none;
+}
+table.stag-compact-grid>tbody>tr>td [if-grid-view] {
+    display: block;
 }
 }

+ 14 - 2
resources/views/app/admin/patients-table-extended.blade.php

@@ -1,3 +1,9 @@
+<div>
+    <div class="pl-3 mb-3 d-inline-flex align-items-baseline">
+        <a href="#" native class="mr-3 text-decoration-none" onclick="$('#admin-patients-list-extended>table').addClass('stag-compact-grid'); return false;"><i class="fa fa-list text-sm"></i> Grid</a>
+        <a href="#" native class="text-decoration-none" onclick="$('#admin-patients-list-extended>table').removeClass('stag-compact-grid'); return false;"><i class="fa fa-file text-sm"></i> Details</a>
+    </div>
+</div>
 <div class="table-responsive border-top" style="height: calc(100vh - 280px)" id="admin-patients-list-extended">
 <div class="table-responsive border-top" style="height: calc(100vh - 280px)" id="admin-patients-list-extended">
     <table class="table p-0 m-0 table-sm table-striped border-bottom text-nowrap">
     <table class="table p-0 m-0 table-sm table-striped border-bottom text-nowrap">
         <thead class="bg-light">
         <thead class="bg-light">
@@ -76,11 +82,13 @@
                     {{-- {{$patient->lastMcpAppointment ? friendly_date_time($patient->lastMcpAppointment->raw_date.' '.$patient->lastMcpAppointment->raw_start_time) : '-'}}--}}
                     {{-- {{$patient->lastMcpAppointment ? friendly_date_time($patient->lastMcpAppointment->raw_date.' '.$patient->lastMcpAppointment->raw_start_time) : '-'}}--}}
                 </td>
                 </td>
                 <td>{{$patient->nextMcpAppointment ? friendly_date_time($patient->nextMcpAppointment->raw_date.' '.$patient->nextMcpAppointment->raw_start_time) : '-'}}
                 <td>{{$patient->nextMcpAppointment ? friendly_date_time($patient->nextMcpAppointment->raw_date.' '.$patient->nextMcpAppointment->raw_start_time) : '-'}}
-                    <br>
-                    {{$patient->nextMcpAppointment ? $patient->nextMcpAppointment->status : '-'}}
+                    <div if-details-view>
+                        {{$patient->nextMcpAppointment ? $patient->nextMcpAppointment->status : '-'}}
+                    </div>
                 </td>
                 </td>
 
 
                 <td class="p-0 pb-1">
                 <td class="p-0 pb-1">
+                    <div if-details-view>
                     @if(count($patient->activeNotes))
                     @if(count($patient->activeNotes))
                         <?php $noteIndex = 0; ?>
                         <?php $noteIndex = 0; ?>
                         @foreach ($patient->activeNotes as $note)
                         @foreach ($patient->activeNotes as $note)
@@ -259,6 +267,10 @@
                             </div>
                             </div>
                         @endforeach
                         @endforeach
                     @endif
                     @endif
+                    </div>
+                    <div if-grid-view class="p-1">
+                        {{count($patient->activeNotes)}}
+                    </div>
                 </td>
                 </td>
 
 
                 <td>
                 <td>