Selaa lähdekoodia

Stat tree edit (wip)

Vijayakrishnan 3 vuotta sitten
vanhempi
commit
846a39fc36
2 muutettua tiedostoa jossa 152 lisäystä ja 136 poistoa
  1. 7 0
      public/css/style.css
  2. 145 136
      resources/views/app/stat-tree/stat-trees/sub/edit.blade.php

+ 7 - 0
public/css/style.css

@@ -2754,6 +2754,13 @@ table.stag-compact-grid>tbody>tr>td [if-grid-view] {
     text-decoration: underline;
     margin-left: 10px;
 }
+.stat-tree .v-split {
+    width: 6px;
+    margin-left: -3px;
+    margin-top: 0;
+    height: 100%;
+    border-radius: 0;
+}
 .stat-tree-view .stat-tree-node {
     padding: 0.1rem 0.3rem;
 }

+ 145 - 136
resources/views/app/stat-tree/stat-trees/sub/edit.blade.php

@@ -93,10 +93,10 @@
                 </div>
             </div>
             <div class="card-body p-0 flex-grow-1">
-                <div id="statTreeEdit-{{$statTree->id}}" class="row m-0 h-100 {{$multiProView ? 'multi-pro-view' : ''}}">
+                <div id="statTreeEdit-{{$statTree->id}}" class="row m-0 h-100 stat-tree {{$multiProView ? 'multi-pro-view' : ''}}">
 
                     <!-- clauses -->
-                    <div class="col-3 p-0 h-100">
+                    <div class="col-3 p-0 h-100 clauses-column">
 
                         <div class="d-flex flex-column h-100">
                             <div class="d-flex align-items-center pl-2 height-35px border-bottom bg-light">
@@ -266,151 +266,155 @@
 
 
                     <!-- tree -->
-                    <div class="{{ !$multiProView ? 'col-5' : 'col-9' }} p-0 h-100 border-left border-right tree-column">
-                        <div class="d-flex flex-column h-100">
-                            <div class="d-flex align-items-center pl-2 height-35px border-bottom bg-light">
-                                <h6 class="font-weight-bold m-0 text-secondary">{{$statTree->name}}</h6>
-                                <span class="text-danger d-none if-changed ml-2 text-sm">(modified *)</span>
-                                @if($multiProView)
-                                    <div moe class="ml-3">
-                                        <a href="#" start show>Add Pro</a>
-                                        <div url="/nop">
-                                            <div class="mb-2">
-                                                <select id="proUid" class="form-control input-sm" provider-search provider-type="hcp">
-                                                    <option value="">--select--</option>
-                                                </select>
-                                            </div>
-                                            <div class="d-flex align-items-center">
-                                                <button class="btn btn-sm btn-primary mr-2 btn-add-pro" type="button">Add</button>
-                                                <button class="btn btn-sm btn-default mr-2 border" type="button" cancel>Cancel</button>
+                    <div class="col-9 p-0 h-100 border-left tree-column">
+                        <div class="row m-0 h-100">
+                            <div class="{{$multiProView ? 'col-12' : 'col-6'}} tree-lhs-column border-right h-100 p-0">
+                                <div class="d-flex flex-column h-100">
+                                    <div class="d-flex align-items-center pl-2 height-35px border-bottom bg-light">
+                                        <h6 class="font-weight-bold m-0 text-secondary">{{$statTree->name}}</h6>
+                                        <span class="text-danger d-none if-changed ml-2 text-sm">(modified *)</span>
+                                        @if($multiProView)
+                                            <div moe class="ml-3">
+                                                <a href="#" start show>Add Pro</a>
+                                                <div url="/nop">
+                                                    <div class="mb-2">
+                                                        <select id="proUid" class="form-control input-sm" provider-search provider-type="hcp">
+                                                            <option value="">--select--</option>
+                                                        </select>
+                                                    </div>
+                                                    <div class="d-flex align-items-center">
+                                                        <button class="btn btn-sm btn-primary mr-2 btn-add-pro" type="button">Add</button>
+                                                        <button class="btn btn-sm btn-default mr-2 border" type="button" cancel>Cancel</button>
+                                                    </div>
+                                                </div>
                                             </div>
+                                        @endif
+                                        <a href="#" id="refresh-counts" class="ml-3">Refresh Counts</a>
+                                        <a href="#" class="tree-expand-all ml-3" title="Expand All"><i class="fa fa-angle-double-down text-secondary"></i></a>
+                                        <a href="#" class="tree-collapse-all ml-2" title="Collapse All"><i class="fa fa-angle-double-up text-secondary"></i></a>
+                                        <div class="ml-auto mr-2 d-none if-changed">
+                                            <a href="#" class="btn btn-sm btn-primary text-white" id="btn-save-tree">Save</a>
+                                            <a href="#" class="ml-2 btn btn-sm btn-default border text-dark" onclick="return fastReload()">Reset</a>
                                         </div>
                                     </div>
-                                @endif
-                                <a href="#" id="refresh-counts" class="ml-3">Refresh Counts</a>
-                                <a href="#" class="tree-expand-all ml-3" title="Expand All"><i class="fa fa-angle-double-down text-secondary"></i></a>
-                                <a href="#" class="tree-collapse-all ml-2" title="Collapse All"><i class="fa fa-angle-double-up text-secondary"></i></a>
-                                <div class="ml-auto mr-2 d-none if-changed">
-                                    <a href="#" class="btn btn-sm btn-primary text-white" id="btn-save-tree">Save</a>
-                                    <a href="#" class="ml-2 btn btn-sm btn-default border text-dark" onclick="return fastReload()">Reset</a>
+                                    <div class="flex-grow-1 overflow-overlay-on-hover">
+                                        @if(!$multiProView)
+                                            <div class="stat-tree-view overflow-auto min-height-300px" id="stat-tree-edit-{{$statTree->id}}"></div>
+                                        @else
+                                            <div class="d-flex align-items-start">
+                                                <div class="">
+                                                    <div class="multi-pro-view-stat-label">Stat</div>
+                                                    <div class="stat-tree-view overflow-auto" id="stat-tree-edit-{{$statTree->id}}"></div>
+                                                </div>
+                                                <div class="flex-grow-1">
+                                                    <table class="table table-sm multi-pro-stats-table">
+                                                        <thead>
+                                                        <tr>
+                                                            <th {{$statTree->pro ? 'data-pro-uid="' . $statTree->pro->uid . '"' : ''}}>
+                                                                <div class="pro-label" title="{{$statTree->pro ? $statTree->pro->name_display : 'Total'}}">{{$statTree->pro ? $statTree->pro->name_display : 'Total'}}</div>
+                                                            </th>
+                                                            @foreach($multiPros as $multiPro)
+                                                                <th data-pro-uid="{{$multiPro->uid}}" count-required>
+                                                                    <div class="pro-label" title="{{$multiPro->name_display}}">{{$multiPro->name_display}}</div>
+                                                                </th>
+                                                            @endforeach
+                                                            <th></th>
+                                                        </tr>
+                                                        </thead>
+                                                        <tbody>
+                                                        @foreach($linesFlat as $line)
+                                                            <tr data-line-uid="{{$line->uid}}">
+                                                                <td class="p-0">
+                                                                    <div class="count-label">
+                                                                        <div class="count">{{$line->last_refresh_count}}</div>
+                                                                        <div class="drop-percent">50%  ⤵</div>
+                                                                    </div>
+                                                                </td>
+                                                                @foreach($multiPros as $multiPro)
+                                                                    <td class="p-0" data-pro-uid="{{$multiPro->uid}}">
+                                                                        <div class="count-label">
+                                                                            <div class="count">0</div>
+                                                                            <div class="drop-percent">0%  ⤵</div>
+                                                                        </div>
+                                                                    </td>
+                                                                @endforeach
+                                                                <td></td>
+                                                            </tr>
+                                                        @endforeach
+                                                        </tbody>
+                                                    </table>
+                                                </div>
+                                            </div>
+                                        @endif
+                                    </div>
                                 </div>
                             </div>
-                            <div class="flex-grow-1 overflow-overlay-on-hover">
-                                @if(!$multiProView)
-                                    <div class="stat-tree-view overflow-auto min-height-300px" id="stat-tree-edit-{{$statTree->id}}"></div>
-                                @else
-                                    <div class="d-flex align-items-start">
-                                        <div class="">
-                                            <div class="multi-pro-view-stat-label">Stat</div>
-                                            <div class="stat-tree-view overflow-auto" id="stat-tree-edit-{{$statTree->id}}"></div>
-                                        </div>
-                                        <div class="flex-grow-1">
-                                            <table class="table table-sm multi-pro-stats-table">
-                                                <thead>
-                                                <tr>
-                                                    <th {{$statTree->pro ? 'data-pro-uid="' . $statTree->pro->uid . '"' : ''}}>
-                                                        <div class="pro-label" title="{{$statTree->pro ? $statTree->pro->name_display : 'Total'}}">{{$statTree->pro ? $statTree->pro->name_display : 'Total'}}</div>
-                                                    </th>
-                                                    @foreach($multiPros as $multiPro)
-                                                        <th data-pro-uid="{{$multiPro->uid}}" count-required>
-                                                            <div class="pro-label" title="{{$multiPro->name_display}}">{{$multiPro->name_display}}</div>
-                                                        </th>
-                                                    @endforeach
-                                                    <th></th>
-                                                </tr>
-                                                </thead>
-                                                <tbody>
-                                                @foreach($linesFlat as $line)
-                                                <tr data-line-uid="{{$line->uid}}">
-                                                    <td class="p-0">
-                                                        <div class="count-label">
-                                                            <div class="count">{{$line->last_refresh_count}}</div>
-                                                            <div class="drop-percent">50%  ⤵</div>
+                            @if(!$multiProView)
+                                <!-- selected line properties -->
+                                <div class="col-6 tree-rhs-column h-100 p-0">
+                                    <div class="h-100 setup-column d-none" id="line-properties-column">
+                                        <div class="d-flex flex-column h-100">
+                                            <div class="d-flex align-items-center pl-2 height-35px border-bottom bg-light">
+                                                <h6 class="font-weight-bold m-0 text-secondary">Selected Line Properties</h6>
+                                            </div>
+                                            <div class="flex-grow-1 overflow-overlay-on-hover">
+                                                <div class="mb-3 d-flex align-items-baseline p-2 border-bottom font-weight-bold">
+                                                    <span line-label></span>
+                                                </div>
+                                                <div class="d-flex align-items-baseline mb-2 px-2">
+                                                    <h6 class="font-weight-bold m-0 text-secondary">Argument Values</h6>
+                                                    <!--<a href="#" class="ml-3 text-sm" onclick="$('.parent-arg').toggle(); return false;">Toggle Parent Clause Args</a>-->
+                                                </div>
+                                                <div class="px-2">
+                                                    <table class="table table-sm table-bordered table-striped">
+                                                        <thead>
+                                                        <tr>
+                                                            <th class="border-bottom-0 w-35">Arg</th>
+                                                            <th class="border-bottom-0 w-35">Value</th>
+                                                            <th class="border-bottom-0">Access</th>
+                                                        </tr>
+                                                        </thead>
+                                                        <tbody line-args>
+                                                        </tbody>
+                                                    </table>
+                                                </div>
+                                                <div class="d-flex align-items-baseline mb-2 border-top pt-3 px-2">
+                                                    <h6 class="font-weight-bold m-0 text-secondary">Report Columns</h6>
+                                                </div>
+                                                <div class="px-2">
+                                                    <div class="mb-2 d-flex align-items-baseline">
+                                                        <span class="text-secondary mr-1 text-nowrap">Quick Add:</span>
+                                                        <div class="flex-grow-1 position-relative">
+                                                            <input type="text"
+                                                                   name="displayKey"
+                                                                   class="form-control form-control-sm"
+                                                                   placeholder="Column name"
+                                                                   stag-suggest stag-suggest-left
+                                                                   stag-suggest-ep="/column-suggest"
+                                                                   stag-suggest-extra="table={{$statTree->model}}"
+                                                                   autocomplete="off">
                                                         </div>
-                                                    </td>
-                                                    @foreach($multiPros as $multiPro)
-                                                        <td class="p-0" data-pro-uid="{{$multiPro->uid}}">
-                                                            <div class="count-label">
-                                                                <div class="count">0</div>
-                                                                <div class="drop-percent">0%  ⤵</div>
-                                                            </div>
-                                                        </td>
-                                                    @endforeach
-                                                    <td></td>
-                                                </tr>
-                                                @endforeach
-                                                </tbody>
-                                            </table>
-                                        </div>
-                                    </div>
-                                @endif
-                            </div>
-                        </div>
-                    </div>
-
-
-                    <!-- selected line properties -->
-                    @if(!$multiProView)
-                        <div class="col-4 p-0 h-100 setup-column d-none" id="line-properties-column">
-                            <div class="d-flex flex-column h-100">
-                                <div class="d-flex align-items-center pl-2 height-35px border-bottom bg-light">
-                                    <h6 class="font-weight-bold m-0 text-secondary">Selected Line Properties</h6>
-                                </div>
-                                <div class="flex-grow-1 overflow-overlay-on-hover">
-                                    <div class="mb-3 d-flex align-items-baseline p-2 border-bottom font-weight-bold">
-                                        <span line-label></span>
-                                    </div>
-                                    <div class="d-flex align-items-baseline mb-2 px-2">
-                                        <h6 class="font-weight-bold m-0 text-secondary">Argument Values</h6>
-                                        <!--<a href="#" class="ml-3 text-sm" onclick="$('.parent-arg').toggle(); return false;">Toggle Parent Clause Args</a>-->
-                                    </div>
-                                    <div class="px-2">
-                                        <table class="table table-sm table-bordered table-striped">
-                                            <thead>
-                                            <tr>
-                                                <th class="border-bottom-0 w-35">Arg</th>
-                                                <th class="border-bottom-0 w-35">Value</th>
-                                                <th class="border-bottom-0">Access</th>
-                                            </tr>
-                                            </thead>
-                                            <tbody line-args>
-                                            </tbody>
-                                        </table>
-                                    </div>
-                                    <div class="d-flex align-items-baseline mb-2 border-top pt-3 px-2">
-                                        <h6 class="font-weight-bold m-0 text-secondary">Report Columns</h6>
-                                    </div>
-                                    <div class="px-2">
-                                        <div class="mb-2 d-flex align-items-baseline">
-                                            <span class="text-secondary mr-1 text-nowrap">Quick Add:</span>
-                                            <div class="flex-grow-1 position-relative">
-                                                <input type="text"
-                                                       name="displayKey"
-                                                       class="form-control form-control-sm"
-                                                       placeholder="Column name"
-                                                       stag-suggest stag-suggest-left
-                                                       stag-suggest-ep="/column-suggest"
-                                                       stag-suggest-extra="table={{$statTree->model}}"
-                                                       autocomplete="off">
+                                                    </div>
+                                                    <table class="table table-sm table-bordered table-striped">
+                                                        <thead>
+                                                        <tr>
+                                                            <th class="border-bottom-0 width-30px">#</th>
+                                                            <th class="border-bottom-0 w-35">Label</th>
+                                                            <th class="border-bottom-0">Column</th>
+                                                            <th class="border-bottom-0 width-60px"></th>
+                                                        </tr>
+                                                        </thead>
+                                                        <tbody line-columns>
+                                                        </tbody>
+                                                    </table>
+                                                </div>
                                             </div>
                                         </div>
-                                        <table class="table table-sm table-bordered table-striped">
-                                            <thead>
-                                            <tr>
-                                                <th class="border-bottom-0 width-30px">#</th>
-                                                <th class="border-bottom-0 w-35">Label</th>
-                                                <th class="border-bottom-0">Column</th>
-                                                <th class="border-bottom-0 width-60px"></th>
-                                            </tr>
-                                            </thead>
-                                            <tbody line-columns>
-                                            </tbody>
-                                        </table>
                                     </div>
                                 </div>
-                            </div>
+                            @endif
                         </div>
-                    @endif
+                    </div>
 
                 </div>
                 <script>
@@ -1145,6 +1149,11 @@
                                 ClausesTree.load();
                             });
 
+                            initVSplitter('stat-tree-edit-1', $('.clauses-column'), $('.tree-column'));
+                            @if(!$multiProView)
+                                initVSplitter('stat-tree-edit-2', $('.tree-lhs-column'), $('.tree-rhs-column'));
+                            @endif
+
                         }
                         addMCInitializer('stat-tree-edit-page', init, '#statTreeEdit-{{$statTree->id}}');
                     }).call(window);