Merge branch 'develop' into api_performance

This commit is contained in:
vabene1111
2021-10-12 16:28:49 +02:00
committed by GitHub
62 changed files with 296 additions and 98 deletions

View File

@@ -31,11 +31,11 @@
<b-tab :title="$t('Settings')">
<div class="row mt-3">
<div class="col-3 calender-options">
<h5>{{ $t('CalenderSettings') }}</h5>
<h5>{{ $t('Planner_Settings') }}</h5>
<b-form>
<b-form-group id="UomInput"
:label="$t('Period')"
:description="$t('PeriodToShow')"
:description="$t('Plan_Period_To_Show')"
label-for="UomInput">
<b-form-select
id="UomInput"
@@ -44,8 +44,8 @@
></b-form-select>
</b-form-group>
<b-form-group id="PeriodInput"
:label="$t('PeriodCount')"
:description="$t('ShowHowManyPeriods')"
:label="$t('Periods')"
:description="$t('Plan_Show_How_Many_Periods')"
label-for="PeriodInput">
<b-form-select
id="PeriodInput"
@@ -54,8 +54,8 @@
></b-form-select>
</b-form-group>
<b-form-group id="DaysInput"
:label="$t('StartingDay')"
:description="$t('StartingDay')"
:label="$t('Starting_Day')"
:description="$t('Starting_Day')"
label-for="DaysInput">
<b-form-select
id="DaysInput"
@@ -66,7 +66,7 @@
</b-form>
</div>
<div class="col-6">
<h5>{{ $t('MealTypes') }}</h5>
<h5>{{ $t('Meal_Types') }}</h5>
<b-form>
</b-form>
@@ -82,10 +82,10 @@
<a class="dropdown-item p-2" href="#"><i class="fas fa-pen"></i> {{ $t("Edit") }}</a>
</ContextMenuItem>
<ContextMenuItem @click="$refs.menu.close();moveEntryLeft(contextData)">
<a class="dropdown-item p-2" href="#"><i class="fas fa-arrow-left"></i> {{ $t("DayBack") }}</a>
<a class="dropdown-item p-2" href="#"><i class="fas fa-arrow-left"></i> {{ $t("Move") }}</a>
</ContextMenuItem>
<ContextMenuItem @click="$refs.menu.close();moveEntryRight(contextData)">
<a class="dropdown-item p-2" href="#"><i class="fas fa-arrow-right"></i> {{ $t("DayForward") }}</a>
<a class="dropdown-item p-2" href="#"><i class="fas fa-arrow-right"></i> {{ $t("Move") }}</a>
</ContextMenuItem>
<ContextMenuItem @click="$refs.menu.close();createEntry(contextData.originalItem.entry)">
<a class="dropdown-item p-2" href="#"><i class="fas fa-copy"></i> {{ $t("Clone") }}</a>
@@ -98,7 +98,7 @@
<meal-plan-edit-modal :entry="entryEditing" :entryEditing_initial_recipe="entryEditing_initial_recipe"
:entry-editing_initial_meal_type="entryEditing_initial_meal_type" :modal_title="modal_title"
:edit_modal_show="edit_modal_show" @save-entry="editEntry"
@delete-entry="deleteEntry"></meal-plan-edit-modal>
@delete-entry="deleteEntry" @reload-meal-types="refreshMealTypes"></meal-plan-edit-modal>
</div>
</template>
@@ -178,9 +178,9 @@ export default {
computed: {
modal_title: function () {
if (this.entryEditing.id === -1) {
return this.$t('CreateMealPlanEntry')
return this.$t('Create_Meal_Plan_Entry')
} else {
return this.$t('EditMealPlanEntry')
return this.$t('Edit_Meal_Plan_Entry')
}
},
entryEditing_initial_recipe: function () {
@@ -332,6 +332,11 @@ export default {
}).then(result => {
this.plan_entries = result.data
})
this.refreshMealTypes()
},
refreshMealTypes() {
let apiClient = new ApiApiFactory()
apiClient.listMealTypes().then(result => {
this.meal_types = result.data
})

View File

@@ -24,7 +24,7 @@
</div>
<div class="row pt-2">
<div class="col-md-6" style="max-height: 50vh">
<div class="col-md-6" style="max-height: 50vh; min-height: 30vh">
<input id="id_file_upload" ref="file_upload" type="file" hidden @change="uploadImage($event.target.files[0])">
@@ -47,7 +47,7 @@
</button>
</div>
<div class="col-md-6">
<div class="col-md-6 mt-1">
<label for="id_name"> {{ $t('Preparation') }} {{ $t('Time') }}</label>
<input class="form-control" id="id_prep_time" v-model="recipe.working_time">
<br/>

View File

@@ -13,7 +13,8 @@
<div class="row text-center">
<div class="col col-md-12">
<recipe-rating :recipe="recipe"></recipe-rating> <br/>
<recipe-rating :recipe="recipe"></recipe-rating>
<br/>
<last-cooked :recipe="recipe"></last-cooked>
</div>
</div>
@@ -60,12 +61,14 @@
<i class="fas fa-pizza-slice fa-2x text-primary"></i>
</div>
<div class="my-auto" style="padding-right: 4px">
<input style="text-align: right; border-width:0px;border:none; padding:0px; padding-left: 0.5vw; padding-right: 8px; max-width: 80px"
value="1" maxlength="3" min="0"
type="number" class="form-control form-control-lg" v-model.number="servings"/>
<input
style="text-align: right; border-width:0px;border:none; padding:0px; padding-left: 0.5vw; padding-right: 8px; max-width: 80px"
value="1" maxlength="3" min="0"
type="number" class="form-control form-control-lg" v-model.number="servings"/>
</div>
<div class="my-auto ">
<span class="text-primary"><b><template v-if="recipe.servings_text === ''">{{ $t('Servings') }}</template><template v-else>{{recipe.servings_text}}</template></b></span>
<span class="text-primary"><b><template v-if="recipe.servings_text === ''">{{ $t('Servings') }}</template><template
v-else>{{ recipe.servings_text }}</template></b></span>
</div>
</div>
</div>
@@ -90,12 +93,15 @@
<div class="col-md-12">
<table class="table table-sm">
<!-- eslint-disable vue/no-v-for-template-key-on-child -->
<template v-for="s in recipe.steps">
<div v-for="s in recipe.steps" v-bind:key="s.id">
<template v-if="s.show_as_header && s.name !== ''">
<b>{{s.name}}</b>
</template>
<template v-for="i in s.ingredients">
<Ingredient :ingredient="i" :ingredient_factor="ingredient_factor" :key="i.id"
@checked-state-changed="updateIngredientCheckedState"></Ingredient>
</template>
</template>
</div>
<!-- eslint-enable vue/no-v-for-template-key-on-child -->
</table>
</div>
@@ -144,7 +150,7 @@
<div class="row text-center d-print-none" style="margin-top: 3vh; margin-bottom: 3vh" v-if="share_uid !== 'None'">
<div class="col col-md-12">
<a :href="resolveDjangoUrl('view_report_share_abuse', share_uid)" >{{$t('Report Abuse')}}</a>
<a :href="resolveDjangoUrl('view_report_share_abuse', share_uid)">{{ $t('Report Abuse') }}</a>
</div>
</div>