Kaynağa Gözat

Tree lines updates

Samson Mutunga 3 yıl önce
ebeveyn
işleme
ca01be0340

+ 26 - 15
resources/views/app/stat-tree/stat-trees/single.blade.php

@@ -1,24 +1,35 @@
 @extends ('layouts/template')
 @section('content')
 
-<div class="row">
-    <div class="col-md-12">
-        <div class="d-flex align-items-center justify-content-between">
-            <div class="d-flex align-items-center">
-            <h6 class="me-3">Name: {{ $statTree->name }}</h6>
-            <h6 class="me-3">Model: {{ $statTree->model }}</h6>
-            <h6 class="me-3">Slug: {{ $statTree->slug }}</h6>
+<main role="main" class="stag-content px-0">
+    <div class="p-3 mcp-theme-1">
+        <div class="card">
+            <div class="card-header">
+                <div class="d-flex align-items-center justify-content-between">
+                    <div class="d-flex align-items-center">
+                        <div class="mr-3">
+                            <span>Name:</span>
+                            <span class="font-weight-bold">{{ $statTree->name }}</span>
+                        </div>
+                        <div class="mr-3">
+                            <span>Model:</span>
+                            <span class="font-weight-bold">{{ $statTree->model }}</span>
+                        </div>
+                        <div class="mr-3">
+                            <span>Slug:</span>
+                            <span class="font-weight-bold">{{ $statTree->slug }}</span>
+                        </div>
+                    </div>
+                    <div>
+                        <a href="" class="btn btn-sm btn-primary text-white"><i class="fas fa-network-wired"></i> View All Stat Trees</a>
+                    </div>
+                </div>
             </div>
-            <div>
-                <form class="d-inline" action="{{ route('practice-management.api.statTree.delete', $statTree) }}" method="POST">
-                    @csrf
-                    <input type="hidden" name="id" value="{{ $statTree->id }}" />
-                    <button class="btn btn-sm btn-danger">Delete</button>
-                </form>
+            <div class="card-body">
+                @yield('page')
             </div>
         </div>
     </div>
-</div>
-@yield('page')
+</main>
 
 @endsection

+ 56 - 51
resources/views/app/stat-tree/stat-trees/sub/dashboard.blade.php

@@ -1,51 +1,56 @@
 @extends('app.stat-tree.stat-trees.single')
 @section('page')
 
-<h1>Lines</h1>
-
-<table class="table">
-    <thead>
-        <tr>
-            <th>#</th>
-            <th>Clauses</th>
-            <th>Query</th>
-            <th>Count</th>
-        </tr>
-    </thead>
-    @foreach($statTree->lines as $line)
-    <tr>
-        <td>
-            <a href="{{ route('practice-management.statTreeLines.view.dashboard', $line) }}">
-            {{ $line->tree_order_position_index }}
-            </a>
-        </td>
-        <td>
-            @foreach($line->lineClauses as $c)
-                | {{ $c->clause_label }}
-            @endforeach
-        </td>
-        <td>
-            SELECT COUNT(*) FROM {{ $statTree->model }} WHERE
-            @foreach($line->lineClauses as $c)
-                {{ $c->clause->clause_text }} @if(!$loop->last) AND @endif
-            @endforeach
-        </td>
-        <td>
-            {{ $line->last_refresh_count }}
-        </td>
-    </tr>
-    @endforeach
-</table>
-
-<hr>
-<h2>Replace Stat Tree Lines</h2>
+<div class="row">
+    @if(count($statTree->lines))
+    <div class="col-12">
+        <h6 class="font-weight-bold">Lines</h6>
+        <div class="table-responsive">
+            <table class="table table-condensed border p-0 m-0">
+                <thead class="bg-light">
+                    <tr>
+                        <th class="border-bottom-0">#</th>
+                        <th class="border-bottom-0">Clauses</th>
+                        <th class="border-bottom-0">Query</th>
+                        <th class="border-bottom-0">Count</th>
+                    </tr>
+                </thead>
+                <tbody>
+                    @foreach($statTree->lines as $line)
+                    <tr>
+                        <td>
+                            <a href="{{ route('practice-management.statTreeLines.view.dashboard', $line) }}">
+                                {{ $line->tree_order_position_index }}
+                            </a>
+                        </td>
+                        <td>
+                            @foreach($line->lineClauses as $c)
+                            | {{ $c->clause_label }}
+                            @endforeach
+                        </td>
+                        <td>
+                            SELECT COUNT(*) FROM {{ $statTree->model }} WHERE
+                            @foreach($line->lineClauses as $c)
+                            {{ $c->clause->clause_text }} @if(!$loop->last) AND @endif
+                            @endforeach
+                        </td>
+                        <td>
+                            {{ $line->last_refresh_count }}
+                        </td>
+                    </tr>
+                    @endforeach
+                </tbody>
+            </table>
+        </div>
+    </div>
+    @endif
 
-<div id="app">
-    <div class="container">
+    <div id="app" class="col-12">
+        <h6 class="font-weight-bold bg-light p-3 mt-3">Replace Stat Tree Lines</h6>
         <div class="row">
             <div class="col-md-6">
                 <div class="bg-white p-3">
-                    <h6>TSV</h6>
+                    <h6 class="font-weight-bold">TSV</h6>
                     <div class="input-group">
                         <textarea v-model="content" class="form-control" rows="10" @keyup="splitContents"></textarea>
                     </div>
@@ -53,7 +58,7 @@
             </div>
             <div class="col-md-6">
                 <div class="bg-white p-3">
-                    <h6>JSON Structure</h6>
+                    <h6 class="font-weight-bold">JSON Structure</h6>
                     <textarea class="form-control" rows="10">@{{jsonStructure}}</textarea>
                 </div>
             </div>
@@ -62,7 +67,7 @@
             <div class="row my-3">
                 <div class="col">
                     <div class="bg-white p-3">
-                        <h6>Table output:</h6>
+                        <h6 class="font-weight-bold">Table output:</h6>
                         <div class="table-responsive">
                             <table class="table table-bordered table-hover">
                                 <tbody>
@@ -80,11 +85,14 @@
         </template>
         <div class="row">
             <div class="col-md-12">
-                <button type="button" class="btn btn-sm btn-primary" @click="submit">Submit</button>
-                <button type="button" class="btn btn-sm btn-secondary" @click="generateAutoFilledJson">Fill</button>
+                <div class="px-3">
+                    <button type="button" class="btn btn-sm btn-primary" @click="submit">Submit</button>
+                    <button type="button" class="btn btn-sm btn-secondary" @click="generateAutoFilledJson">Fill</button>
+                </div>
             </div>
         </div>
     </div>
+
 </div>
 
 <script src="{{ asset('js/tsvToArray.js') }}"></script>
@@ -102,6 +110,7 @@
             jsonStructure: '',
             isAutoFilled: false
         },
+        delimiters: ['@{{', '}}'],
         methods: {
             updateColumns(rowIndex, columnIndex) {
                 try {
@@ -184,11 +193,7 @@
                 })
             }
         }
-    })
-
-    // Sam, write a function that takes the tsv array to text please. T
-    // Sorry, i haven't understood you well
-    //What if I add extra function to auto-fill his empty cells?
+    });
 </script>
 
-@endsection
+@endsection