Browse Source

Sticky note update

Samson Mutunga 2 years ago
parent
commit
1c4c078c37

+ 6 - 0
app/Helpers/helpers.php

@@ -1138,3 +1138,9 @@ if(!function_exists('mask_string')) {
         return $maskedFirstCharacters . $lastCharacters;
     }
 }
+
+if(!function_exists('limit_string_length')) {
+    function limit_string_length($string, $length = 30) {
+        return substr($string,0, $length);
+    }
+}

+ 1 - 1
public/css/style.css

@@ -3803,4 +3803,4 @@ table.v-top th {
 .ss-leftnav>a {
     padding: 0.5rem 1.25rem;
     width: 250px;
-}
+}

+ 19 - 0
resources/views/app/patient/partials/sticky-notes-view.blade.php

@@ -0,0 +1,19 @@
+
+@if(strlen($patient->sticky_note) > 60)
+<div moe relative wide center>
+	<a start show class="font-weight-bold">...</a>
+	<form url="" class="mcp-theme-1">
+		<div>
+			<div class="d-flex align-items-center justify-content-between pb-2 mb-1">
+				<h5 class="mb-0 font-weight-bold">Sticky Note</h5>
+				<button cancel class="btn btn-sm btn-default border">
+					<i class="fas fa-times"></i>
+				</button>
+			</div>
+			<div>
+				{{ $patient->sticky_note }}
+			</div>
+		</div>
+	</form>
+</div>
+@endif

+ 3 - 1
resources/views/layouts/patient-header.blade.php

@@ -554,7 +554,9 @@ $addressParts .= implode(", ", $addressPart2);
                     $patientRecentStickyNote = App\Models\ClientStickyNote::where('client_id', $patient->id)->orderBy('created_at', 'DESC')->limit(1)->first();
                     ?>
                     <div class="">
-                        <span class="d-block text-secondary">{{$patient->sticky_note ?? '-' }}</span>
+                        <span class="d-block text-secondary">{{ limit_string_length($patient->sticky_note ?? '-', 60) }}
+                            @include('app.patient.partials.sticky-notes-view')
+                        </span>
                         <div>
                             <small class="text-muted">By: {{ $patient->stickyNoteUpdatedBySession? $patient->stickyNoteUpdatedBySession->pro->displayName() : '-'  }} • At: {{ friendlier_date($patient->sticky_note_updated_at) }}</small>
                         </div>