Răsfoiți Sursa

Visit UI - more common actions

Vijayakrishnan 3 ani în urmă
părinte
comite
008db4948d

+ 7 - 0
public/css/style.css

@@ -1998,4 +1998,11 @@ body.in-iframe .main-row > .sidebar {
 }
 .spot-highlight {
     background: aliceblue !important;
+}
+.on-click-menu [menu] {
+    position: absolute;
+    display: none;
+    top: 100%;
+    right: 0;
+    z-index: 1;
 }

+ 102 - 4
resources/views/app/patient/segment-templates/_common_actions/remove-undo.php

@@ -1,8 +1,8 @@
 <?php if ($point->is_removed): ?>
     <?php if ($point->is_removed_due_to_entry_error): ?>
-        <span class="font-weight-bold text-secondary mr-2">Entry error</span>
+        <span class="font-weight-bold text-secondary mr-2 text-nowrap">Entry error</span>
     <?php else: ?>
-        <span class="font-weight-bold text-secondary mr-2">Removed on intake</span>
+        <span class="font-weight-bold text-secondary mr-2 text-nowrap">Removed on intake</span>
     <?php endif; ?>
     <div visit-moe>
         <form show url="/api/visitPoint/undoMarkRemoved" class="mcp-theme-1">
@@ -13,7 +13,7 @@
     </div>
 <?php else: ?>
     <?php if($point->added_in_note_id === $note->id): ?>
-        <span class="font-weight-bold text-success mr-2">* Added on intake</span>
+        <span class="font-weight-bold text-success mx-2 text-nowrap">* Added on intake</span>
     <?php endif; ?>
     <div visit-moe>
         <a start show href="#">Remove</a>
@@ -52,4 +52,102 @@
             </div>
         </form>
     </div>
-<?php endif; ?>
+<?php endif; ?>
+
+<!-- additional actions -->
+<div class="ml-2 position-relative on-click-menu">
+    <span class="d-block btn btn-sm btn-default px-1 py-0 border font-weight-bold text-secondary align-middle">&hellip;</span>
+    <div menu class="bg-white border">
+
+        <!-- if removed -->
+            <!-- ACT: update removal reason memo -->
+            <!-- if entry error -->
+                <!-- ACT: mark as not entry error-->
+            <!-- if not entry error-->
+                <!-- ACT: mark as entry error-->
+        <!-- if not removed -->
+            <!-- ACT: update addition reason memo -->
+            <!-- ACT: mark added during visit -->
+
+        <?php if ($point->is_removed): ?>
+            <div class="border-bottom">
+                <div visit-moe>
+                    <a start show href="#" class="px-2 py-1 d-block text-nowrap">Update removal reason</a>
+                    <form url="/api/visitPoint/updateRemovalReasonMemo" class="mcp-theme-1">
+                        <input type="hidden" name="uid" value="<?= $point->uid ?>">
+                        <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+                        <p class="mb-2"><b>Update Removal Reason</b></p>
+                        <div class="mb-2">
+                            <label class="text-sm text-secondary mb-1">Removal Reason</label>
+                            <textarea name="removalReasonMemo" class="form-control form-control-sm" rows="2"></textarea>
+                        </div>
+                        <div>
+                            <button submit class="btn btn-sm btn-primary mr-2">Submit</button>
+                            <button cancel class="btn btn-sm btn-default border">Cancel</button>
+                        </div>
+                    </form>
+                </div>
+            </div>
+            <?php if ($point->is_removed_due_to_entry_error): ?>
+                <div class="border-bottom">
+                    <div visit-moe>
+                        <form show url="/api/visitPoint/setIsRemovedDueToEntryErrorToFalse" class="mcp-theme-1">
+                            <input type="hidden" name="uid" value="<?= $point->uid ?>">
+                            <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+                            <a submit href="#" class="text-nowrap px-2 py-1 d-block">Mark as not entry error</a>
+                        </form>
+                    </div>
+                </div>
+            <?php else: ?>
+                <div class="border-bottom">
+                    <div visit-moe>
+                        <form show url="/api/visitPoint/setIsRemovedDueToEntryErrorToTrue" class="mcp-theme-1">
+                            <input type="hidden" name="uid" value="<?= $point->uid ?>">
+                            <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+                            <a submit href="#" class="text-nowrap px-2 py-1 d-block">Mark as entry error</a>
+                        </form>
+                    </div>
+                </div>
+            <?php endif; ?>
+        <?php else: ?>
+            <div class="border-bottom">
+                <div visit-moe>
+                    <a start show href="#" class="px-2 py-1 d-block text-nowrap">Update addition reason</a>
+                    <form url="/api/visitPoint/updateAdditionReasonMemo" class="mcp-theme-1">
+                        <input type="hidden" name="uid" value="<?= $point->uid ?>">
+                        <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+                        <p class="mb-2"><b>Update Addition Reason</b></p>
+                        <div class="mb-2">
+                            <label class="text-sm text-secondary mb-1">Addition Reason</label>
+                            <textarea name="additionReasonMemo" class="form-control form-control-sm" rows="2"></textarea>
+                        </div>
+                        <div>
+                            <button submit class="btn btn-sm btn-primary mr-2">Submit</button>
+                            <button cancel class="btn btn-sm btn-default border">Cancel</button>
+                        </div>
+                    </form>
+                </div>
+            </div>
+            <div class="border-bottom">
+                <div visit-moe>
+                    <a start show href="#" class="px-2 py-1 d-block text-nowrap">Mark as added during visit</a>
+                    <form url="/api/visitPoint/markAddedDuringVisit" class="mcp-theme-1">
+                        <input type="hidden" name="uid" value="<?= $point->uid ?>">
+                        <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+                        <p class="mb-2"><b>Mark as added during visit</b></p>
+                        <div class="mb-2">
+                            <label class="text-sm text-secondary mb-1">Addition Reason</label>
+                            <textarea name="additionReasonMemo" class="form-control form-control-sm" rows="2"></textarea>
+                        </div>
+                        <div>
+                            <button submit class="btn btn-sm btn-primary mr-2">Submit</button>
+                            <button cancel class="btn btn-sm btn-default border">Cancel</button>
+                        </div>
+                    </form>
+                </div>
+            </div>
+        <?php endif; ?>
+
+
+    </div>
+</div>

+ 16 - 0
resources/views/layouts/template.blade.php

@@ -319,6 +319,22 @@
                     return false;
                 });
 
+            $(document)
+                .off('click.on-click-menu', '.on-click-menu>span')
+                .on('click.on-click-menu', '.on-click-menu>span', function() {
+                    $(this).parent().find('[menu]').first().show();
+                    return false;
+                });
+
+            $('body')
+                .off('mousedown.on-click-menu-outside-click')
+                .on('mousedown.on-click-menu-outside-click', function (e) {
+                    if ($(e.target).closest('.on-click-menu').length) {
+                        return;
+                    }
+                    $('.on-click-menu [menu]').hide();
+                });
+
             function onQueryChange() {
                 returnedFunction();
             }