Explorar o código

Merge branch 'dev-vj' of rav.triplestart.com:TigerPHP/stagfe into dev-vj

Josh Kamau %!s(int64=5) %!d(string=hai) anos
pai
achega
c57401cef5

+ 23 - 6
app/Console/Commands/GenerateTreeCommand.php

@@ -96,6 +96,11 @@ class GenerateTreeCommand extends Command
                 $hasView = in_array("view", $tokens);
                 $hasRemove = in_array("remove", $tokens);
 
+                $icon = "user";
+                if(strpos($tokens[count($tokens) - 1], "icon:") === 0) {
+                    $icon = substr($tokens[count($tokens) - 1], 5);
+                }
+
                 switch($ls) {
 
                     case 4: // top level controller OR top level controller action
@@ -133,7 +138,7 @@ class GenerateTreeCommand extends Command
                             if(!empty($currentController)) {
                                 $currentController->save();
                             }
-                            $currentController = new GenController($currentRoot, $line);
+                            $currentController = new GenController($currentRoot, $line, $icon);
                             $currentController->dbTable = $dbTable;
                             $currentController->condition = $condition;
                             $currentController->hasAdd = $hasAdd;
@@ -149,7 +154,7 @@ class GenerateTreeCommand extends Command
                             $sideLinks[] = "<li class='nav-item'><a href='/{$currentController->name}' " .
                                 "class='nav-link " .
                                 "{{ (isset(request()->route()->getController()->selfName) && strpos(request()->route()->getController()->selfName, '{$currentController->name}') === 0 ? 'active' : '') }}" . " '>" .
-                                "<i class='nav-icon fa fa-user'></i>" .
+                                "<i class='nav-icon fa fa-$icon'></i>" .
                                 "<p>" . $currentController->snakeToTitleCase($currentController->name) . "</p>" .
                                 "</a></li>";
                         }
@@ -322,10 +327,12 @@ class GenController {
     public $parentControllerName = '';
     public $subLinksSaved = false;
     public $actionLinksSaved = false;
-    public function __construct($root = null, $name = null)
+    public $icon = "user";
+    public function __construct($root = null, $name = null, $icon = "user")
     {
         $this->root = $root;
         $this->name = $name;
+        $this->icon = $icon;
         $this->methods = [];
     }
     public function addMethod($method, $route) {
@@ -561,11 +568,21 @@ class GenController {
             unlink(resource_path("views/{$controller->root}/{$controller->parentControllerName}/actions.blade.php"));
         }
 
+        // write info view
+        $text = file_get_contents(base_path('generatecv/tree-templates/info.template.blade.php'));
+        $text = str_replace("_NAME_", $this->snakeToTitleCase($controller->name), $text);
+        $text = str_replace("_UID_", '<?= $record->uid ?>', $text);
+        $text = str_replace("_INDEX_ROUTE_", $controller->name . '-index', $text);
+        $this->file_force_contents(resource_path("views/{$controller->root}/{$controller->name}/info.blade.php"), $text);
+        echo "Generated " . resource_path("views/{$controller->root}/{$controller->name}/info.blade.php") . "\n";
+
+        // write main view
         $text = file_get_contents(base_path('generatecv/tree-templates/show.template.blade.php'));
         $text = str_replace("_NAME_", $this->snakeToTitleCase($controller->name), $text);
         $text = str_replace("_UID_", '<?= $record->uid ?>', $text);
         $text = str_replace("_INDEX_ROUTE_", $controller->name . '-index', $text);
         $text = str_replace("_SUB_LINKS_VIEW_", "{$controller->root}/{$controller->name}/subs", $text);
+        $text = str_replace("_INFO_VIEW_", "{$controller->root}/{$controller->name}/info", $text);
         $this->file_force_contents(resource_path("views/{$controller->root}/{$controller->name}/{$method->name}.blade.php"), $text);
         echo "Generated " . resource_path("views/{$controller->root}/{$controller->name}/{$method->name}.blade.php") . "\n";
     }
@@ -806,11 +823,11 @@ class GenController {
         }
         else {
             $text = str_replace("_SUB_VIEW_",
-                "<h4 class='py-3 border-bottom'>" .
-                $this->camelToTitleCase($this->snakeToTitleCase($method->name)) . "</h4>" .
+                "<h5 class='py-3 border-bottom'>" .
+                $this->camelToTitleCase($this->snakeToTitleCase($method->name)) . "</h5>" .
                 "Controller: <b>{$controller->name}</b><br>" .
                 "Action: <b>{$method->name}()</b><br>" .
-                "View: <b>{$controller->root}/{$controller->name}/{$method->name}.blade.php</b><br>",
+                "View: <b>{$controller->root}/{$controller->name}/{$method->name}.blade.php</b><br><br>",
                 $text);
         }
         return $text;

+ 1 - 1
generatecv/tree-templates/dashboard-group.template.blade.php

@@ -1,4 +1,4 @@
-<div class="table-responsive p-0 bg-white table-sm my-3">
+<div class="table-responsive p-0 bg-white table-sm mb-3">
     <table class="table table-hover text-nowrap table-striped border-left border-right border-bottom">
         <thead>
         <tr>

+ 4 - 4
generatecv/tree-templates/dashboard-grouped.template.blade.php

@@ -1,11 +1,11 @@
-<div class="row">
-    <div class="col-7">
+<div class="row mt-3">
+    <div class="col-8">
 
         <!-- _GROUPS_ -->
 
     </div>
-    <div class="col-5">
-        <div class="border-left h-100 pt-3 px-3">
+    <div class="col-4">
+        <div class="border-left h-100 pl-3">
             @include('_ACTION_LINKS_VIEW_')
         </div>
     </div>

+ 5 - 5
generatecv/tree-templates/dashboard.template.blade.php

@@ -1,7 +1,7 @@
-<div class="row">
-    <div class="col-7">
+<div class="row mt-3">
+    <div class="col-8">
 
-        <div class="table-responsive p-0 bg-white table-sm mt-3">
+        <div class="table-responsive p-0 bg-white table-sm">
             <table class="table table-hover text-nowrap table-striped border-left border-right border-bottom">
                 <thead>
                 <tr>
@@ -20,8 +20,8 @@
         </div>
 
     </div>
-    <div class="col-5">
-        <div class="border-left h-100 pt-3 px-3">
+    <div class="col-4">
+        <div class="border-left h-100 pl-3">
             @include('_ACTION_LINKS_VIEW_')
         </div>
     </div>

+ 7 - 0
generatecv/tree-templates/info.template.blade.php

@@ -0,0 +1,7 @@
+<div class="row">
+    <div class="col-12">
+        <h4 class="d-flex mb-3">
+            <div>_NAME_: Single [_UID_]</div>
+        </h4>
+    </div>
+</div>

+ 7 - 14
generatecv/tree-templates/show.template.blade.php

@@ -1,25 +1,18 @@
 @extends('layouts.pro-logged-in')
 @section('content')
 
-    <h3 class="d-flex mb-3">
-        <div>_NAME_: Single [_UID_]</div>
-        <div class="ml-auto">
-            <a class="btn btn-primary btn-sm" href="{{route('_INDEX_ROUTE_')}}">
-                <i class="fa fa-chevron-left" aria-hidden="true"></i>
-                Back
-            </a>
-        </div>
-    </h3>
-
     <div class="card">
-        <div class="row">
-            <div class="col-3">
+        <div class="d-flex align-items-stretch">
+            <div class="inner-side-nav">
                 <div class="border-right h-100">
                     @include('_SUB_LINKS_VIEW_')
                 </div>
             </div>
-            <div class="col-9">
-                @yield('content-inner')
+            <div class="flex-grow-1 p-3 mb-3 inner-content">
+                <div class="border-bottom">@include('_INFO_VIEW_')</div>
+                <div>
+                    @yield('content-inner')
+                </div>
             </div>
         </div>
     </div>

+ 3 - 3
generatecv/tree-templates/sub-index.template.blade.php

@@ -1,14 +1,14 @@
 @extends('_LAYOUT_')
 @section('content-inner')
 
-    <div class="mr-3 pb-3">
+    <div class="pb-3">
 
-        <h4 class='my-3 d-flex'>
+        <h5 class='my-3 d-flex'>
             <div>_NAME_</div>
             <div class="ml-auto">
                 <!-- _ADD_NEW_LINK_ -->
             </div>
-        </h4>
+        </h5>
 
         <div class="table-responsive p-0 bg-white border">
             <table class="table table-hover text-nowrap">

+ 25 - 25
generatecv/tree.txt

@@ -1,12 +1,12 @@
 PRO
 #    dashboard
-    my_payment_schedule|pro_rate:pro_id=OWN
+    my_payment_schedule|pro_rate:pro_id=OWN|icon:dollar-sign
         !inc:code,as_hcp_or_ally,amount,earnings
         !col:code:Code
         !col:as_hcp_or_ally:Description (HCP/Ally)
         !col:amount:Amount
         !col:earnings:Earnings:select '- TODO -' as result
-    my_teams|team|add|view
+my_teams|team|add|view
         !inc:@team_number,hcp_pro_id,ally_pro_id,client_count
         !col:hcp_pro_id:HCP:select name_display as result from pro where id = $hcp_pro_id limit 1=>/foo/bar/$hcp_pro_id
         !col:ally_pro_id:Ally Pro:select name_display as result from pro where id = $ally_pro_id limit 1
@@ -58,7 +58,7 @@ PRO
                     emailAddress*:email
                     medicareNumber
             audit_log
-    my_clients|client|add|view
+    my_clients|client|add|view|icon:user-injured
         !inc:@name_display,date_of_birth,gender,is_client_enrolled_in_cm,is_client_enrolled_in_rm,mcp_pro_id,ally_pro_id
         !col:name_display:Name
         !col:date_of_birth:DOB
@@ -240,7 +240,7 @@ PRO
             ally_updates
                 id=client_ally_update.client_id
             audit_log
-    notes|note|view
+    notes|note|view|icon:file-alt
         !inc:effective_dateest,client_id,hcp_pro_id,ally_pro_id,reasons,content_text,is_signed_by_ally,is_signed_by_hcp,billed
         !col:effective_dateest:Date
         !col:client_id:Client:select name_display as result FROM client WHERE id = $client_id
@@ -272,7 +272,7 @@ PRO
                     modifier
                     numberOfUnits:number
             audit_log
-    erx|action_item:action_item_category='RX'|view
+    erx|action_item:action_item_category='RX'|view|icon:file-signature
     erx/view/{uid}
         ACTIONS
             signAsPrescriber
@@ -289,7 +289,7 @@ PRO
         SUB
             dashboard
             audit_log
-    action_items|action_item|view
+    action_items|action_item|view|icon:tasks
     action_items/view/{uid}
         ACTIONS
             signAsPrescriber
@@ -306,7 +306,7 @@ PRO
         SUB
             dashboard
             audit_log
-    care_months|care_month|view
+    care_months|care_month|view|icon:calendar-plus
     care_months/view/{uid}
         ACTIONS
             putMcpPro
@@ -369,7 +369,7 @@ PRO
                     contentText
                     contentDetail
             audit_log
-    care_month_entries|care_month_entry|view
+    care_month_entries|care_month_entry|view|icon:calendar-alt
     care_month_entries/view/{uid}
         ACTIONS
             updateContent
@@ -383,7 +383,7 @@ PRO
                 endingTime
         SUB
             dashboard
-    bills|bill|view
+    bills|bill|view|icon:file-invoice-dollar
     bills/view/{uid}
         ACTIONS
             payHcpAmount
@@ -399,10 +399,10 @@ PRO
             transactions
                 id=pro_transaction.bill_id
             audit_log
-    transactions|pro_transaction
-    med_profile_lines|client_info_line
-    med_profile_line_updates|client_info_line_update
-    pro_access|client_pro_access|view
+    transactions|pro_transaction|icon:exchange-alt
+    med_profile_lines|client_info_line|icon:window-restore
+    med_profile_line_updates|client_info_line_update|icon:window-restore
+    pro_access|client_pro_access|view|icon:arrow-alt-circle-right
     pro_access/view/{uid}
         ACTIONS
             updateReason
@@ -418,13 +418,13 @@ PRO
                 memo=reactivation_memo
         SUB
             dashboard
-    mcp_updates|client_mcp_update
-    ally_updates|client_ally_update
+    mcp_updates|client_mcp_update|icon:user-edit
+    ally_updates|client_ally_update|icon:user-edit
 #   audit_log :: coming soon
 
 ADMIN
 #   admin_dashboard
-    facilities|facility|view
+    facilities|facility|view|icon:temperature-low
     facilities/add_new:create
     facilities/view/{uid}
         ACTIONS
@@ -455,7 +455,7 @@ ADMIN
             erx
             action_items
             audit_log
-    pros|pro|add|view
+    pros|pro|add|view|icon:user-md
     pros/add_new:create
         cellNumber:tel
         emailAddress:email
@@ -582,14 +582,14 @@ ADMIN
                     lobbyUid:record:lobby:uid,name
             sessions
             audit_log
-    pro_rates|pro_rate|view
+    pro_rates|pro_rate|view|icon:funnel-dollar
     pro_rates/view/{uid}
         ACTIONS
             updateAmount
                 newAmount:number=amount
         SUB
             dashboard
-    lobbies|lobby|add|view
+    lobbies|lobby|add|view|icon:hospital
     lobbies/add_new:create
         name
 		urlSlug
@@ -614,7 +614,7 @@ ADMIN
                     proUid:record:pro:uid,name_display
             meetings
                 id=meeting.lobby_id=>/meetings/view/UID
-    meetings|meeting|add|view
+    meetings|meeting|add|view|icon:handshake
     meetings/add_new:meetings:createAsProPerformer
         lobbyUid:record:lobby:uid,name
 		targetLobbyProUid:record:lobby_pro:uid,uid
@@ -662,26 +662,26 @@ ADMIN
                 id=meeting_knock.meeting_id=>/meeting_knocks/view/UID
             meeting_messages
                 id=meeting_message.meeting_id=>/meeting_messages/view/UID
-    meeting_participants|meeting_participant|view
+    meeting_participants|meeting_participant|view|icon:user
     meeting_participants/view/{uid}
         SUB
             dashboard
-    meeting_invitations|meeting_invitation|view
+    meeting_invitations|meeting_invitation|view|icon:envelope
     meeting_invitations/view/{uid}
         ACTIONS
             cancel
                 memo
         SUB
             dashboard
-    meeting_rings|meeting_ring|view
+    meeting_rings|meeting_ring|view|icon:phone
     meeting_rings/view/{uid}
         SUB
             dashboard
-    meeting_knocks|meeting_knock|view
+    meeting_knocks|meeting_knock|view|icon:door-closed
     meeting_knocks/view/{uid}
         SUB
             dashboard
-    meeting_messages|meeting_message|view
+    meeting_messages|meeting_message|view|icon:comments
     meeting_message/view/{uid}
         SUB
             dashboard

+ 7 - 1
resources/views/layouts/pro-logged-in.blade.php

@@ -24,7 +24,7 @@
         @keyframes spin { 100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); } }
     </style>
 </head>
-<body class="hold-transition sidebar-mini layout-fixed">
+<body class="hold-transition sidebar-mini layout-fixed sidebar-collapse">
 <div class="wrapper">
 
     <!-- Navbar -->
@@ -141,6 +141,12 @@
         border-radius: 8px;
         overflow: hidden;
     }
+    .inner-side-nav {
+        width: 200px;
+    }
+    .inner-content {
+        width: calc(100% - 200px);
+    }
 </style>
 
 <script>