Преглед на файлове

Device - add - select2 for imei

Vijayakrishnan преди 4 години
родител
ревизия
b2b3ca05c8
променени са 2 файла, в които са добавени 26 реда и са изтрити 2 реда
  1. 13 1
      resources/views/app/patient/dashboard.blade.php
  2. 13 1
      resources/views/app/patient/devices.blade.php

+ 13 - 1
resources/views/app/patient/dashboard.blade.php

@@ -17,6 +17,8 @@
     }
     ?>
     <script>window.userShortcuts = <?= json_encode($shortCutsObject); ?>;</script>
+    <link href="/select2/select2.min.css" rel="stylesheet" />
+    <script src="/select2/select2.min.js"></script>
     <div>
 
         {{-- CARE PLAN START --}}
@@ -66,7 +68,7 @@
                         <?php $availableDevices++; ?>
                     @endif
                 @endforeach
-                <div class="mt-2 pb-1">
+                <div class="mt-2 pb-1" id="patient-dashboard-devices">
                     <div class="d-flex align-items-center mb-2 py-2 border-top border-bottom">
                         <h6 class="my-0 font-weight-bold text-secondary">Devices</h6>
                         @if($availableDevices > 0)
@@ -930,4 +932,14 @@
         </div>
 
     </div>
+    <script>
+        (function() {
+            function init() {
+                $('select[name="deviceUid"]').select2({
+                    width: '100%'
+                });
+            }
+            addMCInitializer('patient-dashboard-devices', init, '#patient-dashboard-devices');
+        }).call(window);
+    </script>
 @endsection

+ 13 - 1
resources/views/app/patient/devices.blade.php

@@ -1,6 +1,8 @@
 @extends ('layouts.patient')
 @section('inner-content')
-    <div class="">
+    <link href="/select2/select2.min.css" rel="stylesheet" />
+    <script src="/select2/select2.min.js"></script>
+    <div id="patient-devices">
         <div class="d-flex align-items-start pb-2">
             <div class="font-weight-bold m-0">Devices</div>
             @if(count($devices))
@@ -71,4 +73,14 @@
             @endif
         </table>
     </div>
+    <script>
+        (function() {
+            function init() {
+                $('select[name="deviceUid"]').select2({
+                    width: '100%'
+                });
+            }
+            addMCInitializer('patient-devices', init, '#patient-devices');
+        }).call(window);
+    </script>
 @endsection