Demo project
This commit is contained in:
1 parent
5e4f3540e8
commit
a68267d0f0
146 files changed
+41587
No files matched your search
@@ -0,0 +1,316 @@
|
||||
<div x-data="{ modalFieldUpdate: @entangle('modalFieldUpdate'), modalColumnUpdate: @entangle('modalColumnUpdate'), modalDelete: @entangle('modalDelete') }">
|
||||
@if(\Auth::user()->hasPosts($year))
|
||||
<div>
|
||||
<div class="text-center" >
|
||||
<input wire:keydown.enter="quickinput" wire:model.defer="quickValue" name="quickValue" type="text" class="form-input px-2 py-2 rounded-md w-2/12" placeholder="Quick value ...">
|
||||
|
||||
<select wire:keydown.enter="quickinput" wire:model.defer="quickPostID" name="quickPostID" class="form-input px-2 rounded-md w-2/12" placeholder="Post ...">
|
||||
@foreach($categories as $category)
|
||||
<optgroup label="{{$category->name}}">
|
||||
@foreach($category->posts->where('year', $year) as $category)
|
||||
<option value="{{$category->id}}">{{$category->name}}</option>
|
||||
@endforeach
|
||||
</optgroup>
|
||||
@endforeach
|
||||
</select>
|
||||
|
||||
<select wire:keydown.enter="quickinput" wire:model.defer="quickMonth" name="quickMonth" class="form-input px-2 rounded-md w-1/12" placeholder="Month ...">
|
||||
<option value="1">January</option>
|
||||
<option value="2">February</option>
|
||||
<option value="3">March</option>
|
||||
<option value="4">April</option>
|
||||
<option value="5">May</option>
|
||||
<option value="6">June</option>
|
||||
<option value="7">July</option>
|
||||
<option value="8">August</option>
|
||||
<option value="9">September</option>
|
||||
<option value="10">October</option>
|
||||
<option value="11">November</option>
|
||||
<option value="12">December</option>
|
||||
</select>
|
||||
|
||||
<button wire:click="quickinput" class="form-input px-2 py-2 rounded-md color-white bg-green-200">Add</button>
|
||||
|
||||
<span class="border-left pl-3 ml-2">
|
||||
<a class="rounded-left color-white p-2 {{$switchValuesCSS}}" wire:click="switchMode('values')" href="javascript:;">Values</a><a class="rounded-right p-2 color-white {{$switchDifferenceCSS}}" wire:click="switchMode('difference')" href="javascript:;">Difference</a>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<table class="table border-collapse w-full mt-6">
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td wire:click="openColumnUpdate(1)" class="text-right border-left-weak font-bold @if(!$activeMonths[0]) col-muted @endif">Jan</td>
|
||||
<td wire:click="openColumnUpdate(2)" class="text-right border-left-weak font-bold @if(!$activeMonths[1]) col-muted @endif">Feb</td>
|
||||
<td wire:click="openColumnUpdate(3)" class="text-right border-left-weak font-bold @if(!$activeMonths[2]) col-muted @endif">Mar</td>
|
||||
<td wire:click="openColumnUpdate(4)" class="text-right border-left-weak font-bold @if(!$activeMonths[3]) col-muted @endif">Apr</td>
|
||||
<td wire:click="openColumnUpdate(5)" class="text-right border-left-weak font-bold @if(!$activeMonths[4]) col-muted @endif">May</td>
|
||||
<td wire:click="openColumnUpdate(6)" class="text-right border-left-weak font-bold @if(!$activeMonths[5]) col-muted @endif">Jun</td>
|
||||
<td wire:click="openColumnUpdate(7)" class="text-right border-left-weak font-bold @if(!$activeMonths[6]) col-muted @endif">Jul</td>
|
||||
<td wire:click="openColumnUpdate(8)" class="text-right border-left-weak font-bold @if(!$activeMonths[7]) col-muted @endif">Aug</td>
|
||||
<td wire:click="openColumnUpdate(9)" class="text-right border-left-weak font-bold @if(!$activeMonths[8]) col-muted @endif">Sep</td>
|
||||
<td wire:click="openColumnUpdate(10)" class="text-right border-left-weak font-bold @if(!$activeMonths[9]) col-muted @endif">Okt</td>
|
||||
<td wire:click="openColumnUpdate(11)" class="text-right border-left-weak font-bold @if(!$activeMonths[10]) col-muted @endif">Nov</td>
|
||||
<td wire:click="openColumnUpdate(12)" class="text-right border-left-weak font-bold @if(!$activeMonths[11]) col-muted @endif">Dec</td>
|
||||
<td class="text-right border-left font-bold italic">Avg</td>
|
||||
<td class="text-right border-left-weak font-bold">Total</td>
|
||||
</tr>
|
||||
@foreach($categories as $category)
|
||||
<tr>
|
||||
<td><strong>{{$category->name}}</strong></td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
</tr>
|
||||
@foreach($category->posts->where("year", $year) as $post)
|
||||
<tr>
|
||||
<td class="@if(!$loop->first) border-top-weak @endif"> {{$post->name}}</td>
|
||||
<td class="text-right border-left-weak @if(!$loop->first) border-top-weak @endif @if(!$activeMonths[0]) col-muted @endif">
|
||||
<div wire:click="openFieldUpdate({{$post->id}}, 1)">
|
||||
{!! $hf->number($post->monthActualValue(1, ($switchMode == "difference"))) !!}
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-right border-left-weak @if(!$loop->first) border-top-weak @endif @if(!$activeMonths[1]) col-muted @endif">
|
||||
<div wire:click="openFieldUpdate({{$post->id}}, 2)">
|
||||
{!! $hf->number($post->monthActualValue(2, ($switchMode == "difference"))) !!}
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-right border-left-weak @if(!$loop->first) border-top-weak @endif @if(!$activeMonths[2]) col-muted @endif">
|
||||
<div wire:click="openFieldUpdate({{$post->id}}, 3)">
|
||||
{!! $hf->number($post->monthActualValue(3, ($switchMode == "difference"))) !!}
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-right border-left-weak @if(!$loop->first) border-top-weak @endif @if(!$activeMonths[3]) col-muted @endif">
|
||||
<div wire:click="openFieldUpdate({{$post->id}}, 4)">
|
||||
{!! $hf->number($post->monthActualValue(4, ($switchMode == "difference"))) !!}
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-right border-left-weak @if(!$loop->first) border-top-weak @endif @if(!$activeMonths[4]) col-muted @endif">
|
||||
<div wire:click="openFieldUpdate({{$post->id}}, 5)">
|
||||
{!! $hf->number($post->monthActualValue(5, ($switchMode == "difference"))) !!}
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-right border-left-weak @if(!$loop->first) border-top-weak @endif @if(!$activeMonths[5]) col-muted @endif">
|
||||
<div wire:click="openFieldUpdate({{$post->id}}, 6)">
|
||||
{!! $hf->number($post->monthActualValue(6, ($switchMode == "difference"))) !!}
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-right border-left-weak @if(!$loop->first) border-top-weak @endif @if(!$activeMonths[6]) col-muted @endif">
|
||||
<div wire:click="openFieldUpdate({{$post->id}}, 7)">
|
||||
{!! $hf->number($post->monthActualValue(7, ($switchMode == "difference"))) !!}
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-right border-left-weak @if(!$loop->first) border-top-weak @endif @if(!$activeMonths[7]) col-muted @endif">
|
||||
<div wire:click="openFieldUpdate({{$post->id}}, 8)">
|
||||
{!! $hf->number($post->monthActualValue(8, ($switchMode == "difference"))) !!}
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-right border-left-weak @if(!$loop->first) border-top-weak @endif @if(!$activeMonths[8]) col-muted @endif">
|
||||
<div wire:click="openFieldUpdate({{$post->id}}, 9)">
|
||||
{!! $hf->number($post->monthActualValue(9, ($switchMode == "difference"))) !!}
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-right border-left-weak @if(!$loop->first) border-top-weak @endif @if(!$activeMonths[9]) col-muted @endif">
|
||||
<div wire:click="openFieldUpdate({{$post->id}}, 10)">
|
||||
{!! $hf->number($post->monthActualValue(10, ($switchMode == "difference"))) !!}
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-right border-left-weak @if(!$loop->first) border-top-weak @endif @if(!$activeMonths[10]) col-muted @endif">
|
||||
<div wire:click="openFieldUpdate({{$post->id}}, 11)">
|
||||
{!! $hf->number($post->monthActualValue(11, ($switchMode == "difference"))) !!}
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-right border-left-weak @if(!$loop->first) border-top-weak @endif @if(!$activeMonths[11]) col-muted @endif">
|
||||
<div wire:click="openFieldUpdate({{$post->id}}, 12)">
|
||||
{!! $hf->number($post->monthActualValue(12, ($switchMode == "difference"))) !!}
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-right border-left @if(!$loop->first) border-top-weak @endif italic">{!! $hf->number($post->avgActualValue($activeMonthCount, ($switchMode == "difference"))) !!}</td>
|
||||
<td class="text-right border-left-weak @if(!$loop->first) border-top-weak @endif font-bold">{!! $hf->number($post->totalActualValue(($switchMode == "difference"))) !!}</td></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
<tr>
|
||||
<td class="border-top"> </td>
|
||||
<td class="text-right border-left-weak font-bold border-top @if(!$activeMonths[0]) col-muted @endif">{!! $hf->number($category->monthActualValue($year, 1, ($switchMode == "difference"))) !!}</td>
|
||||
<td class="text-right border-left-weak font-bold border-top @if(!$activeMonths[1]) col-muted @endif">{!! $hf->number($category->monthActualValue($year, 2, ($switchMode == "difference"))) !!}</td>
|
||||
<td class="text-right border-left-weak font-bold border-top @if(!$activeMonths[2]) col-muted @endif">{!! $hf->number($category->monthActualValue($year, 3, ($switchMode == "difference"))) !!}</td>
|
||||
<td class="text-right border-left-weak font-bold border-top @if(!$activeMonths[3]) col-muted @endif">{!! $hf->number($category->monthActualValue($year, 4, ($switchMode == "difference"))) !!}</td>
|
||||
<td class="text-right border-left-weak font-bold border-top @if(!$activeMonths[4]) col-muted @endif">{!! $hf->number($category->monthActualValue($year, 5, ($switchMode == "difference"))) !!}</td>
|
||||
<td class="text-right border-left-weak font-bold border-top @if(!$activeMonths[5]) col-muted @endif">{!! $hf->number($category->monthActualValue($year, 6, ($switchMode == "difference"))) !!}</td>
|
||||
<td class="text-right border-left-weak font-bold border-top @if(!$activeMonths[6]) col-muted @endif">{!! $hf->number($category->monthActualValue($year, 7, ($switchMode == "difference"))) !!}</td>
|
||||
<td class="text-right border-left-weak font-bold border-top @if(!$activeMonths[7]) col-muted @endif">{!! $hf->number($category->monthActualValue($year, 8, ($switchMode == "difference"))) !!}</td>
|
||||
<td class="text-right border-left-weak font-bold border-top @if(!$activeMonths[8]) col-muted @endif">{!! $hf->number($category->monthActualValue($year, 9, ($switchMode == "difference"))) !!}</td>
|
||||
<td class="text-right border-left-weak font-bold border-top @if(!$activeMonths[9]) col-muted @endif">{!! $hf->number($category->monthActualValue($year, 10, ($switchMode == "difference"))) !!}</td>
|
||||
<td class="text-right border-left-weak font-bold border-top @if(!$activeMonths[10]) col-muted @endif">{!! $hf->number($category->monthActualValue($year, 11, ($switchMode == "difference"))) !!}</td>
|
||||
<td class="text-right border-left-weak font-bold border-top @if(!$activeMonths[11]) col-muted @endif">{!! $hf->number($category->monthActualValue($year, 12, ($switchMode == "difference"))) !!}</td>
|
||||
<td class="text-right border-left font-bold border-top italic">{!! $hf->number($category->avgActualValue($year, $activeMonthCount, ($switchMode == "difference"))) !!}</td>
|
||||
<td class="text-right border-left-weak font-bold border-top">{!! $hf->number($category->totalActualValue($year, ($switchMode == "difference"))) !!}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="border-top-strong"><strong>Total</strong></td>
|
||||
<td class="text-right border-left-weak border-top-strong font-bold @if(!$activeMonths[0]) col-muted @endif">{!! $hf->number(\Auth::user()->monthActualValue($categories, $year, 1, ($switchMode == "difference"))) !!}</td>
|
||||
<td class="text-right border-left-weak border-top-strong font-bold @if(!$activeMonths[1]) col-muted @endif">{!! $hf->number(\Auth::user()->monthActualValue($categories, $year, 2, ($switchMode == "difference"))) !!}</td>
|
||||
<td class="text-right border-left-weak border-top-strong font-bold @if(!$activeMonths[2]) col-muted @endif">{!! $hf->number(\Auth::user()->monthActualValue($categories, $year, 3, ($switchMode == "difference"))) !!}</td>
|
||||
<td class="text-right border-left-weak border-top-strong font-bold @if(!$activeMonths[3]) col-muted @endif">{!! $hf->number(\Auth::user()->monthActualValue($categories, $year, 4, ($switchMode == "difference"))) !!}</td>
|
||||
<td class="text-right border-left-weak border-top-strong font-bold @if(!$activeMonths[4]) col-muted @endif">{!! $hf->number(\Auth::user()->monthActualValue($categories, $year, 5, ($switchMode == "difference"))) !!}</td>
|
||||
<td class="text-right border-left-weak border-top-strong font-bold @if(!$activeMonths[5]) col-muted @endif">{!! $hf->number(\Auth::user()->monthActualValue($categories, $year, 6, ($switchMode == "difference"))) !!}</td>
|
||||
<td class="text-right border-left-weak border-top-strong font-bold @if(!$activeMonths[6]) col-muted @endif">{!! $hf->number(\Auth::user()->monthActualValue($categories, $year, 7, ($switchMode == "difference"))) !!}</td>
|
||||
<td class="text-right border-left-weak border-top-strong font-bold @if(!$activeMonths[7]) col-muted @endif">{!! $hf->number(\Auth::user()->monthActualValue($categories, $year, 8, ($switchMode == "difference"))) !!}</td>
|
||||
<td class="text-right border-left-weak border-top-strong font-bold @if(!$activeMonths[8]) col-muted @endif">{!! $hf->number(\Auth::user()->monthActualValue($categories, $year, 9, ($switchMode == "difference"))) !!}</td>
|
||||
<td class="text-right border-left-weak border-top-strong font-bold @if(!$activeMonths[9]) col-muted @endif">{!! $hf->number(\Auth::user()->monthActualValue($categories, $year, 10, ($switchMode == "difference"))) !!}</td>
|
||||
<td class="text-right border-left-weak border-top-strong font-bold @if(!$activeMonths[10]) col-muted @endif">{!! $hf->number(\Auth::user()->monthActualValue($categories, $year, 11, ($switchMode == "difference"))) !!}</td>
|
||||
<td class="text-right border-left-weak border-top-strong font-bold font-bold @if(!$activeMonths[11]) col-muted @endif">{!! $hf->number(\Auth::user()->monthActualValue($categories, $year, 12, ($switchMode == "difference"))) !!}</td>
|
||||
<td class="text-right border-left border-top-strong font-bold italic">{!! $hf->number(\Auth::user()->avgActualValue($categories, $year, $activeMonthCount, ($switchMode == "difference"))) !!}</td>
|
||||
<td class="text-right border-left-weak border-top-strong font-bold">{!! $hf->number(\Auth::user()->totalActualValue($categories, $year, ($switchMode == "difference"))) !!}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<script>
|
||||
window.addEventListener("load", function() {
|
||||
Livewire.on("focusField", inputName => {
|
||||
setTimeout(function() {
|
||||
$("input[name="+inputName+"]")[0].select();
|
||||
$("input[name="+inputName+"]")[0].focus();
|
||||
}, 100);
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
@else
|
||||
<div>
|
||||
<p class="text-center">
|
||||
No posts created ...
|
||||
</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="fixed z-10 inset-0 overflow-y-auto" style="display:none" aria-labelledby="modal-title-1" role="dialog" aria-modal="true" x-show="modalColumnUpdate">
|
||||
<div class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
|
||||
<div class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity" aria-hidden="true"></div>
|
||||
|
||||
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">​</span>
|
||||
|
||||
<div class="inline-block align-bottom bg-white rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-sm sm:w-full sm:p-6">
|
||||
<div>
|
||||
<div class="mt-1 text-center sm:mt-1">
|
||||
<h3 class="text-lg leading-6 font-medium text-gray-900" id="modal-title-1">
|
||||
{{$columnName}}
|
||||
</h3>
|
||||
<div class="mt-2">
|
||||
<p class="text-sm text-gray-500">
|
||||
Clear all values for month?<br>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-5 sm:mt-6 text-center">
|
||||
<button type="button" wire:click="updateColumn" class="inline-flex w-5/12 justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-yellow-600 text-base font-medium text-white hover:bg-yellow-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-yellow-500 sm:text-sm">
|
||||
Clear
|
||||
</button>
|
||||
<button type="button" wire:click="closeColumnUpdate" class="inline-flex w-5/12 justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-gray-600 text-base font-medium text-white hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 sm:text-sm">
|
||||
Cancel
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fixed z-10 inset-0 overflow-y-auto" style="display:none" aria-labelledby="modal-title-2" role="dialog" aria-modal="true" x-show="modalFieldUpdate">
|
||||
<div class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
|
||||
<div class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity" aria-hidden="true"></div>
|
||||
|
||||
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">​</span>
|
||||
|
||||
<div class="inline-block align-bottom bg-white rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-sm sm:w-full sm:p-6">
|
||||
<div>
|
||||
<div class="mt-1 text-center sm:mt-1">
|
||||
<h3 class="text-lg leading-6 font-medium text-gray-900" id="modal-title-2">
|
||||
{{$fieldName}} for ({{$fieldMonthName}})
|
||||
</h3>
|
||||
<div class="mt-2">
|
||||
<p class="text-sm text-gray-500">
|
||||
Added values (<span>{!!$fieldTypeHTML!!}</span>)<br>
|
||||
</p>
|
||||
<p>
|
||||
<span>{!! $fieldHistoryHTML !!}</span>
|
||||
</p>
|
||||
</div>
|
||||
<hr class="my-4">
|
||||
<input wire:keydown.enter="addValue" wire:model.defer="fieldAddValue" name="fieldAddValue" type="text" class="form-input px-2 py-2 rounded-md w-10/12" placeholder="Add value ...">
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-5 sm:mt-6 text-center">
|
||||
<button type="button" wire:click="addValue" class="inline-flex w-5/12 justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-green-600 text-base font-medium text-white hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 sm:text-sm">
|
||||
Add
|
||||
</button>
|
||||
<button type="button" wire:click="closeFieldUpdate" class="inline-flex w-5/12 justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-gray-600 text-base font-medium text-white hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 sm:text-sm">
|
||||
Close
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fixed z-10 inset-0 overflow-y-auto" style="display:none" aria-labelledby="modal-title-3" role="dialog" aria-modal="true" x-show="modalDelete">
|
||||
<div class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
|
||||
<div class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity" aria-hidden="true"></div>
|
||||
|
||||
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">​</span>
|
||||
|
||||
<div class="inline-block align-bottom bg-white rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-sm sm:w-full sm:p-6">
|
||||
<div>
|
||||
<div class="mt-1 text-center sm:mt-1">
|
||||
<h3 class="text-lg leading-6 font-medium text-gray-900" id="modal-title-3">
|
||||
{{$fieldName}} for ({{$fieldMonthName}})
|
||||
</h3>
|
||||
<div class="mt-2">
|
||||
<p class="text-sm text-gray-500">
|
||||
Delete value <span>{!!$deleteValueHTML!!}</span>?<br>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-5 sm:mt-6 text-center">
|
||||
<button type="button" wire:click="deleteValue" class="inline-flex w-5/12 justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:text-sm">
|
||||
Delete
|
||||
</button>
|
||||
<button type="button" wire:click="closeDelete" class="inline-flex w-5/12 justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-gray-600 text-base font-medium text-white hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 sm:text-sm">
|
||||
Cancel
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,51 @@
|
||||
<div class="text-center" x-data="{ deleteshow: false }">
|
||||
<input wire:keydown.enter="create" wire:model.defer="name" name="name" type="text" class="form-input px-2 py-1 rounded-md" placeholder="Category name ...">
|
||||
<button wire:click="create" class="form-input px-2 py-1 rounded-md color-white bg-green-200">Create</button>
|
||||
|
||||
<ul class="pt-6 w-4/12 m-auto text-left">
|
||||
@foreach($categories as $category)
|
||||
<li>
|
||||
<span class="text-sm text-gray-600">
|
||||
[
|
||||
<a href="javscript:;" class="text-blue-500" wire:click="moveUp({{$category->id}})">↑</a>
|
||||
<a href="javscript:;" class="text-blue-500" wire:click="moveDown({{$category->id}})">↓</a>
|
||||
<a href="javscript:;" class="text-red-500" wire:click="$set('deleteID', {{$category->id}})" @click="deleteshow=true">X</a>
|
||||
]
|
||||
</span>
|
||||
{{$category->name}}
|
||||
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
<div class="fixed z-10 inset-0 overflow-y-auto" aria-labelledby="modal-title" role="dialog" aria-modal="true" x-show="deleteshow">
|
||||
<div class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
|
||||
<div class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity" aria-hidden="true"></div>
|
||||
|
||||
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">​</span>
|
||||
|
||||
<div class="inline-block align-bottom bg-white rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-sm sm:w-full sm:p-6">
|
||||
<div>
|
||||
<div class="mt-1 text-center sm:mt-1">
|
||||
<h3 class="text-lg leading-6 font-medium text-gray-900" id="modal-title">
|
||||
Delete category?
|
||||
</h3>
|
||||
<div class="mt-2">
|
||||
<p class="text-sm text-gray-500">
|
||||
All posts and data related will also be removed.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-5 sm:mt-6 text-center">
|
||||
<button type="button" wire:click="delete" @click="deleteshow=false" class="inline-flex w-5/12 justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:text-sm">
|
||||
Delete
|
||||
</button>
|
||||
<button type="button" @click="deleteshow=false" class="inline-flex w-5/12 justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-gray-600 text-base font-medium text-white hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 sm:text-sm">
|
||||
Cancel
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,326 @@
|
||||
<div x-data="{ modalRowUpdate: @entangle('modalRowUpdate'), modalFieldUpdate: @entangle('modalFieldUpdate'), modalColumnUpdate: @entangle('modalColumnUpdate'), modalDelete: @entangle('modalDelete') }">
|
||||
<div class="text-center" >
|
||||
<input wire:keydown.enter="createPost" wire:model.defer="createName" name="createName" type="text" class="form-input px-2 py-2 rounded-md w-4/12" placeholder="Name ...">
|
||||
|
||||
<select wire:keydown.enter="createPost" wire:model="createType" name="createType" class="form-input px-2 rounded-md w-2/12" placeholder="Type ...">
|
||||
<option value="expense">Expense Type</option>
|
||||
<option value="income">Income Type</option>
|
||||
</select>
|
||||
|
||||
<select wire:keydown.enter="createPost" wire:model.defer="createCategoryID" name="createCategoryID" class="form-input px-2 rounded-md w-2/12" placeholder="Category ...">
|
||||
@foreach($categories as $category)
|
||||
<option value="{{$category->id}}">{{$category->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
|
||||
<button wire:click="createPost" class="form-input px-2 py-2 rounded-md color-white bg-green-200">Add</button>
|
||||
</div>
|
||||
|
||||
@if(\Auth::user()->hasPosts($year))
|
||||
<div>
|
||||
<table class="table border-collapse w-full mt-6">
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td wire:click="openColumnUpdate(1)" class="text-right border-left-weak font-bold @if(!$activeMonths[0]) col-muted @endif">Jan</td>
|
||||
<td wire:click="openColumnUpdate(2)" class="text-right border-left-weak font-bold @if(!$activeMonths[1]) col-muted @endif">Feb</td>
|
||||
<td wire:click="openColumnUpdate(3)" class="text-right border-left-weak font-bold @if(!$activeMonths[2]) col-muted @endif">Mar</td>
|
||||
<td wire:click="openColumnUpdate(4)" class="text-right border-left-weak font-bold @if(!$activeMonths[3]) col-muted @endif">Apr</td>
|
||||
<td wire:click="openColumnUpdate(5)" class="text-right border-left-weak font-bold @if(!$activeMonths[4]) col-muted @endif">May</td>
|
||||
<td wire:click="openColumnUpdate(6)" class="text-right border-left-weak font-bold @if(!$activeMonths[5]) col-muted @endif">Jun</td>
|
||||
<td wire:click="openColumnUpdate(7)" class="text-right border-left-weak font-bold @if(!$activeMonths[6]) col-muted @endif">Jul</td>
|
||||
<td wire:click="openColumnUpdate(8)" class="text-right border-left-weak font-bold @if(!$activeMonths[7]) col-muted @endif">Aug</td>
|
||||
<td wire:click="openColumnUpdate(9)" class="text-right border-left-weak font-bold @if(!$activeMonths[8]) col-muted @endif">Sep</td>
|
||||
<td wire:click="openColumnUpdate(10)" class="text-right border-left-weak font-bold @if(!$activeMonths[9]) col-muted @endif">Okt</td>
|
||||
<td wire:click="openColumnUpdate(11)" class="text-right border-left-weak font-bold @if(!$activeMonths[10]) col-muted @endif">Nov</td>
|
||||
<td wire:click="openColumnUpdate(12)" class="text-right border-left-weak font-bold @if(!$activeMonths[11]) col-muted @endif">Dec</td>
|
||||
<td class="text-right border-left font-bold italic">Avg</td>
|
||||
<td class="text-right border-left-weak font-bold">Total</td>
|
||||
</tr>
|
||||
@foreach($categories as $category)
|
||||
<tr>
|
||||
<td><strong>{{$category->name}}</strong></td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
</tr>
|
||||
@foreach($category->posts as $post)
|
||||
<tr>
|
||||
<td class="@if(!$loop->first) border-top-weak @endif">
|
||||
<div wire:click="openRowUpdate({{$post->id}})"> {{$post->name}}</div>
|
||||
</td>
|
||||
<td class="text-right border-left-weak @if(!$loop->first) border-top-weak @endif @if(!$activeMonths[0]) col-muted @endif">
|
||||
<div wire:click="openFieldUpdate({{$post->id}}, 1)">{!! $hf->number($post->monthValue(1)) !!}</div>
|
||||
</td>
|
||||
<td class="text-right border-left-weak @if(!$loop->first) border-top-weak @endif @if(!$activeMonths[1]) col-muted @endif">
|
||||
<div wire:click="openFieldUpdate({{$post->id}}, 2)">{!! $hf->number($post->monthValue(2)) !!}</div>
|
||||
</td>
|
||||
<td class="text-right border-left-weak @if(!$loop->first) border-top-weak @endif @if(!$activeMonths[2]) col-muted @endif">
|
||||
<div wire:click="openFieldUpdate({{$post->id}}, 3)">{!! $hf->number($post->monthValue(3)) !!}</div>
|
||||
</td>
|
||||
<td class="text-right border-left-weak @if(!$loop->first) border-top-weak @endif @if(!$activeMonths[3]) col-muted @endif">
|
||||
<div wire:click="openFieldUpdate({{$post->id}}, 4)">{!! $hf->number($post->monthValue(4)) !!}</div>
|
||||
</td>
|
||||
<td class="text-right border-left-weak @if(!$loop->first) border-top-weak @endif @if(!$activeMonths[4]) col-muted @endif">
|
||||
<div wire:click="openFieldUpdate({{$post->id}}, 5)">{!! $hf->number($post->monthValue(5)) !!}</div>
|
||||
</td>
|
||||
<td class="text-right border-left-weak @if(!$loop->first) border-top-weak @endif @if(!$activeMonths[5]) col-muted @endif">
|
||||
<div wire:click="openFieldUpdate({{$post->id}}, 6)">{!! $hf->number($post->monthValue(6)) !!}</div>
|
||||
</td>
|
||||
<td class="text-right border-left-weak @if(!$loop->first) border-top-weak @endif @if(!$activeMonths[6]) col-muted @endif">
|
||||
<div wire:click="openFieldUpdate({{$post->id}}, 7)">{!! $hf->number($post->monthValue(7)) !!}</div>
|
||||
</td>
|
||||
<td class="text-right border-left-weak @if(!$loop->first) border-top-weak @endif @if(!$activeMonths[7]) col-muted @endif">
|
||||
<div wire:click="openFieldUpdate({{$post->id}}, 8)">{!! $hf->number($post->monthValue(8)) !!}</div>
|
||||
</td>
|
||||
<td class="text-right border-left-weak @if(!$loop->first) border-top-weak @endif @if(!$activeMonths[8]) col-muted @endif">
|
||||
<div wire:click="openFieldUpdate({{$post->id}}, 9)">{!! $hf->number($post->monthValue(9)) !!}</div>
|
||||
</td>
|
||||
<td class="text-right border-left-weak @if(!$loop->first) border-top-weak @endif @if(!$activeMonths[9]) col-muted @endif">
|
||||
<div wire:click="openFieldUpdate({{$post->id}}, 10)">{!! $hf->number($post->monthValue(10)) !!}</div>
|
||||
</td>
|
||||
<td class="text-right border-left-weak @if(!$loop->first) border-top-weak @endif @if(!$activeMonths[10]) col-muted @endif">
|
||||
<div wire:click="openFieldUpdate({{$post->id}}, 11)">{!! $hf->number($post->monthValue(11)) !!}</div>
|
||||
</td>
|
||||
<td class="text-right border-left-weak @if(!$loop->first) border-top-weak @endif @if(!$activeMonths[11]) col-muted @endif">
|
||||
<div wire:click="openFieldUpdate({{$post->id}}, 12)">{!! $hf->number($post->monthValue(12)) !!}</div>
|
||||
</td>
|
||||
<td class="text-right border-left @if(!$loop->first) border-top-weak @endif italic">
|
||||
{!! $hf->number($post->avgValue($activeMonthCount)) !!}
|
||||
</td>
|
||||
<td class="text-right border-left-weak @if(!$loop->first) border-top-weak @endif font-bold">
|
||||
{!! $hf->number($post->totalValue()) !!}</td>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
<tr>
|
||||
<td class="border-top"> </td>
|
||||
<td class="text-right border-left-weak font-bold border-top @if(!$activeMonths[0]) col-muted @endif">{!! $hf->number($category->monthValue($year, 1)) !!}</td>
|
||||
<td class="text-right border-left-weak font-bold border-top @if(!$activeMonths[1]) col-muted @endif">{!! $hf->number($category->monthValue($year, 2)) !!}</td>
|
||||
<td class="text-right border-left-weak font-bold border-top @if(!$activeMonths[2]) col-muted @endif">{!! $hf->number($category->monthValue($year, 3)) !!}</td>
|
||||
<td class="text-right border-left-weak font-bold border-top @if(!$activeMonths[3]) col-muted @endif">{!! $hf->number($category->monthValue($year, 4)) !!}</td>
|
||||
<td class="text-right border-left-weak font-bold border-top @if(!$activeMonths[4]) col-muted @endif">{!! $hf->number($category->monthValue($year, 5)) !!}</td>
|
||||
<td class="text-right border-left-weak font-bold border-top @if(!$activeMonths[5]) col-muted @endif">{!! $hf->number($category->monthValue($year, 6)) !!}</td>
|
||||
<td class="text-right border-left-weak font-bold border-top @if(!$activeMonths[6]) col-muted @endif">{!! $hf->number($category->monthValue($year, 7)) !!}</td>
|
||||
<td class="text-right border-left-weak font-bold border-top @if(!$activeMonths[7]) col-muted @endif">{!! $hf->number($category->monthValue($year, 8)) !!}</td>
|
||||
<td class="text-right border-left-weak font-bold border-top @if(!$activeMonths[8]) col-muted @endif">{!! $hf->number($category->monthValue($year, 9)) !!}</td>
|
||||
<td class="text-right border-left-weak font-bold border-top @if(!$activeMonths[9]) col-muted @endif">{!! $hf->number($category->monthValue($year, 10)) !!}</td>
|
||||
<td class="text-right border-left-weak font-bold border-top @if(!$activeMonths[10]) col-muted @endif">{!! $hf->number($category->monthValue($year, 11)) !!}</td>
|
||||
<td class="text-right border-left-weak font-bold border-top @if(!$activeMonths[11]) col-muted @endif">{!! $hf->number($category->monthValue($year, 12)) !!}</td>
|
||||
<td class="text-right border-left font-bold border-top italic">{!! $hf->number($category->avgValue($year, $activeMonthCount)) !!}</td>
|
||||
<td class="text-right border-left-weak font-bold border-top">{!! $hf->number($category->totalValue($year)) !!}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
<td class="border-left"> </td>
|
||||
<td class="border-left-weak"> </td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="border-top-strong"><strong>Total</strong></td>
|
||||
<td class="text-right border-left-weak border-top-strong font-bold @if(!$activeMonths[0]) col-muted @endif">{!! $hf->number(\Auth::user()->monthValue($categories, $year, 1)) !!}</td>
|
||||
<td class="text-right border-left-weak border-top-strong font-bold @if(!$activeMonths[1]) col-muted @endif">{!! $hf->number(\Auth::user()->monthValue($categories, $year, 2)) !!}</td>
|
||||
<td class="text-right border-left-weak border-top-strong font-bold @if(!$activeMonths[2]) col-muted @endif">{!! $hf->number(\Auth::user()->monthValue($categories, $year, 3)) !!}</td>
|
||||
<td class="text-right border-left-weak border-top-strong font-bold @if(!$activeMonths[3]) col-muted @endif">{!! $hf->number(\Auth::user()->monthValue($categories, $year, 4)) !!}</td>
|
||||
<td class="text-right border-left-weak border-top-strong font-bold @if(!$activeMonths[4]) col-muted @endif">{!! $hf->number(\Auth::user()->monthValue($categories, $year, 5)) !!}</td>
|
||||
<td class="text-right border-left-weak border-top-strong font-bold @if(!$activeMonths[5]) col-muted @endif">{!! $hf->number(\Auth::user()->monthValue($categories, $year, 6)) !!}</td>
|
||||
<td class="text-right border-left-weak border-top-strong font-bold @if(!$activeMonths[6]) col-muted @endif">{!! $hf->number(\Auth::user()->monthValue($categories, $year, 7)) !!}</td>
|
||||
<td class="text-right border-left-weak border-top-strong font-bold @if(!$activeMonths[7]) col-muted @endif">{!! $hf->number(\Auth::user()->monthValue($categories, $year, 8)) !!}</td>
|
||||
<td class="text-right border-left-weak border-top-strong font-bold @if(!$activeMonths[8]) col-muted @endif">{!! $hf->number(\Auth::user()->monthValue($categories, $year, 9)) !!}</td>
|
||||
<td class="text-right border-left-weak border-top-strong font-bold @if(!$activeMonths[9]) col-muted @endif">{!! $hf->number(\Auth::user()->monthValue($categories, $year, 10)) !!}</td>
|
||||
<td class="text-right border-left-weak border-top-strong font-bold @if(!$activeMonths[10]) col-muted @endif">{!! $hf->number(\Auth::user()->monthValue($categories, $year, 11)) !!}</td>
|
||||
<td class="text-right border-left-weak border-top-strong font-bold font-bold @if(!$activeMonths[11]) col-muted @endif">{!! $hf->number(\Auth::user()->monthValue($categories, $year, 12)) !!}</td>
|
||||
<td class="text-right border-left border-top-strong font-bold italic">{!! $hf->number(\Auth::user()->avgValue($categories, $year, $activeMonthCount)) !!}</td>
|
||||
<td class="text-right border-left-weak border-top-strong font-bold">{!! $hf->number(\Auth::user()->totalValue($categories, $year)) !!}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@elseif(count($yearList) > 0)
|
||||
<div>
|
||||
<p class="text-center pt-6">
|
||||
or copy from:
|
||||
<br>
|
||||
|
||||
<select wire:keydown.enter="copyBudget" wire:model.defer="copyYear" name="copyYear" class="form-input px-2 rounded-md w-2/12" placeholder="Year ...">
|
||||
@foreach($yearList as $y)
|
||||
<option value="{{$y}}">{{$y}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
|
||||
<select wire:keydown.enter="copyBudget" wire:model.defer="copyMethod" name="copyMethod" class="form-input px-2 rounded-md w-2/12" placeholder="Method ...">
|
||||
<option value="full">With values</option>
|
||||
<option value="clean">Only posts</option>
|
||||
</select>
|
||||
|
||||
<button wire:click="copyBudget" class="form-input px-2 py-2 rounded-md color-white bg-green-200">Copy</button>
|
||||
</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="fixed z-10 inset-0 overflow-y-auto" style="display:none" aria-labelledby="modal-title-1" role="dialog" aria-modal="true" x-show="modalFieldUpdate">
|
||||
<div class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
|
||||
<div class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity" aria-hidden="true"></div>
|
||||
|
||||
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">​</span>
|
||||
|
||||
<div class="inline-block align-bottom bg-white rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-sm sm:w-full sm:p-6">
|
||||
<div>
|
||||
<div class="mt-1 text-center sm:mt-1">
|
||||
<h3 class="text-lg leading-6 font-medium text-gray-900" id="modal-title-1">
|
||||
{{$fieldName}} for ({{$fieldMonthName}})
|
||||
</h3>
|
||||
<div class="mt-2">
|
||||
<p class="text-sm text-gray-500">
|
||||
Set value (<span>{!!$fieldTypeHTML!!}</span>)<br>
|
||||
</p>
|
||||
</div>
|
||||
<input wire:keydown.enter="updateField" wire:model.defer="fieldValue" name="fieldValue" type="text" class="form-input px-2 py-2 rounded-md w-10/12" placeholder="Value for month ...">
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-5 sm:mt-6 text-center">
|
||||
<button type="button" wire:click="updateField" class="inline-flex w-5/12 justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-green-600 text-base font-medium text-white hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 sm:text-sm">
|
||||
Update
|
||||
</button>
|
||||
<button type="button" wire:click="closeFieldUpdate" class="inline-flex w-5/12 justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-gray-600 text-base font-medium text-white hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 sm:text-sm">
|
||||
Cancel
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fixed z-10 inset-0 overflow-y-auto" style="display:none" aria-labelledby="modal-title-2" role="dialog" aria-modal="true" x-show="modalRowUpdate">
|
||||
<div class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
|
||||
<div class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity" aria-hidden="true"></div>
|
||||
|
||||
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">​</span>
|
||||
|
||||
<div class="inline-block align-bottom bg-white rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-sm sm:w-full sm:p-6">
|
||||
<div>
|
||||
<div class="mt-1 text-center sm:mt-1">
|
||||
<h3 class="text-lg leading-6 font-medium text-gray-900" id="modal-title-2">
|
||||
{{$rowName}}
|
||||
</h3>
|
||||
<div class="mt-2">
|
||||
<p class="text-sm text-gray-500">
|
||||
Set value for all months (<span>{!!$rowTypeHTML!!}</span>)<br>
|
||||
</p>
|
||||
</div>
|
||||
<input wire:keydown.enter="updateRow" wire:model.defer="rowValue" name="rowValue" type="text" class="form-input px-2 py-2 rounded-md w-10/12" placeholder="Value for all months ...">
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-5 sm:mt-6 text-center">
|
||||
<button type="button" wire:click="updateRow" class="inline-flex w-5/12 justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-green-600 text-base font-medium text-white hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 sm:text-sm">
|
||||
Update
|
||||
</button>
|
||||
<button type="button" wire:click="closeRowUpdate" class="inline-flex w-5/12 justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-gray-600 text-base font-medium text-white hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 sm:text-sm">
|
||||
Cancel
|
||||
</button>
|
||||
<p class="pt-2 text-sm">
|
||||
or <a href="javascript:;" wire:click="openDelete" class="text-red-500">delete</a><br>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fixed z-10 inset-0 overflow-y-auto" style="display:none" aria-labelledby="modal-title-3" role="dialog" aria-modal="true" x-show="modalColumnUpdate">
|
||||
<div class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
|
||||
<div class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity" aria-hidden="true"></div>
|
||||
|
||||
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">​</span>
|
||||
|
||||
<div class="inline-block align-bottom bg-white rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-sm sm:w-full sm:p-6">
|
||||
<div>
|
||||
<div class="mt-1 text-center sm:mt-1">
|
||||
<h3 class="text-lg leading-6 font-medium text-gray-900" id="modal-title-3">
|
||||
{{$columnName}}
|
||||
</h3>
|
||||
<div class="mt-2">
|
||||
<p class="text-sm text-gray-500">
|
||||
Clear all values for month?<br>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-5 sm:mt-6 text-center">
|
||||
<button type="button" wire:click="updateColumn" class="inline-flex w-5/12 justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-yellow-600 text-base font-medium text-white hover:bg-yellow-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-yellow-500 sm:text-sm">
|
||||
Clear
|
||||
</button>
|
||||
<button type="button" wire:click="closeColumnUpdate" class="inline-flex w-5/12 justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-gray-600 text-base font-medium text-white hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 sm:text-sm">
|
||||
Cancel
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fixed z-10 inset-0 overflow-y-auto" style="display:none" aria-labelledby="modal-title-4" role="dialog" aria-modal="true" x-show="modalDelete">
|
||||
<div class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
|
||||
<div class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity" aria-hidden="true"></div>
|
||||
|
||||
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">​</span>
|
||||
|
||||
<div class="inline-block align-bottom bg-white rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-sm sm:w-full sm:p-6">
|
||||
<div>
|
||||
<div class="mt-1 text-center sm:mt-1">
|
||||
<h3 class="text-lg leading-6 font-medium text-gray-900" id="modal-title-4">
|
||||
Delete {{$deleteName}}?
|
||||
</h3>
|
||||
<div class="mt-2">
|
||||
<p class="text-sm text-gray-500">
|
||||
All data related will also be removed.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-5 sm:mt-6 text-center">
|
||||
<button type="button" wire:click="deletePost" class="inline-flex w-5/12 justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:text-sm">
|
||||
Delete
|
||||
</button>
|
||||
<button type="button" wire:click="closeDelete" class="inline-flex w-5/12 justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-gray-600 text-base font-medium text-white hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 sm:text-sm">
|
||||
Cancel
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
window.addEventListener("load", function() {
|
||||
Livewire.on("focusField", inputName => {
|
||||
setTimeout(function() {
|
||||
$("input[name="+inputName+"]")[0].select();
|
||||
$("input[name="+inputName+"]")[0].focus();
|
||||
}, 100);
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</div>
|
||||
Reference in new issue
Block a user