Răsfoiți Sursa

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

Josh Kamau 5 ani în urmă
părinte
comite
3db109b890

+ 12 - 4
app/Console/Commands/GenerateTreeCommand.php

@@ -242,7 +242,7 @@ class GenerateTreeCommand extends Command
                             else if(strpos($line, "!col:") === 0) { // !col:
                                 if (!empty($currentMethod)) {
                                     $currentMethod->setColumnSpec(substr($line, 5), $exitURL,
-                                        $currentMethod->name === 'SUB_dashboard' ? 'record' : 'subRecord'
+                                        $currentMethod->dashboard ? 'record' : 'subRecord'
                                     );
                                 }
                             }
@@ -256,6 +256,11 @@ class GenerateTreeCommand extends Command
                                     $currentMethod->addColumnAction(substr($line, 5), $exitURL);
                                 }
                             }
+                            else if(strpos($line, "!nal:") === 0) { // !nal:
+                                if (!empty($currentMethod)) {
+                                    $currentMethod->noActionLinks = true;
+                                }
+                            }
                             else if(!empty($currentMethod)) {
                                 $currentMethod->data[] = $line;
                                 if($exitURL) {
@@ -735,12 +740,12 @@ class GenController {
         echo "Generated " . resource_path("views/{$controller->root}/{$controller->name}/{$method->name}.blade.php") . "\n";
     }
     public function generateSubContent(GenController $controller, GenControllerMethod $method, $text) {
-        if($method->name === 'SUB_dashboard') {
+        if($method->dashboard) {
             if(!isset($method->groups) || !count($method->groups)) {
-                $html = file_get_contents(base_path('generatecv/tree-templates/dashboard.template.blade.php'));
+                $html = file_get_contents(base_path('generatecv/tree-templates/dashboard' . ($method->noActionLinks ? '-nal' : '') . '.template.blade.php'));
             }
             else {
-                $html = file_get_contents(base_path('generatecv/tree-templates/dashboard-grouped.template.blade.php'));
+                $html = file_get_contents(base_path('generatecv/tree-templates/dashboard-grouped' . ($method->noActionLinks ? '-nal' : '') . '.template.blade.php'));
                 $groupsHtml = [];
                 $groupTemplate = file_get_contents(base_path('generatecv/tree-templates/dashboard-group.template.blade.php'));
                 foreach ($method->groups as $group) {
@@ -1025,6 +1030,8 @@ class GenControllerMethod {
     public $columns = [];
     public $columnActions = [];
     public $groups = [];
+    public $dashboard = false;
+    public $noActionLinks = false;
     public function __construct($name, $route)
     {
         $this->name = $name;
@@ -1066,6 +1073,7 @@ class GenControllerMethod {
             "name" => $parts[0],
             "fields" => explode(",", $parts[1])
         ];
+        $this->dashboard = true;
     }
     public function addColumnAction($line, $link) {
         // is_active:Deactivate:deactivate:edit:if:is_active

+ 7 - 0
generatecv/tree-templates/dashboard-grouped-nal.template.blade.php

@@ -0,0 +1,7 @@
+<div class="row mt-3">
+    <div class="col-12">
+
+        <!-- _GROUPS_ -->
+
+    </div>
+</div>

+ 23 - 0
generatecv/tree-templates/dashboard-nal.template.blade.php

@@ -0,0 +1,23 @@
+<div class="row mt-3">
+    <div class="col-12">
+
+        <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>
+                    <th colspan="2" class="px-2">Record Details</th>
+                </tr>
+                </thead>
+                <tbody>
+                @foreach($record as $k => $v)
+                    <tr>
+                        <td class="px-2 text-secondary border-right">{{ ucwords(str_replace("_", " ", $k)) }}</td>
+                        <td class="px-2 font-weight-bold">{{ $record->$k }}</td>
+                    </tr>
+                @endforeach
+                </tbody>
+            </table>
+        </div>
+
+    </div>
+</div>

+ 6 - 2
generatecv/tree.txt

@@ -38,6 +38,11 @@ PRO
                 !act:team_number:Update Team Number:pencil-alt=>/my_teams/view/$uid/ACTION_updateTeamNumber
                 !act:is_active:Deactivate:pencil-alt:if:is_active=>/my_teams/view/$uid/ACTION_deactivate
                 !act:is_active:Reactivate:pencil-alt:if-not:is_active=>/my_teams/view/$uid/ACTION_reactivate
+            edit_demographics
+                !grp:Basic Details:team_number,created_at,client_count,is_active
+                !act:is_active:Deactivate:pencil-alt:if:is_active=>/my_teams/view/$uid/ACTION_deactivate
+                !act:is_active:Reactivate:pencil-alt:if-not:is_active=>/my_teams/view/$uid/ACTION_reactivate
+                !nal:
             clients
                 id=client.team_id=>/my_clients/view/UID
                 !exc:id,uid
@@ -190,8 +195,7 @@ PRO
                 !act:name_display:putName:pencil-alt=>/my_clients/view/$uid/ACTION_putName
                 !act:gender:putGender:pencil-alt=>/my_clients/view/$uid/ACTION_putGender
                 !act:date_of_birth:putDateOfBirth:pencil-alt=>/my_clients/view/$uid/ACTION_putDateOfBirth
-                !act:mailing_address_zip:updateAddress:pencil-alt=>/my_clients/view/$uid/ACTION_updateAddress           
-            edit_demographics
+                !act:mailing_address_zip:updateAddress:pencil-alt=>/my_clients/view/$uid/ACTION_updateAddress
             med_profile
             med_profile_log
             pro_access