Преглед на файлове

Patient left nav - highlight current context

Vijayakrishnan Krishnan преди 4 години
родител
ревизия
fe3657ca6f
променени са 2 файла, в които са добавени 32 реда и са изтрити 15 реда
  1. 3 1
      public/css/style.css
  2. 29 14
      resources/views/layouts/patient.blade.php

+ 3 - 1
public/css/style.css

@@ -127,13 +127,15 @@ body.stag_rhs_collapsed .app-right-panel {
     border-color: rgb(13, 89, 175);
     box-shadow: none;
 }
-.mcp-theme
 .mcp-theme-1 .nav-item {
     margin: 0;
 }
 .mcp-theme-1 .nav-link:hover {
     background: #e3e3e394;
 }
+.mcp-theme-1 .nav-link.active {
+    background: #e2e2e2;
+}
 .mcp-theme-1 .text-sm {
     font-size: 85%;
 }

+ 29 - 14
resources/views/layouts/patient.blade.php

@@ -8,47 +8,62 @@
             <nav id="sidebarMenu" class="d-md-block bg-light sidebar collapse px-0">
                 <div class="sidebar-sticky pt-3">
                     <ul class="nav flex-column mcp-theme-1">
+                        <?php $routeName = request()->route()->getName(); ?>
                         <li class="nav-item">
-                            <a class="nav-link" href="{{ route('patients.view.dashboard', ['patient' => $patient]) }}">Dashboard</a>
+                            <a class="nav-link {{ strpos($routeName, 'patients.view.dashboard') === 0 ? 'active' : '' }}"
+                               href="{{ route('patients.view.dashboard', ['patient' => $patient]) }}">Dashboard</a>
                         </li>
                         <li class="nav-item">
-                            <a class="nav-link" href="{{ route('patients.view.care-months', ['patient' => $patient]) }}">Care Months</a>
+                            <a class="nav-link {{ strpos($routeName, 'patients.view.care-months') === 0 ? 'active' : '' }}"
+                               href="{{ route('patients.view.care-months', ['patient' => $patient]) }}">Care Months</a>
                         </li>
                         <li class="nav-item">
-                            <a class="nav-link" href="{{ route('patients.view.notes', ['patient' => $patient]) }}">Notes</a>
+                            <a class="nav-link {{ strpos($routeName, 'patients.view.notes') === 0 ? 'active' : '' }}"
+                               href="{{ route('patients.view.notes', ['patient' => $patient]) }}">Notes</a>
                         </li>
                         <li class="nav-item">
-                            <a class="nav-link" href="{{ route('patients.view.action-items', ['patient' => $patient]) }}">ERx/Orders</a>
+                            <a class="nav-link {{ strpos($routeName, 'patients.view.action-items') === 0 ? 'active' : '' }}"
+                               href="{{ route('patients.view.action-items', ['patient' => $patient]) }}">ERx/Orders</a>
                         </li>
                         <li class="nav-item">
-                            <a class="nav-link" href="{{ route('patients.view.allergies', ['patient' => $patient]) }}">Allergies</a>
+                            <a class="nav-link {{ strpos($routeName, 'patients.view.allergies') === 0 ? 'active' : '' }}"
+                               href="{{ route('patients.view.allergies', ['patient' => $patient]) }}">Allergies</a>
                         </li>
                         <li class="nav-item">
-                            <a class="nav-link" href="{{ route('patients.view.medications', ['patient' => $patient]) }}">Medications</a>
+                            <a class="nav-link {{ strpos($routeName, 'patients.view.medications') === 0 ? 'active' : '' }}"
+                               href="{{ route('patients.view.medications', ['patient' => $patient]) }}">Medications</a>
                         </li>
                         <li class="nav-item">
-                            <a class="nav-link" href="{{ route('patients.view.dx-and-focus-areas', ['patient' => $patient]) }}">Current Focus Areas</a>
+                            <a class="nav-link {{ strpos($routeName, 'patients.view.dx-and-focus-areas') === 0 ? 'active' : '' }}"
+                               href="{{ route('patients.view.dx-and-focus-areas', ['patient' => $patient]) }}">Current Focus Areas</a>
                         </li>
                         <li class="nav-item">
-                            <a class="nav-link" href="{{ route('patients.view.care-team', ['patient' => $patient]) }}">Care Team</a>
+                            <a class="nav-link {{ strpos($routeName, 'patients.view.care-team') === 0 ? 'active' : '' }}"
+                               href="{{ route('patients.view.care-team', ['patient' => $patient]) }}">Care Team</a>
                         </li>
                         <li class="nav-item">
-                            <a class="nav-link" href="{{ route('patients.view.history', ['patient' => $patient]) }}">History</a>
+                            <a class="nav-link {{ strpos($routeName, 'patients.view.history') === 0 ? 'active' : '' }}"
+                               href="{{ route('patients.view.history', ['patient' => $patient]) }}">History</a>
                         </li>
                         <li class="nav-item">
-                            <a class="nav-link" href="{{ route('patients.view.memos', ['patient' => $patient]) }}">Memos</a>
+                            <a class="nav-link {{ strpos($routeName, 'patients.view.memos') === 0 ? 'active' : '' }}"
+                               href="{{ route('patients.view.memos', ['patient' => $patient]) }}">Memos</a>
                         </li>
                         <li class="nav-item">
-                            <a class="nav-link" href="{{ route('patients.view.sms', ['patient' => $patient]) }}">SMS</a>
+                            <a class="nav-link {{ $routeName === 'patients.view.sms' ? 'active' : '' }}"
+                               href="{{ route('patients.view.sms', ['patient' => $patient]) }}">SMS</a>
                         </li>
                         <li class="nav-item">
-                            <a class="nav-link" href="{{ route('patients.view.sms-numbers', ['patient' => $patient]) }}">SMS Numbers</a>
+                            <a class="nav-link {{ strpos($routeName, 'patients.view.sms-numbers') === 0 ? 'active' : '' }}"
+                               href="{{ route('patients.view.sms-numbers', ['patient' => $patient]) }}">SMS Numbers</a>
                         </li>
                         <li class="nav-item">
-                            <a class="nav-link" href="{{ route('patients.view.documents', ['patient' => $patient]) }}">Documents</a>
+                            <a class="nav-link {{ strpos($routeName, 'patients.view.documents') === 0 ? 'active' : '' }}"
+                               href="{{ route('patients.view.documents', ['patient' => $patient]) }}">Documents</a>
                         </li>
                         <li class="nav-item">
-                            <a class="nav-link" href="{{ route('patients.view.demographics', ['patient' => $patient]) }}">Contact Info</a>
+                            <a class="nav-link {{ strpos($routeName, 'patients.view.demographics') === 0 ? 'active' : '' }}"
+                               href="{{ route('patients.view.demographics', ['patient' => $patient]) }}">Contact Info</a>
                         </li>
                         {{--<li class="nav-item">
                             <a class="nav-link" href="/patients/view/{{ $patient->uid }}/intake">Intake</a>