Răsfoiți Sursa

Weight loss - render only if there is content

Vijayakrishnan 3 ani în urmă
părinte
comite
42ef3117ef

+ 20 - 7
resources/views/app/patient/module-specific-summary-renderers/weight_loss_intake/plan.blade.php

@@ -78,6 +78,24 @@
     'comments'
 ] ?>
 @if($points && count($points))
+    <?php
+        ob_start();
+        $j = 0;
+        foreach ($points as $point) {
+            $j++;
+            ?>
+            <tr>
+                <td class="font-weight-normal">
+                    @include('app.patient.module-specific-summary-renderers.data-dump', compact('point'))
+                </td>
+                <td></td>
+            </tr>
+            <?php
+        }
+        $output = ob_get_contents();
+        ob_end_clean();
+    ?>
+    @if($output && !!trim(strip_tags($output)))
     <div class="d-flex border-bottom">
         <a class="mr-2 min-width-110px hide-if-note-signed"
             open-in-stag-popup
@@ -93,14 +111,9 @@
 
         <div class="flex-grow-1">
             <table class="table table-bordered table-xs table-cage mb-0">
-                <?php $j = 0; foreach ($points as $point): $j++; ?>
-                    <tr>
-                        <td>
-                            @include('app.patient.module-specific-summary-renderers.data-dump', compact('point'))
-                        </td>
-                    </tr>
-                <?php endforeach; ?>
+                <?= $output ?>
             </table>
         </div>
     </div>
+    @endif
 @endif

+ 34 - 21
resources/views/app/patient/module-specific-summary-renderers/weight_loss_intake/subjective.blade.php

@@ -3,29 +3,42 @@
 ]; 
 ?>
 @if($points && count($points))
-    <div class="d-flex border-bottom">
-        <a class="mr-2 min-width-110px hide-if-note-signed"
-            open-in-stag-popup
-           href="/module-view/{{$note->uid}}/weight_loss_intake/edit"
-           mc-initer="edit-weight_loss_intake-container-{{$note->id}}"
-           title="Weight Loss Intake"
-           popup-style="stag-popup-md overflow-visible">
-            Weight Loss
-        </a>
-        <span class="mr-2 min-width-110px font-weight-bold show-if-note-signed">
+    <?php
+    ob_start();
+    $j = 0;
+    foreach ($points as $point) {
+    $j++;
+    ?>
+    <tr>
+        <td>
+            @include('app.patient.module-specific-summary-renderers.data-dump', compact('point'))
+        </td>
+        <td></td>
+    </tr>
+    <?php
+    }
+    $output = ob_get_contents();
+    ob_end_clean();
+    ?>
+    @if($output && !!trim(strip_tags($output)))
+        <div class="d-flex border-bottom">
+            <a class="mr-2 min-width-110px hide-if-note-signed"
+               open-in-stag-popup
+               href="/module-view/{{$note->uid}}/weight_loss_intake/edit"
+               mc-initer="edit-weight_loss_intake-container-{{$note->id}}"
+               title="Weight Loss Intake"
+               popup-style="stag-popup-md overflow-visible">
+                Weight Loss
+            </a>
+            <span class="mr-2 min-width-110px font-weight-bold show-if-note-signed">
             Weight Loss
         </span>
 
-        <div class="flex-grow-1">
-            <table class="table table-bordered table-xs table-cage mb-0">
-                <?php $j = 0; foreach ($points as $point): $j++; ?>
-                    <tr>
-                        <td>
-                            @include('app.patient.module-specific-summary-renderers.data-dump', compact('point'))
-                        </td>
-                    </tr>
-                <?php endforeach; ?>
-            </table>
+            <div class="flex-grow-1">
+                <table class="table table-bordered table-xs table-cage mb-0">
+                    <?= $output ?>
+                </table>
+            </div>
         </div>
-    </div>
+    @endif
 @endif