|
@@ -4,21 +4,9 @@ if (!function_exists('renderStatTreeLineNodeEdit')) {
|
|
|
{
|
|
|
?>
|
|
|
<li class="jstree-open">
|
|
|
- <div class="d-inline-flex align-items-baseline stat-tree-line">
|
|
|
+ <div class="d-inline-flex align-items-baseline stat-tree-line" data-line-id="{{$line->id}}">
|
|
|
<span>{{$line->displayLabel()}}</span>
|
|
|
<span class="ml-2 text-secondary">({{(is_null($line->last_refresh_count) ? '-' : $line->last_refresh_count)}})</span>
|
|
|
- <div moe relative wide class="ml-3 mr-2">
|
|
|
- <a href="#" start show><i class="text-sm fa fa-trash-alt on-hover-opaque text-danger"></i></a>
|
|
|
- <form url="#">Foobar</form>
|
|
|
- </div>
|
|
|
- <div moe relative wide class="mr-2">
|
|
|
- <a href="#" start show class="text-sm">Cols</a>
|
|
|
- <form url="#">Foobar</form>
|
|
|
- </div>
|
|
|
- <div moe relative wide>
|
|
|
- <a href="#" start show class="text-sm">+Child</a>
|
|
|
- <form url="#">Move</form>
|
|
|
- </div>
|
|
|
</div>
|
|
|
<?php
|
|
|
if (count($line->children)) {
|
|
@@ -33,6 +21,35 @@ if (!function_exists('renderStatTreeLineNodeEdit')) {
|
|
|
<?php
|
|
|
}
|
|
|
}
|
|
|
+if (!function_exists('renderStatTreeLineNodeEdit_Moes')) {
|
|
|
+ function renderStatTreeLineNodeEdit_Moes($line)
|
|
|
+ {
|
|
|
+ ?>
|
|
|
+ <div class="d-flex align-items-baseline stat-tree-line">
|
|
|
+ <div moe relative center class="remove-line-moe-{{$line->id}}">
|
|
|
+ <a href="#" start show><i class="text-sm fa fa-trash-alt on-hover-opaque text-danger"></i></a>
|
|
|
+ <form url="{{ route("practice-management.api.statTreeLine.remove") }}" center>
|
|
|
+ @csrf
|
|
|
+ <input type="hidden" name="uid" value="{{$line->uid}}">
|
|
|
+ <p>Are you sure?</p>
|
|
|
+ <div class="d-flex align-items-center">
|
|
|
+ <button class="btn btn-sm btn-danger mr-2" type="button" submit>Remove</button>
|
|
|
+ <button class="btn btn-sm btn-default mr-2 border" type="button" cancel>Cancel</button>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <?php
|
|
|
+ if (count($line->children)) {
|
|
|
+ foreach ($line->children as $child) {
|
|
|
+ renderStatTreeLineNodeEdit_Moes($child);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ?>
|
|
|
+ </li>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+}
|
|
|
$statTree = \App\Models\StatTree::where('slug', $slug)->first();
|
|
|
?>
|
|
|
@if(@$statTree)
|
|
@@ -57,4 +74,11 @@ $statTree = \App\Models\StatTree::where('slug', $slug)->first();
|
|
|
@endforeach
|
|
|
</ul>
|
|
|
</div>
|
|
|
+ <div class="border mb-3 p-2 position-absolute" style="left: -10000px; top: -10000px;">
|
|
|
+ @foreach($statTree->lines as $line)
|
|
|
+ @if(!$line->parent_stat_tree_line_id)
|
|
|
+ <?php renderStatTreeLineNodeEdit_Moes($line); ?>
|
|
|
+ @endif
|
|
|
+ @endforeach
|
|
|
+ </div>
|
|
|
@endif
|