Răsfoiți Sursa

Typical daya / lifestyle segment - impression

Vijayakrishnan 3 ani în urmă
părinte
comite
efe629ba97

+ 18 - 13
resources/views/app/patient/segment-templates/typical_day_lifestyle/edit.blade.php

@@ -10,22 +10,18 @@ $contentData = [
     ],
     "estimated_daily_calories" => [
         "S" => '',
-        "I" => '',
         "P" => '',
     ],
     "estimated_daily_protein_grams" => [
         "S" => '',
-        "I" => '',
         "P" => '',
     ],
     "estimated_daily_vegetable_servings" => [
         "S" => '',
-        "I" => '',
         "P" => '',
     ],
     "estimated_daily_hours_of_sleep" => [
         "S" => '',
-        "I" => '',
         "P" => '',
     ]
 ];
@@ -49,15 +45,17 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
             <tr>
                 <th class="border-bottom-0 text-secondary width-30px"></th>
                 <th class="border-bottom-0 text-secondary">Subjective</th>
-                <th class="border-bottom-0 text-secondary w-50">Impression & Plan</th>
+                <th class="border-bottom-0 text-secondary width-100px">Impression</th>
+                <th class="border-bottom-0 text-secondary w-50">Plan</th>
             </tr>
             </thead>
             <tbody>
                 @foreach(@$contentData["lines"] as $line)
                     <tr>
                         <td class="align-middle text-center bg-light"><a href="#" class="delete-line"><i class="fa fa-trash-alt on-hover-opaque text-danger"></i></a></td>
-                        <td><textarea rows="1" key="S">{{$line['S']}}</textarea></td>
-                        <td><textarea rows="1" key="P">{{$line['P']}}</textarea></td>
+                        <td><textarea rows="1" key="S">{{@$line['S']}}</textarea></td>
+                        <td><textarea rows="1" key="I">{{@$line['I']}}</textarea></td>
+                        <td><textarea rows="1" key="P">{{@$line['P']}}</textarea></td>
                     </tr>
                 @endforeach
             </tbody>
@@ -112,6 +110,7 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
 <style>
     .stag-sheet tbody tr td {
         padding: 0;
+        background: #fff;
     }
     .stag-sheet tbody tr td textarea {
         border: 1px solid transparent;
@@ -123,6 +122,9 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
         padding: 3px;
         min-height: 28px;
     }
+    .stag-sheet tbody tr td textarea {
+        overflow: hidden;
+    }
     .stag-sheet tbody tr td textarea:focus,
     .stag-sheet tbody tr td textarea:focus-visible {
         border: 1px solid steelblue;
@@ -156,6 +158,7 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
         function newRow() {
             return $('<tr><td class="align-middle text-center bg-light"><a href="#" class="delete-line"><i class="fa fa-trash-alt on-hover-opaque text-danger"></i></a></td>' +
                 '<td><textarea rows="1" key="S"></textarea></td>' +
+                '<td><textarea rows="1" key="I"></textarea></td>' +
                 '<td><textarea rows="1" key="P"></textarea></td></tr>');
         }
 
@@ -209,6 +212,12 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
             parentSegment.find('[name="data"]').trigger('save-trigger');
         }
 
+        function autoGrowTextarea(_textarea) {
+            _textarea.style.minHeight = "100%";
+            _textarea.style.height = "calc(1.5em + .5rem + 2px)";
+            _textarea.style.height = (_textarea.scrollHeight)+"px";
+        }
+
         parentSegment
             .off('keydown', '.stag-sheet textarea')
             .on('keydown', '.stag-sheet textarea', function(_e) {
@@ -272,18 +281,14 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
             });
 
         parentSegment.find('.stag-sheet textarea').each(function() {
-            this.style.minHeight = "calc(1.5em + .5rem + 2px)";
-            this.style.height = "calc(1.5em + .5rem + 2px)";
-            this.style.height = (this.scrollHeight)+"px";
+            autoGrowTextarea(this);
         });
 
         parentSegment
             .off('edit-mode-activated')
             .on('edit-mode-activated', function() {
                 parentSegment.find('.stag-sheet textarea').each(function() {
-                    this.style.minHeight = "calc(1.5em + .5rem + 2px)";
-                    this.style.height = "calc(1.5em + .5rem + 2px)";
-                    this.style.height = (this.scrollHeight)+"px";
+                    autoGrowTextarea(this);
                 });
             });
 

+ 8 - 5
resources/views/app/patient/segment-templates/typical_day_lifestyle/summary.blade.php

@@ -10,22 +10,18 @@ $contentData = [
     ],
     "estimated_daily_calories" => [
         "S" => '',
-        "I" => '',
         "P" => '',
     ],
     "estimated_daily_protein_grams" => [
         "S" => '',
-        "I" => '',
         "P" => '',
     ],
     "estimated_daily_vegetable_servings" => [
         "S" => '',
-        "I" => '',
         "P" => '',
     ],
     "estimated_daily_hours_of_sleep" => [
         "S" => '',
-        "I" => '',
         "P" => '',
     ]
 ];
@@ -49,7 +45,14 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
             @foreach(@$contentData["lines"] as $line)
                 <tr>
                     <td><pre class="m-0">{{$line['S']}}</pre></td>
-                    <td><pre class="m-0">{{$line['P']}}</pre></td>
+                    <td>
+                        <div class="d-flex align-items-baseline">
+                            @if(@$line['I'])
+                                <b class="mr-2">{{$line['I']}}</b>
+                            @endif
+                            <pre class="m-0">{{$line['P']}}</pre>
+                        </div>
+                    </td>
                 </tr>
             @endforeach
             </tbody>