浏览代码

Notes table UI updates

Vijayakrishnan Krishnan 4 年之前
父节点
当前提交
28a6ac87b5
共有 3 个文件被更改,包括 37 次插入10 次删除
  1. 5 0
      app/Models/Note.php
  2. 8 0
      public/css/style.css
  3. 24 10
      resources/views/app/patient/notes.blade.php

+ 5 - 0
app/Models/Note.php

@@ -18,6 +18,11 @@ class Note extends Model
         return $this->hasOne(Pro::class, 'id', 'hcp_pro_id');
     }
 
+    public function createdSession()
+    {
+        return $this->hasOne(AppSession::class, 'id', 'created_by_session_id');
+    }
+
     public function allyPro()
     {
         return $this->hasOne(Pro::class, 'id', 'ally_pro_id');

+ 8 - 0
public/css/style.css

@@ -620,3 +620,11 @@ body #searchCount {
 body .break-spaces {
     white-space: pre-wrap;
 }
+.stag-tooltip .stag-tooltip-content {
+    display: none;
+}
+.stag-tooltip:hover .stag-tooltip-content {
+    display: block;
+    right: 0;
+    top: 100%;
+}

+ 24 - 10
resources/views/app/patient/notes.blade.php

@@ -58,10 +58,12 @@
     <table class="table table-sm table-striped table-bordered mb-0 mt-2">
         <thead>
         <tr>
-            <th class="px-2 text-secondary border-bottom-0">Created</th>
-            <th class="px-2 text-secondary border-bottom-0 w-50">Content</th>
             <th class="px-2 text-secondary border-bottom-0">Effective Date</th>
+            <th class="px-2 text-secondary border-bottom-0">Title</th>
             <th class="px-2 text-secondary border-bottom-0">HCP</th>
+            <th class="px-2 text-secondary border-bottom-0">Signed</th>
+            <th class="px-2 text-secondary border-bottom-0 w-50">Content</th>
+            <th class="px-2 text-secondary border-bottom-0">&nbsp;</th>
             <th class="px-2 text-secondary border-bottom-0">&nbsp;</th>
         </tr>
         </thead>
@@ -69,7 +71,19 @@
         @foreach ($patient->notes as $note)
             <tr class="{{ $note->is_cancelled ? 'cancelled-item always-clickable' : '' }}">
                 <td class="px-2">
-                    {{ friendly_date_time($note->created_at, true) }}
+                    <span class="font-weight-bold">
+                        {{ friendly_date_time($note->effective_dateest, false) }}
+                    </span>
+                    <span class="ml-1">{{ $note->is_cancelled ? '[cancelled]' : '' }}</span>
+                </td>
+                <td class="px-2">
+                    {{ $note->title }}
+                </td>
+                <td class="px-2">
+                    {{$note->hcpPro ? $note->hcpPro->name_display: '-'}}
+                </td>
+                <td class="px-2">
+                    {!! $note->hcpPro && $note->is_signed_by_hcp ? '<b class="text-success">Yes</b>' : 'No' !!}
                 </td>
                 <td class="px-2 note-summary">
                     <?php
@@ -86,13 +100,13 @@
                     @endforeach
                 </td>
                 <td class="px-2">
-                    <span class="font-weight-bold">
-                        {{ friendly_date_time($note->effective_dateest, false) }}
-                    </span>
-                    <span class="ml-1">{{ $note->is_cancelled ? '[cancelled]' : '' }}</span>
-                </td>
-                <td class="px-2">
-                    {{$note->hcpPro ? $note->hcpPro->name_display: '-'}}
+                    <div class="position-relative c-pointer text-center stag-tooltip">
+                        <i class="fa fa-info-circle"></i>
+                        <div class="position-absolute bg-white border rounded p-2 stag-tooltip-content">
+                            <div class="text-nowrap small text-left pb-1">Created on <b>{{ friendly_date_time($note->created_at, true) }}</b></div>
+                            <div class="text-nowrap small text-left">Created by <b>{{ $note->createdSession->pro->displayName() }}</b></div>
+                        </div>
+                    </div>
                 </td>
                 <td class="px-2">
                     <div class="d-flex align-items-center">