mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 04:12:59 +00:00
Reorganize project part 3
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
@extends('layout.default')
|
||||
|
||||
@section('title', 'Batteries')
|
||||
@section('activeNav', 'batteries')
|
||||
@section('viewJsName', 'batteries')
|
||||
|
||||
@section('content')
|
||||
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
|
||||
|
||||
@@ -21,27 +25,27 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($batteries as $battery) : ?>
|
||||
@foreach($batteries as $battery)
|
||||
<tr>
|
||||
<td class="fit-content">
|
||||
<a class="btn btn-info" href="/battery/<?php echo $battery->id; ?>" role="button">
|
||||
<a class="btn btn-info" href="/battery/{{ $battery->id }}" role="button">
|
||||
<i class="fa fa-pencil"></i>
|
||||
</a>
|
||||
<a class="btn btn-danger battery-delete-button" href="#" role="button" data-battery-id="<?php echo $battery->id; ?>" data-battery-name="<?php echo $battery->name; ?>">
|
||||
<a class="btn btn-danger battery-delete-button" href="#" role="button" data-battery-id="{{ $battery->id }}" data-battery-name="{{ $battery->name }}">
|
||||
<i class="fa fa-trash"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $battery->name; ?>
|
||||
{{ $battery->name }}
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $battery->description; ?>
|
||||
{{ $battery->description }}
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $battery->used_in; ?>
|
||||
{{ $battery->used_in }}
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
@@ -1,10 +1,9 @@
|
||||
<?php
|
||||
use Grocy\Services\BatteriesService;
|
||||
$batteriesService = new BatteriesService();
|
||||
?>
|
||||
|
||||
@extends('layout.default')
|
||||
|
||||
@section('title', 'Batteries overview')
|
||||
@section('activeNav', 'batteriesoverview')
|
||||
@section('viewJsName', 'batteriesoverview')
|
||||
|
||||
@section('content')
|
||||
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
|
||||
|
||||
@@ -20,25 +19,25 @@ $batteriesService = new BatteriesService();
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($current as $curentBatteryEntry) : ?>
|
||||
<tr class="<?php if (FindObjectInArrayByPropertyValue($batteries, 'id', $curentBatteryEntry->battery_id)->charge_interval_days > 0 && $batteriesService->GetNextChargeTime($curentBatteryEntry->battery_id) < date('Y-m-d H:i:s')) echo 'error-bg'; ?>">
|
||||
@foreach($current as $curentBatteryEntry)
|
||||
<tr class="@if(FindObjectInArrayByPropertyValue($batteries, 'id', $curentBatteryEntry->battery_id)->charge_interval_days > 0 && $nextChargeTimes[$curentBatteryEntry->battery_id] < date('Y-m-d H:i:s')) error-bg @endif">
|
||||
<td>
|
||||
<?php echo FindObjectInArrayByPropertyValue($batteries, 'id', $curentBatteryEntry->battery_id)->name; ?>
|
||||
{{ FindObjectInArrayByPropertyValue($batteries, 'id', $curentBatteryEntry->battery_id)->name }}
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $curentBatteryEntry->last_tracked_time; ?>
|
||||
<time class="timeago timeago-contextual" datetime="<?php echo $curentBatteryEntry->last_tracked_time; ?>"></time>
|
||||
{{ $curentBatteryEntry->last_tracked_time }}
|
||||
<time class="timeago timeago-contextual" datetime="{{ $curentBatteryEntry->last_tracked_time }}"></time>
|
||||
</td>
|
||||
<td>
|
||||
<?php if (FindObjectInArrayByPropertyValue($batteries, 'id', $curentBatteryEntry->battery_id)->charge_interval_days > 0): ?>
|
||||
<?php echo $batteriesService->GetNextChargeTime($curentBatteryEntry->battery_id); ?>
|
||||
<time class="timeago timeago-contextual" datetime="<?php echo $batteriesService->GetNextChargeTime($curentBatteryEntry->battery_id); ?>"></time>
|
||||
<?php else: ?>
|
||||
@if(FindObjectInArrayByPropertyValue($batteries, 'id', $curentBatteryEntry->battery_id)->charge_interval_days > 0)
|
||||
{{ $nextChargeTimes[$curentBatteryEntry->battery_id] }}
|
||||
<time class="timeago timeago-contextual" datetime="{{ $nextChargeTimes[$curentBatteryEntry->battery_id] }}"></time>
|
||||
@else
|
||||
...
|
||||
<?php endif; ?>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
@@ -1,32 +1,40 @@
|
||||
@extends('layout.default')
|
||||
|
||||
@if($mode == 'edit')
|
||||
@section('title', 'Edit battery')
|
||||
@else
|
||||
@section('title', 'Create battery')
|
||||
@endif
|
||||
|
||||
@section('viewJsName', 'batteryform')
|
||||
|
||||
@section('content')
|
||||
<div class="col-sm-3 col-sm-offset-3 col-md-4 col-md-offset-2 main">
|
||||
|
||||
<h1 class="page-header"><?php echo $title; ?></h1>
|
||||
<h1 class="page-header">@yield('title')</h1>
|
||||
|
||||
<script>Grocy.EditMode = '<?php echo $mode; ?>';</script>
|
||||
<script>Grocy.EditMode = '{{ $mode }}';</script>
|
||||
|
||||
<?php if ($mode == 'edit') : ?>
|
||||
<script>Grocy.EditObjectId = <?php echo $battery->id; ?>;</script>
|
||||
<?php endif; ?>
|
||||
@if($mode == 'edit')
|
||||
<script>Grocy.EditObjectId = {{ $battery->id }}</script>
|
||||
@endif
|
||||
|
||||
<form id="battery-form">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="name">Name</label>
|
||||
<input type="text" class="form-control" required id="name" name="name" value="<?php if ($mode == 'edit') echo $battery->name; ?>">
|
||||
<input type="text" class="form-control" required id="name" name="name" value="@if($mode == 'edit'){{ $battery->name }}@endif">
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="description">Description</label>
|
||||
<input type="text" class="form-control" id="description" name="description" value="<?php if ($mode == 'edit') echo $battery->description; ?>">
|
||||
<input type="text" class="form-control" id="description" name="description" value="@if($mode == 'edit'){{ $battery->description }}@endif">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="name">Used in</label>
|
||||
<input type="text" class="form-control" id="used_in" name="used_in" value="<?php if ($mode == 'edit') echo $battery->used_in; ?>">
|
||||
<input type="text" class="form-control" id="used_in" name="used_in" value="@if($mode == 'edit'){{ $battery->used_in }}@endif">
|
||||
</div>
|
||||
|
||||
<button id="save-battery-button" type="submit" class="btn btn-default">Save</button>
|
||||
|
@@ -1,5 +1,9 @@
|
||||
@extends('layout.default')
|
||||
|
||||
@section('title', 'Battery tracking')
|
||||
@section('activeNav', 'batterytracking')
|
||||
@section('viewJsName', 'batterytracking')
|
||||
|
||||
@section('content')
|
||||
<div class="col-sm-3 col-sm-offset-3 col-md-3 col-md-offset-2 main">
|
||||
|
||||
@@ -11,9 +15,9 @@
|
||||
<label for="battery_id">Battery</label>
|
||||
<select class="form-control combobox" id="battery_id" name="battery_id" required>
|
||||
<option value=""></option>
|
||||
<?php foreach ($batteries as $battery) : ?>
|
||||
<option value="<?php echo $battery->id; ?>"><?php echo $battery->name; ?></option>
|
||||
<?php endforeach; ?>
|
||||
@foreach($batteries as $battery)
|
||||
<option value="{{ $battery->id }}">{{ $battery->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<div id="battery-error" class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
@@ -1,5 +1,9 @@
|
||||
@extends('layout.default')
|
||||
|
||||
@section('title', 'Consume')
|
||||
@section('activeNav', 'consume')
|
||||
@section('viewJsName', 'consume')
|
||||
|
||||
@section('content')
|
||||
<div class="col-sm-3 col-sm-offset-3 col-md-3 col-md-offset-2 main">
|
||||
|
||||
@@ -11,9 +15,9 @@
|
||||
<label for="product_id">Product <i class="fa fa-barcode"></i></label>
|
||||
<select class="form-control combobox" id="product_id" name="product_id" required>
|
||||
<option value=""></option>
|
||||
<?php foreach ($products as $product) : ?>
|
||||
<option data-additional-searchdata="<?php echo $product->barcode; ?>" value="<?php echo $product->id; ?>"><?php echo $product->name; ?></option>
|
||||
<?php endforeach; ?>
|
||||
@foreach($products as $product)
|
||||
<option data-additional-searchdata="{{ $product->barcode }}" value="{{ $product->id }}">{{ $product->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<div id="product-error" class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
@@ -1,42 +1,50 @@
|
||||
@extends('layout.default')
|
||||
|
||||
@if($mode == 'edit')
|
||||
@section('title', 'Edit habit')
|
||||
@else
|
||||
@section('title', 'Create habit')
|
||||
@endif
|
||||
|
||||
@section('viewJsName', 'habitform')
|
||||
|
||||
@section('content')
|
||||
<div class="col-sm-3 col-sm-offset-3 col-md-4 col-md-offset-2 main">
|
||||
|
||||
<h1 class="page-header"><?php echo $title; ?></h1>
|
||||
<h1 class="page-header">@yield('title')</h1>
|
||||
|
||||
<script>Grocy.EditMode = '<?php echo $mode; ?>';</script>
|
||||
<script>Grocy.EditMode = '{{ $mode }}';</script>
|
||||
|
||||
<?php if ($mode == 'edit') : ?>
|
||||
<script>Grocy.EditObjectId = <?php echo $habit->id; ?>;</script>
|
||||
<?php endif; ?>
|
||||
@if($mode == 'edit')
|
||||
<script>Grocy.EditObjectId = {{ $habit->id }};</script>
|
||||
@endif
|
||||
|
||||
<form id="habit-form">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="name">Name</label>
|
||||
<input type="text" class="form-control" required id="name" name="name" value="<?php if ($mode == 'edit') echo $habit->name; ?>">
|
||||
<input type="text" class="form-control" required id="name" name="name" value="@if($mode == 'edit'){{ $habit->name }}@endif">
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="description">Description</label>
|
||||
<textarea class="form-control" rows="2" id="description" name="description"><?php if ($mode == 'edit') echo $habit->description; ?></textarea>
|
||||
<textarea class="form-control" rows="2" id="description" name="description">@if($mode == 'edit'){{ $habit->description }}@endif</textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="period_type">Period type</label>
|
||||
<select required class="form-control input-group-habit-period-type" id="period_type" name="period_type">
|
||||
<?php foreach ($periodTypes as $periodType) : ?>
|
||||
<option <?php if ($mode == 'edit' && $periodType == $habit->period_type) echo 'selected="selected"'; ?> value="<?php echo $periodType; ?>"><?php echo $periodType; ?></option>
|
||||
<?php endforeach; ?>
|
||||
@foreach($periodTypes as $periodType)
|
||||
<option @if($mode == 'edit' && $periodType == $habit->period_type) selected="selected" @endif value="{{ $periodType }}">{{ $periodType }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="period_days">Period days</label>
|
||||
<input type="number" class="form-control input-group-habit-period-type" id="period_days" name="period_days" value="<?php if ($mode == 'edit') echo $habit->period_days; ?>">
|
||||
<input type="number" class="form-control input-group-habit-period-type" id="period_days" name="period_days" value="@if($mode == 'edit'){{ $habit->period_days }}@endif">
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
|
@@ -1,5 +1,9 @@
|
||||
@extends('layout.default')
|
||||
|
||||
@section('title', 'Habits')
|
||||
@section('activeNav', 'habits')
|
||||
@section('viewJsName', 'habits')
|
||||
|
||||
@section('content')
|
||||
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
|
||||
|
||||
@@ -22,30 +26,30 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($habits as $habit) : ?>
|
||||
@foreach($habits as $habit)
|
||||
<tr>
|
||||
<td class="fit-content">
|
||||
<a class="btn btn-info" href="/habit/<?php echo $habit->id; ?>" role="button">
|
||||
<a class="btn btn-info" href="/habit/{{ $habit->id }}" role="button">
|
||||
<i class="fa fa-pencil"></i>
|
||||
</a>
|
||||
<a class="btn btn-danger habit-delete-button" href="#" role="button" data-habit-id="<?php echo $habit->id; ?>" data-habit-name="<?php echo $habit->name; ?>">
|
||||
<a class="btn btn-danger habit-delete-button" href="#" role="button" data-habit-id="{{ $habit->id }}" data-habit-name="{{ $habit->name }}">
|
||||
<i class="fa fa-trash"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $habit->name; ?>
|
||||
{{ $habit->name }}
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $habit->period_type; ?>
|
||||
{{ $habit->period_type }}
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $habit->period_days; ?>
|
||||
{{ $habit->period_days }}
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $habit->description; ?>
|
||||
{{ $habit->description }}
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
@@ -1,10 +1,9 @@
|
||||
<?php
|
||||
use Grocy\Services\HabitsService;
|
||||
$habitsService = new HabitsService();
|
||||
?>
|
||||
|
||||
@extends('layout.default')
|
||||
|
||||
@section('title', 'Habits overview')
|
||||
@section('activeNav', 'habitsoverview')
|
||||
@section('viewJsName', 'habitsoverview')
|
||||
|
||||
@section('content')
|
||||
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
|
||||
|
||||
@@ -20,25 +19,25 @@ $habitsService = new HabitsService();
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($currentHabits as $curentHabitEntry) : ?>
|
||||
<tr class="<?php if (FindObjectInArrayByPropertyValue($habits, 'id', $curentHabitEntry->habit_id)->period_type === HabitsService::HABIT_TYPE_DYNAMIC_REGULAR && $habitsService->GetNextHabitTime($curentHabitEntry->habit_id) < date('Y-m-d H:i:s')) echo 'error-bg'; ?>">
|
||||
@foreach($currentHabits as $curentHabitEntry)
|
||||
<tr class="@if(FindObjectInArrayByPropertyValue($habits, 'id', $curentHabitEntry->habit_id)->period_type === \Grocy\Services\HabitsService::HABIT_TYPE_DYNAMIC_REGULAR && $nextHabitTimes[$curentHabitEntry->habit_id] < date('Y-m-d H:i:s')) error-bg @endif">
|
||||
<td>
|
||||
<?php echo FindObjectInArrayByPropertyValue($habits, 'id', $curentHabitEntry->habit_id)->name; ?>
|
||||
{{ FindObjectInArrayByPropertyValue($habits, 'id', $curentHabitEntry->habit_id)->name }}
|
||||
</td>
|
||||
<td>
|
||||
<?php if (FindObjectInArrayByPropertyValue($habits, 'id', $curentHabitEntry->habit_id)->period_type === HabitsService::HABIT_TYPE_DYNAMIC_REGULAR): ?>
|
||||
<?php echo $habitsService->GetNextHabitTime($curentHabitEntry->habit_id); ?>
|
||||
<time class="timeago timeago-contextual" datetime="<?php echo $habitsService->GetNextHabitTime($curentHabitEntry->habit_id); ?>"></time>
|
||||
<?php else: ?>
|
||||
@if(FindObjectInArrayByPropertyValue($habits, 'id', $curentHabitEntry->habit_id)->period_type === \Grocy\Services\HabitsService::HABIT_TYPE_DYNAMIC_REGULAR)
|
||||
{{ $nextHabitTimes[$curentHabitEntry->habit_id] }}
|
||||
<time class="timeago timeago-contextual" datetime="{{ $nextHabitTimes[$curentHabitEntry->habit_id] }}"></time>
|
||||
@else
|
||||
...
|
||||
<?php endif; ?>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $curentHabitEntry->last_tracked_time; ?>
|
||||
<time class="timeago timeago-contextual" datetime="<?php echo $curentHabitEntry->last_tracked_time; ?>"></time>
|
||||
{{ $curentHabitEntry->last_tracked_time }}
|
||||
<time class="timeago timeago-contextual" datetime="{{ $curentHabitEntry->last_tracked_time }}"></time>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
@@ -1,5 +1,9 @@
|
||||
@extends('layout.default')
|
||||
|
||||
@section('title', 'Habit tracking')
|
||||
@section('activeNav', 'habittracking')
|
||||
@section('viewJsName', 'habittracking')
|
||||
|
||||
@section('content')
|
||||
<div class="col-sm-3 col-sm-offset-3 col-md-3 col-md-offset-2 main">
|
||||
|
||||
@@ -11,9 +15,9 @@
|
||||
<label for="habit_id">Habit</label>
|
||||
<select class="form-control combobox" id="habit_id" name="habit_id" required>
|
||||
<option value=""></option>
|
||||
<?php foreach ($habits as $habit) : ?>
|
||||
<option value="<?php echo $habit->id; ?>"><?php echo $habit->name; ?></option>
|
||||
<?php endforeach; ?>
|
||||
@foreach($habits as $habit)
|
||||
<option value="{{ $habit->id }}">{{ $habit->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<div id="product-error" class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
@@ -1,5 +1,9 @@
|
||||
@extends('layout.default')
|
||||
|
||||
@section('title', 'Inventory')
|
||||
@section('activeNav', 'inventory')
|
||||
@section('viewJsName', 'inventory')
|
||||
|
||||
@section('content')
|
||||
<div class="col-sm-4 col-sm-offset-3 col-md-3 col-md-offset-2 main">
|
||||
|
||||
@@ -11,9 +15,9 @@
|
||||
<label for="product_id">Product <i class="fa fa-barcode"></i><span id="barcode-lookup-disabled-hint" class="small text-muted hide"> Barcode lookup is disabled</span></label>
|
||||
<select class="form-control combobox" id="product_id" name="product_id" required>
|
||||
<option value=""></option>
|
||||
<?php foreach ($products as $product) : ?>
|
||||
<option data-additional-searchdata="<?php echo $product->barcode; ?>" value="<?php echo $product->id; ?>"><?php echo $product->name; ?></option>
|
||||
<?php endforeach; ?>
|
||||
@foreach($products as $product)
|
||||
<option data-additional-searchdata="{{ $product->barcode }}" value="{{ $product->id }}">{{ $product->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<div class="help-block with-errors"></div>
|
||||
<div id="flow-info-addbarcodetoselection" class="text-muted small hide"><strong><span id="addbarcodetoselection"></span></strong> will be added to the list of barcodes for the selected product on submit.</div>
|
||||
|
@@ -1,10 +1,3 @@
|
||||
<?php
|
||||
|
||||
use Grocy\Services\ApplicationService;
|
||||
$applicationService = new ApplicationService();
|
||||
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
@@ -18,22 +11,23 @@ $applicationService = new ApplicationService();
|
||||
<meta name="author" content="Bernd Bestel (bernd@berrnd.de)">
|
||||
<link rel="icon" type="image/png" sizes="200x200" href="/img/grocy.png">
|
||||
|
||||
<title><?php echo $title; ?> | grocy</title>
|
||||
<title>@yield('title') | grocy</title>
|
||||
|
||||
<link href="/bower_components/bootstrap/dist/css/bootstrap.min.css?v=<?php echo $applicationService->GetInstalledVersion(); ?>" rel="stylesheet">
|
||||
<link href="/bower_components/font-awesome/css/font-awesome.min.css?v=<?php echo $applicationService->GetInstalledVersion(); ?>" rel="stylesheet">
|
||||
<link href="/bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker3.min.css?v=<?php echo $applicationService->GetInstalledVersion(); ?>" rel="stylesheet">
|
||||
<link href="/bower_components/bootstrap-combobox/css/bootstrap-combobox.css?v=<?php echo $applicationService->GetInstalledVersion(); ?>" rel="stylesheet">
|
||||
<link href="/bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css?v=<?php echo $applicationService->GetInstalledVersion(); ?>" rel="stylesheet">
|
||||
<link href="/bower_components/datatables.net-responsive-bs/css/responsive.bootstrap.min.css?v=<?php echo $applicationService->GetInstalledVersion(); ?>" rel="stylesheet">
|
||||
<link href="/bower_components/toastr/toastr.min.css?v=<?php echo $applicationService->GetInstalledVersion(); ?>" rel="stylesheet">
|
||||
<link href="/bower_components/tagmanager/tagmanager.css?v=<?php echo $applicationService->GetInstalledVersion(); ?>" rel="stylesheet">
|
||||
<link href="/bower_components/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css?v=<?php echo $applicationService->GetInstalledVersion(); ?>" rel="stylesheet">
|
||||
<link href="/vendor_unmanaged/noto-sans-v6-latin/noto-sans-v6-latin.css?v=<?php echo $applicationService->GetInstalledVersion(); ?>" rel="stylesheet">
|
||||
<link href="/css/grocy.css?v=<?php echo $applicationService->GetInstalledVersion(); ?>" rel="stylesheet">
|
||||
<link href="/bower_components/bootstrap/dist/css/bootstrap.min.css?v={{ $version }}" rel="stylesheet">
|
||||
<link href="/bower_components/font-awesome/css/font-awesome.min.css?v={{ $version }}" rel="stylesheet">
|
||||
<link href="/bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker3.min.css?v={{ $version }}" rel="stylesheet">
|
||||
<link href="/bower_components/bootstrap-combobox/css/bootstrap-combobox.css?v={{ $version }}" rel="stylesheet">
|
||||
<link href="/bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css?v={{ $version }}" rel="stylesheet">
|
||||
<link href="/bower_components/datatables.net-responsive-bs/css/responsive.bootstrap.min.css?v={{ $version }}" rel="stylesheet">
|
||||
<link href="/bower_components/toastr/toastr.min.css?v={{ $version }}" rel="stylesheet">
|
||||
<link href="/bower_components/tagmanager/tagmanager.css?v={{ $version }}" rel="stylesheet">
|
||||
<link href="/bower_components/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css?v={{ $version }}" rel="stylesheet">
|
||||
<link href="/components_unmanaged/noto-sans-v6-latin/noto-sans-v6-latin.css?v={{ $version }}" rel="stylesheet">
|
||||
<link href="/css/grocy.css?v={{ $version }}" rel="stylesheet">
|
||||
|
||||
<script src="/bower_components/jquery/dist/jquery.min.js?v=<?php echo $applicationService->GetInstalledVersion(); ?>"></script>
|
||||
<script src="/js/grocy.js?v=<?php echo $applicationService->GetInstalledVersion(); ?>"></script>
|
||||
<script src="/bower_components/jquery/dist/jquery.min.js?v={{ $version }}"></script>
|
||||
<script src="/js/grocy.js?v={{ $version }}"></script>
|
||||
<script>Grocy.ActiveNav = '@yield('activeNav', '')';</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -59,54 +53,54 @@ $applicationService = new ApplicationService();
|
||||
<div id="navbar-mobile" class="navbar-collapse collapse">
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li data-nav-for-page="stockoverview.php">
|
||||
<li data-nav-for-page="stockoverview">
|
||||
<a class="discrete-link" href="/stockoverview"><i class="fa fa-tachometer fa-fw"></i> Stock overview</a>
|
||||
</li>
|
||||
<li data-nav-for-page="habitsoverview.php">
|
||||
<li data-nav-for-page="habitsoverview">
|
||||
<a class="discrete-link" href="/habitsoverview"><i class="fa fa-tachometer fa-fw"></i> Habits overview</a>
|
||||
</li>
|
||||
<li data-nav-for-page="batteriesoverview.php">
|
||||
<li data-nav-for-page="batteriesoverview">
|
||||
<a class="discrete-link" href="/batteriesoverview"><i class="fa fa-tachometer fa-fw"></i> Batteries overview</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li class="disabled"><a href="#"><strong>Record data</strong></a></li>
|
||||
<li data-nav-for-page="purchase.php">
|
||||
<li data-nav-for-page="purchase">
|
||||
<a class="discrete-link" href="/purchase"><i class="fa fa-shopping-cart fa-fw"></i> Purchase</a>
|
||||
</li>
|
||||
<li data-nav-for-page="consume.php">
|
||||
<li data-nav-for-page="consume">
|
||||
<a class="discrete-link" href="/consume"><i class="fa fa-cutlery fa-fw"></i> Consume</a>
|
||||
</li>
|
||||
<li data-nav-for-page="inventory.php">
|
||||
<li data-nav-for-page="inventory">
|
||||
<a class="discrete-link" href="/inventory"><i class="fa fa-list fa-fw"></i> Inventory</a>
|
||||
</li>
|
||||
<li data-nav-for-page="shoppinglist.php">
|
||||
<li data-nav-for-page="shoppinglist">
|
||||
<a class="discrete-link" href="/shoppinglist"><i class="fa fa-shopping-bag fa-fw"></i> Shopping list</a>
|
||||
</li>
|
||||
<li data-nav-for-page="habittracking.php">
|
||||
<li data-nav-for-page="habittracking">
|
||||
<a class="discrete-link" href="/habittracking"><i class="fa fa-play fa-fw"></i> Habit tracking</a>
|
||||
</li>
|
||||
<li data-nav-for-page="batterytracking.php">
|
||||
<li data-nav-for-page="batterytracking">
|
||||
<a class="discrete-link" href="/batterytracking"><i class="fa fa-fire fa-fw"></i> Battery tracking</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li class="disabled"><a href="#"><strong>Manage master data</strong></a></li>
|
||||
<li data-nav-for-page="products.php">
|
||||
<li data-nav-for-page="products">
|
||||
<a class="discrete-link" href="/products"><i class="fa fa-product-hunt fa-fw"></i> Products</a>
|
||||
</li>
|
||||
<li data-nav-for-page="locations.php">
|
||||
<li data-nav-for-page="locations">
|
||||
<a class="discrete-link" href="/locations"><i class="fa fa-map-marker fa-fw"></i> Locations</a>
|
||||
</li>
|
||||
<li data-nav-for-page="quantityunits.php">
|
||||
<li data-nav-for-page="quantityunits">
|
||||
<a class="discrete-link" href="/quantityunits"><i class="fa fa-balance-scale fa-fw"></i> Quantity units</a>
|
||||
</li>
|
||||
<li data-nav-for-page="habits.php">
|
||||
<li data-nav-for-page="habits">
|
||||
<a class="discrete-link" href="/habits"><i class="fa fa-refresh fa-fw"></i> Habits</a>
|
||||
</li>
|
||||
<li data-nav-for-page="batteries.php">
|
||||
<li data-nav-for-page="batteries">
|
||||
<a class="discrete-link" href="/batteries"><i class="fa fa-battery-three-quarters fa-fw"></i> Batteries</a>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -123,7 +117,7 @@ $applicationService = new ApplicationService();
|
||||
<br>
|
||||
Created with passion since 2017
|
||||
<br>
|
||||
Version <?php echo $applicationService->GetInstalledVersion(); ?>
|
||||
Version {{ $version }}
|
||||
<br>
|
||||
Life runs on code
|
||||
<br>
|
||||
@@ -142,54 +136,54 @@ $applicationService = new ApplicationService();
|
||||
<div class="col-sm-3 col-md-2 sidebar">
|
||||
|
||||
<ul class="nav nav-sidebar">
|
||||
<li data-nav-for-page="stockoverview.php">
|
||||
<li data-nav-for-page="stockoverview">
|
||||
<a class="discrete-link" href="/stockoverview"><i class="fa fa-tachometer fa-fw"></i> Stock overview</a>
|
||||
</li>
|
||||
<li data-nav-for-page="habitsoverview.php">
|
||||
<li data-nav-for-page="habitsoverview">
|
||||
<a class="discrete-link" href="/habitsoverview"><i class="fa fa-tachometer fa-fw"></i> Habits overview</a>
|
||||
</li>
|
||||
<li data-nav-for-page="batteriesoverview.php">
|
||||
<li data-nav-for-page="batteriesoverview">
|
||||
<a class="discrete-link" href="/batteriesoverview"><i class="fa fa-tachometer fa-fw"></i> Batteries overview</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav nav-sidebar">
|
||||
<li class="disabled"><a href="#"><strong>Record data</strong></a></li>
|
||||
<li data-nav-for-page="purchase.php">
|
||||
<li data-nav-for-page="purchase">
|
||||
<a class="discrete-link" href="/purchase"><i class="fa fa-shopping-cart fa-fw"></i> Purchase</a>
|
||||
</li>
|
||||
<li data-nav-for-page="consume.php">
|
||||
<li data-nav-for-page="consume">
|
||||
<a class="discrete-link" href="/consume"><i class="fa fa-cutlery fa-fw"></i> Consume</a>
|
||||
</li>
|
||||
<li data-nav-for-page="inventory.php">
|
||||
<li data-nav-for-page="inventory">
|
||||
<a class="discrete-link" href="/inventory"><i class="fa fa-list fa-fw"></i> Inventory</a>
|
||||
</li>
|
||||
<li data-nav-for-page="shoppinglist.php">
|
||||
<li data-nav-for-page="shoppinglist">
|
||||
<a class="discrete-link" href="/shoppinglist"><i class="fa fa-shopping-bag fa-fw"></i> Shopping list</a>
|
||||
</li>
|
||||
<li data-nav-for-page="habittracking.php">
|
||||
<li data-nav-for-page="habittracking">
|
||||
<a class="discrete-link" href="/habittracking"><i class="fa fa-play fa-fw"></i> Habit tracking</a>
|
||||
</li>
|
||||
<li data-nav-for-page="batterytracking.php">
|
||||
<li data-nav-for-page="batterytracking">
|
||||
<a class="discrete-link" href="/batterytracking"><i class="fa fa-fire fa-fw"></i> Battery tracking</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav nav-sidebar">
|
||||
<li class="disabled"><a href="#"><strong>Manage master data</strong></a></li>
|
||||
<li data-nav-for-page="products.php">
|
||||
<li data-nav-for-page="products">
|
||||
<a class="discrete-link" href="/products"><i class="fa fa-product-hunt fa-fw"></i> Products</a>
|
||||
</li>
|
||||
<li data-nav-for-page="locations.php">
|
||||
<li data-nav-for-page="locations">
|
||||
<a class="discrete-link" href="/locations"><i class="fa fa-map-marker fa-fw"></i> Locations</a>
|
||||
</li>
|
||||
<li data-nav-for-page="quantityunits.php">
|
||||
<li data-nav-for-page="quantityunits">
|
||||
<a class="discrete-link" href="/quantityunits"><i class="fa fa-balance-scale fa-fw"></i> Quantity units</a>
|
||||
</li>
|
||||
<li data-nav-for-page="habits.php">
|
||||
<li data-nav-for-page="habits">
|
||||
<a class="discrete-link" href="/habits"><i class="fa fa-refresh fa-fw"></i> Habits</a>
|
||||
</li>
|
||||
<li data-nav-for-page="batteries.php">
|
||||
<li data-nav-for-page="batteries">
|
||||
<a class="discrete-link" href="/batteries"><i class="fa fa-battery-three-quarters fa-fw"></i> Batteries</a>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -200,7 +194,7 @@ $applicationService = new ApplicationService();
|
||||
<br>
|
||||
Created with passion since 2017
|
||||
<br>
|
||||
Version <?php echo $applicationService->GetInstalledVersion(); ?>
|
||||
Version {{ $version }}
|
||||
<br>
|
||||
Life runs on code
|
||||
<br>
|
||||
@@ -211,33 +205,32 @@ $applicationService = new ApplicationService();
|
||||
|
||||
</div>
|
||||
|
||||
<script>Grocy.ContentPage = '{{ $contentPage }}';</script>
|
||||
@section('content')
|
||||
@show
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/bower_components/bootstrap/dist/js/bootstrap.min.js?v=<?php echo $applicationService->GetInstalledVersion(); ?>"></script>
|
||||
<script src="/bower_components/bootbox/bootbox.js?v=<?php echo $applicationService->GetInstalledVersion(); ?>"></script>
|
||||
<script src="/bower_components/jquery.serializeJSON/jquery.serializejson.min.js?v=<?php echo $applicationService->GetInstalledVersion(); ?>"></script>
|
||||
<script src="/bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js?v=<?php echo $applicationService->GetInstalledVersion(); ?>"></script>
|
||||
<script src="/bower_components/moment/min/moment.min.js?v=<?php echo $applicationService->GetInstalledVersion(); ?>"></script>
|
||||
<script src="/bower_components/bootstrap-validator/dist/validator.min.js?v=<?php echo $applicationService->GetInstalledVersion(); ?>"></script>
|
||||
<script src="/bower_components/bootstrap-combobox/js/bootstrap-combobox.js?v=<?php echo $applicationService->GetInstalledVersion(); ?>"></script>
|
||||
<script src="/bower_components/datatables.net/js/jquery.dataTables.min.js?v=<?php echo $applicationService->GetInstalledVersion(); ?>"></script>
|
||||
<script src="/bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js?v=<?php echo $applicationService->GetInstalledVersion(); ?>"></script>
|
||||
<script src="/bower_components/datatables.net-responsive/js/dataTables.responsive.min.js?v=<?php echo $applicationService->GetInstalledVersion(); ?>"></script>
|
||||
<script src="/bower_components/datatables.net-responsive-bs/js/responsive.bootstrap.min.js?v=<?php echo $applicationService->GetInstalledVersion(); ?>"></script>
|
||||
<script src="/bower_components/jquery-timeago/jquery.timeago.js?v=<?php echo $applicationService->GetInstalledVersion(); ?>"></script>
|
||||
<script src="/bower_components/toastr/toastr.min.js?v=<?php echo $applicationService->GetInstalledVersion(); ?>"></script>
|
||||
<script src="/bower_components/tagmanager/tagmanager.js?v=<?php echo $applicationService->GetInstalledVersion(); ?>"></script>
|
||||
<script src="/bower_components/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js?v=<?php echo $applicationService->GetInstalledVersion(); ?>"></script>
|
||||
<script src="/bower_components/bootstrap/dist/js/bootstrap.min.js?v={{ $version }}"></script>
|
||||
<script src="/bower_components/bootbox/bootbox.js?v={{ $version }}"></script>
|
||||
<script src="/bower_components/jquery.serializeJSON/jquery.serializejson.min.js?v={{ $version }}"></script>
|
||||
<script src="/bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js?v={{ $version }}"></script>
|
||||
<script src="/bower_components/moment/min/moment.min.js?v={{ $version }}"></script>
|
||||
<script src="/bower_components/bootstrap-validator/dist/validator.min.js?v={{ $version }}"></script>
|
||||
<script src="/bower_components/bootstrap-combobox/js/bootstrap-combobox.js?v={{ $version }}"></script>
|
||||
<script src="/bower_components/datatables.net/js/jquery.dataTables.min.js?v={{ $version }}"></script>
|
||||
<script src="/bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js?v={{ $version }}"></script>
|
||||
<script src="/bower_components/datatables.net-responsive/js/dataTables.responsive.min.js?v={{ $version }}"></script>
|
||||
<script src="/bower_components/datatables.net-responsive-bs/js/responsive.bootstrap.min.js?v={{ $version }}"></script>
|
||||
<script src="/bower_components/jquery-timeago/jquery.timeago.js?v={{ $version }}"></script>
|
||||
<script src="/bower_components/toastr/toastr.min.js?v={{ $version }}"></script>
|
||||
<script src="/bower_components/tagmanager/tagmanager.js?v={{ $version }}"></script>
|
||||
<script src="/bower_components/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js?v={{ $version }}"></script>
|
||||
|
||||
<?php if (file_exists(__DIR__ . '/../../public/viewjs/' . str_replace('.php', '.js', $contentPage))) : ?>
|
||||
<script src="/viewjs/<?php echo str_replace('.php', '.js', $contentPage) . '?v=' . $applicationService->GetInstalledVersion(); ?>"></script>
|
||||
<?php endif; ?>
|
||||
<script src="/viewjs/@yield('viewJsName').js"></script>
|
||||
|
||||
<?php if (file_exists(__DIR__ . '/../data/add_before_end_body.html')) include __DIR__ . '/../data/add_before_end_body.html' ?>
|
||||
@if(file_exists(__DIR__ . '/../../data/add_before_end_body.html'))
|
||||
@php include __DIR__ . '/../../data/add_before_end_body.html' @endphp
|
||||
@endif
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -1,27 +1,35 @@
|
||||
@extends('layout.default')
|
||||
|
||||
@if($mode == 'edit')
|
||||
@section('title', 'Edit location')
|
||||
@else
|
||||
@section('title', 'Create location')
|
||||
@endif
|
||||
|
||||
@section('viewJsName', 'locationform')
|
||||
|
||||
@section('content')
|
||||
<div class="col-sm-3 col-sm-offset-3 col-md-4 col-md-offset-2 main">
|
||||
|
||||
<h1 class="page-header"><?php echo $title; ?></h1>
|
||||
<h1 class="page-header">@yield('title')</h1>
|
||||
|
||||
<script>Grocy.EditMode = '<?php echo $mode; ?>';</script>
|
||||
<script>Grocy.EditMode = '{{ $mode }}';</script>
|
||||
|
||||
<?php if ($mode == 'edit') : ?>
|
||||
<script>Grocy.EditObjectId = <?php echo $location->id; ?>;</script>
|
||||
<?php endif; ?>
|
||||
@if($mode == 'edit')
|
||||
<script>Grocy.EditObjectId = {{ $location->id }};</script>
|
||||
@endif
|
||||
|
||||
<form id="location-form">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="name">Name</label>
|
||||
<input type="text" class="form-control" required id="name" name="name" value="<?php if ($mode == 'edit') echo $location->name; ?>">
|
||||
<input type="text" class="form-control" required id="name" name="name" value="@if($mode == 'edit'){{ $location->name }}@endif">
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="description">Description</label>
|
||||
<textarea class="form-control" rows="2" id="description" name="description"><?php if ($mode == 'edit') echo $location->description; ?></textarea>
|
||||
<textarea class="form-control" rows="2" id="description" name="description">@if($mode == 'edit'){{ $location->description }}@endif</textarea>
|
||||
</div>
|
||||
|
||||
<button id="save-location-button" type="submit" class="btn btn-default">Save</button>
|
||||
|
@@ -1,5 +1,9 @@
|
||||
@extends('layout.default')
|
||||
|
||||
@section('title', 'Locations')
|
||||
@section('activeNav', 'locations')
|
||||
@section('viewJsName', 'locations')
|
||||
|
||||
@section('content')
|
||||
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
|
||||
|
||||
@@ -20,24 +24,24 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($locations as $location) : ?>
|
||||
@foreach($locations as $location)
|
||||
<tr>
|
||||
<td class="fit-content">
|
||||
<a class="btn btn-info" href="/location/<?php echo $location->id; ?>" role="button">
|
||||
<a class="btn btn-info" href="/location/{{ $location->id }}" role="button">
|
||||
<i class="fa fa-pencil"></i>
|
||||
</a>
|
||||
<a class="btn btn-danger location-delete-button" href="#" role="button" data-location-id="<?php echo $location->id; ?>" data-location-name="<?php echo $location->name; ?>">
|
||||
<a class="btn btn-danger location-delete-button" href="#" role="button" data-location-id="{{ $location->id }}" data-location-name="{{ $location->name }}">
|
||||
<i class="fa fa-trash"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $location->name; ?>
|
||||
{{ $location->name }}
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $location->description; ?>
|
||||
{{ $location->description }}
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
@@ -1,5 +1,8 @@
|
||||
@extends('layout.default')
|
||||
|
||||
@section('title', 'Login')
|
||||
@section('viewJsName', 'login')
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-4 col-md-offset-5 main">
|
||||
|
||||
|
@@ -1,27 +1,35 @@
|
||||
@extends('layout.default')
|
||||
|
||||
@if($mode == 'edit')
|
||||
@section('title', 'Edit product')
|
||||
@else
|
||||
@section('title', 'Create product')
|
||||
@endif
|
||||
|
||||
@section('viewJsName', 'productform')
|
||||
|
||||
@section('content')
|
||||
<div class="col-sm-3 col-sm-offset-3 col-md-4 col-md-offset-2 main">
|
||||
|
||||
<h1 class="page-header"><?php echo $title; ?></h1>
|
||||
<h1 class="page-header">@yield('title')</h1>
|
||||
|
||||
<script>Grocy.EditMode = '<?php echo $mode; ?>';</script>
|
||||
<script>Grocy.EditMode = '{{ $mode }}';</script>
|
||||
|
||||
<?php if ($mode == 'edit') : ?>
|
||||
<script>Grocy.EditObjectId = <?php echo $product->id; ?>;</script>
|
||||
<?php endif; ?>
|
||||
@if($mode == 'edit')
|
||||
<script>Grocy.EditObjectId = {{ $product->id }};</script>
|
||||
@endif
|
||||
|
||||
<form id="product-form">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="name">Name</label>
|
||||
<input type="text" class="form-control" required id="name" name="name" value="<?php if ($mode == 'edit') echo $product->name; ?>">
|
||||
<input type="text" class="form-control" required id="name" name="name" value="@if($mode == 'edit'){{ $product->name}}@endif">
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="description">Description</label>
|
||||
<textarea class="form-control" rows="2" id="description" name="description"><?php if ($mode == 'edit') echo $product->description; ?></textarea>
|
||||
<textarea class="form-control" rows="2" id="description" name="description">@if($mode == 'edit'){{ $product->description }}@endif</textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group tm-group">
|
||||
@@ -33,31 +41,31 @@
|
||||
<div class="form-group">
|
||||
<label for="location_id">Location</label>
|
||||
<select required class="form-control" id="location_id" name="location_id">
|
||||
<?php foreach ($locations as $location) : ?>
|
||||
<option <?php if ($mode == 'edit' && $location->id == $product->location_id) echo 'selected="selected"'; ?> value="<?php echo $location->id; ?>"><?php echo $location->name; ?></option>
|
||||
<?php endforeach; ?>
|
||||
@foreach($locations as $location)
|
||||
<option @if($mode == 'edit' && $location->id == $product->location_id) selected="selected" @endif value="{{ $location->id }}">{{ $location->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="min_stock_amount">Minimum stock amount</label>
|
||||
<input required min="0" type="number" class="form-control" id="min_stock_amount" name="min_stock_amount" value="<?php if ($mode == 'edit') echo $product->min_stock_amount; else echo '0'; ?>">
|
||||
<input required min="0" type="number" class="form-control" id="min_stock_amount" name="min_stock_amount" value="@if($mode == 'edit'){{ $product->min_stock_amount }}@else{{0}}@endif">
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="default_best_before_days">Default best before days<br><span class="small text-muted">For purchases this amount of days will be added to today for the best before date suggestion</span></label>
|
||||
<input required min="0" type="number" class="form-control" id="default_best_before_days" name="default_best_before_days" value="<?php if ($mode == 'edit') echo $product->default_best_before_days; else echo '0'; ?>">
|
||||
<input required min="0" type="number" class="form-control" id="default_best_before_days" name="default_best_before_days" value="@if($mode == 'edit'){{ $product->default_best_before_days }}@else{{0}}@endif">
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="qu_id_purchase">Quantity unit purchase</label>
|
||||
<select required class="form-control input-group-qu" id="qu_id_purchase" name="qu_id_purchase">
|
||||
<?php foreach ($quantityunits as $quantityunit) : ?>
|
||||
<option <?php if ($mode == 'edit' && $quantityunit->id == $product->qu_id_purchase) echo 'selected="selected"'; ?> value="<?php echo $quantityunit->id; ?>"><?php echo $quantityunit->name; ?></option>
|
||||
<?php endforeach; ?>
|
||||
@foreach($quantityunits as $quantityunit)
|
||||
<option @if($mode == 'edit' && $quantityunit->id == $product->qu_id_purchase) selected="selected" @endif value="{{ $quantityunit->id }}">{{ $quantityunit->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
@@ -65,16 +73,16 @@
|
||||
<div class="form-group">
|
||||
<label for="qu_id_stock">Quantity unit stock</label>
|
||||
<select required class="form-control input-group-qu" id="qu_id_stock" name="qu_id_stock">
|
||||
<?php foreach ($quantityunits as $quantityunit) : ?>
|
||||
<option <?php if ($mode == 'edit' && $quantityunit->id == $product->qu_id_stock) echo 'selected="selected"'; ?> value="<?php echo $quantityunit->id; ?>"><?php echo $quantityunit->name; ?></option>
|
||||
<?php endforeach; ?>
|
||||
@foreach($quantityunits as $quantityunit)
|
||||
<option @if($mode == 'edit' && $quantityunit->id == $product->qu_id_stock) selected="selected" @endif value="{{ $quantityunit->id }}">{{ $quantityunit->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="qu_factor_purchase_to_stock">Factor purchase to stock quantity unit</label>
|
||||
<input required min="1" type="number" class="form-control input-group-qu" id="qu_factor_purchase_to_stock" name="qu_factor_purchase_to_stock" value="<?php if ($mode == 'edit') echo $product->qu_factor_purchase_to_stock; else echo '1'; ?>">
|
||||
<input required min="1" type="number" class="form-control input-group-qu" id="qu_factor_purchase_to_stock" name="qu_factor_purchase_to_stock" value="@if ($mode == 'edit'){{ $product->qu_factor_purchase_to_stock }}@else{{1}}@endif">
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
|
@@ -1,5 +1,9 @@
|
||||
@extends('layout.default')
|
||||
|
||||
@section('title', 'Products')
|
||||
@section('activeNav', 'products')
|
||||
@section('viewJsName', 'products')
|
||||
|
||||
@section('content')
|
||||
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
|
||||
|
||||
@@ -25,39 +29,39 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($products as $product) : ?>
|
||||
@foreach($products as $product)
|
||||
<tr>
|
||||
<td class="fit-content">
|
||||
<a class="btn btn-info" href="/product/<?php echo $product->id; ?>" role="button">
|
||||
<a class="btn btn-info" href="/product/{{ $product->id }}" role="button">
|
||||
<i class="fa fa-pencil"></i>
|
||||
</a>
|
||||
<a class="btn btn-danger product-delete-button" href="#" role="button" data-product-id="<?php echo $product->id; ?>" data-product-name="<?php echo $product->name; ?>">
|
||||
<a class="btn btn-danger product-delete-button" href="#" role="button" data-product-id="{{ $product->id }}" data-product-name="{{ $product->name }}">
|
||||
<i class="fa fa-trash"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $product->name; ?>
|
||||
{{ $product->name }}
|
||||
</td>
|
||||
<td>
|
||||
<?php echo FindObjectInArrayByPropertyValue($locations, 'id', $product->location_id)->name; ?>
|
||||
{{ FindObjectInArrayByPropertyValue($locations, 'id', $product->location_id)->name }}
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $product->min_stock_amount; ?>
|
||||
{{ $product->min_stock_amount }}
|
||||
</td>
|
||||
<td>
|
||||
<?php echo FindObjectInArrayByPropertyValue($quantityunits, 'id', $product->qu_id_purchase)->name; ?>
|
||||
{{ FindObjectInArrayByPropertyValue($quantityunits, 'id', $product->qu_id_purchase)->name }}
|
||||
</td>
|
||||
<td>
|
||||
<?php echo FindObjectInArrayByPropertyValue($quantityunits, 'id', $product->qu_id_stock)->name; ?>
|
||||
{{ FindObjectInArrayByPropertyValue($quantityunits, 'id', $product->qu_id_stock)->name }}
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $product->qu_factor_purchase_to_stock; ?>
|
||||
{{ $product->qu_factor_purchase_to_stock }}
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $product->description; ?>
|
||||
{{ $product->description }}
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
@@ -1,5 +1,9 @@
|
||||
@extends('layout.default')
|
||||
|
||||
@section('title', 'Purchase')
|
||||
@section('activeNav', 'purchase')
|
||||
@section('viewJsName', 'purchase')
|
||||
|
||||
@section('content')
|
||||
<div class="col-sm-4 col-sm-offset-3 col-md-3 col-md-offset-2 main">
|
||||
|
||||
@@ -11,9 +15,9 @@
|
||||
<label for="product_id">Product <i class="fa fa-barcode"></i><span id="barcode-lookup-disabled-hint" class="small text-muted hide"> Barcode lookup is disabled</span></label>
|
||||
<select class="form-control combobox" id="product_id" name="product_id" required>
|
||||
<option value=""></option>
|
||||
<?php foreach ($products as $product) : ?>
|
||||
<option data-additional-searchdata="<?php echo $product->barcode; ?>" value="<?php echo $product->id; ?>"><?php echo $product->name; ?></option>
|
||||
<?php endforeach; ?>
|
||||
@foreach($products as $product)
|
||||
<option data-additional-searchdata="{{ $product->barcode }}" value="{{ $product->id }}">{{ $product->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<div class="help-block with-errors"></div>
|
||||
<div id="flow-info-addbarcodetoselection" class="text-muted small hide"><strong><span id="addbarcodetoselection"></span></strong> will be added to the list of barcodes for the selected product on submit.</div>
|
||||
|
@@ -1,27 +1,35 @@
|
||||
@extends('layout.default')
|
||||
|
||||
@if($mode == 'edit')
|
||||
@section('title', 'Edit quantity unit')
|
||||
@else
|
||||
@section('title', 'Create quantity unit')
|
||||
@endif
|
||||
|
||||
@section('viewJsName', 'quantityunitform')
|
||||
|
||||
@section('content')
|
||||
<div class="col-sm-3 col-sm-offset-3 col-md-4 col-md-offset-2 main">
|
||||
|
||||
<h1 class="page-header"><?php echo $title; ?></h1>
|
||||
<h1 class="page-header">@yield('title')</h1>
|
||||
|
||||
<script>Grocy.EditMode = '<?php echo $mode; ?>';</script>
|
||||
<script>Grocy.EditMode = '{{ $mode }}';</script>
|
||||
|
||||
<?php if ($mode == 'edit') : ?>
|
||||
<script>Grocy.EditObjectId = <?php echo $quantityunit->id; ?>;</script>
|
||||
<?php endif; ?>
|
||||
@if($mode == 'edit')
|
||||
<script>Grocy.EditObjectId = {{ $quantityunit->id }};</script>
|
||||
@endif
|
||||
|
||||
<form id="quantityunit-form">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="name">Name</label>
|
||||
<input type="text" class="form-control" required id="name" name="name" value="<?php if ($mode == 'edit') echo $quantityunit->name; ?>">
|
||||
<input type="text" class="form-control" required id="name" name="name" value="@if($mode == 'edit'){{ $quantityunit->name }}@endif">
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="description">Description</label>
|
||||
<textarea class="form-control" rows="2" id="description" name="description"><?php if ($mode == 'edit') echo $quantityunit->description; ?></textarea>
|
||||
<textarea class="form-control" rows="2" id="description" name="description">@if($mode == 'edit'){{ $quantityunit->description }}@endif</textarea>
|
||||
</div>
|
||||
|
||||
<button id="save-quantityunit-button" type="submit" class="btn btn-default">Save</button>
|
||||
|
@@ -1,5 +1,9 @@
|
||||
@extends('layout.default')
|
||||
|
||||
@section('title', 'Quantity units')
|
||||
@section('activeNav', 'quantityunits')
|
||||
@section('viewJsName', 'quantityunits')
|
||||
|
||||
@section('content')
|
||||
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
|
||||
|
||||
@@ -20,24 +24,24 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($quantityunits as $quantityunit) : ?>
|
||||
@foreach($quantityunits as $quantityunit)
|
||||
<tr>
|
||||
<td class="fit-content">
|
||||
<a class="btn btn-info" href="/quantityunit/<?php echo $quantityunit->id; ?>" role="button">
|
||||
<a class="btn btn-info" href="/quantityunit/{{ $quantityunit->id }}" role="button">
|
||||
<i class="fa fa-pencil"></i>
|
||||
</a>
|
||||
<a class="btn btn-danger quantityunit-delete-button" href="#" role="button" data-quantityunit-id="<?php echo $quantityunit->id; ?>" data-quantityunit-name="<?php echo $quantityunit->name; ?>">
|
||||
<a class="btn btn-danger quantityunit-delete-button" href="#" role="button" data-quantityunit-id="{{ $quantityunit->id }}" data-quantityunit-name="{{ $quantityunit->name }}">
|
||||
<i class="fa fa-trash"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $quantityunit->name; ?>
|
||||
{{ $quantityunit->name }}
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $quantityunit->description; ?>
|
||||
{{ $quantityunit->description }}
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
@@ -1,5 +1,9 @@
|
||||
@extends('layout.default')
|
||||
|
||||
@section('title', 'Shopping list')
|
||||
@section('activeNav', 'shoppinglist')
|
||||
@section('viewJsName', 'shoppinglist')
|
||||
|
||||
@section('content')
|
||||
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
|
||||
|
||||
@@ -23,24 +27,24 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($listItems as $listItem) : ?>
|
||||
<tr class="<?php if ($listItem->amount_autoadded > 0) echo 'info-bg'; ?>">
|
||||
@foreach($listItems as $listItem)
|
||||
<tr class="@if($listItem->amount_autoadded > 0) info-bg @endif">
|
||||
<td class="fit-content">
|
||||
<a class="btn btn-info" href="/shoppinglistitem/<?php echo $listItem->id; ?>" role="button">
|
||||
<a class="btn btn-info" href="/shoppinglistitem/{{ $listItem->id }}" role="button">
|
||||
<i class="fa fa-pencil"></i>
|
||||
</a>
|
||||
<a class="btn btn-danger shoppinglist-delete-button" href="#" role="button" data-shoppinglist-id="<?php echo $listItem->id; ?>">
|
||||
<a class="btn btn-danger shoppinglist-delete-button" href="#" role="button" data-shoppinglist-id="{{ $listItem->id }}">
|
||||
<i class="fa fa-trash"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<?php if (!empty($listItem->product_id)) echo FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->name . '<br>'; ?><em><?php echo $listItem->note; ?></em>
|
||||
@if(!empty($listItem->product_id)) {{ FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->name }}<br>@endif<em>{{ $listItem->note }}</em>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $listItem->amount + $listItem->amount_autoadded; if (!empty($listItem->product_id)) echo ' ' . FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->qu_id_purchase)->name; ?>
|
||||
{{ $listItem->amount + $listItem->amount_autoadded }} @if(!empty($listItem->product_id)) {{ FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->qu_id_purchase)->name }}@endif
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
@@ -1,38 +1,46 @@
|
||||
@extends('layout.default')
|
||||
|
||||
@if($mode == 'edit')
|
||||
@section('title', 'Edit shopping list item')
|
||||
@else
|
||||
@section('title', 'Create shopping list item')
|
||||
@endif
|
||||
|
||||
@section('viewJsName', 'shoppinglistform')
|
||||
|
||||
@section('content')
|
||||
<div class="col-sm-3 col-sm-offset-3 col-md-3 col-md-offset-2 main">
|
||||
|
||||
<h1 class="page-header"><?php echo $title; ?></h1>
|
||||
<h1 class="page-header">@yield('title')</h1>
|
||||
|
||||
<script>Grocy.EditMode = '<?php echo $mode; ?>';</script>
|
||||
<script>Grocy.EditMode = '{{ $mode }}';</script>
|
||||
|
||||
<?php if ($mode == 'edit') : ?>
|
||||
<script>Grocy.EditObjectId = <?php echo $listItem->id; ?>;</script>
|
||||
<?php endif; ?>
|
||||
@if($mode == 'edit')
|
||||
<script>Grocy.EditObjectId = {{ $listItem->id }};</script>
|
||||
@endif
|
||||
|
||||
<form id="shoppinglist-form">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="product_id">Product <i class="fa fa-barcode"></i></label>
|
||||
<select class="form-control combobox" id="product_id" name="product_id" value="<?php if ($mode == 'edit') echo $listItem->product_id; ?>">
|
||||
<select class="form-control combobox" id="product_id" name="product_id" value="@if($mode == 'edit') {{ $listItem->product_id }} @endif">
|
||||
<option value=""></option>
|
||||
<?php foreach ($products as $product) : ?>
|
||||
<option <?php if ($mode == 'edit' && $product->id == $listItem->product_id) echo 'selected="selected"'; ?> data-additional-searchdata="<?php echo $product->barcode; ?>" value="<?php echo $product->id; ?>"><?php echo $product->name; ?></option>
|
||||
<?php endforeach; ?>
|
||||
@foreach($products as $product)
|
||||
<option @if($mode == 'edit' && $product->id == $listItem->product_id) selected="selected" @endif data-additional-searchdata="{{ $product->barcode }}" value="{{ $product->id }}">{{ $product->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<div id="product-error" class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="amount">Amount <span id="amount_qu_unit" class="small text-muted"></span><br><span class="small text-warning"><?php if ($mode == 'edit' && $listItem->amount_autoadded > 0) echo $listItem->amount_autoadded . " units were automatically added and will apply in addition to the amount entered here."; ?></span></label>
|
||||
<input type="number" class="form-control" id="amount" name="amount" value="<?php if ($mode == 'edit') echo $listItem->amount; else echo '1'; ?>" min="0" required>
|
||||
<label for="amount">Amount <span id="amount_qu_unit" class="small text-muted"></span><br><span class="small text-warning">@if($mode == 'edit' && $listItem->amount_autoadded > 0){{ $listItem->amount_autoadded }} units were automatically added and will apply in addition to the amount entered here.@endif</span></label>
|
||||
<input type="number" class="form-control" id="amount" name="amount" value="@if($mode == 'edit'){{ $listItem->amount }}@else{{1}}@endif" min="0" required>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="note">Note</label>
|
||||
<textarea class="form-control" rows="2" id="note" name="note"><?php if ($mode == 'edit') echo $listItem->note; ?></textarea>
|
||||
<textarea class="form-control" rows="2" id="note" name="note">@if($mode == 'edit'){{ $listItem->note }}@endif</textarea>
|
||||
</div>
|
||||
|
||||
<button id="save-shoppinglist-button" type="submit" class="btn btn-default">Save</button>
|
||||
|
@@ -1,15 +1,19 @@
|
||||
@extends('layout.default')
|
||||
|
||||
@section('title', 'Stock overview')
|
||||
@section('activeNav', 'stockoverview')
|
||||
@section('viewJsName', 'stockoverview')
|
||||
|
||||
@section('content')
|
||||
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
|
||||
|
||||
<h1 class="page-header">Stock overview <span class="text-muded small"><strong><?php echo count($currentStock) ?></strong> products with <strong><?php echo SumArrayValue($currentStock, 'amount'); ?></strong> units in stock</span></h1>
|
||||
<h1 class="page-header">Stock overview <span class="text-muded small"><strong>{{ count($currentStock) }}</strong> products with <strong>{{ SumArrayValue($currentStock, 'amount') }}</strong> units in stock</span></h1>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<p class="btn btn-lg btn-warning no-real-button"><strong><?php echo count(FindAllObjectsInArrayByPropertyValue($currentStock, 'best_before_date', date('Y-m-d', strtotime('+5 days')), '<')); ?></strong> products expiring within the next 5 days</p>
|
||||
<p class="btn btn-lg btn-danger no-real-button"><strong><?php echo count(FindAllObjectsInArrayByPropertyValue($currentStock, 'best_before_date', date('Y-m-d', strtotime('-1 days')), '<')); ?></strong> products are already expired</p>
|
||||
<p class="btn btn-lg btn-info no-real-button"><strong><?php echo count($missingProducts); ?></strong> products are below defined min. stock amount</p>
|
||||
<p class="btn btn-lg btn-warning no-real-button"><strong>{{ count(FindAllObjectsInArrayByPropertyValue($currentStock, 'best_before_date', date('Y-m-d', strtotime('+5 days')), '<')) }}</strong> products expiring within the next 5 days</p>
|
||||
<p class="btn btn-lg btn-danger no-real-button"><strong>{{ count(FindAllObjectsInArrayByPropertyValue($currentStock, 'best_before_date', date('Y-m-d', strtotime('-1 days')), '<')) }}</strong> products are already expired</p>
|
||||
<p class="btn btn-lg btn-info no-real-button"><strong>{{ count($missingProducts) }}</strong> products are below defined min. stock amount</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -25,20 +29,20 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($currentStock as $currentStockEntry) : ?>
|
||||
<tr class="<?php if ($currentStockEntry->best_before_date < date('Y-m-d', strtotime('-1 days'))) echo 'error-bg'; else if ($currentStockEntry->best_before_date < date('Y-m-d', strtotime('+5 days'))) echo 'warning-bg'; else if (FindObjectInArrayByPropertyValue($missingProducts, 'id', $currentStockEntry->product_id) !== null) echo 'info-bg'; ?>">
|
||||
@foreach($currentStock as $currentStockEntry)
|
||||
<tr class="@if($currentStockEntry->best_before_date < date('Y-m-d', strtotime('-1 days'))) error-bg @elseif($currentStockEntry->best_before_date < date('Y-m-d', strtotime('+5 days'))) warning-bg @elseif (FindObjectInArrayByPropertyValue($missingProducts, 'id', $currentStockEntry->product_id) !== null) info-bg @endif">
|
||||
<td>
|
||||
<?php echo FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->name; ?>
|
||||
{{ FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->name }}
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $currentStockEntry->amount . ' ' . FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name; ?>
|
||||
{{ $currentStockEntry->amount . ' ' . FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name }}
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $currentStockEntry->best_before_date; ?>
|
||||
<time class="timeago timeago-contextual" datetime="<?php echo $currentStockEntry->best_before_date; ?>"></time>
|
||||
{{ $currentStockEntry->best_before_date }}
|
||||
<time class="timeago timeago-contextual" datetime="{{ $currentStockEntry->best_before_date }}"></time>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user