mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-05 06:08:46 -05:00
some styling stuff
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
<v-spacer></v-spacer>
|
<v-spacer></v-spacer>
|
||||||
<global-search-dialog></global-search-dialog>
|
<global-search-dialog></global-search-dialog>
|
||||||
<v-btn icon="$add">
|
<v-btn icon="$add">
|
||||||
<v-icon icon="$add"></v-icon>
|
<v-icon icon="$add" class="fa-fw"></v-icon>
|
||||||
<v-menu activator="parent">
|
<v-menu activator="parent">
|
||||||
<v-list>
|
<v-list>
|
||||||
<v-list-item prepend-icon="$add" :to="{ name: 'ModelEditPage', params: {model: 'recipe'} }">{{ $t('Create Recipe') }}</v-list-item>
|
<v-list-item prepend-icon="$add" :to="{ name: 'ModelEditPage', params: {model: 'recipe'} }">{{ $t('Create Recipe') }}</v-list-item>
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
<v-divider v-if="mealPlanGridItem.plan_entries.length > 0"></v-divider>
|
<v-divider v-if="mealPlanGridItem.plan_entries.length > 0"></v-divider>
|
||||||
<v-list-item v-for="p in mealPlanGridItem.plan_entries">
|
<v-list-item v-for="p in mealPlanGridItem.plan_entries" link>
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<v-avatar :image="p.recipe.image" v-if="p.recipe?.image"></v-avatar>
|
<v-avatar :image="p.recipe.image" v-if="p.recipe?.image"></v-avatar>
|
||||||
<v-avatar image="../../assets/recipe_no_image.svg" v-else></v-avatar>
|
<v-avatar image="../../assets/recipe_no_image.svg" v-else></v-avatar>
|
||||||
|
|||||||
@@ -10,8 +10,8 @@
|
|||||||
<v-col>
|
<v-col>
|
||||||
<v-window show-arrows>
|
<v-window show-arrows>
|
||||||
<v-window-item v-for="w in recipeWindows" class="pt-1 pb-1">
|
<v-window-item v-for="w in recipeWindows" class="pt-1 pb-1">
|
||||||
<v-row>
|
<v-row dense>
|
||||||
<v-col v-for="r in w" :key="r.id">
|
<v-col class="pr-0 pl-0" v-for="r in w" :key="r.id">
|
||||||
<recipe-card :recipe="r" :show_description="true" :show_keywords="true" style="height: 20vh"></recipe-card>
|
<recipe-card :recipe="r" :show_description="true" :show_keywords="true" style="height: 20vh"></recipe-card>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div v-if="props.keywords">
|
<div v-if="props.keywords">
|
||||||
<slot name="prepend"></slot>
|
<slot name="prepend"></slot>
|
||||||
|
|
||||||
<v-chip class="me-1 mb-1" :label="props.label" :color="props.color" :size="props.size" :variant="props.variant" v-for="k in props.keywords"> {{ k.label }}</v-chip>
|
<v-chip class="me-1 mb-1" :label="props.label" :color="props.color" :size="props.size" :variant="props.variant" v-for="k in keywords"> {{ k.label }}</v-chip>
|
||||||
|
|
||||||
<slot name="append"></slot>
|
<slot name="append"></slot>
|
||||||
</div>
|
</div>
|
||||||
@@ -12,14 +12,24 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
|
||||||
import {Keyword, KeywordLabel} from "@/openapi";
|
import {Keyword, KeywordLabel} from "@/openapi";
|
||||||
import {PropType} from "vue";
|
import {computed, PropType} from "vue";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
keywords: Array as PropType<Array<Keyword> | Array<KeywordLabel> | undefined>,
|
keywords: Array as PropType<Array<Keyword> | Array<KeywordLabel> | undefined>,
|
||||||
size: {type: String, default: 'x-small'},
|
size: {type: String, default: 'x-small'},
|
||||||
color: {type: String, default: ''},
|
color: {type: String, default: ''},
|
||||||
variant: {type: String as PropType<NonNullable<"tonal" | "flat" | "text" | "elevated" | "outlined" | "plain"> | undefined>, default: 'tonal'},
|
variant: {type: String as PropType<NonNullable<"tonal" | "flat" | "text" | "elevated" | "outlined" | "plain"> | undefined>, default: 'tonal'},
|
||||||
label: {type: Boolean, default: true}
|
label: {type: Boolean, default: true},
|
||||||
|
// maximum number of keywords, 0 for all
|
||||||
|
maxKeywords : {type: Number, default: 0},
|
||||||
|
})
|
||||||
|
|
||||||
|
const keywords = computed(() => {
|
||||||
|
if (props.maxKeywords > 0){
|
||||||
|
return props.keywords?.slice(0, props.maxKeywords)
|
||||||
|
} else {
|
||||||
|
return props.keywords
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<template v-if="!props.loading">
|
<template v-if="!props.loading">
|
||||||
|
|
||||||
<recipe-image :to="`/recipe/${props.recipe.id}`" :style="{'height': props.height}" :recipe="props.recipe" rounded="lg" class="mr-3 ml-3">
|
<router-link :to="{name: 'view_recipe', params: {id: props.recipe.id}}">
|
||||||
|
<recipe-image :style="{'height': props.height}" :recipe="props.recipe" rounded="lg" class="mr-3 ml-3">
|
||||||
|
|
||||||
</recipe-image>
|
</recipe-image>
|
||||||
|
</router-link>
|
||||||
<div class="ml-3">
|
<div class="ml-3">
|
||||||
<div class="d-flex ">
|
<div class="d-flex ">
|
||||||
<div class="flex-grow-1 ">
|
<div class="flex-grow-1 cursor-pointer" @click="router.push({name: 'view_recipe', params: {id: props.recipe.id}})">
|
||||||
<p class="font-weight-bold mt-2">{{ props.recipe.name }}</p>
|
<p class="font-weight-bold mt-2">{{ props.recipe.name }}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-1">
|
<div class="mt-1">
|
||||||
@@ -15,6 +17,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <p class="text-disabled">{{ props.recipe.createdBy.displayName}}</p>-->
|
<!-- <p class="text-disabled">{{ props.recipe.createdBy.displayName}}</p>-->
|
||||||
|
<keywords-component variant="outlined" :keywords="props.recipe.keywords" :max-keywords="3">
|
||||||
|
<template #prepend>
|
||||||
|
<v-chip class="mb-1 me-1" size="x-small" prepend-icon="far fa-clock" label variant="outlined"
|
||||||
|
v-if="props.recipe.workingTime != undefined && props.recipe.workingTime > 0">
|
||||||
|
{{ recipe.workingTime! + recipe.waitingTime! }}
|
||||||
|
</v-chip>
|
||||||
|
</template>
|
||||||
|
</keywords-component>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@@ -85,6 +95,7 @@ import {Recipe, RecipeOverview} from "@/openapi";
|
|||||||
|
|
||||||
import RecipeContextMenu from "@/components/inputs/RecipeContextMenu.vue";
|
import RecipeContextMenu from "@/components/inputs/RecipeContextMenu.vue";
|
||||||
import RecipeImage from "@/components/display/RecipeImage.vue";
|
import RecipeImage from "@/components/display/RecipeImage.vue";
|
||||||
|
import {useRouter} from "vue-router";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
recipe: {type: {} as PropType<Recipe | RecipeOverview>, required: true,},
|
recipe: {type: {} as PropType<Recipe | RecipeOverview>, required: true,},
|
||||||
@@ -94,6 +105,8 @@ const props = defineProps({
|
|||||||
height: {type: String, required: false, default: '15vh'},
|
height: {type: String, required: false, default: '15vh'},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<slot name="activator">
|
<slot name="activator">
|
||||||
<v-btn @click="dialog = true" variant="plain" density="default">
|
<v-btn @click="dialog = true" variant="plain" density="default" :icon="mobile">
|
||||||
<i class="fas fa-search mr-1"></i>
|
<v-icon icon="fa-solid fa-search" class="mr-1 fa-fw"></v-icon>
|
||||||
<span class="d-none d-sm-block">{{$t('Search')}}</span>
|
<span class="d-none d-sm-block">{{$t('Search')}}</span>
|
||||||
<v-chip size="x-small" variant="tonal" class="d-none d-md-flex ml-1" label>{{$t('Ctrl+K')}}</v-chip>
|
<v-chip size="x-small" variant="tonal" class="d-none d-md-flex ml-1" label>{{$t('Ctrl+K')}}</v-chip>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
@@ -62,8 +62,10 @@ import {computed, defineComponent, onMounted, ref, watch} from 'vue'
|
|||||||
import {SearchResult} from "@/types/SearchTypes";
|
import {SearchResult} from "@/types/SearchTypes";
|
||||||
import {ApiApi, Recipe, RecipeFlat} from "@/openapi";
|
import {ApiApi, Recipe, RecipeFlat} from "@/openapi";
|
||||||
import {useRouter} from "vue-router";
|
import {useRouter} from "vue-router";
|
||||||
|
import {useDisplay} from "vuetify";
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
const {mobile} = useDisplay()
|
||||||
|
|
||||||
const dialog = ref(false)
|
const dialog = ref(false)
|
||||||
const recipes = ref([] as Recipe[])
|
const recipes = ref([] as Recipe[])
|
||||||
|
|||||||
Reference in New Issue
Block a user