mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 04:12:59 +00:00
Continue working on tasks feature
This commit is contained in:
@@ -158,6 +158,12 @@
|
||||
<span class="nav-link-text">{{ $L('Batteries') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
<li data-nav-for-page="taskcategories" data-sub-menu-of="#top-nav-manager-master-data">
|
||||
<a class="nav-link discrete-link" href="{{ $U('/taskcategories') }}">
|
||||
<i class="fas fa-project-diagram "></i>
|
||||
<span class="nav-link-text">{{ $L('Task categories') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
@@ -43,7 +43,7 @@
|
||||
<th>{{ $L('Product') }}</th>
|
||||
<th>{{ $L('Amount') }}</th>
|
||||
<th>{{ $L('Next best before date') }}</th>
|
||||
<th class="hidden">Hidden location</th>
|
||||
<th class="d-none">Hidden location</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -75,7 +75,7 @@
|
||||
<span id="product-{{ $currentStockEntry->product_id }}-next-best-before-date">{{ $currentStockEntry->best_before_date }}</span>
|
||||
<time id="product-{{ $currentStockEntry->product_id }}-next-best-before-date-timeago" class="timeago timeago-contextual" datetime="{{ $currentStockEntry->best_before_date }}"></time>
|
||||
</td>
|
||||
<td class="hidden">
|
||||
<td class="d-none">
|
||||
{{ FindObjectInArrayByPropertyValue($locations, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->location_id)->name }}
|
||||
</td>
|
||||
</tr>
|
||||
|
59
views/taskcategories.blade.php
Normal file
59
views/taskcategories.blade.php
Normal file
@@ -0,0 +1,59 @@
|
||||
@extends('layout.default')
|
||||
|
||||
@section('title', $L('Task categories'))
|
||||
@section('activeNav', 'taskcategories')
|
||||
@section('viewJsName', 'taskcategories')
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h1>
|
||||
@yield('title')
|
||||
<a class="btn btn-outline-dark" href="{{ $U('/taskcategory/new') }}">
|
||||
<i class="fas fa-plus"></i> {{ $L('Add') }}
|
||||
</a>
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="col-xs-12 col-md-6 col-xl-3">
|
||||
<label for="search">{{ $L('Search') }}</label> <i class="fas fa-search"></i>
|
||||
<input type="text" class="form-control" id="search">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<table id="taskcategories-table" class="table table-sm table-striped dt-responsive">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>{{ $L('Name') }}</th>
|
||||
<th>{{ $L('Description') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($taskCategories as $taskCategory)
|
||||
<tr>
|
||||
<td class="fit-content">
|
||||
<a class="btn btn-info btn-sm" href="{{ $U('/taskcategory/') }}{{ $taskCategory->id }}">
|
||||
<i class="fas fa-edit"></i>
|
||||
</a>
|
||||
<a class="btn btn-danger btn-sm task-category-delete-button" href="#" data-category-id="{{ $taskCategory->id }}" data-category-name="{{ $taskCategory->name }}">
|
||||
<i class="fas fa-trash"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
{{ $taskCategory->name }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $taskCategory->description }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
40
views/taskcategoryform.blade.php
Normal file
40
views/taskcategoryform.blade.php
Normal file
@@ -0,0 +1,40 @@
|
||||
@extends('layout.default')
|
||||
|
||||
@if($mode == 'edit')
|
||||
@section('title', $L('Edit task category'))
|
||||
@else
|
||||
@section('title', $L('Create task category'))
|
||||
@endif
|
||||
|
||||
@section('viewJsName', 'taskcategoryform')
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-xs-12">
|
||||
<h1>@yield('title')</h1>
|
||||
|
||||
<script>Grocy.EditMode = '{{ $mode }}';</script>
|
||||
|
||||
@if($mode == 'edit')
|
||||
<script>Grocy.EditObjectId = {{ $category->id }};</script>
|
||||
@endif
|
||||
|
||||
<form id="task-category-form" novalidate>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="name">{{ $L('Name') }}</label>
|
||||
<input type="text" class="form-control" required id="name" name="name" value="@if($mode == 'edit'){{ $category->name }}@endif">
|
||||
<div class="invalid-feedback">{{ $L('A name is required') }}</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="description">{{ $L('Description') }}</label>
|
||||
<textarea class="form-control" rows="2" id="description" name="description">@if($mode == 'edit'){{ $category->description }}@endif</textarea>
|
||||
</div>
|
||||
|
||||
<button id="save-task-category-button" type="submit" class="btn btn-success">{{ $L('Save') }}</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
@@ -32,14 +32,22 @@
|
||||
<textarea class="form-control" rows="2" id="description" name="description">@if($mode == 'edit'){{ $task->description }}@endif</textarea>
|
||||
</div>
|
||||
|
||||
@php
|
||||
$initialDueDate = null;
|
||||
if ($mode == 'edit')
|
||||
{
|
||||
$initialDueDate = date('Y-m-d', strtotime($task->due_date));
|
||||
}
|
||||
@endphp
|
||||
@include('components.datetimepicker', array(
|
||||
'id' => 'due',
|
||||
'id' => 'due_date',
|
||||
'label' => 'Due',
|
||||
'format' => 'YYYY-MM-DD',
|
||||
'initWithNow' => false,
|
||||
'initialValue' => $initialDueDate,
|
||||
'limitEndToNow' => false,
|
||||
'limitStartToNow' => false,
|
||||
'invalidFeedback' => $L('A due dat is required'),
|
||||
'invalidFeedback' => $L('A due date is required'),
|
||||
'nextInputSelector' => '',
|
||||
'additionalCssClasses' => 'date-only-datetimepicker',
|
||||
'isRequired' => false
|
||||
|
@@ -6,12 +6,23 @@
|
||||
|
||||
@push('pageScripts')
|
||||
<script src="{{ $U('/node_modules/jquery-ui-dist/jquery-ui.min.js?v=', true) }}{{ $version }}"></script>
|
||||
<script src="{{ $U('/node_modules/datatables.net-rowgroup/js/dataTables.rowGroup.min.js?v=', true) }}{{ $version }}"></script>
|
||||
<script src="{{ $U('/node_modules/datatables.net-rowgroup-bs4/js/rowGroup.bootstrap4.min.js?v=', true) }}{{ $version }}"></script>
|
||||
@endpush
|
||||
|
||||
@push('pageStyles')
|
||||
<link href="{{ $U('/node_modules/datatables.net-rowgroup-bs4/css/rowGroup.bootstrap4.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h1>@yield('title')</h1>
|
||||
<h1>
|
||||
@yield('title')
|
||||
<a class="btn btn-outline-dark responsive-button" href="{{ $U('/task/new') }}">
|
||||
<i class="fas fa-plus"></i> {{ $L('Add') }}
|
||||
</a>
|
||||
</h1>
|
||||
<p id="info-due-tasks" data-next-x-days="{{ $nextXDays }}" class="btn btn-lg btn-warning no-real-button responsive-button mr-2"></p>
|
||||
<p id="info-overdue-tasks" class="btn btn-lg btn-danger no-real-button responsive-button"></p>
|
||||
</div>
|
||||
@@ -32,19 +43,22 @@
|
||||
<th>#</th>
|
||||
<th>{{ $L('Aufgabe') }}</th>
|
||||
<th>{{ $L('Due') }}</th>
|
||||
<th class="d-none">Hidden category</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($tasks as $task)
|
||||
<tr id="task-{{ $task->id }}-row" class="@if($task->due < date('Y-m-d H:i:s')) table-danger @elseif($task->due < date('Y-m-d H:i:s', strtotime("+$nextXDays days"))) table-warning @endif">
|
||||
<tr id="task-{{ $task->id }}-row" class="@if($task->due_date < date('Y-m-d')) table-danger @elseif($task->due_date < date('Y-m-d', strtotime("+$nextXDays days"))) table-warning @endif">
|
||||
<td class="fit-content">
|
||||
<a class="btn btn-success btn-sm do-task-button" href="#" data-toggle="tooltip" title="{{ $L('Mark task "#1" as completed', $task->name) }}"
|
||||
data-task-id="{{ $task->id }}">
|
||||
data-task-id="{{ $task->id }}"
|
||||
data-task-name="{{ $task->name }}">
|
||||
<i class="fas fa-check"></i>
|
||||
</a>
|
||||
<a class="btn btn-success btn-sm start-task-button" href="#" data-toggle="tooltip" title="{{ $L('Start task "#1"', $task->name) }}"
|
||||
data-task-id="{{ $task->id }}">
|
||||
<i class="fas fa-play"></i>
|
||||
<a class="btn btn-sm btn-danger delete-task-button" href="#"
|
||||
data-task-id="{{ $task->id }}"
|
||||
data-task-name="{{ $task->name }}">
|
||||
<i class="fas fa-trash"></i>
|
||||
</a>
|
||||
<a class="btn btn-info btn-sm" href="{{ $U('/task/') }}{{ $task->id }}">
|
||||
<i class="fas fa-edit"></i>
|
||||
@@ -54,8 +68,11 @@
|
||||
{{ $task->name }}
|
||||
</td>
|
||||
<td>
|
||||
<span>{{ $task->due }}</span>
|
||||
<time class="timeago timeago-contextual" datetime="{{ $task->due }}"></time>
|
||||
<span>{{ $task->due_date }}</span>
|
||||
<time class="timeago timeago-contextual" datetime="{{ $task->due_date }}"></time>
|
||||
</td>
|
||||
<td class="d-none">
|
||||
@if($task->category_id !== null) <span>{{ FindObjectInArrayByPropertyValue($taskCategories, 'id', $task->category_id)->name }}</span> @else <span class="font-italic font-weight-light">{{ $L('Uncategorized') }}</span>@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
Reference in New Issue
Block a user