mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 14:33:33 -07:00
login form refactor/split v-container
This commit is contained in:
parent
2abc773022
commit
c8e90f759d
19 changed files with 232 additions and 202 deletions
|
@ -31,10 +31,8 @@
|
||||||
<LanguageMenu />
|
<LanguageMenu />
|
||||||
</v-app-bar>
|
</v-app-bar>
|
||||||
<v-main>
|
<v-main>
|
||||||
<v-container>
|
<AddRecipeFab />
|
||||||
<AddRecipeFab />
|
|
||||||
<router-view></router-view>
|
<router-view></router-view>
|
||||||
</v-container>
|
|
||||||
<FlashMessage :position="'right bottom'"></FlashMessage>
|
<FlashMessage :position="'right bottom'"></FlashMessage>
|
||||||
</v-main>
|
</v-main>
|
||||||
</v-app>
|
</v-app>
|
||||||
|
|
|
@ -5,13 +5,14 @@ const prefix = baseURL + "categories";
|
||||||
|
|
||||||
const categoryURLs = {
|
const categoryURLs = {
|
||||||
get_all: `${prefix}`,
|
get_all: `${prefix}`,
|
||||||
get_category: (category) => `${prefix}/${category}`,
|
get_category: category => `${prefix}/${category}`,
|
||||||
delete_category: (category) => `${prefix}/${category}`,
|
delete_category: category => `${prefix}/${category}`,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
async get_all() {
|
async get_all() {
|
||||||
let response = await apiReq.get(categoryURLs.get_all);
|
let response = await apiReq.get(categoryURLs.get_all);
|
||||||
|
console.log("All Cats", response.data);
|
||||||
return response.data;
|
return response.data;
|
||||||
},
|
},
|
||||||
async get_recipes_in_category(category) {
|
async get_recipes_in_category(category) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<v-dialog v-model="dialog" width="500">
|
<v-dialog v-model="dialog" width="500px">
|
||||||
<LoginForm @logged-in="dialog = false" />
|
<LoginForm @logged-in="dialog = false" />
|
||||||
</v-dialog>
|
</v-dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,80 +1,79 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<v-card width="500px">
|
||||||
<v-card max-width="500px">
|
<v-divider></v-divider>
|
||||||
<v-divider></v-divider>
|
<v-app-bar dark color="primary" class="mt-n1">
|
||||||
<v-app-bar dark color="primary mt-n1">
|
<v-icon large left v-if="!loading">
|
||||||
<v-icon large left v-if="!loading">
|
mdi-account
|
||||||
mdi-account
|
</v-icon>
|
||||||
</v-icon>
|
<v-progress-circular
|
||||||
<v-progress-circular
|
v-else
|
||||||
v-else
|
indeterminate
|
||||||
indeterminate
|
color="white"
|
||||||
color="white"
|
large
|
||||||
large
|
class="mr-2"
|
||||||
class="mr-2"
|
>
|
||||||
|
</v-progress-circular>
|
||||||
|
<v-toolbar-title class="headline"> Login </v-toolbar-title>
|
||||||
|
|
||||||
|
<v-spacer></v-spacer>
|
||||||
|
</v-app-bar>
|
||||||
|
|
||||||
|
<v-card-text>
|
||||||
|
<v-form>
|
||||||
|
<v-text-field
|
||||||
|
v-if="!options.isLoggingIn"
|
||||||
|
v-model="user.name"
|
||||||
|
light="light"
|
||||||
|
prepend-icon="person"
|
||||||
|
:label="$t('general.name')"
|
||||||
|
></v-text-field>
|
||||||
|
<v-text-field
|
||||||
|
v-model="user.email"
|
||||||
|
light="light"
|
||||||
|
prepend-icon="mdi-email"
|
||||||
|
validate-on-blur
|
||||||
|
:label="$t('login.email')"
|
||||||
|
type="email"
|
||||||
|
></v-text-field>
|
||||||
|
<v-text-field
|
||||||
|
v-model="user.password"
|
||||||
|
light="light"
|
||||||
|
prepend-icon="mdi-lock"
|
||||||
|
:label="$t('login.password')"
|
||||||
|
:type="showPassword ? 'text' : 'password'"
|
||||||
|
:append-icon="showPassword ? 'mdi-eye' : 'mdi-eye-off'"
|
||||||
|
@click:append="showPassword = !showPassword"
|
||||||
|
></v-text-field>
|
||||||
|
<v-checkbox
|
||||||
|
class="mb-2 mt-0"
|
||||||
|
v-if="options.isLoggingIn"
|
||||||
|
v-model="options.shouldStayLoggedIn"
|
||||||
|
light="light"
|
||||||
|
:label="$t('login.stay-logged-in')"
|
||||||
|
hide-details="hide-details"
|
||||||
|
></v-checkbox>
|
||||||
|
<v-btn
|
||||||
|
v-if="options.isLoggingIn"
|
||||||
|
@click.prevent="login"
|
||||||
|
dark
|
||||||
|
color="primary"
|
||||||
|
block="block"
|
||||||
|
type="submit"
|
||||||
|
>{{ $t("login.sign-in") }}</v-btn
|
||||||
>
|
>
|
||||||
</v-progress-circular>
|
<v-btn
|
||||||
<v-toolbar-title class="headline"> Login </v-toolbar-title>
|
v-else
|
||||||
|
block="block"
|
||||||
<v-spacer></v-spacer>
|
type="submit"
|
||||||
</v-app-bar>
|
@click.prevent="options.isLoggingIn = true"
|
||||||
|
>{{ $t("login.sign-up") }}</v-btn
|
||||||
<v-card-text>
|
>
|
||||||
<v-form>
|
</v-form>
|
||||||
<v-text-field
|
<v-alert v-if="error" outlined class="mt-3 mb-0" type="error">
|
||||||
v-if="!options.isLoggingIn"
|
Could Not Validate Credentials
|
||||||
v-model="user.name"
|
</v-alert>
|
||||||
light="light"
|
</v-card-text>
|
||||||
prepend-icon="person"
|
<!-- <v-card-actions v-if="options.isLoggingIn" class="card-actions">
|
||||||
:label="$t('general.name')"
|
|
||||||
></v-text-field>
|
|
||||||
<v-text-field
|
|
||||||
v-model="user.email"
|
|
||||||
light="light"
|
|
||||||
prepend-icon="mdi-email"
|
|
||||||
validate-on-blur
|
|
||||||
:label="$t('login.email')"
|
|
||||||
type="email"
|
|
||||||
></v-text-field>
|
|
||||||
<v-text-field
|
|
||||||
v-model="user.password"
|
|
||||||
light="light"
|
|
||||||
prepend-icon="mdi-lock"
|
|
||||||
:label="$t('login.password')"
|
|
||||||
:type="showPassword ? 'text' : 'password'"
|
|
||||||
:append-icon="showPassword ? 'mdi-eye' : 'mdi-eye-off'"
|
|
||||||
@click:append="showPassword = !showPassword"
|
|
||||||
></v-text-field>
|
|
||||||
<v-checkbox
|
|
||||||
class="mb-2 mt-0"
|
|
||||||
v-if="options.isLoggingIn"
|
|
||||||
v-model="options.shouldStayLoggedIn"
|
|
||||||
light="light"
|
|
||||||
:label="$t('login.stay-logged-in')"
|
|
||||||
hide-details="hide-details"
|
|
||||||
></v-checkbox>
|
|
||||||
<v-btn
|
|
||||||
v-if="options.isLoggingIn"
|
|
||||||
@click.prevent="login"
|
|
||||||
dark
|
|
||||||
color="primary"
|
|
||||||
block="block"
|
|
||||||
type="submit"
|
|
||||||
>{{ $t("login.sign-in") }}</v-btn
|
|
||||||
>
|
|
||||||
<v-btn
|
|
||||||
v-else
|
|
||||||
block="block"
|
|
||||||
type="submit"
|
|
||||||
@click.prevent="options.isLoggingIn = true"
|
|
||||||
>{{ $t("login.sign-up") }}</v-btn
|
|
||||||
>
|
|
||||||
</v-form>
|
|
||||||
<v-alert v-if="error" outlined class="mt-3 mb-0" type="error">
|
|
||||||
Could Not Validate Credentials
|
|
||||||
</v-alert>
|
|
||||||
</v-card-text>
|
|
||||||
<!-- <v-card-actions v-if="options.isLoggingIn" class="card-actions">
|
|
||||||
<div>
|
<div>
|
||||||
Don't have an account?
|
Don't have an account?
|
||||||
</div>
|
</div>
|
||||||
|
@ -87,8 +86,7 @@
|
||||||
Sign up
|
Sign up
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-card-actions> -->
|
</v-card-actions> -->
|
||||||
</v-card>
|
</v-card>
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -129,12 +127,14 @@ export default {
|
||||||
} catch {
|
} catch {
|
||||||
this.error = true;
|
this.error = true;
|
||||||
}
|
}
|
||||||
if (key.status != 200) this.error = true;
|
if (key.status != 200) {
|
||||||
else {
|
this.error = true;
|
||||||
this.$emit("logged-in");
|
this.loading = false;
|
||||||
|
} else {
|
||||||
this.clear();
|
this.clear();
|
||||||
|
this.$store.commit("setToken", key.data.access_token);
|
||||||
|
this.$emit("logged-in");
|
||||||
}
|
}
|
||||||
this.$store.commit("setToken", key.data.access_token);
|
|
||||||
|
|
||||||
let user = await api.users.self();
|
let user = await api.users.self();
|
||||||
this.$store.commit("setUserData", user);
|
this.$store.commit("setUserData", user);
|
||||||
|
|
|
@ -76,7 +76,6 @@
|
||||||
<v-btn color="success" @click="save" text :disabled="meals.length == 0">
|
<v-btn color="success" @click="save" text :disabled="meals.length == 0">
|
||||||
{{ $t("general.save") }}
|
{{ $t("general.save") }}
|
||||||
</v-btn>
|
</v-btn>
|
||||||
|
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-card>
|
</v-card>
|
||||||
|
@ -118,6 +117,7 @@ export default {
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
let settings = await api.settings.requestAll();
|
let settings = await api.settings.requestAll();
|
||||||
|
console.log("Settings", settings.planCategories);
|
||||||
this.items = await api.recipes.getAllByCategory(settings.planCategories);
|
this.items = await api.recipes.getAllByCategory(settings.planCategories);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="text-center">
|
<v-container class="text-center">
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col cols="2"></v-col>
|
<v-col cols="2"></v-col>
|
||||||
<v-col>
|
<v-col>
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="2"></v-col>
|
<v-col cols="2"></v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</div>
|
</v-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<v-container>
|
||||||
<AdminSidebar />
|
<AdminSidebar />
|
||||||
<v-slide-x-transition hide-on-leave>
|
<v-slide-x-transition hide-on-leave>
|
||||||
<router-view></router-view>
|
<router-view></router-view>
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
</a>
|
</a>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-footer> -->
|
</v-footer> -->
|
||||||
</div>
|
</v-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<v-container>
|
||||||
<CategorySidebar />
|
<CategorySidebar />
|
||||||
<CardSection
|
<CardSection
|
||||||
:sortable="true"
|
:sortable="true"
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
@sort="sortAZ"
|
@sort="sortAZ"
|
||||||
@sort-recent="sortRecent"
|
@sort-recent="sortRecent"
|
||||||
/>
|
/>
|
||||||
</div>
|
</v-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<v-container>
|
||||||
<CategorySidebar />
|
<CategorySidebar />
|
||||||
<CardSection
|
<CardSection
|
||||||
:sortable="true"
|
:sortable="true"
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
@sort="sortAZ"
|
@sort="sortAZ"
|
||||||
@sort-recent="sortRecent"
|
@sort-recent="sortRecent"
|
||||||
/>
|
/>
|
||||||
</div>
|
</v-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<v-container>
|
||||||
<LastRecipe />
|
<LastRecipe />
|
||||||
<LogFile class="mt-2" />
|
<LogFile class="mt-2" />
|
||||||
</div>
|
</v-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<v-container>
|
||||||
<CategorySidebar />
|
<CategorySidebar />
|
||||||
<CardSection
|
<CardSection
|
||||||
v-if="showRecent"
|
v-if="showRecent"
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
@sort="sortAZ(index)"
|
@sort="sortAZ(index)"
|
||||||
@sort-recent="sortRecent(index)"
|
@sort-recent="sortRecent(index)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</v-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
<template>
|
<template>
|
||||||
<v-row justify="start" height="100%">
|
<v-container fill-height class="text-center">
|
||||||
<v-col align="center">
|
<v-row>
|
||||||
<LoginForm />
|
<v-flex class="d-flex justify-center" width="500px">
|
||||||
</v-col>
|
<LoginForm @logged-in="redirectMe" class="ma-1" />
|
||||||
</v-row>
|
</v-flex>
|
||||||
|
</v-row>
|
||||||
|
<v-row></v-row>
|
||||||
|
</v-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -12,6 +15,25 @@ export default {
|
||||||
components: {
|
components: {
|
||||||
LoginForm,
|
LoginForm,
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
viewScale() {
|
||||||
|
switch (this.$vuetify.breakpoint.name) {
|
||||||
|
case "xs":
|
||||||
|
return true;
|
||||||
|
case "sm":
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
redirectMe() {
|
||||||
|
if (this.$route.query.redirect) {
|
||||||
|
this.$router.push(this.$route.query.redirect);
|
||||||
|
} else this.$router.push({ path: "/" });
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<v-container>
|
||||||
<EditPlan
|
<EditPlan
|
||||||
v-if="editMealPlan"
|
v-if="editMealPlan"
|
||||||
:meal-plan="editMealPlan"
|
:meal-plan="editMealPlan"
|
||||||
|
@ -25,8 +25,8 @@
|
||||||
>
|
>
|
||||||
<v-card class="mt-1">
|
<v-card class="mt-1">
|
||||||
<v-card-title>
|
<v-card-title>
|
||||||
{{ $d( new Date(mealplan.startDate), 'short' ) }} -
|
{{ $d(new Date(mealplan.startDate), "short") }} -
|
||||||
{{ $d( new Date(mealplan.endDate), 'short' ) }}
|
{{ $d(new Date(mealplan.endDate), "short") }}
|
||||||
</v-card-title>
|
</v-card-title>
|
||||||
<v-list nav>
|
<v-list nav>
|
||||||
<v-list-item-group color="primary">
|
<v-list-item-group color="primary">
|
||||||
|
@ -43,7 +43,9 @@
|
||||||
</v-list-item-avatar>
|
</v-list-item-avatar>
|
||||||
<v-list-item-content>
|
<v-list-item-content>
|
||||||
<v-list-item-title v-text="meal.name"></v-list-item-title>
|
<v-list-item-title v-text="meal.name"></v-list-item-title>
|
||||||
<v-list-item-subtitle v-text="$d( new Date(meal.date), 'short' )" >
|
<v-list-item-subtitle
|
||||||
|
v-text="$d(new Date(meal.date), 'short')"
|
||||||
|
>
|
||||||
</v-list-item-subtitle>
|
</v-list-item-subtitle>
|
||||||
</v-list-item-content>
|
</v-list-item-content>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
|
@ -79,7 +81,7 @@
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</div>
|
</v-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -1,41 +1,43 @@
|
||||||
<template>
|
<template>
|
||||||
<v-card :loading="isLoading">
|
<v-container>
|
||||||
<v-img v-if="image" height="400" :src="image">
|
<v-card :loading="isLoading">
|
||||||
<template v-slot:placeholder>
|
<v-img v-if="image" height="400" :src="image">
|
||||||
<v-row class="fill-height ma-0" align="center" justify="center">
|
<template v-slot:placeholder>
|
||||||
<v-progress-circular
|
<v-row class="fill-height ma-0" align="center" justify="center">
|
||||||
indeterminate
|
<v-progress-circular
|
||||||
color="grey lighten-5"
|
indeterminate
|
||||||
></v-progress-circular>
|
color="grey lighten-5"
|
||||||
</v-row>
|
></v-progress-circular>
|
||||||
</template>
|
</v-row>
|
||||||
</v-img>
|
</template>
|
||||||
<br v-else />
|
</v-img>
|
||||||
|
<br v-else />
|
||||||
|
|
||||||
<EditorButtonRow
|
<EditorButtonRow
|
||||||
@json="jsonEditor = true"
|
@json="jsonEditor = true"
|
||||||
@editor="jsonEditor = false"
|
@editor="jsonEditor = false"
|
||||||
@save="createRecipe"
|
@save="createRecipe"
|
||||||
/>
|
|
||||||
|
|
||||||
<div v-if="jsonEditor">
|
|
||||||
<!-- Probably not the best way, but it works! -->
|
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
<VJsoneditor
|
|
||||||
v-model="recipeDetails"
|
|
||||||
height="1500px"
|
|
||||||
:options="jsonEditorOptions"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
|
||||||
|
|
||||||
<RecipeEditor
|
<div v-if="jsonEditor">
|
||||||
ref="recipeEditor"
|
<!-- Probably not the best way, but it works! -->
|
||||||
v-else
|
<br />
|
||||||
v-model="recipeDetails"
|
<br />
|
||||||
@upload="getImage"
|
<VJsoneditor
|
||||||
/>
|
v-model="recipeDetails"
|
||||||
</v-card>
|
height="1500px"
|
||||||
|
:options="jsonEditorOptions"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<RecipeEditor
|
||||||
|
ref="recipeEditor"
|
||||||
|
v-else
|
||||||
|
v-model="recipeDetails"
|
||||||
|
@upload="getImage"
|
||||||
|
/>
|
||||||
|
</v-card>
|
||||||
|
</v-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -1,58 +1,60 @@
|
||||||
<template>
|
<template>
|
||||||
<v-card id="myRecipe">
|
<v-container>
|
||||||
<v-img
|
<v-card id="myRecipe">
|
||||||
height="400"
|
<v-img
|
||||||
:src="getImage(recipeDetails.image)"
|
height="400"
|
||||||
class="d-print-none"
|
:src="getImage(recipeDetails.image)"
|
||||||
:key="imageKey"
|
class="d-print-none"
|
||||||
>
|
:key="imageKey"
|
||||||
<RecipeTimeCard
|
>
|
||||||
class="force-bottom"
|
<RecipeTimeCard
|
||||||
:prepTime="recipeDetails.prepTime"
|
class="force-bottom"
|
||||||
:totalTime="recipeDetails.totalTime"
|
:prepTime="recipeDetails.prepTime"
|
||||||
:performTime="recipeDetails.performTime"
|
:totalTime="recipeDetails.totalTime"
|
||||||
|
:performTime="recipeDetails.performTime"
|
||||||
|
/>
|
||||||
|
</v-img>
|
||||||
|
<EditorButtonRow
|
||||||
|
:open="showIcons"
|
||||||
|
@json="jsonEditor = true"
|
||||||
|
@editor="
|
||||||
|
jsonEditor = false;
|
||||||
|
form = true;
|
||||||
|
"
|
||||||
|
@save="saveRecipe"
|
||||||
|
@delete="deleteRecipe"
|
||||||
|
class="sticky"
|
||||||
/>
|
/>
|
||||||
</v-img>
|
|
||||||
<EditorButtonRow
|
|
||||||
:open="showIcons"
|
|
||||||
@json="jsonEditor = true"
|
|
||||||
@editor="
|
|
||||||
jsonEditor = false;
|
|
||||||
form = true;
|
|
||||||
"
|
|
||||||
@save="saveRecipe"
|
|
||||||
@delete="deleteRecipe"
|
|
||||||
class="sticky"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<RecipeViewer
|
<RecipeViewer
|
||||||
v-if="!form"
|
v-if="!form"
|
||||||
:name="recipeDetails.name"
|
:name="recipeDetails.name"
|
||||||
:ingredients="recipeDetails.recipeIngredient"
|
:ingredients="recipeDetails.recipeIngredient"
|
||||||
:description="recipeDetails.description"
|
:description="recipeDetails.description"
|
||||||
:instructions="recipeDetails.recipeInstructions"
|
:instructions="recipeDetails.recipeInstructions"
|
||||||
:tags="recipeDetails.tags"
|
:tags="recipeDetails.tags"
|
||||||
:categories="recipeDetails.categories"
|
:categories="recipeDetails.categories"
|
||||||
:notes="recipeDetails.notes"
|
:notes="recipeDetails.notes"
|
||||||
:rating="recipeDetails.rating"
|
:rating="recipeDetails.rating"
|
||||||
:yields="recipeDetails.recipeYield"
|
:yields="recipeDetails.recipeYield"
|
||||||
:orgURL="recipeDetails.orgURL"
|
:orgURL="recipeDetails.orgURL"
|
||||||
/>
|
/>
|
||||||
<VJsoneditor
|
<VJsoneditor
|
||||||
@error="logError()"
|
@error="logError()"
|
||||||
class="mt-10"
|
class="mt-10"
|
||||||
v-else-if="showJsonEditor"
|
v-else-if="showJsonEditor"
|
||||||
v-model="recipeDetails"
|
v-model="recipeDetails"
|
||||||
height="1500px"
|
height="1500px"
|
||||||
:options="jsonEditorOptions"
|
:options="jsonEditorOptions"
|
||||||
/>
|
/>
|
||||||
<RecipeEditor
|
<RecipeEditor
|
||||||
v-else
|
v-else
|
||||||
v-model="recipeDetails"
|
v-model="recipeDetails"
|
||||||
ref="recipeEditor"
|
ref="recipeEditor"
|
||||||
@upload="getImageFile"
|
@upload="getImageFile"
|
||||||
/>
|
/>
|
||||||
</v-card>
|
</v-card>
|
||||||
|
</v-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<v-container>
|
||||||
<v-row justify="center">
|
<v-row justify="center">
|
||||||
<v-col cols="1"> </v-col>
|
<v-col cols="1"> </v-col>
|
||||||
<v-col>
|
<v-col>
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
/>
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</div>
|
</v-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -6,10 +6,16 @@ import Migration from "@/pages/Admin/Migration";
|
||||||
import Profile from "@/pages/Admin/Profile";
|
import Profile from "@/pages/Admin/Profile";
|
||||||
import ManageUsers from "@/pages/Admin/ManageUsers";
|
import ManageUsers from "@/pages/Admin/ManageUsers";
|
||||||
import Settings from "@/pages/Admin/Settings";
|
import Settings from "@/pages/Admin/Settings";
|
||||||
|
import { store } from "../store";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
path: "/admin",
|
path: "/admin",
|
||||||
component: Admin,
|
component: Admin,
|
||||||
|
beforeEnter: (to, _from, next) => {
|
||||||
|
if (store.getters.getIsLoggedIn) {
|
||||||
|
next();
|
||||||
|
} else next({ path: "/login", query: { redirect: to.fullPath } });
|
||||||
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: "",
|
path: "",
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
// import utils from "@/utils";
|
|
||||||
// import Vue from "vue";
|
|
||||||
// import Vuetify from "./plugins/vuetify";
|
|
||||||
import { vueApp } from "../main";
|
import { vueApp } from "../main";
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ def filter_by_category(categories: list, session: Session = Depends(generate_ses
|
||||||
in_category = [
|
in_category = [
|
||||||
db.categories.get(session, slugify(cat), limit=1) for cat in categories
|
db.categories.get(session, slugify(cat), limit=1) for cat in categories
|
||||||
]
|
]
|
||||||
in_category = [cat.get("recipes") for cat in in_category]
|
in_category = [cat.get("recipes") for cat in in_category if cat]
|
||||||
in_category = [item for sublist in in_category for item in sublist]
|
in_category = [item for sublist in in_category for item in sublist]
|
||||||
return in_category
|
return in_category
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue