mirror of
https://github.com/grocy/grocy.git
synced 2026-04-05 12:26:15 +02:00
Moved view-specific GrocyConfig variables into own section
Additionally, GrocyConfig is now complete for every page with the first line of the body tag.
This commit is contained in:
parent
b3366366b5
commit
9dab8a502f
|
|
@ -9,7 +9,8 @@ class batterycard
|
|||
|
||||
this.scopeSelector = scopeSelector;
|
||||
this.scope = scopeSelector != null ? $(scopeSelector) : $(document);
|
||||
var jScope = this.scope; \n\tthis.$ = scopeSelector != null ? (selector) => jScope.find(selector) : $;
|
||||
var jScope = this.scope;
|
||||
this.$ = scopeSelector != null ? (selector) => jScope.find(selector) : $;
|
||||
}
|
||||
|
||||
Refresh(batteryId)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@ class calendarcard
|
|||
|
||||
this.scopeSelector = scopeSelector;
|
||||
this.scope = scopeSelector != null ? $(scopeSelector) : $(document);
|
||||
var jScope = this.scope; \n\tthis.$ = scopeSelector != null ? (selector) => jScope.find(selector) : $;
|
||||
var jScope = this.scope;
|
||||
this.$ = scopeSelector != null ? (selector) => jScope.find(selector) : $;
|
||||
|
||||
this.$('#calendar').datetimepicker(
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,7 +9,8 @@ class chorecard
|
|||
|
||||
this.scopeSelector = scopeSelector;
|
||||
this.scope = scopeSelector != null ? $(scopeSelector) : $(document);
|
||||
var jScope = this.scope; \n\tthis.$ = scopeSelector != null ? (selector) => jScope.find(selector) : $;
|
||||
var jScope = this.scope;
|
||||
this.$ = scopeSelector != null ? (selector) => jScope.find(selector) : $;
|
||||
}
|
||||
|
||||
Refresh(choreId)
|
||||
|
|
|
|||
|
|
@ -46,6 +46,9 @@ class GrocyClass
|
|||
this.RecipePictureFileName = config.RecipePictureFileName;
|
||||
this.InstructionManualFileNameName = config.InstructionManualFileNameName;
|
||||
this.Locale = config.Locale;
|
||||
this.fullcalendarEventSources = config.fullcalendarEventSources;
|
||||
this.internalRecipes = config.internalRecipes;
|
||||
this.recipesResolved = config.recipesResolved;
|
||||
|
||||
this.Components = {};
|
||||
this.initComponents = [];
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
|
||||
/* global fullcalendarEventSources */
|
||||
|
||||
import { Calendar } from '@fullcalendar/core';
|
||||
import dayGridPlugin from '@fullcalendar/daygrid';
|
||||
import bootstrapPlugin from '@fullcalendar/bootstrap';
|
||||
|
|
@ -38,7 +36,7 @@ function calendarView(Grocy, scope = null)
|
|||
firstDay: firstDay,
|
||||
eventLimit: false,
|
||||
height: "auto",
|
||||
events: fullcalendarEventSources,
|
||||
events: Grocy.fullcalendarEventSources,
|
||||
// fullcalendar 4 doesn't translate the default view names (?)
|
||||
// so we have to supply our own.
|
||||
views: {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
/* global fullcalendarEventSources, internalRecipes, recipesResolved */
|
||||
|
||||
import { Calendar } from '@fullcalendar/core';
|
||||
import { Calendar } from '@fullcalendar/core';
|
||||
import dayGridPlugin from '@fullcalendar/daygrid';
|
||||
import bootstrapPlugin from '@fullcalendar/bootstrap';
|
||||
import momentPlugin from '@fullcalendar/moment/main';
|
||||
|
|
@ -57,7 +55,7 @@ function mealplanView(Grocy, scope = null)
|
|||
},
|
||||
weekNumbers: false,
|
||||
eventLimit: false,
|
||||
events: fullcalendarEventSources,
|
||||
events: Grocy.fullcalendarEventSources,
|
||||
defaultView: (viewport.width() < 768) ? "dayGridDay" : "dayGridWeek",
|
||||
firstDay: firstDay,
|
||||
height: "auto",
|
||||
|
|
@ -85,7 +83,7 @@ function mealplanView(Grocy, scope = null)
|
|||
</div>');
|
||||
|
||||
var weekRecipeName = start.year() + "-" + ((start.week() - 1).toString().padStart(2, "0")).toString();
|
||||
var weekRecipe = internalRecipes.find(elem => elem.name == weekRecipeName);
|
||||
var weekRecipe = Grocy.internalRecipes.find(elem => elem.name == weekRecipeName);
|
||||
|
||||
var weekCosts = 0;
|
||||
var weekRecipeOrderMissingButtonHtml = "";
|
||||
|
|
@ -93,7 +91,7 @@ function mealplanView(Grocy, scope = null)
|
|||
var weekCostsHtml = "";
|
||||
if (weekRecipe !== null && weekRecipe !== undefined) // Array.prototype.find returns undefined if not found.
|
||||
{
|
||||
var recipes = recipesResolved.find(elem => elem.recipe_id == weekRecipe.id);
|
||||
var recipes = Grocy.recipesResolved.find(elem => elem.recipe_id == weekRecipe.id);
|
||||
if (Grocy.FeatureFlags.GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)
|
||||
{
|
||||
weekCosts = recipes.costs;
|
||||
|
|
@ -130,8 +128,8 @@ function mealplanView(Grocy, scope = null)
|
|||
if (event.type != "note")
|
||||
{
|
||||
var dayRecipeName = toMoment(info.event.start, calendar).format("YYYY-MM-DD");
|
||||
var dayRecipe = internalRecipes.find(elem => elem.name == dayRecipeName);
|
||||
var dayRecipeResolved = recipesResolved.find(elem => elem.recipe_id == dayRecipe.id);
|
||||
var dayRecipe = Grocy.internalRecipes.find(elem => elem.name == dayRecipeName);
|
||||
var dayRecipeResolved = Grocy.recipesResolved.find(elem => elem.recipe_id == dayRecipe.id);
|
||||
|
||||
if (!$scope("#day-summary-" + dayRecipeName).length) // This runs for every event/recipe, so maybe multiple times per day, so only add the day summary once
|
||||
{
|
||||
|
|
@ -158,7 +156,7 @@ function mealplanView(Grocy, scope = null)
|
|||
return false;
|
||||
}
|
||||
|
||||
var resolvedRecipe = recipesResolved.find(elem => elem.recipe_id == recipe.id);
|
||||
var resolvedRecipe = Grocy.recipesResolved.find(elem => elem.recipe_id == recipe.id);
|
||||
|
||||
element.attr("data-recipe", event.recipe);
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,13 @@
|
|||
|
||||
@section('viewJsName', 'batteryform')
|
||||
|
||||
@section('grocyConfigProps')
|
||||
EditMode: '{{ $mode }}',
|
||||
@if($mode == 'edit')
|
||||
EditObjectId: {{ $battery->id }},
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
|
|
@ -19,17 +26,6 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-xs-12">
|
||||
|
||||
<script>
|
||||
GrocyConfig.EditMode = '{{ $mode }}';
|
||||
</script>
|
||||
|
||||
@if($mode == 'edit')
|
||||
<script>
|
||||
GrocyConfig.EditObjectId = {{ $battery->id }}
|
||||
</script>
|
||||
@endif
|
||||
|
||||
<form id="battery-form"
|
||||
novalidate>
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@
|
|||
rel="stylesheet">
|
||||
@endpush
|
||||
|
||||
@section('grocyConfigProps')
|
||||
fullcalendarEventSources: {!! json_encode([ "events" => $fullcalendarEventSources]) !!},
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
|
|
@ -35,10 +38,6 @@
|
|||
|
||||
<hr class="my-2">
|
||||
|
||||
<script>
|
||||
var fullcalendarEventSources = {!! json_encode([ "events" => $fullcalendarEventSources]) !!}
|
||||
</script>
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div id="calendar"></div>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,13 @@
|
|||
|
||||
@section('viewJsName', 'choreform')
|
||||
|
||||
@section('grocyConfigProps')
|
||||
EditMode: '{{ $mode }}',
|
||||
@if($mode == 'edit')
|
||||
EditObjectId: {{ $chore->id }},
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
|
|
@ -19,16 +26,6 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-xs-12">
|
||||
<script>
|
||||
GrocyConfig.EditMode = '{{ $mode }}';
|
||||
</script>
|
||||
|
||||
@if($mode == 'edit')
|
||||
<script>
|
||||
GrocyConfig.EditObjectId = {{ $chore->id }};
|
||||
</script>
|
||||
@endif
|
||||
|
||||
<form id="chore-form"
|
||||
novalidate>
|
||||
|
||||
|
|
|
|||
|
|
@ -4,13 +4,19 @@
|
|||
@section('activeNav', 'consume')
|
||||
@section('viewJsName', 'consume')
|
||||
|
||||
@section('content')
|
||||
<script>
|
||||
GrocyConfig.QuantityUnits = {!! json_encode($quantityUnits) !!};
|
||||
GrocyConfig.QuantityUnitConversionsResolved = {!! json_encode($quantityUnitConversionsResolved) !!};
|
||||
GrocyConfig.DefaultMinAmount = '{{$DEFAULT_MIN_AMOUNT}}';
|
||||
</script>
|
||||
@section('grocyConfigProps')
|
||||
QuantityUnits: {!! json_encode($quantityUnits) !!},
|
||||
QuantityUnitConversionsResolved: {!! json_encode($quantityUnitConversionsResolved) !!},
|
||||
DefaultMinAmount: '{{$DEFAULT_MIN_AMOUNT}}',
|
||||
@endsection
|
||||
|
||||
@section('forceUserSettings')
|
||||
@if($embedded)
|
||||
scan_mode_consume_enabled: false,
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6 col-xl-4 pb-3">
|
||||
<div class="title-related-links">
|
||||
|
|
@ -35,10 +41,6 @@
|
|||
@if(boolval($userSettings['scan_mode_consume_enabled']))
|
||||
checked
|
||||
@endif>
|
||||
@else
|
||||
<script>
|
||||
GrocyConfig.UserSettings.scan_mode_consume_enabled = false;
|
||||
</script>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,16 @@
|
|||
|
||||
@section('viewJsName', 'equipmentform')
|
||||
|
||||
@section('grocyConfigProps')
|
||||
EditMode: '{{ $mode }}',
|
||||
@if($mode == 'edit')
|
||||
EditObjectId: {{ $equipment->id }},
|
||||
@if(!empty($equipment->instruction_manual_file_name))
|
||||
InstructionManualFileNameName: '{{ $equipment->instruction_manual_file_name }}',
|
||||
@endif
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
|
|
@ -19,22 +29,6 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-xs-12">
|
||||
<script>
|
||||
GrocyConfig.EditMode = '{{ $mode }}';
|
||||
</script>
|
||||
|
||||
@if($mode == 'edit')
|
||||
<script>
|
||||
GrocyConfig.EditObjectId = {{ $equipment->id }};
|
||||
</script>
|
||||
|
||||
@if(!empty($equipment->instruction_manual_file_name))
|
||||
<script>
|
||||
GrocyConfig.InstructionManualFileNameName = '{{ $equipment->instruction_manual_file_name }}';
|
||||
</script>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
<form id="equipment-form"
|
||||
novalidate>
|
||||
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@
|
|||
@section('activeNav', 'inventory')
|
||||
@section('viewJsName', 'inventory')
|
||||
|
||||
@section('content')
|
||||
<script>
|
||||
GrocyConfig.QuantityUnits = {!! json_encode($quantityUnits) !!};
|
||||
GrocyConfig.QuantityUnitConversionsResolved = {!! json_encode($quantityUnitConversionsResolved) !!};
|
||||
GrocyConfig.DefaultMinAmount = '{{$DEFAULT_MIN_AMOUNT}}';
|
||||
</script>
|
||||
@section('grocyConfigProps')
|
||||
QuantityUnits: {!! json_encode($quantityUnits) !!},
|
||||
QuantityUnitConversionsResolved: {!! json_encode($quantityUnitConversionsResolved) !!},
|
||||
DefaultMinAmount: '{{$DEFAULT_MIN_AMOUNT}}',
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6 col-xl-4 pb-3">
|
||||
<h2 class="title">@yield('title')</h2>
|
||||
|
|
|
|||
|
|
@ -88,6 +88,17 @@
|
|||
UserId: -1,
|
||||
@endif
|
||||
};
|
||||
@hasSection('grocyConfigProps')
|
||||
Object.assign(GrocyConfig, {
|
||||
@yield('grocyConfigProps')
|
||||
});
|
||||
@endif
|
||||
|
||||
@hasSection('forceUserSettings')
|
||||
Object.assign(GrocyConfig.UserSettings, {
|
||||
@yield('forceUserSettings')
|
||||
});
|
||||
@endif
|
||||
</script>
|
||||
</head>
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,13 @@
|
|||
|
||||
@section('viewJsName', 'locationform')
|
||||
|
||||
@section('grocyConfigProps')
|
||||
EditMode: '{{ $mode }}',
|
||||
@if($mode == 'edit')
|
||||
EditObjectId: {{ $location->id }},
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
|
|
@ -19,15 +26,6 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-xs-12">
|
||||
<script>
|
||||
GrocyConfig.EditMode = '{{ $mode }}';
|
||||
</script>
|
||||
|
||||
@if($mode == 'edit')
|
||||
<script>
|
||||
GrocyConfig.EditObjectId = {{ $location->id }};
|
||||
</script>
|
||||
@endif
|
||||
|
||||
<form id="location-form"
|
||||
novalidate>
|
||||
|
|
|
|||
|
|
@ -4,10 +4,6 @@
|
|||
@section('activeNav', '')
|
||||
@section('viewJsName', 'manageapikeys')
|
||||
|
||||
@push('pageScripts')
|
||||
<script src="{{ $U('/node_modules/bwip-js/dist/bwip-js-min.js?v=', true) }}{{ $version }}"></script>
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
|
|
|
|||
|
|
@ -9,18 +9,18 @@
|
|||
rel="stylesheet">
|
||||
@endpush
|
||||
|
||||
@section('grocyConfigProps')
|
||||
fullcalendarEventSources: {!! json_encode([ "events" => $fullcalendarEventSources ]) !!},
|
||||
internalRecipes: {!! json_encode($internalRecipes) !!},
|
||||
recipesResolved: {!! json_encode($recipesResolved) !!},
|
||||
|
||||
QuantityUnits: {!! json_encode($quantityUnits) !!},
|
||||
QuantityUnitConversionsResolved: {!! json_encode($quantityUnitConversionsResolved) !!},
|
||||
|
||||
MealPlanFirstDayOfWeek: '{{ GROCY_MEAL_PLAN_FIRST_DAY_OF_WEEK }}',
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<script>
|
||||
var fullcalendarEventSources = {!! json_encode([ "events" => $fullcalendarEventSources ]) !!}
|
||||
var internalRecipes = {!! json_encode($internalRecipes) !!}
|
||||
var recipesResolved = {!! json_encode($recipesResolved) !!}
|
||||
|
||||
GrocyConfig.QuantityUnits = {!! json_encode($quantityUnits) !!};
|
||||
GrocyConfig.QuantityUnitConversionsResolved = {!! json_encode($quantityUnitConversionsResolved) !!};
|
||||
|
||||
GrocyConfig.MealPlanFirstDayOfWeek = '{{ GROCY_MEAL_PLAN_FIRST_DAY_OF_WEEK }}';
|
||||
</script>
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h2 class="title">@yield('title')</h2>
|
||||
|
|
|
|||
|
|
@ -8,12 +8,18 @@
|
|||
|
||||
@section('viewJsName', 'productbarcodeform')
|
||||
|
||||
@section('content')
|
||||
<script>
|
||||
GrocyConfig.QuantityUnits = {!! json_encode($quantityUnits) !!};
|
||||
GrocyConfig.QuantityUnitConversionsResolved = {!! json_encode($quantityUnitConversionsResolved) !!};
|
||||
</script>
|
||||
@section('grocyConfigProps')
|
||||
QuantityUnits: {!! json_encode($quantityUnits) !!},
|
||||
QuantityUnitConversionsResolved: {!! json_encode($quantityUnitConversionsResolved) !!},
|
||||
EditMode: '{{ $mode }}',
|
||||
@if($mode == 'edit')
|
||||
EditObjectId: {{ $barcode->id }},
|
||||
EditObject: {!! json_encode($barcode) !!},
|
||||
@endif
|
||||
EditObjectProduct: {!! json_encode($product) !!},
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="title-related-links">
|
||||
|
|
@ -29,19 +35,6 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-xs-12">
|
||||
|
||||
<script>
|
||||
GrocyConfig.EditMode = '{{ $mode }}';
|
||||
GrocyConfig.EditObjectProduct = {!! json_encode($product) !!};
|
||||
</script>
|
||||
|
||||
@if($mode == 'edit')
|
||||
<script>
|
||||
GrocyConfig.EditObjectId = {{ $barcode->id }};
|
||||
GrocyConfig.EditObject = {!! json_encode($barcode) !!};
|
||||
</script>
|
||||
@endif
|
||||
|
||||
<form id="barcode-form"
|
||||
novalidate>
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,18 @@
|
|||
|
||||
@section('viewJsName', 'productform')
|
||||
|
||||
@section('grocyConfigProps')
|
||||
EditMode: '{{ $mode }}',
|
||||
|
||||
@if($mode == 'edit')
|
||||
EditObjectId: {{ $product->id }},
|
||||
|
||||
@if(!empty($product->picture_file_name))
|
||||
ProductPictureFileName: '{{ $product->picture_file_name }}',
|
||||
@endif
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
|
|
@ -19,22 +31,6 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-xs-12">
|
||||
<script>
|
||||
GrocyConfig.EditMode = '{{ $mode }}';
|
||||
</script>
|
||||
|
||||
@if($mode == 'edit')
|
||||
<script>
|
||||
GrocyConfig.EditObjectId = {{ $product->id }};
|
||||
</script>
|
||||
|
||||
@if(!empty($product->picture_file_name))
|
||||
<script>
|
||||
GrocyConfig.ProductPictureFileName = '{{ $product->picture_file_name }}';
|
||||
</script>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
<form id="product-form"
|
||||
novalidate>
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,13 @@
|
|||
|
||||
@section('viewJsName', 'productgroupform')
|
||||
|
||||
@section('grocyConfigProps')
|
||||
EditMode: '{{ $mode }}',
|
||||
@if($mode == 'edit')
|
||||
EditObjectId: {{ $group->id }},
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
|
|
@ -19,16 +26,6 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-xs-12">
|
||||
<script>
|
||||
GrocyConfig.EditMode = '{{ $mode }}';
|
||||
</script>
|
||||
|
||||
@if($mode == 'edit')
|
||||
<script>
|
||||
GrocyConfig.EditObjectId = {{ $group->id }};
|
||||
</script>
|
||||
@endif
|
||||
|
||||
<form id="product-group-form"
|
||||
novalidate>
|
||||
|
||||
|
|
|
|||
|
|
@ -4,13 +4,19 @@
|
|||
@section('activeNav', 'purchase')
|
||||
@section('viewJsName', 'purchase')
|
||||
|
||||
@section('content')
|
||||
<script>
|
||||
GrocyConfig.QuantityUnits = {!! json_encode($quantityUnits) !!};
|
||||
GrocyConfig.QuantityUnitConversionsResolved = {!! json_encode($quantityUnitConversionsResolved) !!};
|
||||
GrocyConfig.DefaultMinAmount = '{{ $DEFAULT_MIN_AMOUNT }}';
|
||||
</script>
|
||||
@section('grocyConfigProps')
|
||||
QuantityUnits: {!! json_encode($quantityUnits) !!},
|
||||
QuantityUnitConversionsResolved: {!! json_encode($quantityUnitConversionsResolved) !!},
|
||||
DefaultMinAmount: '{{$DEFAULT_MIN_AMOUNT}}',
|
||||
@endsection
|
||||
|
||||
@section('forceUserSettings')
|
||||
@if($embedded)
|
||||
scan_mode_consume_enabled: false,
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6 col-xl-4 pb-3">
|
||||
<div class="title-related-links">
|
||||
|
|
@ -35,10 +41,6 @@
|
|||
@if(boolval($userSettings['scan_mode_purchase_enabled']))
|
||||
checked
|
||||
@endif>
|
||||
@else
|
||||
<script>
|
||||
GrocyConfig.UserSettings.scan_mode_purchase_enabled = false;
|
||||
</script>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,14 @@
|
|||
|
||||
@section('viewJsName', 'quantityunitconversionform')
|
||||
|
||||
@section('grocyConfigProps')
|
||||
EditMode: '{{ $mode }}',
|
||||
@if($mode == 'edit')
|
||||
EditObjectId: {{ $quConversion->id }},
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
|
|
@ -28,17 +36,6 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-xs-12">
|
||||
|
||||
<script>
|
||||
GrocyConfig.EditMode = '{{ $mode }}';
|
||||
</script>
|
||||
|
||||
@if($mode == 'edit')
|
||||
<script>
|
||||
GrocyConfig.EditObjectId = {{ $quConversion->id }};
|
||||
</script>
|
||||
@endif
|
||||
|
||||
<form id="quconversion-form"
|
||||
novalidate>
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,13 @@
|
|||
|
||||
@section('viewJsName', 'quantityunitform')
|
||||
|
||||
@section('grocyConfigProps')
|
||||
EditMode: '{{ $mode }}',
|
||||
@if($mode == 'edit')
|
||||
GrocyConfig.EditObjectId: {{ $quantityUnit->id }},
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
|
|
@ -19,16 +26,6 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-xs-12">
|
||||
<script>
|
||||
GrocyConfig.EditMode = '{{ $mode }}';
|
||||
</script>
|
||||
|
||||
@if($mode == 'edit')
|
||||
<script>
|
||||
GrocyConfig.EditObjectId = {{ $quantityUnit->id }};
|
||||
</script>
|
||||
@endif
|
||||
|
||||
<form id="quantityunit-form"
|
||||
novalidate>
|
||||
|
||||
|
|
|
|||
|
|
@ -8,28 +8,25 @@
|
|||
|
||||
@section('viewJsName', 'recipeform')
|
||||
|
||||
@section('grocyConfigProps')
|
||||
EditMode: '{{ $mode }}',
|
||||
@if($mode == 'edit')
|
||||
GrocyConfig.EditObjectId: {{ $recipe->id }},
|
||||
@endif
|
||||
QuantityUnits: {!! json_encode($quantityUnits) !!},
|
||||
QuantityUnitConversionsResolved: {!! json_encode($quantityUnitConversionsResolved) !!},
|
||||
DefaultMinAmount: '{{$DEFAULT_MIN_AMOUNT}}',
|
||||
|
||||
@if(!empty($recipe->picture_file_name))
|
||||
RecipePictureFileName: '{{ $recipe->picture_file_name }}',
|
||||
@endif
|
||||
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h2 class="title">@yield('title')</h2>
|
||||
|
||||
<script>
|
||||
GrocyConfig.EditMode = '{{ $mode }}';
|
||||
GrocyConfig.QuantityUnits = {!! json_encode($quantityunits) !!};
|
||||
GrocyConfig.QuantityUnitConversionsResolved = {!! json_encode($quantityUnitConversionsResolved) !!};
|
||||
</script>
|
||||
|
||||
@if($mode == 'edit')
|
||||
<script>
|
||||
GrocyConfig.EditObjectId = {{ $recipe->id }};
|
||||
</script>
|
||||
|
||||
@if(!empty($recipe->picture_file_name))
|
||||
<script>
|
||||
GrocyConfig.RecipePictureFileName = '{{ $recipe->picture_file_name }}';
|
||||
</script>
|
||||
@endif
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -8,11 +8,24 @@
|
|||
|
||||
@section('viewJsName', 'recipeposform')
|
||||
|
||||
@section('content')
|
||||
<script>
|
||||
GrocyConfig.DefaultMinAmount = '{{$DEFAULT_MIN_AMOUNT}}';
|
||||
</script>
|
||||
@section('grocyConfigProps')
|
||||
EditMode: '{{ $mode }}',
|
||||
EditObjectParentId: {{ $recipe->id }},
|
||||
EditObject: {!! json_encode($recipePos) !!},
|
||||
@if($mode == 'edit')
|
||||
GrocyConfig.EditObjectId: {{ $recipePos->id }},
|
||||
@endif
|
||||
QuantityUnits: {!! json_encode($quantityUnits) !!},
|
||||
QuantityUnitConversionsResolved: {!! json_encode($quantityUnitConversionsResolved) !!},
|
||||
DefaultMinAmount: '{{$DEFAULT_MIN_AMOUNT}}',
|
||||
|
||||
@if(!empty($recipe->picture_file_name))
|
||||
RecipePictureFileName: '{{ $recipe->picture_file_name }}',
|
||||
@endif
|
||||
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="title-related-links">
|
||||
|
|
@ -28,20 +41,6 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6 col-xl-5 pb-3">
|
||||
<script>
|
||||
GrocyConfig.EditMode = '{{ $mode }}';
|
||||
GrocyConfig.EditObjectParentId = {{ $recipe->id }};
|
||||
GrocyConfig.EditObject = {!! json_encode($recipePos) !!};
|
||||
GrocyConfig.QuantityUnits = {!! json_encode($quantityUnits) !!};
|
||||
GrocyConfig.QuantityUnitConversionsResolved = {!! json_encode($quantityUnitConversionsResolved) !!};
|
||||
</script>
|
||||
|
||||
@if($mode == 'edit')
|
||||
<script>
|
||||
GrocyConfig.EditObjectId = {{ $recipePos->id }};
|
||||
</script>
|
||||
@endif
|
||||
|
||||
<form id="recipe-pos-form"
|
||||
novalidate>
|
||||
|
||||
|
|
|
|||
|
|
@ -4,11 +4,12 @@
|
|||
@section('activeNav', 'recipes')
|
||||
@section('viewJsName', 'recipes')
|
||||
|
||||
@section('grocyConfigProps')
|
||||
QuantityUnits: {!! json_encode($quantityUnits) !!},
|
||||
QuantityUnitConversionsResolved: {!! json_encode($quantityUnitConversionsResolved) !!},
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<script>
|
||||
GrocyConfig.QuantityUnits = {!! json_encode($quantityUnits) !!};
|
||||
GrocyConfig.QuantityUnitConversionsResolved = {!! json_encode($quantityUnitConversionsResolved) !!};
|
||||
</script>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6 d-print-none">
|
||||
|
|
|
|||
|
|
@ -8,6 +8,13 @@
|
|||
|
||||
@section('viewJsName', 'shoppinglistform')
|
||||
|
||||
@section('grocyConfigProps')
|
||||
EditMode: '{{ $mode }}',
|
||||
@if($mode == 'edit')
|
||||
GrocyConfig.EditObjectId: {{ $shoppingList->id }},
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
|
|
@ -19,16 +26,6 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-xs-12">
|
||||
<script>
|
||||
GrocyConfig.EditMode = '{{ $mode }}';
|
||||
</script>
|
||||
|
||||
@if($mode == 'edit')
|
||||
<script>
|
||||
GrocyConfig.EditObjectId = {{ $shoppingList->id }};
|
||||
</script>
|
||||
@endif
|
||||
|
||||
<form id="shopping-list-form"
|
||||
novalidate>
|
||||
|
||||
|
|
|
|||
|
|
@ -8,12 +8,16 @@
|
|||
|
||||
@section('viewJsName', 'shoppinglistitemform')
|
||||
|
||||
@section('grocyConfigProps')
|
||||
EditMode: '{{ $mode }}',
|
||||
@if($mode == 'edit')
|
||||
GrocyConfig.EditObjectId: {{ $listItem->id }},
|
||||
@endif
|
||||
QuantityUnits: {!! json_encode($quantityUnits) !!},
|
||||
QuantityUnitConversionsResolved: {!! json_encode($quantityUnitConversionsResolved) !!},
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<script>
|
||||
GrocyConfig.QuantityUnits = {!! json_encode($quantityUnits) !!};
|
||||
GrocyConfig.QuantityUnitConversionsResolved = {!! json_encode($quantityUnitConversionsResolved) !!};
|
||||
</script>
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h2 class="title">@yield('title')</h2>
|
||||
|
|
@ -24,15 +28,6 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6 col-xl-4 pb-3">
|
||||
<script>
|
||||
GrocyConfig.EditMode = '{{ $mode }}';
|
||||
</script>
|
||||
|
||||
@if($mode == 'edit')
|
||||
<script>
|
||||
GrocyConfig.EditObjectId = {{ $listItem->id }};
|
||||
</script>
|
||||
@endif
|
||||
|
||||
<form id="shoppinglist-form"
|
||||
novalidate>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,13 @@
|
|||
|
||||
@section('viewJsName', 'shoppinglocationform')
|
||||
|
||||
@section('grocyConfigProps')
|
||||
EditMode: '{{ $mode }}',
|
||||
@if($mode == 'edit')
|
||||
EditObjectId: {{ $shoppinglocation->id }},
|
||||
@endif
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
|
|
@ -19,16 +26,6 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-xs-12">
|
||||
<script>
|
||||
GrocyConfig.EditMode = '{{ $mode }}';
|
||||
</script>
|
||||
|
||||
@if($mode == 'edit')
|
||||
<script>
|
||||
GrocyConfig.EditObjectId = {{ $shoppinglocation->id }};
|
||||
</script>
|
||||
@endif
|
||||
|
||||
<form id="shoppinglocation-form"
|
||||
novalidate>
|
||||
|
||||
|
|
|
|||
|
|
@ -3,12 +3,13 @@
|
|||
@section('title', $__t('Edit stock entry'))
|
||||
@section('viewJsName', 'stockentryform')
|
||||
|
||||
@section('content')
|
||||
<script>
|
||||
GrocyConfig.EditObjectId = {{ $stockEntry->id }};
|
||||
GrocyConfig.EditObjectProductId = {{ $stockEntry->product_id }};
|
||||
</script>
|
||||
@section('grocyConfigProps')
|
||||
EditMode: '{{ $mode }}',
|
||||
EditObjectId: {{ $stockEntry->id }},
|
||||
EditObjectProductId: {{ $stockEntry->product_id },
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h2 class="title">@yield('title')</h2>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,13 @@
|
|||
|
||||
@section('viewJsName', 'taskcategoryform')
|
||||
|
||||
@section('grocyConfigProps')
|
||||
EditMode: '{{ $mode }}',
|
||||
@if($mode == 'edit')
|
||||
EditObjectId: {{ $category->id }},
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
|
|
@ -19,16 +26,6 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-xs-12">
|
||||
<script>
|
||||
GrocyConfig.EditMode = '{{ $mode }}';
|
||||
</script>
|
||||
|
||||
@if($mode == 'edit')
|
||||
<script>
|
||||
GrocyConfig.EditObjectId = {{ $category->id }};
|
||||
</script>
|
||||
@endif
|
||||
|
||||
<form id="task-category-form"
|
||||
novalidate>
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,13 @@
|
|||
|
||||
@section('viewJsName', 'taskform')
|
||||
|
||||
@section('grocyConfigProps')
|
||||
EditMode: '{{ $mode }}',
|
||||
@if($mode == 'edit')
|
||||
EditObjectId: {{ $task->id }},
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
|
|
@ -19,16 +26,6 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-xs-12">
|
||||
<script>
|
||||
GrocyConfig.EditMode = '{{ $mode }}';
|
||||
</script>
|
||||
|
||||
@if($mode == 'edit')
|
||||
<script>
|
||||
GrocyConfig.EditObjectId = {{ $task->id }};
|
||||
</script>
|
||||
@endif
|
||||
|
||||
<form id="task-form"
|
||||
novalidate>
|
||||
|
||||
|
|
|
|||
|
|
@ -4,12 +4,13 @@
|
|||
@section('activeNav', 'transfer')
|
||||
@section('viewJsName', 'transfer')
|
||||
|
||||
@section('content')
|
||||
<script>
|
||||
GrocyConfig.QuantityUnits = {!! json_encode($quantityUnits) !!};
|
||||
GrocyConfig.QuantityUnitConversionsResolved = {!! json_encode($quantityUnitConversionsResolved) !!};
|
||||
</script>
|
||||
|
||||
@section('grocyConfigProps')
|
||||
QuantityUnits: {!! json_encode($quantityUnits) !!},
|
||||
QuantityUnitConversionsResolved: {!! json_encode($quantityUnitConversionsResolved) !!},
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6 col-xl-4 pb-3">
|
||||
<h2 class="title">@yield('title')</h2>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,13 @@
|
|||
|
||||
@section('viewJsName', 'userentityform')
|
||||
|
||||
@section('grocyConfigProps')
|
||||
EditMode: '{{ $mode }}',
|
||||
@if($mode == 'edit')
|
||||
EditObjectId: {{ $userentity->id }},
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
|
|
@ -19,16 +26,6 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-xs-12">
|
||||
<script>
|
||||
GrocyConfig.EditMode = '{{ $mode }}';
|
||||
</script>
|
||||
|
||||
@if($mode == 'edit')
|
||||
<script>
|
||||
GrocyConfig.EditObjectId = {{ $userentity->id }};
|
||||
</script>
|
||||
@endif
|
||||
|
||||
<form id="userentity-form"
|
||||
novalidate>
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,13 @@
|
|||
|
||||
@section('viewJsName', 'userfieldform')
|
||||
|
||||
@section('grocyConfigProps')
|
||||
EditMode: '{{ $mode }}',
|
||||
@if($mode == 'edit')
|
||||
EditObjectId: {{ $userfield->id }},
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
|
|
@ -19,16 +26,6 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-xs-12">
|
||||
<script>
|
||||
GrocyConfig.EditMode = '{{ $mode }}';
|
||||
</script>
|
||||
|
||||
@if($mode == 'edit')
|
||||
<script>
|
||||
GrocyConfig.EditObjectId = {{ $userfield->id }};
|
||||
</script>
|
||||
@endif
|
||||
|
||||
<form id="userfield-form"
|
||||
novalidate>
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,16 @@
|
|||
|
||||
@section('viewJsName', 'userform')
|
||||
|
||||
@section('grocyConfigProps')
|
||||
EditMode: '{{ $mode }}',
|
||||
@if($mode == 'edit')
|
||||
EditObjectId: {{ $user->id }},
|
||||
@if(!empty($user->picture_file_name))
|
||||
UserPictureFileName: '{{ $user->picture_file_name }}',
|
||||
@endif
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
|
|
@ -22,17 +32,6 @@
|
|||
<script>
|
||||
GrocyConfig.EditMode = '{{ $mode }}';
|
||||
</script>
|
||||
|
||||
@if($mode == 'edit')
|
||||
<script>
|
||||
GrocyConfig.EditObjectId = {{ $user->id }};
|
||||
|
||||
@if(!empty($user->picture_file_name))
|
||||
GrocyConfig.UserPictureFileName = '{{ $user->picture_file_name }}';
|
||||
@endif
|
||||
</script>
|
||||
@endif
|
||||
|
||||
<form id="user-form"
|
||||
novalidate>
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,15 @@
|
|||
|
||||
@section('viewJsName', 'userobjectform')
|
||||
|
||||
@section('grocyConfigProps')
|
||||
EditMode: '{{ $mode }}',
|
||||
EditObjectParentId: {{ $userentity->id }},
|
||||
EditObjectParentName: "{{ $userentity->name }}",
|
||||
@if($mode == 'edit')
|
||||
EditObjectId: {{ $userobject->id }},
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
|
|
@ -19,18 +28,6 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-xs-12">
|
||||
<script>
|
||||
GrocyConfig.EditMode = '{{ $mode }}';
|
||||
GrocyConfig.EditObjectParentId = {{ $userentity->id }};
|
||||
GrocyConfig.EditObjectParentName = "{{ $userentity->name }}";
|
||||
</script>
|
||||
|
||||
@if($mode == 'edit')
|
||||
<script>
|
||||
GrocyConfig.EditObjectId = {{ $userobject->id }};
|
||||
</script>
|
||||
@endif
|
||||
|
||||
<form id="userobject-form"
|
||||
novalidate>
|
||||
|
||||
|
|
|
|||
|
|
@ -4,11 +4,10 @@
|
|||
@section('activeNav', '')
|
||||
@section('viewJsName', 'userpermissions')
|
||||
|
||||
@push('pageScripts')
|
||||
<script>
|
||||
GrocyConfig.EditObjectId = {{ $user->id }};
|
||||
</script>
|
||||
@endpush
|
||||
@section('grocyConfigProps')
|
||||
EditMode: '{{ $mode }}',
|
||||
EditObjectId: {{ $user->id }},
|
||||
@endsection
|
||||
|
||||
@push('pageStyles')
|
||||
<style>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user